<cfif Not isDefined('session.AgencyId') or session.AgencyId eq ''>
  <div style='margin:20px;'> Your session has Timed Out. <br/>
    <br/>
    Please <a href='/'>Sign In</a> again to continue. </div>
  <cfexit>
</cfif>

<cfquery name="new" datasource="#Application.DataSrc#">
     SELECT Assessment_Completed_M0090 FROM #Request.prefix_db_agency#.Assessment_New where Assessment_ID = '#session.cs.AssessmentId#'
              </cfquery>
			<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>

<cflocation url="/patientadmin_new/index.cfm?page=patient&cat=CodingReport1" addtoken="no" />
<cfelse>

<cfif not isdefined("session.cs.AssessmentId") or session.cs.AssessmentId  eq "" or session.cs.AssessmentId  eq 0>
  <h1> Session has timed out: <br />
  </h1>
  <br />
  <FORM>
    <INPUT type="button" value="Go Back" onClick="history.back()">
  </FORM>
  <cfabort>
</cfif>
<cfset Assessment_ID = session.cs.AssessmentId  />
<cfquery name="Assessment_Details" datasource="#Application.DataSrc#">
SELECT 
			Assessment_Reason_M0100,Admission_Status
			FROM #Request.prefix_db_agency#.Assessment_New
        	WHERE Assessment_ID='#Assessment_ID#'
</cfquery>
<cfset Assessment_Reason_M0100 = Assessment_Details.Assessment_Reason_M0100 />
<cfset Admission_Status = Assessment_Details.Admission_Status />
<cfset thereason = Assessment_Reason_M0100 />
<cfif LEFT(thereason,1) eq '1'>
  <cfset thereason = 'Start of Care' />
  <cfelseif LEFT(thereason,1) eq '3'>
  <cfset thereason = 'Resumption of Care' />
  <cfelseif LEFT(thereason,1) eq '4'>
  <cfset thereason = 'Recertification' />
  <cfelseif LEFT(thereason,1) eq '5'>
  <cfset thereason = 'Other Follow Up' />
  <cfelseif LEFT(thereason,1) eq '6'>
  <cfset thereason = '6 - Transferred to Inpatient Facility' />
  <cfelseif LEFT(thereason,1) eq '7'>
  <cfset thereason = 'Transfer with Discharge' />
  <cfelseif LEFT(thereason,1) eq '8'>
  <cfset thereason = 'Death' />
  <cfelseif LEFT(thereason,1) eq '9'>
  <cfset thereason = 'Discharge' />
  <cfelse>
  <script language="javascript" type="text/javascript">
				alert('You must complete OASIS before viewing the Diagnosis Consistency report.');	
				window.location= 'index.cfm?a=1&page=patient&px=y&cat=Patient';
			</script>
</cfif>
	<cfset thereason=#rereplacenocase(thereason,"recertification","Recertification","ALL")# />
	<cfif Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3")  neq "-1"
	or Assessment_Reason_M0100.indexOf("4") neq "-1"  or Assessment_Reason_M0100.indexOf("5") neq "-1">
		<cfif Admission_Status neq "Complete">
			<script language="javascript" type="text/javascript">
				alert('You must complete OASIS before viewing the Diagnosis Consistency report.');	
				window.location= 'index.cfm?a=1&page=patient&px=y&cat=Patient';
			</script>
			<cfabort>
		</cfif>
		<cfelse>
			<script language="javascript" type="text/javascript">
			alert('Diagnosis Consistency is available only for Start of Care, Resumption, Re-Certification, or Follow-Up assessments.');	
			window.location= 'index.cfm?a=1&page=patient&px=y&cat=Patient';
			</script>
		<cfabort>
	</cfif>
<cfquery name="Assessment_Details" datasource="#Application.DataSrc#">
SELECT 
			Assessment_ID,Assessment_Reason_M0100, M0110, M0826_Ther_Need,Therapies_Home_M0250,Admission_Status,
			Ostomy_for_Bowel_M0550, M1840_Toilet, Dress_Upper_M0650, Dress_Lower_M0660, Ambulation_M0700, Bathing_M0670, Toileting_M0680, 
			Transferring_M0690, Ambulation_M0700, Pressure_Ulcer_Stage_M0460, Pressure_Ulcer_a_M0450, 
			Pressure_Ulcer_b_M0450, Pressure_Ulcer_c_M0450, Pressure_Ulcer_d_M0450, Pressure_Ulcer_e_M0450, M1308_d_2_Pressure, M1308_d_3_Pressure,
			Vision_M0390, Stasis_Ulcer_Num_M0470, Freq_of_Pain_M0420, Stasis_Ulcer_Num_M0470, Pressure_Ulcer_c_M0450, Pressure_Ulcer_d_M0450, 
			Pressure_Ulcer_Stage_M0460, Stasis_Ulcer_Hidden_M0474, Stasis_Ulcer_Status_M0476, Surgical_Wound_Status_M0488, 
			Surgical_Wound_M0482, Breathing_M0490, Bowel_Incont_M0540, Inject_Meds_M0800, Assessment_Completed_M0090, Toileting_M0680,
			Urinary_INcont_M0520, Bowel_Incont_M0540, Transferring_M0690, Ambulation_M0700, patient_ID, Surgical_Wound_M0482,
			Therapy_Visit_Count,Eating_M0710,Grooming_M0640,Start_of_Care_M0030,M0104_Date_of_Referral, M1240_Pain_Assess, M1300_Pressure ,
			M1730_Depression, M1910_Fall_Risk, M2010_Med_Edu, M2250b_Diabetic, M2250e_Pain, M2250f_PressUlc, M2250g_PressUlcMoist,
			M1032_Frailty,Rehab_Prognosis_M0270,Meal_Prep_M0720,M1845_Toilet,Life_Exp_M0280,Conditions_Prior_M0220,
			High_Risk_Factors_M0290,Use_Phone_M0770,Hearing_M0400,M1220_Verbal_Under,Speech_M0410,Open_Wounds_M0440,
			Pressure_Ulcer_Status_M0464, M1302_Pressure, Resp_Treatments_M0500,UTI_M0510,Cog_Function_M0560,Oral_Meds_M0780,
			When_Confused_M0570,When_Anxious_M0580,Depressive_Feelings_M0590,M1730a,M2250c_FallsPrev,M2250d_Depress,Certification_Start,
			Certification_End,Patient_Behav_Weekly_M0610
			FROM #Request.prefix_db_agency#.Assessment_New
        	WHERE Assessment_ID='#Assessment_ID#'
</cfquery>
<cfset Patient_Behav_Weekly_M0610 =  Assessment_Details.Patient_Behav_Weekly_M0610 />
<cfset Certification_Start = Assessment_Details.Certification_Start />
<cfset Certification_End = Assessment_Details.Certification_End />
<cfset M2250d_Depress = Assessment_Details.M2250d_Depress />
<cfset M2250c_FallsPrev = Assessment_Details.M2250c_FallsPrev />
<cfset M1730a = Assessment_Details.M1730a />
<cfset Depressive_Feelings_M0590 = Assessment_Details.Depressive_Feelings_M0590 />
<cfset When_Anxious_M0580 = Assessment_Details.When_Anxious_M0580  />
<cfset When_Confused_M0570 = Assessment_Details.When_Confused_M0570 />
<cfset Oral_Meds_M0780 = Assessment_Details.Oral_Meds_M0780  />
<cfset Cog_Function_M0560 = Assessment_Details.Cog_Function_M0560 />
<cfset UTI_M0510 = Assessment_Details.UTI_M0510 />
<cfset Resp_Treatments_M0500 = Assessment_Details.Resp_Treatments_M0500 />
<cfset M1302_Pressure = Assessment_Details.M1302_Pressure />
<cfset Pressure_Ulcer_Status_M0464 = Assessment_Details.Pressure_Ulcer_Status_M0464 />
<cfset Open_Wounds_M0440 = Assessment_Details.Open_Wounds_M0440 />
<cfset Conditions_Prior_M0220 = Assessment_Details.Conditions_Prior_M0220 />
<cfset Speech_M0410 = Assessment_Details.Speech_M0410 />
<cfset M1220_Verbal_Under = Assessment_Details.M1220_Verbal_Under />
<cfset Hearing_M0400 = Assessment_Details.Hearing_M0400 />
<cfset Use_Phone_M0770 = Assessment_Details.Use_Phone_M0770 />
<cfset M0110_Episode_Timing = Assessment_Details.M0110 />
<cfset patient_ID = Assessment_Details.patient_ID  />
<cfset Assessment_Reason_M0100 = Assessment_Details.Assessment_Reason_M0100 />
<cfset Admission_Status = Assessment_Details.Admission_Status />
<cfset Assessment_Completed_M0090 = Assessment_Details.Assessment_Completed_M0090 />
<cfset M0826_Ther_Need = Assessment_Details.M0826_Ther_Need />
<cfset Therapy_Visit_Count = Assessment_Details.Therapy_Visit_Count />
<cfset Vision_M0390 = Assessment_Details.Vision_M0390  />
<cfset Eating_M0710 = Assessment_Details.Eating_M0710 />
<cfset Grooming_M0640 = Assessment_Details.Grooming_M0640  />
<cfset Start_of_Care_M0030 = Assessment_Details.Start_of_Care_M0030  />
<cfset M0104_Date_of_Referral = Assessment_Details.M0104_Date_of_Referral  />
<cfset Meal_Prep_M0720 = Assessment_Details.Meal_Prep_M0720 />
<cfset M1240_Pain_Assess = Assessment_Details.M1240_Pain_Assess />
<cfset M1300_Pressure = Assessment_Details.M1300_Pressure />
<cfset M1730_Depression = Assessment_Details.M1730_Depression />
<cfset M1910_Fall_Risk = Assessment_Details.M1910_Fall_Risk />
<cfset M2010_Med_Edu = Assessment_Details.M2010_Med_Edu />
<cfset M2250b_Diabetic = Assessment_Details.M2250b_Diabetic  />
<cfset M2250e_Pain = Assessment_Details.M2250e_Pain />
<cfset M2250f_PressUlc = Assessment_Details.M2250f_PressUlc />
<cfset M2250g_PressUlcMoist = Assessment_Details.M2250g_PressUlcMoist />
<cfset M1032_Frailty = Assessment_Details.M1032_Frailty />
<cfset Rehab_Prognosis_M0270 = Assessment_Details.Rehab_Prognosis_M0270 />
<cfset M1845_Toilet = Assessment_Details.M1845_Toilet />
<cfset Life_Exp_M0280 = Assessment_Details.Life_Exp_M0280 />
<cfset High_Risk_Factors_M0290 = Assessment_Details.High_Risk_Factors_M0290 />
<cfif M0826_Ther_Need eq "" >
  <cfset M0826_Ther_Need = 0  />
</cfif>
<cfif Therapy_Visit_Count eq "">
  <cfset Therapy_Visit_Count = 0  />
</cfif>
<cfquery name="Visit_Details" datasource="#Application.DataSrc#">
select count(Assessment_ID) as Schedule_Count from #Request.prefix_db_agency#.ScheduleItems where assessment_id='#Assessment_ID#' and Deleted <> 1
</cfquery>
<cfset Schedule_Visit_Count = Visit_Details.Schedule_Count />
<cfquery name="Patient_Details" datasource="#Application.DataSrc#" timeout="1000">
select Current_Payment_Sources_M0150,M1100_Living_Situation,First_Name_M0040,Last_Name_M0040
	from #Request.prefix_db_agency#.patient where patient_id='#Patient_ID#'
</cfquery>
<cfset Last_Name_M0040 = Patient_Details.Last_Name_M0040 />
<cfset First_Name_M0040 = Patient_Details.First_Name_M0040 />
<cfset Current_Payment_Sources_M0150 = Patient_Details.Current_Payment_Sources_M0150 />
<cfset M1100_Living_Situation = Patient_Details.M1100_Living_Situation />
<cfquery name="PatientContact_Details" datasource="#Application.DataSrc#" timeout="1000">
select PrimaryContact from #Request.prefix_db_agency#.PatientContact where patient_id='#Patient_ID#' and contactstatus =0 and primarycontact=1
</cfquery>
<cfset M0370_Freq_Prm_Asstance = ""  />
<cfif PatientContact_Details.RecordCount gt 0>
  <cfset M0370_Freq_Prm_Asstance = Patient_ID & "YesActive" />
</cfif>
<cfquery datasource="#Application.DataSrc#" name="Diagnosis">
SELECT p.ICD,
        p.Code_Type,
        p.DG_Type,
		p.Primary_Diagnosis,
		p.Severity,
		p.Short_Diagnosis
        FROM #Request.prefix_db_agency#.Diagnosis p where patient_ID=#patient_ID#
        AND assessment_ID=#Assessment_ID# and M0230_Link is not null order by p.Dx_Order
</cfquery>
<cfset Diagnosis_CaseMix_1="" />
<cfset Diagnosis_CaseMix_2="" />
<cfset Diagnosis_CaseMix_3="" />
<cfset Diagnosis_CaseMix_4="" />
<cfset Diagnosis_CaseMix_5="" />
<cfset Diagnosis_CaseMix_6="" />
<cfset Case_Mix_List_1 = ""  />
<cfset Case_Mix_List_2 = ""  />
<cfset Case_Mix_List_3 = ""  />
<cfset Case_Mix_List_4 = ""  />
<cfset Case_Mix_List_5 = ""  />
<cfset Case_Mix_List_6 = ""  />
<cfset Diagnosis1="" />
<cfset Diagnosis2="" />
<cfset Diagnosis3="" />
<cfset Diagnosis4="" />
<cfset Diagnosis5="" />
<cfset Diagnosis6="" />
<cfset Diagnosis_1="" />
<cfset Diagnosis_2="" />
<cfset Diagnosis_3="" />
<cfset Diagnosis_4="" />
<cfset Diagnosis_5="" />
<cfset Diagnosis_6="" />
<cfset Code_Type="" />
<cfset Problem_1="" />
<cfset Problem_2="" />
<cfset Problem_3="" />
<cfset Problem_4="" />
<cfset Problem_5="" />
<cfset Problem_6="" />
<cfset Link_Diagnosis_Severity_1 ="0" />
<cfset Link_Diagnosis_Severity_2 ="0" />
<cfset Link_Diagnosis_Severity_3 ="0" />
<cfset Link_Diagnosis_Severity_4 ="0" />
<cfset Link_Diagnosis_Severity_5 ="0" />
<cfset Link_Diagnosis_Severity_6 ="0" />
<cfset Severity_1 ="0" />
<cfset Severity_2 ="0" />
<cfset Severity_3 ="0" />
<cfset Severity_4 ="0" />
<cfset Severity_5 ="0" />
<cfset Severity_6 ="0" />

<cfset Short_Diagnosis_1="" />
<cfset Short_Diagnosis_2="" />
<cfset Short_Diagnosis_3="" />
<cfset Short_Diagnosis_4="" />
<cfset Short_Diagnosis_5="" />
<cfset Short_Diagnosis_6="" />

<cfset Case_Mix_Match_All = "" />
<cfset Diagnosis_Case_Mix_All = ""  />
<cfset DiagnosisIndex=0 />
<cfloop query="Diagnosis">
  <cfif DiagnosisIndex eq 0>
    <cfquery name="diagnosis_list" datasource="#Application.DataSrc#">
    SELECT diagnosis_list.Problems,diagnosis_list.Pathway_Type
    FROM #Request.prefix_db_lookup#.diagnosis_list 
    WHERE diagnosis_list.ICD='#Diagnosis.ICD#'
    </cfquery>
	<cfset Short_Diagnosis_1=Diagnosis.Short_Diagnosis  />
    <cfset Problem_1 = diagnosis_list.Problems  />
    <cfset Diagnosis_1 =diagnosis_list.Pathway_Type  />
    <cfset Code_Type=Diagnosis.Code_Type />
    <cfset Diagnosis_CaseMix_1=Diagnosis.DG_Type />
    <cfset Diagnosis1=Diagnosis.ICD />
    <cfset Link_Diagnosis_Severity_1 =  Diagnosis.Primary_Diagnosis />
    <cfset Severity_1 =Diagnosis.Severity />
  </cfif>
  <cfif DiagnosisIndex eq 1>
    <cfquery name="diagnosis_list" datasource="#Application.DataSrc#">
    SELECT diagnosis_list.Problems,diagnosis_list.Pathway_Type
    FROM #Request.prefix_db_lookup#.diagnosis_list 
    WHERE diagnosis_list.ICD='#Diagnosis.ICD#'
    </cfquery>
	<cfset Short_Diagnosis_2=Diagnosis.Short_Diagnosis />
    <cfset Problem_2 = diagnosis_list.Problems  />
    <cfset Diagnosis_2=diagnosis_list.Pathway_Type  />
    <cfset Diagnosis_CaseMix_2=Diagnosis.DG_Type />
    <cfset Diagnosis2=Diagnosis.ICD />
    <cfset Link_Diagnosis_Severity_2 =  Diagnosis.Primary_Diagnosis />
    <cfset Severity_2 =Diagnosis.Severity />
  </cfif>
  <cfif DiagnosisIndex eq 2>
    <cfquery name="diagnosis_list" datasource="#Application.DataSrc#">
    SELECT diagnosis_list.Problems,diagnosis_list.Pathway_Type
    FROM #Request.prefix_db_lookup#.diagnosis_list 
    WHERE diagnosis_list.ICD='#Diagnosis.ICD#'
    </cfquery>
	<cfset Short_Diagnosis_3=Diagnosis.Short_Diagnosis />
    <cfset Problem_3 = diagnosis_list.Problems  />
    <cfset Diagnosis_3=diagnosis_list.Pathway_Type  />
    <cfset Diagnosis_CaseMix_3=Diagnosis.DG_Type />
    <cfset Diagnosis3=Diagnosis.ICD />
    <cfset Link_Diagnosis_Severity_3 =  Diagnosis.Primary_Diagnosis />
    <cfset Severity_3 =Diagnosis.Severity />
  </cfif>
  <cfif DiagnosisIndex eq 3>
    <cfquery name="diagnosis_list" datasource="#Application.DataSrc#">
    SELECT diagnosis_list.Problems,diagnosis_list.Pathway_Type
    FROM #Request.prefix_db_lookup#.diagnosis_list 
    WHERE diagnosis_list.ICD='#Diagnosis.ICD#'
    </cfquery>
	<cfset Short_Diagnosis_4=Diagnosis.Short_Diagnosis />
    <cfset Problem_4 = diagnosis_list.Problems  />
    <cfset Diagnosis_4=diagnosis_list.Pathway_Type  />
    <cfset Diagnosis_CaseMix_4=Diagnosis.DG_Type />
    <cfset Diagnosis4=Diagnosis.ICD />
    <cfset Link_Diagnosis_Severity_4 =  Diagnosis.Primary_Diagnosis />
    <cfset Severity_4 =Diagnosis.Severity />
  </cfif>
  <cfif DiagnosisIndex eq 4>
    <cfquery name="diagnosis_list" datasource="#Application.DataSrc#">
    SELECT diagnosis_list.Problems,diagnosis_list.Pathway_Type
    FROM #Request.prefix_db_lookup#.diagnosis_list 
    WHERE diagnosis_list.ICD='#Diagnosis.ICD#'
    </cfquery>
	<cfset Short_Diagnosis_5=Diagnosis.Short_Diagnosis />
    <cfset Problem_5 = diagnosis_list.Problems  />
    <cfset Diagnosis_5=diagnosis_list.Pathway_Type  />
    <cfset Diagnosis_CaseMix_5=Diagnosis.DG_Type />
    <cfset Diagnosis5=Diagnosis.ICD />
    <cfset Link_Diagnosis_Severity_5 =  Diagnosis.Primary_Diagnosis />
    <cfset Severity_5 =Diagnosis.Severity />
  </cfif>
  <cfif DiagnosisIndex eq 5>
    <cfquery name="diagnosis_list" datasource="#Application.DataSrc#">
    SELECT diagnosis_list.Problems,diagnosis_list.Pathway_Type
    FROM #Request.prefix_db_lookup#.diagnosis_list 
    WHERE diagnosis_list.ICD='#Diagnosis.ICD#'
    </cfquery>
	<cfset Short_Diagnosis_6=Diagnosis.Short_Diagnosis />
    <cfset Problem_6 = diagnosis_list.Problems  />
    <cfset Diagnosis_6=diagnosis_list.Pathway_Type  />
    <cfset Diagnosis_CaseMix_6=Diagnosis.DG_Type />
    <cfset Diagnosis6=Diagnosis.ICD />
    <cfset Link_Diagnosis_Severity_6 =  Diagnosis.Primary_Diagnosis />
    <cfset Severity_6 =Diagnosis.Severity />
  </cfif>
  <cfset DiagnosisIndex=DiagnosisIndex+1 />
</cfloop>
<cfset DX_Pathway_All= Diagnosis_1 &" "& Diagnosis_2 &" "& Diagnosis_3 &" "& Diagnosis_4 &" "& Diagnosis_5 &" "& Diagnosis_6 />
<cfset DX_Problem_All= Problem_1 &" "& Problem_2 &" "& Problem_3 &" "& Problem_4 &" "& Problem_5 &" "& Problem_6 />
<cfset Case_Mix_Match_All = Case_Mix_List_1 & Case_Mix_List_2 & Case_Mix_List_3 & Case_Mix_List_4 & Case_Mix_List_5 & Case_Mix_List_6  />
<!--Find Equation_Calc_Actual-->
<cfset Equation_Calc_Actual = "0" />
<cfif M0826_Ther_Need lt "14" AND M0110_Episode_Timing.indexOf("1") neq "-1" >
  <cfset Equation_Calc_Actual = "1" />
  <cfelseif M0826_Ther_Need lt "14" AND M0110_Episode_Timing.indexOf("2") neq "-1" >
  <cfset Equation_Calc_Actual = "3" />
  <cfelseif M0826_Ther_Need gt "13" AND M0110_Episode_Timing.indexOf("1") neq "-1" >
  <cfset Equation_Calc_Actual = "2" />
  <cfelseif M0826_Ther_Need gt "13" AND M0110_Episode_Timing.indexOf("2") neq "-1" >
  <cfset Equation_Calc_Actual = "4" />
</cfif>
<!--Find Clinical_01-->
<cfset Clinical_01="0" />
<cfset Equation_Calc_Run="" />
<cfset Link_Supply_1="" />
<cfset Diagnosis_Case_Mix_All ="" />
<!--Find Link_Supply_1-->
<cfset ICD=Diagnosis1 />
<cfset SupplyNo="" />
<cfset T07_Diagnosis_ICDSupplyNo="" />
<cfset T07_M0246SupplyNo="" />
<cfset Surgical_Wound_M0482 = Assessment_Details.Surgical_Wound_M0482 />
<cfif Surgical_Wound_M0482.indexOf("1 - ") >
  <cfset Code_Type="CPT" />
  <cfelse>
  <cfset Code_Type=Code_Type />
</cfif>
<cfif Code_Type eq "ICD" AND ICD.indexOf("V55.5") eq "-1" AND ICD.indexOf("V55.6") eq "-1" AND ICD.indexOf("V55.0") eq "-1" >
  <cfset Link_Supply_1=SupplyNo />
  <cfelseif ICD.indexOf("V55.5") eq "-1" OR ICD.indexOf("V55.6") eq "-1" OR ICD.indexOf("V55.0") eq "-1" >
  <cfset Link_Supply_1=SupplyNo />
  <cfelseif Code_Type eq "V_Code" AND ICD.indexOf("V55.5") eq "-1" AND ICD.indexOf("V55.6") eq "-1" AND ICD.indexOf("V55.0") eq "-1">
  <cfset Link_Supply_1=SupplyNo />
</cfif>
<!--Find Diagnosis_Case_Mix_All-->
<cfset Diagnosis_Case_Mix_All = Diagnosis_CaseMix_1 &" "& Diagnosis_CaseMix_2 &" "& Diagnosis_CaseMix_3 &" "& Diagnosis_CaseMix_4 &" "& Diagnosis_CaseMix_5 &" "& Diagnosis_CaseMix_6  />
<cfif Equation_Calc_Run eq "5" AND Link_Supply_1 eq "1">
  <cfset Clinical_01="15" />
  <cfelseif Equation_Calc_Run neq "5" AND Diagnosis_Case_Mix_All.indexof("Blind") neq "-1">
  <cfset Clinical_01="3" />
</cfif>
<!--Find Clinical_02-->
<cfset Clinical_02="0" />
<cfset Link_Supply_2="" />
<cfset Link_Supply_3="" />
<cfset Link_Supply_4="" />
<cfset Link_Supply_5="" />
<cfset Link_Supply_6="" />
<cfset ICD=Diagnosis1 />
<cfset SupplyNo="" />
<!--Find Link_Supply_2,Link_Supply_3,Link_Supply_4,Link_Supply_5,Link_Supply_6-->
<cfif Code_Type eq "ICD" AND ICD.indexOf("V55.5") eq "-1" AND ICD.indexOf("V55.6") eq "-1" AND ICD.indexOf("V55.0") eq "-1" >
  <cfset Link_Supply_2=SupplyNo />
  <cfset Link_Supply_3=SupplyNo />
  <cfset Link_Supply_4=SupplyNo />
  <cfset Link_Supply_5=SupplyNo />
  <cfset Link_Supply_6=SupplyNo />
  <cfelseif ICD.indexOf("V55.5") eq "-1" OR ICD.indexOf("V55.6") eq "-1" OR ICD.indexOf("V55.0") eq "-1" >
  <cfset Link_Supply_2=SupplyNo />
  <cfset Link_Supply_3=SupplyNo />
  <cfset Link_Supply_4=SupplyNo />
  <cfset Link_Supply_5=SupplyNo />
  <cfset Link_Supply_6=SupplyNo />
  <cfelseif Code_Type eq "V_Code" AND ICD.indexOf("V55.5") eq "-1" AND ICD.indexOf("V55.6") eq "-1" AND ICD.indexOf("V55.0") eq "-1">
  <cfset Link_Supply_2=SupplyNo />
  <cfset Link_Supply_3=SupplyNo />
  <cfset Link_Supply_4=SupplyNo />
  <cfset Link_Supply_5=SupplyNo />
  <cfset Link_Supply_6=SupplyNo />
</cfif>
<!--Find Equation_Calc_Run-->
<cfset Equation_Calc = Equation_Calc_Actual />
<cfif Equation_Calc eq "5" AND (Link_Supply_2 eq "1" OR Link_Supply_3 eq "1" OR Link_Supply_4 eq "1" OR Link_Supply_5 eq "1" OR Link_Supply_6 eq "1" )>
  <cfset Clinical_02="13" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Blood") neq "-1">
  <cfset Clinical_02="2" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Blood") neq "-1">
  <cfset Clinical_02="5" />
</cfif>
<!--Find Clinical_03-->
<cfset Clinical_03="0" />
<cfif Equation_Calc eq "5" AND Link_Supply_1 eq "2" >
  <cfset Clinical_03="14" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Cancer") neq "-1">
  <cfset Clinical_03="4" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Cancer") neq "-1">
  <cfset Clinical_03="7" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Cancer") neq "-1">
  <cfset Clinical_03="3" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Cancer") neq "-1">
  <cfset Clinical_03="10" />
</cfif>
<!--Find Clinical_04-->
<cfset Clinical_04="0" />
<cfset T01_Primary_Diagnosis_LinkDG_Type=Diagnosis_CaseMix_1 />
<cfif Equation_Calc eq "5" AND ( Link_Supply_2 eq "2" OR Link_Supply_3 eq "2" OR Link_Supply_4 eq "2" OR Link_Supply_5 eq "2" OR Link_Supply_6 eq "2") >
  <cfset Clinical_04="8" />
  <cfelseif Equation_Calc eq "1" AND T01_Primary_Diagnosis_LinkDG_Type.indexof("Diabetes") neq "-1">
  <cfset Clinical_04="5" />
  <cfelseif Equation_Calc eq "2" AND T01_Primary_Diagnosis_LinkDG_Type.indexof("Diabetes") neq "-1">
  <cfset Clinical_04="12" />
  <cfelseif Equation_Calc eq "3" AND T01_Primary_Diagnosis_LinkDG_Type.indexof("Diabetes") neq "-1">
  <cfset Clinical_04="1" />
  <cfelseif Equation_Calc eq "4" AND T01_Primary_Diagnosis_LinkDG_Type.indexof("Diabetes") neq "-1">
  <cfset Clinical_04="8" />
</cfif>
<!--Find Clinical_05-->
<cfset Clinical_05="0" />
<!--Find Diagnosis_Case_Mix_Other-->
<cfset Diagnosis_Case_Mix_Other=Diagnosis_CaseMix_2 &" "& Diagnosis_CaseMix_3 &" "& Diagnosis_CaseMix_4 &" "& Diagnosis_CaseMix_5 &" "& Diagnosis_CaseMix_6 />
<!--Find Diagnoses_All-->
<cfset Diagnoses_All = Diagnosis2 &" "& Diagnosis3 &" "& Diagnosis4 &" "& Diagnosis5 &" "& Diagnosis6 &" "& Diagnosis1 />
<!--Find Supply_250_707-->
<cfif Diagnoses_All.indexof("250.8") gte "0" OR Diagnoses_All.indexof("707.10") gte "0" OR Diagnoses_All.indexof("707.11") gte "0" OR Diagnoses_All.indexof("707.12") gte "0" OR Diagnoses_All.indexof("707.13") gte "0" OR Diagnoses_All.indexof("707.14") gte "0" OR Diagnoses_All.indexof("707.15") gte "0" OR Diagnoses_All.indexof("707.19") gte "0" OR Diagnoses_All.indexof("707.8") gte "0" OR Diagnoses_All.indexof("707.9") gte "0">
  <cfset Supply_250_707="Yes" />
  <cfelse>
  <cfset Supply_250_707="No" />
</cfif>
<cfif Equation_Calc eq "5" AND Supply_250_707 eq "Yes">
  <cfset Clinical_05="20" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_Other.indexof("Diabetes") neq "-1">
  <cfset Clinical_05="2" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_Other.indexof("Diabetes") neq "-1">
  <cfset Clinical_05="4" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_Other.indexof("Diabetes") neq "-1">
  <cfset Clinical_05="1" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_Other.indexof("Diabetes") neq "-1">
  <cfset Clinical_05="4" />
</cfif>
<!--Find Clinical_06-->
<cfset Clinical_06="0" />
<!--Find Diagnosis_Case_Mix_All-->
<cfif Equation_Calc eq "5" AND Link_Supply_1 eq "4">
  <cfset Clinical_06="11" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Dysphagia") neq "-1" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1">
  <cfset Clinical_06="2" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Dysphagia") neq "-1" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1">
  <cfset Clinical_06="6" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Dysphagia") neq "-1" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1">
  <cfset Clinical_06="6" />
</cfif>
<!--Find Clinical_07-->
<cfset Clinical_07="0" />
<cfset Therapies_Home_M0250=Assessment_Details.Therapies_Home_M0250 />
<cfif (Link_Supply_2 eq "4" OR Link_Supply_3 eq "4" OR Link_Supply_4 eq "4" OR Link_Supply_5 eq "4" OR Link_Supply_6 eq "4") AND Equation_Calc eq "5">
  <cfset Clinical_07="8" />
  <cfelseif Diagnosis_Case_Mix_All.indexof("Dysphagia") neq "-1" AND Therapies_Home_M0250.indexof("3 - ") neq "-1" AND Equation_Calc eq "2">
  <cfset Clinical_07="6" />
</cfif>
<!--Find Clinical_08-->
<cfset Clinical_08="0" />
<cfif Equation_Calc eq "5" AND Link_Supply_1 eq "5">
  <cfset Clinical_08="15" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Gastrointestinal") neq "-1" >
  <cfset Clinical_08="2" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Gastrointestinal") neq "-1" >
  <cfset Clinical_08="6" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Gastrointestinal") neq "-1" >
  <cfset Clinical_08="1" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Gastrointestinal") neq "-1" >
  <cfset Clinical_08="4" />
</cfif>
<!--Find Clinical_09-->
<cfset Clinical_09="0" />
<cfset Ostomy_for_Bowel_M0550=Assessment_Details.Ostomy_for_Bowel_M0550 />
<cfif Equation_Calc eq "5" AND Link_Supply_2 eq "5" OR Link_Supply_3 eq "5" OR Link_Supply_4 eq "5" OR Link_Supply_5 eq "5" OR Link_Supply_6 eq "5">
  <cfset Clinical_09="4" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Gastrointestinal") neq "-1" AND Ostomy_for_Bowel_M0550.indexof("0") eq "-1" AND Ostomy_for_Bowel_M0550 neq "">
  <cfset Clinical_09="3" />
</cfif>
<!--Find Clinical_10-->
<cfset Clinical_10="0" />
<cfif Equation_Calc eq "5" AND Supply_250_707 eq "No" AND (Link_Supply_1 eq "6" OR Link_Supply_2 eq "6" OR Link_Supply_3 eq "6" OR Link_Supply_4 eq "6" OR Link_Supply_5 eq "6" OR Link_Supply_6 eq "6") >
  <cfset Clinical_10="13" />
  <cfelseif Diagnosis_Case_Mix_All.indexof("Gastrointestinal") neq "-1" AND Diagnosis_Case_Mix_All.indexof("Neuro") neq "-1" AND Equation_Calc eq "3" >
  <cfset Clinical_10="2" />
</cfif>
<!--Find Clinical_11-->
<cfset Clinical_11="0" />
<cfif Equation_Calc eq "5" AND Link_Supply_1 eq "7">
  <cfset Clinical_11="16" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Cardiac") neq "-1" >
  <cfset Clinical_11="3" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Cardiac") neq "-1" >
  <cfset Clinical_11="7" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Cardiac") neq "-1" >
  <cfset Clinical_11="1" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Cardiac") neq "-1" >
  <cfset Clinical_11="8" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Hypertension") neq "-1" >
  <cfset Clinical_11="3" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Hypertension") neq "-1" >
  <cfset Clinical_11="7" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Hypertension") neq "-1" >
  <cfset Clinical_11="1" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Hypertension") neq "-1" >
  <cfset Clinical_11="8" />
</cfif>
<!--Find Clinical_12-->
<cfset Clinical_12="0" />
<cfif (Link_Supply_2 eq "7" OR Link_Supply_3 eq "7" OR Link_Supply_4 eq "7" OR Link_Supply_5 eq "7" OR Link_Supply_6 eq "7") AND Equation_Calc eq "5" >
  <cfset Clinical_12="7" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_CaseMix_1.indexof("Neuro 1") neq "-1" >
  <cfset Clinical_12="3" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_CaseMix_1.indexof("Neuro 1") neq "-1" >
  <cfset Clinical_12="8" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_CaseMix_1.indexof("Neuro 1") neq "-1" >
  <cfset Clinical_12="5" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_CaseMix_1.indexof("Neuro 1") neq "-1" >
  <cfset Clinical_12="8" />
</cfif>
<!--Find Clinical_13-->
<cfset Clinical_13="0" />
<cfset M1840_Toilet = Assessment_Details.M1840_Toilet />
<cfif Link_Supply_1 eq "8" AND Equation_Calc eq "5" >
  <cfset Clinical_13="23" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" AND (M1840_Toilet.indexof("2 -") neq "-1" OR M1840_Toilet.indexof("3 -") neq "-1" OR M1840_Toilet.indexof("4 -") neq "-1") >
  <cfset Clinical_13="3" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" AND (M1840_Toilet.indexof("2 -") neq "-1" OR M1840_Toilet.indexof("3 -") neq "-1" OR M1840_Toilet.indexof("4 -") neq "-1") >
  <cfset Clinical_13="10" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" AND (M1840_Toilet.indexof("2 -") neq "-1" OR M1840_Toilet.indexof("3 -") neq "-1" OR M1840_Toilet.indexof("4 -") neq "-1") >
  <cfset Clinical_13="3" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" AND (M1840_Toilet.indexof("2 -") neq "-1" OR M1840_Toilet.indexof("3 -") neq "-1" OR M1840_Toilet.indexof("4 -") neq "-1") >
  <cfset Clinical_13="10" />
</cfif>
<!--Find Clinical_14-->
<cfset Clinical_14="0" />
<cfset Dress_Upper_M0650=Assessment_Details.Dress_Upper_M0650 />
<cfset Dress_Lower_M0660=Assessment_Details.Dress_Lower_M0660 />
<cfif Dress_Upper_M0650.indexof("1") neq "-1" OR Dress_Upper_M0650.indexof("2") neq "-1" OR Dress_Upper_M0650.indexof("3") neq "-1" OR Dress_Lower_M0660.indexof("1") neq "-1" OR Dress_Lower_M0660.indexof("2") neq "-1" OR Dress_Lower_M0660.indexof("3") neq "-1" >
  <cfset Clinical_14_M0826="1" />
  <cfelse>
  <cfset Clinical_14_M0826="0" />
</cfif>
<cfif (Link_Supply_2 eq "8" OR Link_Supply_3 eq "8" OR Link_Supply_4 eq "8" OR Link_Supply_5 eq "8" OR Link_Supply_6 eq "8") AND Equation_Calc eq "5" >
  <cfset Clinical_14="15" />
  <cfelseif Equation_Calc eq "1" AND (Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Neuro 2") neq "-1") AND Clinical_14_M0826 eq "1" >
  <cfset Clinical_14="2" />
  <cfelseif Equation_Calc eq "2" AND (Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Neuro 2") neq "-1") AND Clinical_14_M0826 eq "1" >
  <cfset Clinical_14="4" />
  <cfelseif Equation_Calc eq "3" AND (Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Neuro 2") neq "-1") AND Clinical_14_M0826 eq "1" >
  <cfset Clinical_14="2" />
  <cfelseif Equation_Calc eq "4" AND (Diagnosis_Case_Mix_All.indexof("Neuro 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Neuro 2") neq "-1") AND Clinical_14_M0826 eq "1" >
  <cfset Clinical_14="2" />
</cfif>
<!--Find Clinical_15-->
<cfset Clinical_15="0" />
<cfif Link_Supply_1 eq "9" AND Equation_Calc eq "5" >
  <cfset Clinical_15="19" />
  <cfelseif Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1" AND Equation_Calc eq "2">
  <cfset Clinical_15="1" />
</cfif>
<!--Find Clinical_16-->
<cfset Clinical_16="0" />
<cfif (Link_Supply_2 eq "9" OR Link_Supply_3 eq "9" OR Link_Supply_4 eq "9" OR Link_Supply_5 eq "9" OR Link_Supply_6 eq "9") AND Equation_Calc eq "5" >
  <cfset Clinical_16="8" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1" AND Clinical_14_M0826 eq "1">
  <cfset Clinical_16="1" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1" AND Clinical_14_M0826 eq "1">
  <cfset Clinical_16="3" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1" AND Clinical_14_M0826 eq "1">
  <cfset Clinical_16="2" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1" AND Clinical_14_M0826 eq "1">
  <cfset Clinical_16="8" />
</cfif>
<!--Find Clinical_17-->
<cfset Clinical_17="0" />
<cfset Ambulation_M0700=Assessment_Details.Ambulation_M0700 />
<cfif (Link_Supply_2 eq "10" OR Link_Supply_3 eq "10" OR Link_Supply_4 eq "10" OR Link_Supply_5 eq "10" OR Link_Supply_6 eq "10" OR Link_Supply_1 eq "10") AND Equation_Calc eq "5" >
  <cfset Clinical_17="16" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1" AND (Ambulation_M0700.indexof("3") neq "-1" OR Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" OR Ambulation_M0700.indexof("6") neq "-1" )>
  <cfset Clinical_17="1" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Neuro 3") neq "-1" AND (Ambulation_M0700.indexof("3") neq "-1" OR Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" OR Ambulation_M0700.indexof("6") neq "-1" )>
  <cfset Clinical_17="5" />
</cfif>
<!--Find Clinical_18-->
<cfset Clinical_18="0" />
<cfset Bathing_M0670=Assessment_Details.Bathing_M0670 />
<cfset Toileting_M0680=Assessment_Details.Toileting_M0680 />
<cfset Transferring_M0690=Assessment_Details.Transferring_M0690 />
<cfset Ambulation_M0700=Assessment_Details.Ambulation_M0700 />
<cfif Bathing_M0670.indexof("2") neq "-1" OR Bathing_M0670.indexof("3") neq "-1" OR Bathing_M0670.indexof("4") neq "-1" OR Bathing_M0670.indexof("5") neq "-1" OR Toileting_M0680.indexof("2") neq "-1" OR Toileting_M0680.indexof("3") neq "-1" OR Toileting_M0680.indexof("4") neq "-1" OR Transferring_M0690.indexof("2") neq "-1" OR Transferring_M0690.indexof("3") neq "-1" OR Transferring_M0690.indexof("4") neq "-1" OR Transferring_M0690.indexof("5") neq "-1" OR Ambulation_M0700.indexof("3") neq "-1" OR Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" >
  <cfset Clinical_18_M0826="1" />
  <cfelse>
  <cfset Clinical_18_M0826="0" />
</cfif>
<cfif (Link_Supply_1 eq "11" OR Link_Supply_2 eq "11" OR Link_Supply_3 eq "11" OR Link_Supply_4 eq "11" OR Link_Supply_5 eq "11" OR Link_Supply_6 eq "11") AND Equation_Calc eq "5" >
  <cfset Clinical_18="23" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Neuro 4") neq "-1" AND Clinical_18_M0826 eq "1" >
  <cfset Clinical_18="3" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Neuro 4") neq "-1" AND Clinical_18_M0826 eq "1" >
  <cfset Clinical_18="3" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Neuro 4") neq "-1" AND Clinical_18_M0826 eq "1" >
  <cfset Clinical_18="12" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Neuro 4") neq "-1" AND Clinical_18_M0826 eq "1" >
  <cfset Clinical_18="18" />
</cfif>
<!--Find Clinical_19-->
<cfset Clinical_19="0" />
<cfset Pressure_Ulcer_Stage_M0460=Assessment_Details.Pressure_Ulcer_Stage_M0460 />
<cfif (Link_Supply_1 eq "12" OR Link_Supply_2 eq "12" OR Link_Supply_3 eq "12" OR Link_Supply_4 eq "12" OR Link_Supply_5 eq "12" OR Link_Supply_6 eq "12") AND Equation_Calc eq "5" >
  <cfset Clinical_19="24" />
  <cfelseif Equation_Calc eq "1" AND (Diagnosis_Case_Mix_All.indexof("Ortho 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Gait") neq "-1" )AND Pressure_Ulcer_Stage_M0460.indexof("NA") eq "-1" AND Pressure_Ulcer_Stage_M0460 neq "">
  <cfset Clinical_19="2" />
</cfif>
<!--Find Clinical_20-->
<cfset Clinical_20="0" />
<cfset Pressure_Ulcer_a_M0450=Assessment_Details.Pressure_Ulcer_a_M0450 />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_a_M0450.indexof("1") neq "-1" OR Pressure_Ulcer_a_M0450.indexof("2") neq "-1" )>
  <cfset Clinical_20="4" />
  <cfelseif Equation_Calc eq "1" AND (Diagnosis_Case_Mix_All.indexof("Ortho 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Ortho 2") neq "-1" )AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_20="5" />
  <cfelseif Equation_Calc eq "2" AND (Diagnosis_Case_Mix_All.indexof("Ortho 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Ortho 2") neq "-1" )AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_20="5" />
</cfif>
<!--Find Clinical_21-->
<cfset Clinical_21="0" />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_a_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_a_M0450.indexof("4") neq "-1" )>
  <cfset Clinical_21="6" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Psych 1") neq "-1" >
  <cfset Clinical_21="3" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Psych 1") neq "-1" >
  <cfset Clinical_21="5" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Psych 1") neq "-1" >
  <cfset Clinical_21="2" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Psych 1") neq "-1" >
  <cfset Clinical_21="5" />
</cfif>
<!--Find Clinical_22-->
<cfset Clinical_22="0" />
<cfset Pressure_Ulcer_b_M0450=Assessment_Details.Pressure_Ulcer_b_M0450 />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_b_M0450.indexof("1") neq "-1" )>
  <cfset Clinical_22="14" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Psych 2") neq "-1" >
  <cfset Clinical_22="1" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Psych 2") neq "-1" >
  <cfset Clinical_22="2" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Psych 2") neq "-1" >
  <cfset Clinical_22="2" />
</cfif>
<!--Find Clinical_23-->
<cfset Clinical_23="0" />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_b_M0450.indexof("2") neq "-1" )>
  <cfset Clinical_23="22" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Pulmonary") neq "-1" >
  <cfset Clinical_23="1" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Pulmonary") neq "-1" >
  <cfset Clinical_23="5" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Pulmonary") neq "-1" >
  <cfset Clinical_23="1" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Pulmonary") neq "-1" >
  <cfset Clinical_23="5" />
</cfif>
<!--Find Clinical_24-->
<cfset Clinical_24="0" />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_b_M0450.indexof("3") neq "-1" )>
  <cfset Clinical_24="22" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Pulmonary") neq "-1" AND Ambulation_M0700.indexof("0 -") eq "-1" AND  Ambulation_M0700 neq "">
  <cfset Clinical_24="1" />
</cfif>
<!--Find Clinical_25-->
<cfset Clinical_25="0" />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_b_M0450.indexof("4") neq "-1" )>
  <cfset Clinical_25="35" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_CaseMix_1.indexof("Skin 1") neq "-1" >
  <cfset Clinical_25="10" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_CaseMix_1.indexof("Skin 1") neq "-1" >
  <cfset Clinical_25="20" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_CaseMix_1.indexof("Skin 1") neq "-1" >
  <cfset Clinical_25="8" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_CaseMix_1.indexof("Skin 1") neq "-1" >
  <cfset Clinical_25="20" />
</cfif>
<!--Find Clinical_26-->
<cfset Clinical_26="0" />
<cfset Pressure_Ulcer_c_M0450=Assessment_Details.Pressure_Ulcer_c_M0450 />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_c_M0450.indexof("1") neq "-1" )>
  <cfset Clinical_26="29" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_Other.indexof("Skin 1") neq "-1" >
  <cfset Clinical_26="6" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_Other.indexof("Skin 1") neq "-1" >
  <cfset Clinical_26="6" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_Other.indexof("Skin 1") neq "-1" >
  <cfset Clinical_26="4" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_Other.indexof("Skin 1") neq "-1" >
  <cfset Clinical_26="4" />
</cfif>
<!--Find Clinical_27-->
<cfset Clinical_27="0" />
<cfif Equation_Calc eq "5" AND Pressure_Ulcer_c_M0450.indexof("2") neq "-1" >
  <cfset Clinical_27="41" />
  <cfelseif Equation_Calc eq "1" AND (Diagnosis_Case_Mix_All.indexof("Skin 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Skin 2") neq "-1" )AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_27="2" />
  <cfelseif Equation_Calc eq "3" AND (Diagnosis_Case_Mix_All.indexof("Skin 1") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Skin 2") neq "-1" )AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_27="2" />
</cfif>
<!--Find Clinical_28-->
<cfset Clinical_28="0" />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_c_M0450.indexof("3") neq "-1" )>
  <cfset Clinical_28="46" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Skin 2") neq "-1" >
  <cfset Clinical_28="6" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Skin 2") neq "-1" >
  <cfset Clinical_28="12" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Skin 2") neq "-1" >
  <cfset Clinical_28="5" />
  <cfelseif Equation_Calc eq "4" AND Diagnosis_Case_Mix_All.indexof("Skin 2") neq "-1" >
  <cfset Clinical_28="12" />
</cfif>
<!--Find Clinical_29-->
<cfset Clinical_29="0" />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_c_M0450.indexof("4") neq "-1" )>
  <cfset Clinical_29="58" />
  <cfelseif Equation_Calc eq "1" AND Diagnosis_Case_Mix_All.indexof("Trache") neq "-1" >
  <cfset Clinical_29="4" />
  <cfelseif Equation_Calc eq "2" AND Diagnosis_Case_Mix_All.indexof("Trache") neq "-1" >
  <cfset Clinical_29="4" />
  <cfelseif Equation_Calc eq "3" AND Diagnosis_Case_Mix_All.indexof("Trache") neq "-1" >
  <cfset Clinical_29="4" />
</cfif>
<!--Find Clinical_30-->
<cfset Clinical_30="0" />
<cfset Pressure_Ulcer_d_M0450=Assessment_Details.Pressure_Ulcer_d_M0450 />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_d_M0450.indexof("1") neq "-1" )>
  <cfset Clinical_30="48" />
  <cfelseif Equation_Calc eq "1" AND (Diagnosis_Case_Mix_All.indexof("Urosto") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Cysto") neq "-1") >
  <cfset Clinical_30="6" />
  <cfelseif Equation_Calc eq "2" AND (Diagnosis_Case_Mix_All.indexof("Urosto") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Cysto") neq "-1") >
  <cfset Clinical_30="23" />
  <cfelseif Equation_Calc eq "3" AND (Diagnosis_Case_Mix_All.indexof("Urosto") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Cysto") neq "-1") >
  <cfset Clinical_30="4" />
  <cfelseif Equation_Calc eq "4" AND (Diagnosis_Case_Mix_All.indexof("Urosto") neq "-1" OR Diagnosis_Case_Mix_All.indexof("Cysto") neq "-1") >
  <cfset Clinical_30="23" />
</cfif>
<!--Find Clinical_31-->
<cfset Clinical_31="0" />
<cfif Equation_Calc eq "5" AND Pressure_Ulcer_d_M0450.indexof("2") neq "-1" >
  <cfset Clinical_31="67" />
  <cfelseif Equation_Calc eq "1" AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_31="8" />
  <cfelseif Equation_Calc eq "2" AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_31="15" />
  <cfelseif Equation_Calc eq "3" AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_31="5" />
  <cfelseif Equation_Calc eq "4" AND (Therapies_Home_M0250.indexof("1 -") neq "-1" OR Therapies_Home_M0250.indexof("2 -") neq "-1" )>
  <cfset Clinical_31="21" />
</cfif>
<!--Find Clinical_32-->
<cfset Clinical_32="0" />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_d_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("4") neq "-1") >
  <cfset Clinical_32="75" />
  <cfelseif Equation_Calc eq "1" AND Therapies_Home_M0250.indexof("3 -") neq "-1" >
  <cfset Clinical_32="4" />
  <cfelseif Equation_Calc eq "2" AND Therapies_Home_M0250.indexof("3 -") neq "-1" >
  <cfset Clinical_32="12" />
  <cfelseif Equation_Calc eq "4" AND Therapies_Home_M0250.indexof("3 -") neq "-1" >
  <cfset Clinical_32="12" />
</cfif>
<!--Find Clinical_33-->
<cfset Clinical_33="0" />
<cfset Pressure_Ulcer_e_M0450=Assessment_Details.Pressure_Ulcer_e_M0450 />
<cfset M1308_d_2_Pressure=Assessment_Details.M1308_d_2_Pressure />
<cfset M1308_d_3_Pressure=Assessment_Details.M1308_d_3_Pressure />
<cfset Vision_M0390=Assessment_Details.Vision_M0390 />
<cfif Equation_Calc eq "5" AND (Pressure_Ulcer_e_M0450 gt "0" OR M1308_d_2_Pressure gt "0" OR M1308_d_3_Pressure gt "0")  >
  <cfset Clinical_33="17" />
  <cfelseif Equation_Calc eq "1" AND (Vision_M0390.indexof("1") neq "-1" OR Vision_M0390.indexof("2") neq "-1") >
  <cfset Clinical_33="1" />
  <cfelseif Equation_Calc eq "4" AND (Vision_M0390.indexof("1") neq "-1" OR Vision_M0390.indexof("2") neq "-1") >
  <cfset Clinical_33="1" />
</cfif>
<!--Find Clinical_34-->
<cfset Clinical_34="0" />
<cfset Stasis_Ulcer_Num_M0470 = Assessment_Details.Stasis_Ulcer_Num_M0470 />
<cfset Freq_of_Pain_M0420=Assessment_Details.Freq_of_Pain_M0420 />
<cfif Equation_Calc eq "5" AND (Stasis_Ulcer_Num_M0470.indexof("2") neq "-1" )  >
  <cfset Clinical_34="6" />
  <cfelseif Equation_Calc eq "1" AND (Freq_of_Pain_M0420.indexof("3 -") neq "-1" OR Freq_of_Pain_M0420.indexof("4 -") neq "-1") >
  <cfset Clinical_34="1" />
</cfif>
<!--Find Clinical_35-->
<cfset Clinical_35="0" />
<cfset Stasis_Ulcer_Num_M0470=Assessment_Details.Stasis_Ulcer_Num_M0470 />
<cfset Pressure_Ulcer_c_M0450=Assessment_Details.Pressure_Ulcer_c_M0450 />
<cfset Pressure_Ulcer_d_M0450=Assessment_Details.Pressure_Ulcer_d_M0450 />
<cfif Equation_Calc eq "5" AND Stasis_Ulcer_Num_M0470.indexof("3") neq "-1"  >
  <cfset Clinical_35="12" />
  <cfelseif (Equation_Calc eq "1" OR Equation_Calc eq "2") AND (Pressure_Ulcer_c_M0450.indexof("2") neq "-1" OR Pressure_Ulcer_c_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_c_M0450.indexof("4") neq "-1") >
  <cfset Clinical_35="3" />
  <cfelseif (Equation_Calc eq "1" OR Equation_Calc eq "2") AND (Pressure_Ulcer_d_M0450.indexof("2") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("4") neq "-1") >
  <cfset Clinical_35="3" />
  <cfelseif (Equation_Calc eq "3" OR Equation_Calc eq "4") AND (Pressure_Ulcer_c_M0450.indexof("2") neq "-1" OR Pressure_Ulcer_c_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_c_M0450.indexof("4") neq "-1") >
  <cfset Clinical_35="5" />
  <cfelseif (Equation_Calc eq "3" OR Equation_Calc eq "4") AND (Pressure_Ulcer_d_M0450.indexof("2") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("4") neq "-1") >
  <cfset Clinical_35="5" />
</cfif>
<!--Find Clinical_36-->
<cfset Clinical_36="0" />
<cfset Pressure_Ulcer_Stage_M0460=Assessment_Details.Pressure_Ulcer_Stage_M0460 />
<cfif Equation_Calc eq "5" AND Stasis_Ulcer_Num_M0470.indexof("4") neq "-1"  >
  <cfset Clinical_36="21" />
  <cfelseif (Equation_Calc eq "1") AND (Pressure_Ulcer_Stage_M0460.indexof("1 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("2 - ") neq "-1") >
  <cfset Clinical_36="5" />
  <cfelseif (Equation_Calc eq "2") AND (Pressure_Ulcer_Stage_M0460.indexof("1 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("2 - ") neq "-1") >
  <cfset Clinical_36="11" />
  <cfelseif (Equation_Calc eq "3") AND (Pressure_Ulcer_Stage_M0460.indexof("1 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("2 - ") neq "-1") >
  <cfset Clinical_36="5" />
  <cfelseif (Equation_Calc eq "4") AND (Pressure_Ulcer_Stage_M0460.indexof("1 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("2 - ") neq "-1") >
  <cfset Clinical_36="11" />
</cfif>
<!--Find Clinical_37-->
<cfset Clinical_37="0" />
<cfset Stasis_Ulcer_Hidden_M0474=Assessment_Details.Stasis_Ulcer_Hidden_M0474 />
<cfif Equation_Calc eq "5" AND Stasis_Ulcer_Hidden_M0474.indexof("1") neq "-1"  >
  <cfset Clinical_37="9" />
  <cfelseif (Equation_Calc eq "1") AND (Pressure_Ulcer_Stage_M0460.indexof("3 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("4 - ") neq "-1") >
  <cfset Clinical_37="16" />
  <cfelseif (Equation_Calc eq "2") AND (Pressure_Ulcer_Stage_M0460.indexof("3 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("4 - ") neq "-1") >
  <cfset Clinical_37="26" />
  <cfelseif (Equation_Calc eq "3") AND (Pressure_Ulcer_Stage_M0460.indexof("3 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("4 - ") neq "-1") >
  <cfset Clinical_37="12" />
  <cfelseif (Equation_Calc eq "4") AND (Pressure_Ulcer_Stage_M0460.indexof("3 - ") neq "-1" OR Pressure_Ulcer_Stage_M0460.indexof("4 - ") neq "-1") >
  <cfset Clinical_37="23" />
</cfif>
<!--Find Clinical_38-->
<cfset Clinical_38="0" />
<cfset Stasis_Ulcer_Status_M0476=Assessment_Details.Stasis_Ulcer_Status_M0476 />
<cfif Equation_Calc eq "5" AND Stasis_Ulcer_Status_M0476.indexof("1") neq "-1"  >
  <cfset Clinical_38="6" />
  <cfelseif Stasis_Ulcer_Status_M0476.indexof("2 -") neq "-1" >
  <cfset Clinical_38="8" />
</cfif>
<!--Find Clinical_39-->
<cfset Clinical_39="0" />
<cfif Equation_Calc eq "5" AND Stasis_Ulcer_Status_M0476.indexof("2") neq "-1"  >
  <cfset Clinical_39="25" />
  <cfelseif Equation_Calc neq "5" AND Stasis_Ulcer_Status_M0476.indexof("3 - ") neq "-1" >
  <cfset Clinical_39="11" />
</cfif>
<!--Find Clinical_40-->
<cfset Clinical_40 = "0" />
<cfset Surgical_Wound_Status_M0488 = Assessment_Details.Surgical_Wound_Status_M0488 />
<cfif Equation_Calc eq "5" AND Stasis_Ulcer_Status_M0476.indexof("3") neq "-1"  >
  <cfset Clinical_40="36" />
  <cfelseif Equation_Calc eq "2" AND Surgical_Wound_Status_M0488.indexof("2 -") neq "-1" >
  <cfset Clinical_40="2" />
  <cfelseif Equation_Calc eq "3" AND Surgical_Wound_Status_M0488.indexof("2 -") neq "-1" >
  <cfset Clinical_40="3" />
</cfif>
<!--Find Clinical_41-->
<cfset Clinical_41 = "0" />
<cfset Surgical_Wound_M0482=Assessment_Details.Surgical_Wound_M0482 />
<cfif Equation_Calc eq "5" AND Surgical_Wound_M0482.indexof("1 -") neq "-1"  AND Surgical_Wound_Status_M0488.indexof("2 -") neq "-1"  >
  <cfset Clinical_41="4" />
  <cfelseif Equation_Calc neq "5" AND Surgical_Wound_M0482.indexof("1 -") neq "-1"  AND Surgical_Wound_Status_M0488.indexof("3 - ") neq "-1"  >
  <cfset Clinical_41="4" />
</cfif>
<!--Find Clinical_42-->
<cfset Clinical_42 = "0" />
<cfset Breathing_M0490 = Assessment_Details.Breathing_M0490 />
<cfif Equation_Calc eq "5" AND Surgical_Wound_Status_M0488.indexof("3") neq "-1"   >
  <cfset Clinical_42="14" />
  <cfelseif Equation_Calc eq "1" AND (Breathing_M0490.indexof("2 -") neq "-1"  OR Breathing_M0490.indexof("3 -") neq "-1"  OR Breathing_M0490.indexof("4 -") neq "-1")  >
  <cfset Clinical_42="2" />
  <cfelseif Equation_Calc eq "2" AND (Breathing_M0490.indexof("2 -") neq "-1"  OR Breathing_M0490.indexof("3 -") neq "-1"  OR Breathing_M0490.indexof("4 -") neq "-1" ) >
  <cfset Clinical_42="2" />
</cfif>
<!--Find Clinical_43-->
<cfset Clinical_43 = "0" />
<cfset Bowel_Incont_M0540 = Assessment_Details.Bowel_Incont_M0540 />
<cfif Equation_Calc eq "5" AND Ostomy_for_Bowel_M0550.indexof("1") neq "-1"   >
  <cfset Clinical_43="27" />
  <cfelseif Equation_Calc eq "1" AND Bowel_Incont_M0540.indexof("NA -") eq "-1"  AND Bowel_Incont_M0540.indexof("0 -") eq "-1" AND Bowel_Incont_M0540.indexof("1 -") eq "-1"  AND Bowel_Incont_M0540 neq "" >
  <cfset Clinical_43="1" />
  <cfelseif Equation_Calc eq "2" AND Bowel_Incont_M0540.indexof("NA -") eq "-1"  AND Bowel_Incont_M0540.indexof("0 -") eq "-1" AND Bowel_Incont_M0540.indexof("1 -") eq "-1"  AND Bowel_Incont_M0540 neq "" >
  <cfset Clinical_43="2" />
  <cfelseif Equation_Calc eq "3" AND Bowel_Incont_M0540.indexof("NA -") eq "-1"  AND Bowel_Incont_M0540.indexof("0 -") eq "-1" AND Bowel_Incont_M0540.indexof("1 -") eq "-1"  AND Bowel_Incont_M0540 neq "" >
  <cfset Clinical_43="1" />
</cfif>
<!--Find Clinical_44-->
<cfset Clinical_44 = "0" />
<cfif Equation_Calc eq "5" AND Ostomy_for_Bowel_M0550.indexof("2") neq "-1"   >
  <cfset Clinical_44="45" />
  <cfelseif Equation_Calc eq "1" AND (Ostomy_for_Bowel_M0550.indexof("1 -") neq "-1"  OR Ostomy_for_Bowel_M0550.indexof("2 -") neq "-1") >
  <cfset Clinical_44="5" />
  <cfelseif Equation_Calc eq "2" AND (Ostomy_for_Bowel_M0550.indexof("1 -") neq "-1"  OR Ostomy_for_Bowel_M0550.indexof("2 -") neq "-1") >
  <cfset Clinical_44="9" />
  <cfelseif Equation_Calc eq "3" AND (Ostomy_for_Bowel_M0550.indexof("1 -")neq "-1"  OR Ostomy_for_Bowel_M0550.indexof("2 -") neq "-1") >
  <cfset Clinical_44="3" />
  <cfelseif Equation_Calc eq "4" AND (Ostomy_for_Bowel_M0550.indexof("1 -") neq "-1"  OR Ostomy_for_Bowel_M0550.indexof("2 -") neq "-1") >
  <cfset Clinical_44="9" />
</cfif>
<!--Find Clinical_45-->
<cfset Clinical_45 = "0" />
<cfset Inject_Meds_M0800 =Assessment_Details.Inject_Meds_M0800 />
<cfset Supply_All = Link_Supply_2 & " " & Link_Supply_3 & " " & Link_Supply_4 & " " & Link_Supply_5 & " " & Link_Supply_6 & " " & Link_Supply_1  />
<cfif Supply_All neq "" OR Pressure_Ulcer_a_M0450.indexof("1") neq "-1"   OR Pressure_Ulcer_b_M0450.indexof("1") neq "-1"   OR Pressure_Ulcer_c_M0450.indexof("1") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("1") neq "-1" OR Pressure_Ulcer_e_M0450.indexof("1") neq "-1"  OR Stasis_Ulcer_Num_M0470.indexof("1") neq "-1" OR Stasis_Ulcer_Hidden_M0474.indexof("1") neq "-1" OR Stasis_Ulcer_Status_M0476.indexof("1") neq "-1" OR Pressure_Ulcer_a_M0450.indexof("2") neq "-1"   OR Pressure_Ulcer_b_M0450.indexof("2") neq "-1"   OR Pressure_Ulcer_c_M0450.indexof("2") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("2") neq "-1" OR Pressure_Ulcer_a_M0450.indexof("3") neq "-1"   OR Pressure_Ulcer_b_M0450.indexof("3") neq "-1"   OR Pressure_Ulcer_c_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("3") neq "-1" OR Pressure_Ulcer_a_M0450.indexof("4") neq "-1"   OR Pressure_Ulcer_b_M0450.indexof("4") neq "-1"   OR Pressure_Ulcer_c_M0450.indexof("4") neq "-1" OR Pressure_Ulcer_d_M0450.indexof("4") neq "-1" OR Stasis_Ulcer_Num_M0470.indexof("2") neq "-1" OR Stasis_Ulcer_Hidden_M0474.indexof("2") neq "-1" OR Stasis_Ulcer_Status_M0476.indexof("2") neq "-1" OR Surgical_Wound_Status_M0488.indexof("2") neq "-1" OR Stasis_Ulcer_Num_M0470.indexof("3") neq "-1" OR Stasis_Ulcer_Hidden_M0474.indexof("3") neq "-1" OR Stasis_Ulcer_Status_M0476.indexof("3") neq "-1" OR Surgical_Wound_Status_M0488.indexof("3") neq "-1" OR Stasis_Ulcer_Num_M0470.indexof("4") neq "-1"     >
  <cfset Clinical_43_Supply="1" />
  <cfelse>
  <cfset Clinical_43_Supply="0" />
</cfif>
<cfif Equation_Calc eq "5" AND Ostomy_for_Bowel_M0550.indexof("1") neq "-1"  AND Clinical_43_Supply eq "1" >
  <cfset Clinical_45="14" />
  <cfelseif Equation_Calc eq "1" AND Inject_Meds_M0800.indexof("NA ") eq "-1"  AND Inject_Meds_M0800 neq "" >
  <cfset Clinical_45="1" />
  <cfelseif Equation_Calc eq "2" AND Inject_Meds_M0800.indexof("NA ") eq "-1"  AND Inject_Meds_M0800 neq "" >
  <cfset Clinical_45="1" />
  <cfelseif Equation_Calc eq "3" AND Inject_Meds_M0800.indexof("NA ") eq "-1"  AND Inject_Meds_M0800 neq "" >
  <cfset Clinical_45="2" />
  <cfelseif Equation_Calc eq "4" AND Inject_Meds_M0800.indexof("NA ") eq "-1"  AND Inject_Meds_M0800 neq "" >
  <cfset Clinical_45="4" />
</cfif>
<!--Find Clinical_46-->
<cfset Clinical_46 = "0" />
<cfif Equation_Calc eq "5" AND Ostomy_for_Bowel_M0550.indexof("2") neq "-1"  AND Clinical_43_Supply eq "1" >
  <cfset Clinical_46="11" />
  <cfelseif Equation_Calc eq "1" AND Clinical_14_M0826 eq "1"  >
  <cfset Clinical_46="2" />
  <cfelseif Equation_Calc eq "2" AND Clinical_14_M0826 eq "1"  >
  <cfset Clinical_46="4" />
  <cfelseif Equation_Calc eq "3" AND Clinical_14_M0826 eq "1"  >
  <cfset Clinical_46="2" />
  <cfelseif Equation_Calc eq "4" AND Clinical_14_M0826 eq "1"  >
  <cfset Clinical_46="2" />
</cfif>
<!--Find Clinical_47-->
<cfset Clinical_47 = "0" />
<cfif Equation_Calc eq "5" AND Therapies_Home_M0250.indexof("1") neq "-1">
  <cfset Clinical_47 = "5" />
  <cfelseif Equation_Calc eq "1" AND (Bathing_M0670.indexof("2 -") neq "-1" OR Bathing_M0670.indexof("3 -") neq "-1" OR Bathing_M0670.indexof("4 -") neq "-1" OR Bathing_M0670.indexof("5 -") neq "-1" OR Bathing_M0670.indexof("6 -") neq "-1" )>
  <cfset Clinical_47 = "3" />
  <cfelseif Equation_Calc eq "2" AND (Bathing_M0670.indexof("2 -") neq "-1" OR Bathing_M0670.indexof("3 -")neq "-1" OR Bathing_M0670.indexof("4 -") neq "-1" OR Bathing_M0670.indexof("5 -") neq "-1" OR Bathing_M0670.indexof("6 -") neq "-1" )>
  <cfset Clinical_47 = "3" />
  <cfelseif Equation_Calc eq "3" AND (Bathing_M0670.indexof("2 -")neq "-1" OR Bathing_M0670.indexof("3 -") neq "-1" OR Bathing_M0670.indexof("4 -") neq "-1" OR Bathing_M0670.indexof("5 -") neq "-1" OR Bathing_M0670.indexof("6 -") neq "-1" )>
  <cfset Clinical_47 = "6" />
  <cfelseif Equation_Calc eq "4" AND (Bathing_M0670.indexof("2 -") neq "-1" OR Bathing_M0670.indexof("3 -") neq "-1" OR Bathing_M0670.indexof("4 -") neq "-1" OR Bathing_M0670.indexof("5 -") neq "-1" OR Bathing_M0670.indexof("6 -") neq "-1" )>
  <cfset Clinical_47 = "6" />
</cfif>
<!--Find Clinical_48-->
<cfset Clinical_48 = "0" />
<cfset Assessment_Completed_M0090=Assessment_Details.Assessment_Completed_M0090 />
<cfset CheckDate="12/31/2009" />
<!--Default date Don't change.-->
<cfset Toileting_M0680=Assessment_Details.Toileting_M0680 />
<cfset Urinary_INcont_M0520=Assessment_Details.Urinary_INcont_M0520 />
<cfif Assessment_Completed_M0090 gt CheckDate>
  <cfset OASIS_Version_Code_1 = "C-072009" />
  <cfelse>
  <cfset OASIS_Version_Code_1 = "B1-1202" />
</cfif>
<cfif Equation_Calc eq "5" AND Urinary_INcont_M0520.indexof("2") neq "-1">
  <cfset Clinical_48 = "9" />
  <cfelseif Equation_Calc eq "1" AND OASIS_Version_Code_1.indexof("B") neq "-1" AND (Toileting_M0680.indexof("2 -") neq "-1" OR Toileting_M0680.indexof("3 -") neq "-1" OR Toileting_M0680.indexof("4 -") neq "-1" )>
  <cfset Clinical_48 = "2" />
  <cfelseif Equation_Calc eq "2" AND OASIS_Version_Code_1.indexof("B") neq "-1" AND (Toileting_M0680.indexof("2 -") neq "-1" OR Toileting_M0680.indexof("3 -") neq "-1" OR Toileting_M0680.indexof("4 -") neq "-1" )>
  <cfset Clinical_48 = "3" />
  <cfelseif Equation_Calc eq "3" AND OASIS_Version_Code_1.indexof("B") neq "-1" AND (Toileting_M0680.indexof("2 -") neq "-1" OR Toileting_M0680.indexof("3 -") neq "-1" OR Toileting_M0680.indexof("4 -") neq "-1" )>
  <cfset Clinical_48 = "2" />
  <cfelseif Equation_Calc eq "1" AND OASIS_Version_Code_1.indexof("C") neq "-1" AND (M1840_Toilet.indexof("2 -") neq "-1" OR M1840_Toilet.indexof("3 -") neq "-1" OR M1840_Toilet.indexof("4 -") neq "-1" )>
  <cfset Clinical_48 = "2" />
  <cfelseif Equation_Calc eq "2" AND OASIS_Version_Code_1.indexof("C") neq "-1" AND (M1840_Toilet.indexof("2 -") neq "-1" OR M1840_Toilet.indexof("3 -") neq "-1" OR M1840_Toilet.indexof("4 -") neq "-1" )>
  <cfset Clinical_48 = "3" />
  <cfelseif Equation_Calc eq "3" AND OASIS_Version_Code_1.indexof("C") neq "-1" AND (M1840_Toilet.indexof("2 -") neq "-1" OR M1840_Toilet.indexof("3 -") neq "-1" OR M1840_Toilet.indexof("4 -") neq "-1" )>
  <cfset Clinical_48 = "2" />
</cfif>
<!--Find Clinical_49-->
<cfset Clinical_49 = "0" />
<cfset Bowel_Incont_M0540=Assessment_Details.Bowel_Incont_M0540 />
<cfset Transferring_M0690=Assessment_Details.Transferring_M0690 />
<cfif Equation_Calc eq "5" AND Bowel_Incont_M0540.indexof("4") neq "-1" OR Bowel_Incont_M0540.indexof("5") neq "-1" AND Equation_Calc eq "5">
  <cfset Clinical_49 = "10" />
  <cfelseif Equation_Calc eq "2" AND ( Transferring_M0690.indexof("2 -") neq "-1" OR Transferring_M0690.indexof("3 -") neq "-1" OR Transferring_M0690.indexof("4 -") neq "-1" OR Transferring_M0690.indexof("5 -") neq "-1" )>
  <cfset Clinical_49 = "2" />
</cfif>
<!--Find Clinical_50-->
<cfset Clinical_50 = "0" />
<cfset Ambulation_M0700=Assessment_Details.Ambulation_M0700 />
<cfif (Ambulation_M0700.indexof("1") neq "-1" OR Ambulation_M0700.indexof("2") neq "-1" OR Ambulation_M0700.indexof("3") neq "-1")AND (Equation_Calc eq "1" OR Equation_Calc eq "3" )>
  <cfset Clinical_50="1" />
</cfif>
<!--Find Clinical_51-->
<cfset Clinical_51 = "0" />
<cfif (Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" OR Ambulation_M0700.indexof("6") neq "-1") AND Equation_Calc eq "1">
  <cfset Clinical_51="3" />
  <cfelseif (Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" OR Ambulation_M0700.indexof("6") neq "-1") AND Equation_Calc eq "2">
  <cfset Clinical_51="4" />
  <cfelseif (Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" OR Ambulation_M0700.indexof("6") neq "-1") AND Equation_Calc eq "3">
  <cfset Clinical_51="4" />
  <cfelseif (Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" OR Ambulation_M0700.indexof("6") neq "-1") AND Equation_Calc eq "4">
  <cfset Clinical_51="5" />
</cfif>
<!--**************************************************************************************************************************
												Create Message Case Mix Alert Assessment
********************************************************************************************************************************-->
<!--**************************************************************************************************************************
																1. Find CaseMix0
********************************************************************************************************************************-->
<cfset Case_Mix_Compilation ="" />
<cfset gNum ="0" />
<cfset CaseMix0 = 0  />
<cfset OASIS_Version_Code_1="" />
<cfset CheckDate="12/31/2009" />
<cfif Assessment_Completed_M0090 gt CheckDate>
  <cfset OASIS_Version_Code_1 = "C-072009" />
  <cfelse>
  <cfset OASIS_Version_Code_1 = "B1-1202" />
</cfif>
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and (M0826_Ther_Need gt Therapy_Visit_Count)>
  <cfset CaseMix0 = "ALERT: The number of therapy visits ordered on M0826 " & M0826_Ther_Need & " is more than the Medicare average " & Schedule_Visit_Count & " for this HIPPS/HHRG score." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and (M0826_Ther_Need lt Therapy_Visit_Count) and (Therapy_Visit_Count gt 13)>
  <cfset CaseMix0 = "ALERT: The number of therapy visits ordered on M0826 " & M0826_Ther_Need & " is less than the Medicare average " & Schedule_Visit_Count & " for this HIPPS/HHRG score. The recommended number of therapy visits would increase your overall casemix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and (M0826_Ther_Need lt Therapy_Visit_Count) and (Therapy_Visit_Count lt 14)>
  <cfset CaseMix0 = "ALERT: The number of therapy visits ordered on M0826 " & M0826_Ther_Need & " is less than the Medicare average " & Schedule_Visit_Count & " for this HIPPS/HHRG score. This may trigger an ADR." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and (M0826_Ther_Need gt Therapy_Visit_Count)>
  <cfset CaseMix0 = "ALERT: The number of therapy visits ordered on M2200 " & M0826_Ther_Need & " is more than the Medicare average " & Schedule_Visit_Count & " for this HIPPS/HHRG score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and (M0826_Ther_Need lt Therapy_Visit_Count) and (Therapy_Visit_Count gt 13)>
  <cfset CaseMix0 = "ALERT: The number of therapy visits ordered on M2200 " & M0826_Ther_Need & " is less than the Medicare average " & Schedule_Visit_Count & " for this HIPPS/HHRG score. The recommended number of therapy visits would increase your overall casemix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and (M0826_Ther_Need lt Therapy_Visit_Count) and (Therapy_Visit_Count lt 14)>
  <cfset CaseMix0 = "ALERT: The number of therapy visits ordered on M2200 " & M0826_Ther_Need & " is less than the Medicare average " & Schedule_Visit_Count & " for this HIPPS/HHRG score. This may trigger an ADR." />
  <cfelse>
  <cfset CaseMix0	= "0"  />
</cfif>
<cfif CaseMix0.indexOf("ALERT") neq "-1" >
  <cfset Case_Mix_Compilation = "<br/>" & CaseMix0>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																2. Find CaseMix01
********************************************************************************************************************************-->
<cfset CaseMix01 = "" />
<cfif Diagnosis_Case_Mix_All.indexof("Blind") neq "-1">
  <cfset Clinical_01="3" />
</cfif>
<cfif Clinical_01 neq "">
  <cfset CaseMix01 = "               " & Clinical_01 />
  <cfelseif Case_Mix_Match_All.indexOf("blind") neq "-1">
  <cfset CaseMix01 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for blindness/low vision." />
  <cfelse>
  <cfset CaseMix01 = "0"	 />
</cfif>
<cfif CaseMix01.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix01 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix01>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																3. Find CaseMix011
********************************************************************************************************************************-->
<cfset CaseMix011 = "0" />
<cfif Vision_M0390.indexOF("2 -") neq "-1" and Vision_M0390 neq "" and Diagnosis_Case_Mix_All.indexOf("Blind") eq "-1">
  <cfset CaseMix011 = "ALERT: The patient has a severe vision deficit but no case mix diagnosis for blindness/low vision. Think about substituting a current diagnosis for blindness/low vision." />
  <cfelse>
  <cfset CaseMix011 = "0" />
</cfif>
<cfif CaseMix011.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix011 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix011>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																4. Find CaseMix02
********************************************************************************************************************************-->
<cfset CaseMix02 = "0" />
<cfif Clinical_02 neq "0">
  <cfset CaseMix02 = "               " & Clinical_02 />
  <cfelseif (Equation_Calc eq 1 or Equation_Calc eq 2 )and   
Diagnosis_Case_Mix_All.indexOf("Blood") eq "-1" and (Case_Mix_List_1.indexOf("Blood") neq "-1" or  
Case_Mix_List_2.indexOf("Blood") neq "-1" or Case_Mix_List_3.indexOf("Blood") neq "-1" or Case_Mix_List_4.indexOf("Blood") neq "-1" or 
Case_Mix_List_5.indexOf("Blood") neq "-1" or Case_Mix_List_6.indexOf("Blood") neq "-1"  )>
  <cfset CaseMix02 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Blood Disorder." />
  <cfelse>
  <cfset CaseMix02 = "0"	 />
</cfif>
<cfif CaseMix02.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix02 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix02>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																5. Find CaseMix03
********************************************************************************************************************************-->
<cfset CaseMix03 = "0" />
<cfif Clinical_03 neq "0">
  <cfset CaseMix03 = "               " & Clinical_03 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Cancer") eq "-1" and (Case_Mix_List_1.indexOf("Cancer") neq "-1" or  
Case_Mix_List_2.indexOf("Cancer") neq "-1" or Case_Mix_List_3.indexOf("Cancer") neq "-1" or Case_Mix_List_4.indexOf("Cancer") neq "-1" or 
Case_Mix_List_5.indexOf("Cancer") neq "-1" or Case_Mix_List_6.indexOf("Cancer") neq "-1"  )>
  <cfset CaseMix03 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Cancer." />
  <cfelse>
  <cfset CaseMix03 = "0"	 />
</cfif>
<cfif CaseMix03.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix03 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix03>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																6. Find CaseMix04
********************************************************************************************************************************-->
<cfset CaseMix04 = "0" />
<cfif Clinical_04 neq "0">
  <cfset CaseMix04 = "               " & Clinical_04 />
  <cfelseif Diagnosis_Case_Mix_Other.indexOf("Diabetes") neq "-1" and Diagnosis_CaseMix_1.indexOf("Skin 1") eq "-1" and 
(Diagnosis_CaseMix_2 eq "Diabetes" and Link_Diagnosis_Severity_2 gte Link_Diagnosis_Severity_1) or 
(Diagnosis_CaseMix_3 eq "Diabetes" and Link_Diagnosis_Severity_3 gte Link_Diagnosis_Severity_1) or
(Diagnosis_CaseMix_4 eq "Diabetes" and Link_Diagnosis_Severity_4 gte Link_Diagnosis_Severity_1) or
(Diagnosis_CaseMix_5 eq "Diabetes" and Link_Diagnosis_Severity_5 gte Link_Diagnosis_Severity_1) or
(Diagnosis_CaseMix_6 eq "Diabetes" and Link_Diagnosis_Severity_6 gte Link_Diagnosis_Severity_1) >
  <cfset CaseMix03 = "ALERT: The severity of the diabetes diagnosis is equal or greater than the severity of the primary diagnosis. Changing diabetes to the primary diagnosis would increase your overall casemix." />
  <cfelse>
  <cfset CaseMix04 = "0"	 />
</cfif>
<cfif CaseMix04.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix04 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix04>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																7. Find CaseMix05
********************************************************************************************************************************-->
<cfset CaseMix05 = "0" />
<cfif Clinical_05 neq "0">
  <cfset CaseMix05 = "               " & Clinical_05 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Diabetes") eq "-1" and (Case_Mix_List_1.indexOf("Diabetes") neq "-1" or  
Case_Mix_List_2.indexOf("Diabetes") neq "-1" or Case_Mix_List_3.indexOf("Diabetes") neq "-1" or Case_Mix_List_4.indexOf("Diabetes") neq "-1" or 
Case_Mix_List_5.indexOf("Diabetes") neq "-1" or Case_Mix_List_6.indexOf("Diabetes") neq "-1"  )>
  <cfset CaseMix05 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Diabetes." />
  <cfelse>
  <cfset CaseMix05 = "0"	 />
</cfif>
<cfif CaseMix05.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix05 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix05>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																8. Find CaseMix06
********************************************************************************************************************************-->
<cfset CaseMix06 = "0" />
<cfif Clinical_06 neq "0">
  <cfset CaseMix06 = "               " & Clinical_06 />
  <cfelseif (Equation_Calc eq 1 or Equation_Calc eq 2 or Equation_Calc eq 4 )and   
Diagnosis_Case_Mix_All.indexOf("Dysphagia") eq "-1" and (Case_Mix_List_1.indexOf("Dysphagia") neq "-1" or  
Case_Mix_List_2.indexOf("Dysphagia") neq "-1" or Case_Mix_List_3.indexOf("Dysphagia") neq "-1" or Case_Mix_List_4.indexOf("Dysphagia") neq "-1" or 
Case_Mix_List_5.indexOf("Dysphagia") neq "-1" or Case_Mix_List_6.indexOf("Dysphagia") neq "-1"  )>
  <cfset CaseMix06 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Dysphagia." />
  <cfelse>
  <cfset CaseMix06 = "0"	 />
</cfif>
<cfif CaseMix06.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix06 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix06>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																9. Find CaseMix061
********************************************************************************************************************************-->
<cfset CaseMix061 = "0" />
<cfif (Equation_Calc eq 1 or Equation_Calc eq 2 or Equation_Calc eq 4 )and   
Diagnosis_Case_Mix_All.indexOf("Neuro 3") eq "-1" and (Case_Mix_List_1.indexOf("Neuro 3") neq "-1" or  
Case_Mix_List_2.indexOf("Neuro 3") neq "-1" or Case_Mix_List_3.indexOf("Neuro 3") neq "-1" or Case_Mix_List_4.indexOf("Neuro 3") neq "-1" or 
Case_Mix_List_5.indexOf("Neuro 3") neq "-1" or Case_Mix_List_6.indexOf("Neuro 3") neq "-1"  )>
  <cfset CaseMix061 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Neuro 3." />
  <cfelse>
  <cfset CaseMix061 = "0"	 />
</cfif>
<cfif CaseMix061.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix061 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix061>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																10. Find CaseMix071
********************************************************************************************************************************-->
<cfset CaseMix071 = "0" />
<cfif Clinical_07 neq "0">
  <cfset CaseMix07 = "               " & Clinical_07 />
  <cfelseif Equation_Calc eq 2 and   Eating_M0710.indexof("0 - ") eq "-1"  and Eating_M0710 neq "" and 
Diagnosis_Case_Mix_All.indexOf("Dysphagia") eq "-1" >
  <cfset CaseMix071 = "ALERT: The patient has a feeding/eating deficit that may indicate dysphagia but no case mix diagnosis for dysphagia. If the patient has dysphagia think about substituting a current diagnosis with dysphagia." />
  <cfelse>
  <cfset CaseMix071 = "0"	 />
</cfif>
<cfif CaseMix071.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix071 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix071>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																11. Find CaseMix08
********************************************************************************************************************************-->
<cfset CaseMix08 = "0" />
<cfif Clinical_08 neq "0">
  <cfset CaseMix08 = "               " & Clinical_08 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Gastrointestinal") eq "-1" and (Case_Mix_List_1.indexOf("Gastrointestinal") neq "-1" or  
Case_Mix_List_2.indexOf("Gastrointestinal") neq "-1" or Case_Mix_List_3.indexOf("Gastrointestinal") neq "-1" 
or Case_Mix_List_4.indexOf("Gastrointestinal") neq "-1" or 
Case_Mix_List_5.indexOf("Gastrointestinal") neq "-1" or Case_Mix_List_6.indexOf("Gastrointestinal") neq "-1"  )>
  <cfset CaseMix08 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Gastrointestinal" />
  <cfelse>
  <cfset CaseMix08 = "0"	 />
</cfif>
<cfif CaseMix08.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix08 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix08>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																12. Find CaseMix081
********************************************************************************************************************************-->
<cfset CaseMix081 = "0" />
<cfif Bowel_Incont_M0540.indexOf("0 - ") eq "-1" and Bowel_Incont_M0540 neq "" and Diagnosis_Case_Mix_All.indexOf("Gastrointestinal") eq "-1" >
  <cfset CaseMix081 = "ALERT: The patient has bowel incontinence but no case mix diagnosis for gastrointestinal. Think about substituting a current diagnosis with a gastrointestinal case mix." />
  <cfelse>
  <cfset CaseMix081 = "0"	 />
</cfif>
<cfif CaseMix081.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix081 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix081>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																13. Find CaseMix11
********************************************************************************************************************************-->
<cfset CaseMix11 = "0" />
<cfif Clinical_11 neq "0">
  <cfset CaseMix11 = "               " & Clinical_11 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Cardiac") eq "-1" and Diagnosis_Case_Mix_All.indexOf("Hypertension") eq "-1" and
(Case_Mix_List_1.indexOf("Cardiac") neq "-1" or  
Case_Mix_List_2.indexOf("Cardiac") neq "-1" or Case_Mix_List_3.indexOf("Cardiac") neq "-1" 
or Case_Mix_List_4.indexOf("Cardiac") neq "-1" or 
Case_Mix_List_5.indexOf("Cardiac") neq "-1" or Case_Mix_List_6.indexOf("Cardiac") neq "-1" or  
Case_Mix_List_1.indexOf("Hypertension") neq "-1" or  
Case_Mix_List_2.indexOf("Hypertension") neq "-1" or Case_Mix_List_3.indexOf("Hypertension") neq "-1" 
or Case_Mix_List_4.indexOf("Hypertension") neq "-1" or 
Case_Mix_List_5.indexOf("Hypertension") neq "-1" or Case_Mix_List_6.indexOf("Hypertension") neq "-1" )>
  <cfset CaseMix11 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for heart disease and/or hypertension." />
  <cfelse>
  <cfset CaseMix11 = "0"	 />
</cfif>
<cfif CaseMix11.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix11 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix11>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																14. Find CaseMix12
********************************************************************************************************************************-->
<cfset CaseMix12 = "0" />
<cfif Clinical_12 neq "0">
  <cfset CaseMix12 = "               " & Clinical_12 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Neuro 1") eq "-1" and (Case_Mix_List_1.indexOf("Neuro 1") neq "-1" or  
Case_Mix_List_2.indexOf("Neuro 1") neq "-1" or Case_Mix_List_3.indexOf("Neuro 1") neq "-1" 
or Case_Mix_List_4.indexOf("Neuro 1") neq "-1" or 
Case_Mix_List_5.indexOf("Neuro 1") neq "-1" or Case_Mix_List_6.indexOf("Neuro 1") neq "-1"  )>
  <cfset CaseMix12 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Neuro 1" />
  <cfelse>
  <cfset CaseMix12 = "0"	 />
</cfif>
<cfif CaseMix12.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix12 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix12>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																15. Find CaseMix13
********************************************************************************************************************************-->
<cfset CaseMix13 = "0" />
<cfset PT_ADLs_No_M0680 = "" />
<cfif Bathing_M0670.indexof("2") neq "-1" OR Bathing_M0670.indexof("3") neq "-1" OR Bathing_M0670.indexof("4") neq "-1" OR Bathing_M0670.indexof("5") neq "-1" OR Toileting_M0680.indexof("2") neq "-1" OR Toileting_M0680.indexof("3") neq "-1" OR Toileting_M0680.indexof("4") neq "-1" OR Transferring_M0690.indexof("2") neq "-1" OR Transferring_M0690.indexof("3") neq "-1" OR Transferring_M0690.indexof("4") neq "-1" OR Transferring_M0690.indexof("5") neq "-1" OR Ambulation_M0700.indexof("3") neq "-1" OR Ambulation_M0700.indexof("4") neq "-1" OR Ambulation_M0700.indexof("5") neq "-1" >
  <cfset PT_ADLs_No_M0680="1" />
  <cfelse>
  <cfset PT_ADLs_No_M0680="" />
</cfif>
<cfif Clinical_13 neq "0">
  <cfset CaseMix13 = "               " & Clinical_13 />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Neuro 1") neq "-1" and  
(Toileting_M0680.indexOf("0 -") neq "-1" or Toileting_M0680.indexOf("1 -") neq "-1") and PT_ADLs_No_M0680 eq "1">
  <cfset CaseMix13 = "ALERT: M0680 Toileting deficit is 0 (a case mix question) yet other gross motor functions (transferring and/or ambulation) have deficits. Re-evaluate your answer to M0680." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Neuro 1") neq "-1" and  
(Toileting_M0680.indexOf("0 -") neq "-1" or Toileting_M0680.indexOf("1 -") neq "-1") and PT_ADLs_No_M0680 eq "1">
  <cfset CaseMix13 = "ALERT: M1850 Toileting deficit is 0 (a case mix question) yet other gross motor functions (transferring and/or ambulation) have deficits. Re-evaluate your answer to M1850." />
  <cfelse>
  <cfset CaseMix13 = "0"	 />
</cfif>
<cfif CaseMix13.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix13 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix13>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																16. Find CaseMix15
********************************************************************************************************************************-->
<cfset CaseMix15 = "0" />
<cfif Clinical_15 neq "0">
  <cfset CaseMix15 = "               " & Clinical_15 />
  <cfelseif Equation_Calc eq "2" and Diagnosis_Case_Mix_All.indexOf("Neuro 3") eq "-1" and (Case_Mix_List_1.indexOf("Neuro 3") neq "-1" or  
Case_Mix_List_2.indexOf("Neuro 3") neq "-1" or Case_Mix_List_3.indexOf("Neuro 3") neq "-1" 
or Case_Mix_List_4.indexOf("Neuro 3") neq "-1" or 
Case_Mix_List_5.indexOf("Neuro 3") neq "-1" or Case_Mix_List_6.indexOf("Neuro 3") neq "-1"  )>
  <cfset CaseMix15 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Neuro 3" />
  <cfelse>
  <cfset CaseMix15 = "0"	 />
</cfif>
<cfif CaseMix15.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix15 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix15>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																17. Find CaseMix16
********************************************************************************************************************************-->
<cfset CaseMix16 = "0" />
<cfif Clinical_16 neq "0">
  <cfset CaseMix16 = "               " & Clinical_16 />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Neuro 3") neq "-1" and  
Dress_Upper_M0650.indexOf("0 -") neq "-1" or Dress_Lower_M0660.indexOf("0 -") neq "-1" and ((Bathing_M0670.indexOf("0 -") eq "-1"
and Bathing_M0670 neq "") or (Grooming_M0640.indexOf("0 -") eq "-1" and Grooming_M0640 neq ""))>
  <cfset CaseMix13 = "ALERT: M0650/M0660 Dressing deficits are 0 (case mix questions) yet other fine motor functions (grooming and/or bathing) have deficits. Re-evaluate your answer to M0650 and M0660." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Neuro 3") neq "-1" and  
Dress_Upper_M0650.indexOf("0 -") neq "-1" or Dress_Lower_M0660.indexOf("0 -") neq "-1" and ((Bathing_M0670.indexOf("0 -") eq "-1"
and Bathing_M0670 neq "") or (Grooming_M0640.indexOf("0 -") eq "-1" and Grooming_M0640 neq ""))>
  <cfset CaseMix16 = "ALERT: M1810/M1820 Dressing deficits are 0 (case mix questions) yet other fine motor functions (grooming and/or bathing) have deficits. Re-evaluate your answer to M1810 and M1820." />
  <cfelse>
  <cfset CaseMix16 = "0"	 />
</cfif>
<cfif CaseMix16.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix16 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix16>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																18. Find CaseMix17
********************************************************************************************************************************-->
<cfset CaseMix17 = "0" />
<cfif Clinical_17 neq "0">
  <cfset CaseMix17 = "               " & Clinical_17 />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Equation_Calc eq "1" or Equation_Calc eq "2" ) and 
Diagnosis_Case_Mix_All.indexOf("Neuro 3") neq "-1" and  
Ambulation_M0700.indexOf("2 -") neq "-1" and 
(Toileting_M0680.indexOf("2") neq "-1" or Toileting_M0680.indexOf("3") neq "-1" or Toileting_M0680.indexOf("4") neq "-1" ) and
(Transferring_M0690.indexOf("2") neq "-1" or Transferring_M0690.indexOf("3") neq "-1" or Transferring_M0690.indexOf("4") neq "-1" 
or Transferring_M0690.indexOf("4") neq "-1" ) and Clinical_17 eq "0">
  <cfset CaseMix17 = "ALERT: M0700 Patient is semi-independent in ambulation (case mix question) yet other gross motor functions (toileting/transferring) require assistance. Re-evaluate your answer to M0700." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Equation_Calc eq "1" or Equation_Calc eq "2" ) and 
Diagnosis_Case_Mix_All.indexOf("Neuro 3") neq "-1" and  
Ambulation_M0700.indexOf("2 -") neq "-1" and 
(Toileting_M0680.indexOf("2") neq "-1" or Toileting_M0680.indexOf("3") neq "-1" or Toileting_M0680.indexOf("4") neq "-1" ) and
(Transferring_M0690.indexOf("2") neq "-1" or Transferring_M0690.indexOf("3") neq "-1" or Transferring_M0690.indexOf("4") neq "-1" 
or Transferring_M0690.indexOf("4") neq "-1" ) and Clinical_17 eq "0">
  <cfset CaseMix17 = "ALERT: M1860 Patient is semi-independent in ambulation (case mix question) yet other gross motor functions (toileting/transferring) require assistance. Re-evaluate your answer to M1860." />
  <cfelse>
  <cfset CaseMix17 = "0"	 />
</cfif>
<cfif CaseMix17.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix17 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix17>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																19. Find CaseMix18
********************************************************************************************************************************-->
<cfset CaseMix18 = "0" />
<cfif Clinical_18 neq "0">
  <cfset CaseMix18 = "               " & Clinical_18 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Neuro 4") eq "-1" and (Case_Mix_List_1.indexOf("Neuro 4") neq "-1" or  
Case_Mix_List_2.indexOf("Neuro 4") neq "-1" or Case_Mix_List_3.indexOf("Neuro 4") neq "-1" 
or Case_Mix_List_4.indexOf("Neuro 4") neq "-1" or 
Case_Mix_List_5.indexOf("Neuro 4") neq "-1" or Case_Mix_List_6.indexOf("Neuro 4") neq "-1"  )>
  <cfset CaseMix18 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Neuro 4" />
  <cfelse>
  <cfset CaseMix18 = "0"	 />
</cfif>
<cfif CaseMix18.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix18 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix18>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																20. Find CaseMix19
********************************************************************************************************************************-->
<cfset CaseMix19 = "0" />
<cfif Clinical_19 neq "0">
  <cfset CaseMix19 = "               " & Clinical_19 />
  <cfelseif Equation_Calc eq "1" and Diagnosis_Case_Mix_All.indexOf("Ortho 1") eq "-1" and (Case_Mix_List_1.indexOf("Ortho 1") neq "-1" or  
Case_Mix_List_2.indexOf("Ortho 1") neq "-1" or Case_Mix_List_3.indexOf("Ortho 1") neq "-1" 
or Case_Mix_List_4.indexOf("Ortho 1") neq "-1" or 
Case_Mix_List_5.indexOf("Ortho 1") neq "-1" or Case_Mix_List_6.indexOf("Ortho 1") neq "-1"  )>
  <cfset CaseMix19 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Ortho 1 that could add case mix points." />
  <cfelse>
  <cfset CaseMix19 = "0"	 />
</cfif>
<cfif CaseMix19.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix19 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix19>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																21. Find CaseMix20
********************************************************************************************************************************-->
<cfset CaseMix20 = "0" />
<cfif Clinical_20 neq "0">
  <cfset CaseMix20 = "               " & Clinical_20 />
  <cfelseif (Equation_Calc eq "1" or Equation_Calc eq "2") and Diagnosis_Case_Mix_All.indexOf("Ortho 2") eq "-1" and 
(Case_Mix_List_1.indexOf("Ortho 2") neq "-1" or  
Case_Mix_List_2.indexOf("Ortho 2") neq "-1" or Case_Mix_List_3.indexOf("Ortho 2") neq "-1" 
or Case_Mix_List_4.indexOf("Ortho 2") neq "-1" or 
Case_Mix_List_5.indexOf("Ortho 2") neq "-1" or Case_Mix_List_6.indexOf("Ortho 2") neq "-1"  )>
  <cfset CaseMix20 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Ortho 2 that could add case mix points." />
  <cfelse>
  <cfset CaseMix20 = "0"	 />
</cfif>
<cfif CaseMix20.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix20 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix20>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																22. Find CaseMix21
********************************************************************************************************************************-->
<cfset CaseMix21 = "0" />
<cfif Clinical_21 neq "0">
  <cfset CaseMix21 = "               " & Clinical_21 />
  <cfelseif  Diagnosis_Case_Mix_All.indexOf("Psych 1") eq "-1" and 
(Case_Mix_List_1.indexOf("Psych 1") neq "-1" or  
Case_Mix_List_2.indexOf("Psych 1") neq "-1" or Case_Mix_List_3.indexOf("Psych 1") neq "-1" 
or Case_Mix_List_4.indexOf("Psych 1") neq "-1" or 
Case_Mix_List_5.indexOf("Psych 1") neq "-1" or Case_Mix_List_6.indexOf("Psych 1") neq "-1"  )>
  <cfset CaseMix21 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Psych 1." />
  <cfelse>
  <cfset CaseMix21 = "0"	 />
</cfif>
<cfif CaseMix21.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix21 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix21>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																23. Find CaseMix22
********************************************************************************************************************************-->
<cfset CaseMix22 = "0" />
<cfif Clinical_22 neq "0">
  <cfset CaseMix22 = "               " & Clinical_22 />
  <cfelseif (Equation_Calc eq "1" or Equation_Calc eq "2" or Equation_Calc eq "4") and Diagnosis_Case_Mix_All.indexOf("Psych 2") eq "-1" and 
(Case_Mix_List_1.indexOf("Psych 2") neq "-1" or  
Case_Mix_List_2.indexOf("Psych 2") neq "-1" or Case_Mix_List_3.indexOf("Psych 2") neq "-1" 
or Case_Mix_List_4.indexOf("Psych 2") neq "-1" or 
Case_Mix_List_5.indexOf("Psych 2") neq "-1" or Case_Mix_List_6.indexOf("Psych 2") neq "-1"  )>
  <cfset CaseMix22 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Psych 2." />
  <cfelse>
  <cfset CaseMix22 = "0"	 />
</cfif>
<cfif CaseMix22.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix22 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix22>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																24. Find CaseMix23
********************************************************************************************************************************-->
<cfset CaseMix23 = "0" />
<cfif Clinical_23 neq "0">
  <cfset CaseMix23 = "               " & Clinical_23 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Pulmonary") eq "-1" and 
(Case_Mix_List_1.indexOf("Pulmonary") neq "-1" or  
Case_Mix_List_2.indexOf("Pulmonary") neq "-1" or Case_Mix_List_3.indexOf("Pulmonary") neq "-1" 
or Case_Mix_List_4.indexOf("Pulmonary") neq "-1" or 
Case_Mix_List_5.indexOf("Pulmonary") neq "-1" or Case_Mix_List_6.indexOf("Pulmonary") neq "-1"  )>
  <cfset CaseMix23 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Pulmonary." />
  <cfelse>
  <cfset CaseMix23 = "0"	 />
</cfif>
<cfif CaseMix23.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix23 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix23>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																25. Find CaseMix25
********************************************************************************************************************************-->
<cfset CaseMix25 = "0" />
<cfif Clinical_25 neq "0">
  <cfset CaseMix25 = "               " & Clinical_25 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Skin 1") eq "-1" and 
(Case_Mix_List_1.indexOf("Skin 1") neq "-1" or  
Case_Mix_List_2.indexOf("Skin 1") neq "-1" or Case_Mix_List_3.indexOf("Skin 1") neq "-1" 
or Case_Mix_List_4.indexOf("Skin 1") neq "-1" or 
Case_Mix_List_5.indexOf("Skin 1") neq "-1" or Case_Mix_List_6.indexOf("Skin 1") neq "-1"  )>
  <cfset CaseMix25 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Skin 1." />
  <cfelse>
  <cfset CaseMix25 = "0"	 />
</cfif>
<cfif CaseMix25.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix25 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix25>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																26. Find CaseMix26
********************************************************************************************************************************-->
<cfset CaseMix26 = "0" />
<cfif Clinical_26 neq "0">
  <cfset CaseMix26 = "               " & Clinical_26 />
  <cfelseif Diagnosis_Case_Mix_Other.indexOf("Skin 1") neq "-1" and 
(Diagnosis_CaseMix_2 eq "Skin 1" and Link_Diagnosis_Severity_2 gte Link_Diagnosis_Severity_1) or 
(Diagnosis_CaseMix_3 eq "Skin 1" and Link_Diagnosis_Severity_3 gte Link_Diagnosis_Severity_1) or
(Diagnosis_CaseMix_4 eq "Skin 1" and Link_Diagnosis_Severity_4 gte Link_Diagnosis_Severity_1) or
(Diagnosis_CaseMix_5 eq "Skin 1" and Link_Diagnosis_Severity_5 gte Link_Diagnosis_Severity_1) or
(Diagnosis_CaseMix_6 eq "Skin 1" and Link_Diagnosis_Severity_6 gte Link_Diagnosis_Severity_1) >
  <cfset CaseMix03 = "ALERT: The severity of the Skin 1 diagnosis is equal or greater than the severity of the primary diagnosis. Changing Skin 1 to the primary diagnosis would increase your overall casemix." />
  <cfelse>
  <cfset CaseMix26 = "0"	 />
</cfif>
<cfif CaseMix26.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix26 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix26>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																27. Find CaseMix28
********************************************************************************************************************************-->
<cfset CaseMix28 = "0" />
<cfif Clinical_28 neq "0">
  <cfset CaseMix28 = "               " & Clinical_28 />
  <cfelseif Diagnosis_Case_Mix_All.indexOf("Skin 2") eq "-1" and 
(Case_Mix_List_1.indexOf("Skin 2") neq "-1" or  
Case_Mix_List_2.indexOf("Skin 2") neq "-1" or Case_Mix_List_3.indexOf("Skin 2") neq "-1" 
or Case_Mix_List_4.indexOf("Skin 2") neq "-1" or 
Case_Mix_List_5.indexOf("Skin 2") neq "-1" or Case_Mix_List_6.indexOf("Skin 2") neq "-1"  )>
  <cfset CaseMix28 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Skin 2." />
  <cfelse>
  <cfset CaseMix28 = "0"	 />
</cfif>
<cfif CaseMix28.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix28 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix28>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																28. Find CaseMix29
********************************************************************************************************************************-->
<cfset CaseMix29 = "0" />
<cfif Clinical_29 neq "0">
  <cfset CaseMix29 = "               " & Clinical_29  />
  <cfelseif (Equation_Calc eq "1" or Equation_Calc eq "2" or Equation_Calc eq "3") and Diagnosis_Case_Mix_All.indexOf("Trach") eq "-1" and 
(Case_Mix_List_1.indexOf("Trach") neq "-1" or  
Case_Mix_List_2.indexOf("Trach") neq "-1" or Case_Mix_List_3.indexOf("Trach") neq "-1" 
or Case_Mix_List_4.indexOf("Trach") neq "-1" or 
Case_Mix_List_5.indexOf("Trach") neq "-1" or Case_Mix_List_6.indexOf("Trach") neq "-1"  )>
  <cfset CaseMix29 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Tracheostomy." />
  <cfelse>
  <cfset CaseMix29 = "0"	 />
</cfif>
<cfif CaseMix29.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix29 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix29>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																29. Find CaseMix30
********************************************************************************************************************************-->
<cfset CaseMix30 = "0" />
<cfif Clinical_30 neq "0">
  <cfset CaseMix30 = "               " & Clinical_30  />
  <cfelseif  Diagnosis_Case_Mix_All.indexOf("Urost") eq "-1" and 
(Case_Mix_List_1.indexOf("Urost") neq "-1" or  
Case_Mix_List_2.indexOf("Urost") neq "-1" or Case_Mix_List_3.indexOf("Urost") neq "-1" 
or Case_Mix_List_4.indexOf("Urost") neq "-1" or 
Case_Mix_List_5.indexOf("Urost") neq "-1" or Case_Mix_List_6.indexOf("Urost") neq "-1"  )>
  <cfset CaseMix30 = "ALERT: A case mix wasn't selected but there are related case mix diagnoses for Urostomy." />
  <cfelse>
  <cfset CaseMix30 = "0"	 />
</cfif>
<cfif CaseMix30.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix30 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix30>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																30. Find CaseMix31
********************************************************************************************************************************-->
<cfset CaseMix31 = "0" />
<cfif Clinical_31 neq "0">
  <cfset CaseMix31 = "               " & Clinical_31  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and  
Eating_M0710.indexOf("5 -") neq "-1" and Therapies_Home_M0250.indexOf("1 -") eq "-1" and Therapies_Home_M0250.indexOf("2 -") eq "-1" and 
Therapies_Home_M0250 neq "">
  <cfset CaseMix31 = "ALERT: The patient receives no oral or enteral nutrition on M0710 Feeding/Eating but IV or TPN nutritional on M0250 Therapies is not checked." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  
Eating_M0710.indexOf("5 -") neq "-1" and Therapies_Home_M0250.indexOf("1 -") eq "-1" and Therapies_Home_M0250.indexOf("2 -") eq "-1" and 
Therapies_Home_M0250 neq "">
  <cfset CaseMix31 = "ALERT: The patient receives no oral or enteral nutrition on M1870 Feeding/Eating but IV or TPN nutritional on M1030 Therapies is not checked." />
  <cfelse>
  <cfset CaseMix31 = "Case Mix (31) 0"	 />
</cfif>
<cfif CaseMix31.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix31 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix31>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																31. Find CaseMix32
********************************************************************************************************************************-->
<cfset CaseMix32 = "0" />
<cfif Clinical_32 neq "0">
  <cfset CaseMix32 = "               " & Clinical_32  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and  Equation_Calc neq "3" and
(Eating_M0710.indexOf("3 -") neq "-1" or Eating_M0710.indexOf("4 -") neq "-1") and Therapies_Home_M0250.indexOf("3 -") eq "-1" and 
Therapies_Home_M0250 neq "">
  <cfset CaseMix32 = "ALERT: The patient receives enteral nutrition on M0710 Feeding/Eating but Enteral Nutrition on M0250 Therapies is not checked." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  Equation_Calc neq "3" and
(Eating_M0710.indexOf("3 -") neq "-1" or Eating_M0710.indexOf("4 -") neq "-1") and Therapies_Home_M0250.indexOf("3 -") eq "-1" and 
Therapies_Home_M0250 neq "">
  <cfset CaseMix32 = "ALERT: The patient receives enteral nutrition on M1870 Feeding/Eating but Enteral Nutrition on M1030 Therapies is not checked." />
  <cfelse>
  <cfset CaseMix32 = "Case Mix (31) 0"	 />
</cfif>
<cfif CaseMix32.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix32 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix32>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																32. Find CaseMix33
********************************************************************************************************************************-->
<cfset CaseMix33 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and  Vision_M0390.indexOf("0 -") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Blind") neq "-1" >
  <cfset CaseMix33 = "ALERT: The patient has a diagnosis indicating vision deficit but M0390 Vision is '0'." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  Vision_M0390.indexOf("0 -") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Blind")neq "-1" >
  <cfset CaseMix33 = "ALERT: The patient has a diagnosis indicating vision deficit but M1200 Vision is '0'." />
  <cfelse>
  <cfset CaseMix33 = "0"	 />
</cfif>
<cfif CaseMix33.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix33 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix33>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																33. Find CaseMix42
********************************************************************************************************************************-->
<cfset CaseMix42 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and  Breathing_M0490.indexOf("0 -") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Pulmonary")neq "-1" >
  <cfset CaseMix42 = "ALERT: The patient has a pulmonary diagnosis but M0420 SOB is '0'." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  Vision_M0390.indexOf("0 -") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Pulmonary")neq "-1" >
  <cfset CaseMix42 = "ALERT: The patient has a pulmonary diagnosis but M1400 SOB is '0'." />
  <cfelse>
  <cfset CaseMix42 = "0"	 />
</cfif>
<cfif CaseMix42.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix42 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix42>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																34. Find CaseMix43
********************************************************************************************************************************-->
<cfset CaseMix43 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and  Bowel_Incont_M0540.indexOf("0 -") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Gastro")neq "-1" >
  <cfset CaseMix43 = "ALERT: The patient has a gastrointestinal diagnosis but M0540 Bowel Incontinence is '0'." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  Bowel_Incont_M0540.indexOf("0 -") neq "-1" and Diagnosis_Case_Mix_All.indexOf("Gastro")neq "-1" >
  <cfset CaseMix43 = "ALERT: The patient has a gastrointestinal diagnosis but M1620 Bowel Incontinence is '0'." />
  <cfelse>
  <cfset CaseMix43 = "0"	 />
</cfif>
<cfif CaseMix43.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix43 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix43>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																35. Find CaseMix46
********************************************************************************************************************************-->
<cfset CaseMix46 = "0" />
<cfif Clinical_46 neq "0">
  <cfset CaseMix46 = "               " & Clinical_46  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and  Dress_Upper_M0650.indexOf("0") neq "-1" and Dress_Lower_M0660.indexOf("0") neq "-1" and 
Grooming_M0640.indexOf("0") eq "-1" and Grooming_M0640 neq "" and Bathing_M0670.indexOf("0") eq "-1" and Bathing_M0670 neq "" >
  <cfset CaseMix46 = "ALERT: M0650/M0660 Dressing deficits are 0 yet other fine motor functions (grooming and/or bathing) have deficits.  An answer of 1 or higher for either M0650 or 660 will increase your case mix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  Dress_Upper_M0650.indexOf("0") neq "-1" and Dress_Lower_M0660.indexOf("0") neq "-1" and 
Grooming_M0640.indexOf("0") eq "-1" and Grooming_M0640 neq "" and Bathing_M0670.indexOf("0") eq "-1" and Bathing_M0670 neq "" >
  <cfset CaseMix46 = "ALERT: M1810/M1820 Dressing deficits are 0 yet other fine motor functions (grooming and/or bathing) have deficits.  An answer of 1 or higher for either M1810 or 1820 will increase your case mix score." />
  <cfelse>
  <cfset CaseMix46 = "0"	 />
</cfif>
<cfif CaseMix46.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix46 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix46>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																36. Find CaseMix47
********************************************************************************************************************************-->
<cfset CaseMix47 = "0" />
<cfif Clinical_47 neq "0">
  <cfset CaseMix47 = "               " & Clinical_47  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and  
(Bathing_M0670.indexOf("0 -") neq "-1"  or Bathing_M0670.indexOf("1 -") neq "-1") and 
(Grooming_M0640.indexOf("2 -") eq "-1" or Grooming_M0640.indexOf("3 -") eq "-1" 
or Dress_Upper_M0650.indexOf("3 -") neq "-1" or Dress_Upper_M0650.indexOf("2 -") neq "-1" or
 Dress_Lower_M0660.indexOf("3 -") neq "-1" or Dress_Lower_M0660.indexOf("2 -") neq "-1") >
  <cfset CaseMix47 = "ALERT: M0670 Patient is semi-independent in bathing yet other fine motor functions (grooming, dressing upper and lower) have deficits.  An answer of 2 or higher will increase your case mix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  
(Bathing_M0670.indexOf("0 -") neq "-1"  or Bathing_M0670.indexOf("1 -") neq "-1") and 
(Grooming_M0640.indexOf("2 -") eq "-1" or Grooming_M0640.indexOf("3 -") eq "-1" 
or Dress_Upper_M0650.indexOf("3 -") neq "-1" or Dress_Upper_M0650.indexOf("2 -") neq "-1" or
 Dress_Lower_M0660.indexOf("3 -") neq "-1" or Dress_Lower_M0660.indexOf("2 -") neq "-1") >
  <cfset CaseMix47 = "ALERT: M1830 Patient is semi-independent in bathing yet other fine motor functions (grooming, dressing upper and lower) have deficits.  An answer of 2 or higher will increase your case mix score." />
  <cfelse>
  <cfset CaseMix47 = "0"	 />
</cfif>
<cfif CaseMix47.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix47 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix47>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																37. Find CaseMix48
********************************************************************************************************************************-->
<cfset CaseMix48 = "0" />
<cfif Clinical_48 neq "0">
  <cfset CaseMix48 = "               " & Clinical_48  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and   Equation_Calc eq "1" and
(Toileting_M0680.indexOf("0 -") neq "-1"  or Toileting_M0680.indexOf("1 -") neq "-1") and 
(Transferring_M0690.indexOf("2 -") neq "-1"  or Transferring_M0690.indexOf("3 -") neq "-1" or Transferring_M0690.indexOf("4 -") neq "-1" or Transferring_M0690.indexOf("5 -") neq "-1") and 
(Ambulation_M0700.indexOf("2 -") neq "-1"  or Ambulation_M0700.indexOf("3 -") neq "-1" or Ambulation_M0700.indexOf("4 -") neq "-1" or Ambulation_M0700.indexOf("5 -") neq "-1" or Ambulation_M0700.indexOf("6 -") neq "-1") >
  <cfset CaseMix48 = "ALERT: M0680 Patient is semi-independent in toileting yet other gross motor functions (transferring, ambulation) have deficits.  An answer of 2 or higher will increase your case mix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and   M1840_Toilet.indexOf("1 -") neq "-1"   and 
(Transferring_M0690.indexOf("2 -") neq "-1"  or Transferring_M0690.indexOf("3 -") neq "-1" or Transferring_M0690.indexOf("4 -") neq "-1" or Transferring_M0690.indexOf("5 -") neq "-1") and 
(Ambulation_M0700.indexOf("2 -") neq "-1"  or Ambulation_M0700.indexOf("3 -") neq "-1" or Ambulation_M0700.indexOf("4 -") neq "-1" or Ambulation_M0700.indexOf("5 -") neq "-1" or Ambulation_M0700.indexOf("6 -") neq "-1") >
  <cfset CaseMix48 = "ALERT: M1840 Patient is semi-independent in toileting yet other gross motor functions (transferring, ambulation) have deficits.  An answer of 2 or higher will increase your case mix score." />
  <cfelse>
  <cfset CaseMix48 = "0"	 />
</cfif>
<cfif CaseMix48.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix48 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix48>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																38. Find CaseMix49
********************************************************************************************************************************-->
<cfset CaseMix49 = "0" />
<cfif Clinical_49 neq "0">
  <cfset CaseMix49 = "               " & Clinical_49  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and   Equation_Calc eq "2" and
(Transferring_M0690.indexOf("0 -") neq "-1"  or Transferring_M0690.indexOf("1 -") neq "-1" ) and 
(Toileting_M0680.indexOf("2 -") neq "-1"  or Toileting_M0680.indexOf("3 -") neq "-1" or Toileting_M0680.indexOf("4 -") neq "-1" or
Ambulation_M0700.indexOf("2 -") neq "-1"  or Ambulation_M0700.indexOf("3 -") neq "-1" or Ambulation_M0700.indexOf("4 -") neq "-1" or Ambulation_M0700.indexOf("5 -") neq "-1" or Ambulation_M0700.indexOf("6 -") neq "-1") >
  <cfset CaseMix49 = "ALERT: M0680 Patient is semi-independent in toileting yet other gross motor functions (transferring, ambulation) have deficits.  An answer of 2 or higher will increase your case mix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and   Equation_Calc eq "2" and
(Transferring_M0690.indexOf("0 -") neq "-1"  or Transferring_M0690.indexOf("1 -") neq "-1" ) and 
(Toileting_M0680.indexOf("2 -") neq "-1"  or Toileting_M0680.indexOf("3 -") neq "-1" or Toileting_M0680.indexOf("4 -") neq "-1" or
Ambulation_M0700.indexOf("2 -") neq "-1"  or Ambulation_M0700.indexOf("3 -") neq "-1" or Ambulation_M0700.indexOf("4 -") neq "-1" or Ambulation_M0700.indexOf("5 -") neq "-1" or Ambulation_M0700.indexOf("6 -") neq "-1") >
  <cfset CaseMix49 = "ALERT: M1850 Patient is semi-independent in transferring yet other gross motor functions (toileting, ambulation) have deficits.  An answer of 2 or higher will increase your case mix score." />
  <cfelse>
  <cfset CaseMix49 = "0"	 />
</cfif>
<cfif CaseMix49.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix49 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix49>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																39. Find CaseMix50
********************************************************************************************************************************-->
<cfset CaseMix50 = "0" />
<cfif Clinical_50 neq "0">
  <cfset CaseMix50 = "               " & Clinical_50  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and   (Equation_Calc eq "1" or Equation_Calc eq "3") and
(Ambulation_M0700.indexOf("0 -") neq "-1"  ) and 
(Toileting_M0680.indexOf("2") neq "-1"  or Toileting_M0680.indexOf("3") neq "-1" or Toileting_M0680.indexOf("4") neq "-1" or
Transferring_M0690.indexOf("2") neq "-1"  or Transferring_M0690.indexOf("3") neq "-1" or Transferring_M0690.indexOf("4") neq "-1" 
or Transferring_M0690.indexOf("5") neq "-1")>
  <cfset CaseMix50 = "ALERT: M0700 Patient is independent in ambulation yet other gross motor functions (toileting/transferring) require assistance.  An answer of 1 or 2 will increase your case mix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and   (Equation_Calc eq "1" or Equation_Calc eq "3") and
(Ambulation_M0700.indexOf("0 -") neq "-1"  ) and 
(Toileting_M0680.indexOf("2") neq "-1"  or Toileting_M0680.indexOf("3") neq "-1" or Toileting_M0680.indexOf("4") neq "-1" or
Transferring_M0690.indexOf("2") neq "-1"  or Transferring_M0690.indexOf("3") neq "-1" or Transferring_M0690.indexOf("4") neq "-1"  
or Transferring_M0690.indexOf("5") neq "-1")>
  <cfset CaseMix50 = "ALERT: M1860 Patient is independent in ambulation yet other gross motor functions (toileting/transferring) require assistance.  An answer of 1 or 2 will increase your case mix score." />
  <cfelse>
  <cfset CaseMix50 = "0"	 />
</cfif>
<cfif CaseMix50.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix50 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix50>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																40. Find CaseMix51
********************************************************************************************************************************-->
<cfset CaseMix51 = "0" />
<cfif Clinical_51 neq "0">
  <cfset CaseMix51 = "               " & Clinical_51  />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Ambulation_M0700.indexOf("0 -") neq "-1"  or Ambulation_M0700.indexOf("1 -") neq "-1"  or Ambulation_M0700.indexOf("2 -") neq "-1" ) and 
(Toileting_M0680.indexOf("3") neq "-1"  or Toileting_M0680.indexOf("4") neq "-1" or Toileting_M0680.indexOf("4") neq "-1" or Transferring_M0690.indexOf("3") neq "-1" or Transferring_M0690.indexOf("4") neq "-1"  or Transferring_M0690.indexOf("5") neq "-1") >
  <cfset CaseMix51 = "ALERT: M0700 Patient is semi-independent in ambulation yet other gross motor functions (toileting/transferring) require assistance. An answer of 3 or higher will increase your case mix score." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Ambulation_M0700.indexOf("0 -") neq "-1"  or Ambulation_M0700.indexOf("1 -") neq "-1"  or Ambulation_M0700.indexOf("2 -") neq "-1" ) and 
(Toileting_M0680.indexOf("3") neq "-1"  or Toileting_M0680.indexOf("4") neq "-1" or Toileting_M0680.indexOf("4") neq "-1" or Transferring_M0690.indexOf("3") neq "-1" or Transferring_M0690.indexOf("4") neq "-1"   or Transferring_M0690.indexOf("5") neq "-1") >
  <cfset CaseMix51 = "ALERT: M1860 Patient is semi-independent in ambulation yet other gross motor functions (toileting/transferring) require assistance. An answer of 3 or higher will increase your case mix score." />
  <cfelse>
  <cfset CaseMix51 = "0"	 />
</cfif>
<cfif CaseMix51.indexOf("ALERT") neq "-1" >
  <cfif Case_Mix_Compilation eq "">
    <cfset Case_Mix_Compilation = CaseMix51 />
    <cfelse>
    <cfset Case_Mix_Compilation = Case_Mix_Compilation & "<br/><br/>" &CaseMix51>
  </cfif>
  <cfset gNum = gNum + 1 />
</cfif>
<cfif Case_Mix_Compilation eq "">
  <cfset Case_Mix_Compilation = "There are NO case mix alerts." />
</cfif>
<!--**************************************************************************************************************************
												Create Message COMPARE Consistency
********************************************************************************************************************************-->
<cfset Message_COMPARE ="" />
<cfif  M0104_Date_of_Referral neq "" and Start_of_Care_M0030 neq "">
  <cfif DateDiff("d", Start_of_Care_M0030, M0104_Date_of_Referral) gt 2 >
    <cfset Message_COMPARE = Message_COMPARE & "<br/><br/>" & "ALERT (M0104): Assessment was completed more than 48 hours after referral" >
  </cfif>
</cfif>
<cfif  M1240_Pain_Assess.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE & "<br/><br/>" & "ALERT (M1240): Patient was not assessed for pain" >
</cfif>
<cfif  M1300_Pressure.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE & "<br/><br/>" & "ALERT (M1300): Patient was not assessed for pressure ulcer risk" >
</cfif>
<cfif  M1730_Depression.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE & "<br/><br/>" & "ALERT (M1730): Patient was not assessed for depression" >
</cfif>
<cfif  M1910_Fall_Risk.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE & "<br/><br/>" & "ALERT (M1910): Patient was not assessed for fall-risk" >
</cfif>
<cfif  M2010_Med_Edu.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE & "<br/><br/>" & "ALERT (M2010): Patient has high-risk medications but teaching was not performed" >
</cfif>
<cfif  M2250b_Diabetic.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE & "<br/><br/>" & "ALERT (M2250b): Patient has diabetes but diabetic education including foot care is not included in the careplan" >
</cfif>
<cfif  M2250e_Pain.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE &"<br/><br/>"& "ALERT (M2250b): Patient has pain but pain intervention is not included in the careplan" >
</cfif>
<cfif  M2250f_PressUlc.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE &"<br/><br/>"& "ALERT (M2250f): Patient has pressure ulcers but preventive care is not included in the careplan" >
</cfif>
<cfif  M2250g_PressUlcMoist.indexOf("0 - ") neq "-1">
  <cfset Message_COMPARE = Message_COMPARE &"<br/><br/>"& "ALERT (M2250g): Patient has pressure ulcers but moist wound treatment is not included in the careplan" >
</cfif>
<cfif Message_COMPARE eq "">
  <cfset Message_COMPARE = "All Homecare COMPARE questions are answered for maximum outcomes." />
</cfif>
<!--**************************************************************************************************************************
												Create Message Dx Consistency Assessment
********************************************************************************************************************************-->
<cfset Message_Dx_Consistency ="" />
<!--**************************************************************************************************************************
																1. Find Error_M1020
********************************************************************************************************************************-->
<cfset Error_M1020 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and  (Severity_2 gte Severity_1) or (Severity_3 gte Severity_1) or (Severity_4 gte Severity_1) 
or (Severity_5 gte Severity_1) or (Severity_6 gte Severity_1) >
  <cfset Error_M1020 = "ALERT (M0230): One or more M0240 diagnoses has a severity level greater than the primary diagnosis. Revise so that the most unstable problem is the primary diagnosis." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Severity_2 gte Severity_1) or (Severity_3 gte Severity_1) or (Severity_4 gte Severity_1) 
or (Severity_5 gte Severity_1) or (Severity_6 gte Severity_1) >
  <cfset Error_M1020 = "ALERT (M1022): One or more M1022 diagnoses has a severity level greater than the primary diagnosis. Revise so that the most unstable problem is the primary diagnosis." />
  <cfelse>
  <cfset Error_M1020 = ""	 />
</cfif>
<cfif Error_M1020.indexOf("ALERT") neq "-1" >
  <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/>" & Error_M1020>
  <cfset gNum = gNum + 1 />
</cfif>
<!--**************************************************************************************************************************
																2. Find Error_M1030_2
********************************************************************************************************************************-->
<cfset Error_M1030_2 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 Eating_M0710.indexOf("5 -") neq "-1" and (Therapies_Home_M0250.indexOf("1 -") eq "-1" or Therapies_Home_M0250.indexOf("2 -") eq "-1") and 
Therapies_Home_M0250 neq "">
  <cfset Error_M1030_2 = "ALERT M0250/710: Patient unable to receive oral or tube feedings on M0710 Feeding/Eating but no IV or TPN therapy documented on M0250 Therapies. Provide an explanation or update the answer to M0250 or M0710." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 Eating_M0710.indexOf("5 -") neq "-1" and (Therapies_Home_M0250.indexOf("1 -") eq "-1" or Therapies_Home_M0250.indexOf("2 -") eq "-1") and 
Therapies_Home_M0250 neq "">
  <cfset Error_M1030_2 = "ALERT M1030/1870: Patient receiving oral or tube feedings on M1870 Feeding/Eating and also receiving IV or TPN therapy (M1030 Therapies). Provide an explanation or update the answer to M1030 or M1870." />
  <cfelse>
  <cfset Error_M1030_2 = ""	 />
</cfif>
<cfif Error_M1030_2.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1030_2 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1030_2>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																3. Find Error_M1020_3
********************************************************************************************************************************-->
<cfset Error_M1030_3 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 (Eating_M0710.indexOf("3 -") neq "-1" or Eating_M0710.indexOf("4 -") neq "-1") and Therapies_Home_M0250.indexOf("3") eq "-1" >
  <cfset Error_M1030_3 = "ALERT M0250/710: Nasogastric feeding documented on M0710 Feeding/Eating but not on M0250 Therapies. Provide an explanation or update the answer to M0250 or M0710." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 (Eating_M0710.indexOf("3 -") eq "-1" or Eating_M0710.indexOf("4 -") eq "-1") and  Eating_M0710 neq "" and 
 Therapies_Home_M0250.indexOf("3") neq "-1" >
  <cfset Error_M1030_3 = "ALERT M0250/710: Nasogastric feeding documented on M0250 Therapies but not on M0710 Feeding/Eating. Provide an explanation or update the answer to M0250 or M0710." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 (Eating_M0710.indexOf("3 -") neq "-1" or Eating_M0710.indexOf("4 -") neq "-1") and Therapies_Home_M0250.indexOf("3") eq "-1" >
  <cfset Error_M1030_3 = "ALERT M1030/1870: Nasogastric feeding documented on M1870 Feeding/Eating but not on M1030 Therapies. Provide an explanation or update the answer to M1030 or M1870." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 (Eating_M0710.indexOf("3 -") eq "-1" or Eating_M0710.indexOf("4 -") eq "-1") and  Eating_M0710 neq "" and 
 Therapies_Home_M0250.indexOf("3") neq "-1" >
  <cfset Error_M1030_3 = "ALERT M1030/1870: Nasogastric feeding documented on M1030 Therapies but not on M1870 Feeding/Eating. Provide an explanation or update the answer to M1030 or M1870." />
  <cfelse>
  <cfset Error_M1030_3 = ""	 />
</cfif>
<cfif Error_M1030_3.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1030_3 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1030_3>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																4. Find Error_M1032_1
********************************************************************************************************************************-->
<cfset Error_M1032_1 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 M1032_Frailty.indexOf("1 -") neq "-1" and DX_Problem_All.indexOf("cognition") eq "-1">
  <cfset Error_M1032_1 = "ALERT (M1032): Recent decline in mental status reported on M1032 but no related diagnosis. Document why there is a recent mental decline but there is no related diagnosis." />
  <cfelse>
  <cfset Error_M1032_1 = ""	 />
</cfif>
<cfif Error_M1032_1.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1032_1 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1032_1>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																5. Find Error_M1032_O1
********************************************************************************************************************************-->
<cfset Error_M1032_O1 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 M1032_Frailty.indexOf("3") neq "-1" and M1910_Fall_Risk.indexOf("0") neq "-1">
  <cfset Error_M1032_O1 = "ALERT (M1032): History of falls reported on M1032 but no Fall Risk Assessment performed (M1910). Document why no Fall Risk Assessment was performed when the patient has a history of falls." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 M1032_Frailty.indexOf("3") neq "-1" and M1910_Fall_Risk.indexOf("1") neq "-1">
  <cfset Error_M1032_O1 = "ALERT (M1032): History of falls reported on M1032 but Fall Risk Assessment (M1910) indicates no risk for falls. Document why, with a history of falls, patient is not at risk for falls." />
  <cfelse>
  <cfset Error_M1032_O1 = ""	 />
</cfif>
<cfif Error_M1032_O1.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1032_O1 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1032_O1>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																6. Find Error_M1034_O
********************************************************************************************************************************-->
<cfset Error_M1034_O = "0" />
<cfset ADLs_Independent = "" />
<cfif Grooming_M0640.indexOf("0") neq "-1" or 
Dress_Upper_M0650.indexOf("0") neq "-1" or 
Dress_Lower_M0660.indexOf("0") neq "-1" or 
Bathing_M0670.indexOf("0") neq "-1" or 
Toileting_M0680.indexOf("0") neq "-1" or 
Transferring_M0690.indexOf("0") neq "-1" or 
Ambulation_M0700.indexOf("0") neq "-1" or 
Eating_M0710.indexOf("0") neq "-1" or 
Meal_Prep_M0720.indexOf("0") neq "-1" or 
(M1840_Toilet.indexOf("0") neq "-1"  and M1840_Toilet neq "")or 
(M1845_Toilet.indexOf("0") neq "-1"  and M1845_Toilet neq "")
>
  <cfset ADLs_Independent = "Yes" />
  <cfelse>
  <cfset ADLs_Independent = "No" />
</cfif>
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
(Rehab_Prognosis_M0270.indexOf("2") neq "-1" or Rehab_Prognosis_M0270.indexOf("3") neq "-1") and  ADLs_Independent eq "Yes" >
  <cfset Error_M1034_O = "ALERT (M1034): Serious progressive condition(s) reported on M1034 but patient is independent in one or more ADLs 1800-1880. Document why prognosis is poor, yet patient has no deficit in one or more ADLs." />
  <cfelse>
  <cfset Error_M1034_O = ""	 />
</cfif>
<cfif Error_M1034_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1034_O />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1034_O>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																7. Find Error_M0280
********************************************************************************************************************************-->
<cfset Error_M0280 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
Life_Exp_M0280.indexOf("1") neq "-1" and  Current_Payment_Sources_M0150.indexOf("Medicare") neq "-1" >
  <cfset Error_M0280 = "ALERT (M0280): A life expectancy of 6 months or fewer suggests the patient may be a candidate for hospice care and not home health. Document why patient is a candidate for home health and not hospice." />
  <cfelse>
  <cfset Error_M0280 = ""	 />
</cfif>
<cfif Error_M0280.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M0280 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M0280>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																8. Find Error_M1036_3
********************************************************************************************************************************-->
<cfset Error_M1036_3 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 High_Risk_Factors_M0290.indexOf("3") neq "-1" and DX_Pathway_All.indexOf("Alcoh") eq "-1">
  <cfset Error_M1036_3 = "ALERT (M0290): Patient has alcohol dependency yet no diagnosis for alcohol dependency is listed." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 High_Risk_Factors_M0290.indexOf("3") neq "-1" and DX_Pathway_All.indexOf("Alcoh") eq "-1">
  <cfset Error_M1036_3 = "ALERT (M1036): Patient has alcohol dependency yet no diagnosis for alcohol dependency is listed." />
  <cfelse>
  <cfset Error_M1036_3 = ""	 />
</cfif>
<cfif Error_M1036_3.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1036_3 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1036_3>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																9. Find Error_M1036_2
********************************************************************************************************************************-->
<cfset Error_M1036_2 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 High_Risk_Factors_M0290.indexOf("2 -") neq "-1" and DX_Problem_All.indexOf("Obes") eq "-1">
  <cfset Error_M1036_2 = "ALERT (M0290): Patient is obese yet no diagnosis for obesity is listed." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 High_Risk_Factors_M0290.indexOf("2 -") neq "-1" and DX_Problem_All.indexOf("Obes") eq "-1">
  <cfset Error_M1036_2 = "ALERT (M1036): Patient is obese yet no diagnosis for obesity is listed." />
  <cfelse>
  <cfset Error_M1036_2 = ""	 />
</cfif>
<cfif Error_M1036_2.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1036_2 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1036_2>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																10. Find Error_M1200
********************************************************************************************************************************-->
<cfset Error_M1200 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 DX_Problem_All.indexOf("Vision") neq "-1" and Vision_M0390.indexOf("0") neq "-1">
  <cfset Error_M1200 = "ALERT (M0390): Unstable diagnosis that affects vision but no vision deficit recorded. 
Document why the related diagnosis is unstable but there is no effect on vision (M0390)." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 DX_Problem_All.indexOf("Vision") neq "-1" and Vision_M0390.indexOf("0") neq "-1">
  <cfset Error_M1200 = "ALERT (M1200): Unstable diagnosis that affects vision but no vision deficit recorded. 
Document why the related diagnosis is unstable but there is no effect on vision (M1200)." />
  <cfelse>
  <cfset Error_M1200 = ""	 />
</cfif>
<cfif Error_M1200.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1200 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1200>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																11. Find Error_M1200_O
********************************************************************************************************************************-->
<cfset Error_M1200_O = "0" />
<cfif Vision_M0390.indexOf("2") neq "-1" and (Grooming_M0640.indexOf("0") neq "-1" or 
Dress_Upper_M0650.indexOf("0") neq "-1" or 
Dress_Lower_M0660.indexOf("0") neq "-1" or 
Bathing_M0670.indexOf("0") neq "-1" or 
Toileting_M0680.indexOf("0") neq "-1" or 
Transferring_M0690.indexOf("0") neq "-1" or 
Ambulation_M0700.indexOf("0") neq "-1" or 
Eating_M0710.indexOf("0") neq "-1" or 
Meal_Prep_M0720.indexOf("0") neq "-1" or Use_Phone_M0770.indexOf("0") neq "-1") >
  <cfset Error_M1200_O = "ALERT Vision/ADL: Significant vision deficit recorded but patient has no limitations in one or more ADLs/IADLs. Document why the vision deficit has no effect on ADLs." />
  <cfelse>
  <cfset Error_M1200_O = "" />
</cfif>
<cfif Error_M1200_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1200_O />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1200_O>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																12. Find Error_M1210
********************************************************************************************************************************-->
<cfset Error_M1210 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 DX_Problem_All.indexOf("hearing") neq "-1" and Hearing_M0400.indexOf("0") neq "-1">
  <cfset Error_M1210 = "ALERT (M0400): Unstable diagnosis that affects hearing but no hearing deficit recorded. Document why the related diagnosis is unstable but there is no effect on hearing (M0400)." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 DX_Problem_All.indexOf("hearing") neq "-1" and Hearing_M0400.indexOf("0") neq "-1">
  <cfset Error_M1210 = "ALERT (M1200): Unstable diagnosis that affects hearing but no hearing deficit recorded. Document why the related diagnosis is unstable but there is no effect on hearing (M1200)." />
  <cfelse>
  <cfset Error_M1210 = ""	 />
</cfif>
<cfif Error_M1210.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1210 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1210>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																13. Find Error_M1210_O
********************************************************************************************************************************-->
<cfset Error_M1210_O = "0" />
<cfif Hearing_M0400.indexOf("0") eq "-1" and Hearing_M0400.indexOf("1") eq "-1"  and Hearing_M0400 neq "" 
and Use_Phone_M0770.indexOf("0") neq "-1">
  <cfset Error_M1210_O = "ALERT Hearing/Telephone Use: Significant hearing deficit recorded but patient has no limitations in telephone use. Document why the hearing deficit has no effect on telephone use." />
  <cfelse>
  <cfset Error_M1210_O = ""	 />
</cfif>
<cfif Error_M1210_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1210_O />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1210_O>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																14. Find Error_M1220
********************************************************************************************************************************-->
<cfset Error_M1220 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and DX_Problem_All.indexOf("cognition") eq "-1"
and M1220_Verbal_Under.indexOf("0") eq "-1" and M1220_Verbal_Under neq "">
  <cfset Error_M1220 = "ALERT (M1220): Difficulty understanding verbal content but no unstable related diagnosis recorded. Since patient has a cognition deficit add a related diagnosis." />
  <cfelse>
  <cfset Error_M1220 = ""	 />
</cfif>
<cfif Error_M1220.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1220 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1220>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																15. Find Error_M1230
********************************************************************************************************************************-->
<cfset Error_M1230 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 DX_Pathway_All.indexOf("can't talk") neq "-1" and Speech_M0410.indexOf("0") neq "-1">
  <cfset Error_M1230 = "ALERT (M0410): Unstable diagnosis that affects speech but no speech deficit recorded. Document why the related diagnosis is unstable but there is no effect on speech (M0410)." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 DX_Pathway_All.indexOf("can't talk") neq "-1" and Speech_M0410.indexOf("0") neq "-1">
  <cfset Error_M1230 = "ALERT (M1230): Unstable diagnosis that affects speech but no speech deficit recorded. Document why the related diagnosis is unstable but there is no effect on speech (M1230)." />
  <cfelse>
  <cfset Error_M1230 = ""	 />
</cfif>
<cfif Error_M1230.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1230 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1230>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																16. Find Error_M1230_O
********************************************************************************************************************************-->
<cfset Error_M1230_O = "0" />
<cfif Speech_M0410.indexOf("0") eq "-1" and Speech_M0410.indexOf("1") eq "-1"  and Speech_M0410 neq "" 
and Use_Phone_M0770.indexOf("0") neq "-1">
  <cfset Error_M1230_O = "ALERT Speech/Telephone Use: Significant speech deficit recorded but patient has no limitations in telephone use.  Document why the speech deficit has no effect on telephone use." />
  <cfelse>
  <cfset Error_M1230_O = ""	 />
</cfif>
<cfif Error_M1230_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1230_O />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1230_O>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																17. Find Error_M1242_O1
********************************************************************************************************************************-->
<cfset Error_M1242_O1 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 Freq_of_Pain_M0420.indexOf("0") neq "-1" and Conditions_Prior_M0220.indexOf("3") neq "-1">
  <cfset Error_M1242_O1 = "ALERT (M0420): Intractable Pain was reported on M0220 - Prior Conditions yet the patient is now free of pain. Document why the patient is now free of pain." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") and
 Freq_of_Pain_M0420.indexOf("0") neq "-1" and Conditions_Prior_M0220.indexOf("3") neq "-1">
  <cfset Error_M1242_O1 = "ALERT (M1242): Intractable Pain was reported on M1018 - Prior Conditions yet the patient is now free of pain. Document why the patient is now free of pain." />
  <cfelse>
  <cfset Error_M1242_O1 = ""	 />
</cfif>
<cfif Error_M1242_O1.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1242_O1 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1242_O1>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																18. Find Error_M1242_O
********************************************************************************************************************************-->
<cfset Error_M1242_O = "0" />
<cfif (Freq_of_Pain_M0420.indexOf("3") neq "-1" or Freq_of_Pain_M0420.indexOf("4") neq "-1") and
(Grooming_M0640.indexOf("0") neq "-1" or 
Dress_Upper_M0650.indexOf("0") neq "-1" or 
Dress_Lower_M0660.indexOf("0") neq "-1" or 
Bathing_M0670.indexOf("0") neq "-1" or 
Toileting_M0680.indexOf("0") neq "-1" or 
Transferring_M0690.indexOf("0") neq "-1" or 
Ambulation_M0700.indexOf("0") neq "-1" or 
Meal_Prep_M0720.indexOf("0") neq "-1" ) >
  <cfset Error_M1242_O = "ALERT Pain/ADL: Significant pain recorded but patient has no limitations in one or more ADLs/IADLs. Document why the patient's pain has no effect on some ADLs." />
  <cfelse>
  <cfset Error_M1242_O = "" />
</cfif>
<cfif Error_M1242_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1242_O />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1242_O>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																19. Find Error_M1242_O2
********************************************************************************************************************************-->
<cfset Error_M1242_O2 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") 
and M1240_Pain_Assess.indexOf("0") neq "-1" and (Freq_of_Pain_M0420.indexOf("4") neq "-1" or Freq_of_Pain_M0420.indexOf("3") neq "-1")>
  <cfset Error_M1242_O2 = "ALERT (M1242): Significant pain recorded on M1242 yet no pain assessment (M1240) performed. Document why no pain assessment was performed." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") 
and M1240_Pain_Assess.indexOf("1") neq "-1" and Freq_of_Pain_M0420.indexOf("4") neq "-1" >
  <cfset Error_M1242_O2 = "ALERT (M1242): Significant pain recorded on M1242 yet the pain assessment (M1240) indicates pain is not severe. Document a reason for the inconsistency." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") 
and M1240_Pain_Assess.indexOf("2") neq "-1" and (Freq_of_Pain_M0420.indexOf("0") neq "-1" or Freq_of_Pain_M0420.indexOf("1") neq "-1" 
or Freq_of_Pain_M0420.indexOf("2") neq "-1" )>
  <cfset Error_M1242_O2 = "ALERT (M1240): The pain assessment indicates severe pain yet M1242 indicates pain is not severe. Document a reason for the inconsistency." />
  <cfelse>
  <cfset Error_M1242_O2 = ""	 />
</cfif>
<cfif Error_M1242_O2.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1242_O2 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1242_O2>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																20. Find Error_M1302
********************************************************************************************************************************-->
<cfset Error_M1302 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Problem_All.indexof("integumentary") neq "-1" and
Open_Wounds_M0440.indexOf("0") neq "-1" >
  <cfset Error_M1302 = "ALERT (M0440): Unstable diagnosis that indicates wounds and/or ulcers but patient is free of wounds and ulcers. Document why the related diagnosis is unstable but there are no wounds." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Problem_All.indexof("integumentary") eq "-1" and 
(Surgical_Wound_Status_M0488.indexOf("1") neq "-1" OR 
Stasis_Ulcer_Status_M0476.indexOf("1") neq "-1" OR 
Pressure_Ulcer_Status_M0464.indexOf("1") neq "-1" OR 
Surgical_Wound_Status_M0488.indexOf("2") neq "-1" OR 
Stasis_Ulcer_Status_M0476.indexOf("2") neq "-1" OR 
Pressure_Ulcer_Status_M0464.indexOf("2") neq "-1" OR 
Surgical_Wound_Status_M0488.indexOf("3") neq "-1" OR 
Stasis_Ulcer_Status_M0476.indexOf("3") neq "-1" OR 
Pressure_Ulcer_Status_M0464.indexOf("3") neq "-1") >
  <cfset Error_M1302 = "ALERT (M0440): Wounds recorded but no related unstable diagnosis. Since patient has a wound add a related diagnosis." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Problem_All.indexof("integumentary") eq "-1" and 
(Surgical_Wound_Status_M0488.indexOf("1") neq "-1" OR 
Stasis_Ulcer_Status_M0476.indexOf("1") neq "-1" OR 
Pressure_Ulcer_Status_M0464.indexOf("1") neq "-1" OR 
Surgical_Wound_Status_M0488.indexOf("2") neq "-1" OR 
Stasis_Ulcer_Status_M0476.indexOf("2") neq "-1" OR 
Pressure_Ulcer_Status_M0464.indexOf("2") neq "-1" OR 
Surgical_Wound_Status_M0488.indexOf("3") neq "-1" OR 
Stasis_Ulcer_Status_M0476.indexOf("3") neq "-1" OR 
Pressure_Ulcer_Status_M0464.indexOf("3") neq "-1") >
  <cfset Error_M1302 = "ALERT (M1020): Wounds recorded but no related unstable diagnosis. Since patient has a wound add a related diagnosis." />
  <cfelse>
  <cfset Error_M1302 = ""	 />
</cfif>
<cfif Error_M1302.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1302 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1302>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																21. Find Error_M1302_O
********************************************************************************************************************************-->
<cfset Error_M1302_O = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(Assessment_Reason_M0100.indexOf("1") neq "-1" or Assessment_Reason_M0100.indexOf("3") neq "-1") 
and M1302_Pressure.indexOf("0") neq "-1" and (Pressure_Ulcer_Stage_M0460.indexOf("NA") eq "-1" and Pressure_Ulcer_Stage_M0460 neq "")>
  <cfset Error_M1302_O = "ALERT (M1302): Patient has pressure ulcers yet M1302 Risk for Pressure Ulcers is marked 'No'. Document the explanation for this inconsistency." />
  <cfelse>
  <cfset Error_M1302_O = ""	 />
</cfif>
<cfif Error_M1302_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1302_O />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1302_O>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																22. Find Error_M1400
********************************************************************************************************************************-->
<cfset Error_M1400 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and 
(DX_Pathway_All.indexOf("heart") neq "-1" or DX_Pathway_All.indexOf("lung") neq "-1") and Breathing_M0490.indexOf("0 -") neq "-1">
  <cfset Error_M1400 = "ALERT (M0490): Unstable diagnosis that causes SOB but patient is free of SOB. Document why diagnosis with SOB is unstable yet patient is free of SOB." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and 
(DX_Pathway_All.indexOf("heart") neq "-1" or DX_Pathway_All.indexOf("lung") neq "-1") and Breathing_M0490.indexOf("0 -") neq "-1">
  <cfset Error_M1400 = "ALERT (M1400): Unstable diagnosis that causes SOB but patient is free of SOB. Document why diagnosis with SOB is unstable yet patient is free of SOB." />
  <cfelse>
  <cfset Error_M1400 = ""	 />
</cfif>
<cfif Error_M1400.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1400 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1400>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																23. Find Error_M1400_O
********************************************************************************************************************************-->
<cfset Error_M1400_O = "0" />
<cfif (Breathing_M0490.indexOf("0") eq "-1" and Breathing_M0490.indexOf("1") eq "-1" and Breathing_M0490 neq "") and
(Grooming_M0640.indexOf("0") neq "-1" or 
Dress_Upper_M0650.indexOf("0") neq "-1" or 
Dress_Lower_M0660.indexOf("0") neq "-1" or 
Bathing_M0670.indexOf("0") neq "-1" or 
Toileting_M0680.indexOf("0") neq "-1" or 
Transferring_M0690.indexOf("0") neq "-1" or 
Ambulation_M0700.indexOf("0") neq "-1" or 
Meal_Prep_M0720.indexOf("0") neq "-1" ) >
  <cfset Error_M1400_O = "ALERT SOB/ADL: Significant SOB recorded but patient has no limitations in one or more ADLs/IADLs. Document why the SOB has no effect on some ADLs." />
  <cfelse>
  <cfset Error_M1400_O = "" />
</cfif>
<cfif Error_M1400_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1400_O  />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1400_O >
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																24. Find Error_M1410_O
********************************************************************************************************************************-->
<cfset Error_M1410_O = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and Breathing_M0490.indexOf("0") eq "-1" and Breathing_M0490.indexOf("1") eq "-1"
and Breathing_M0490 neq "" and Resp_Treatments_M0500.indexOf("4") neq "-1">
  <cfset Error_M1410_O = "ALERT (M0500): Patient has significant SOB but is receiving no respiratory treatments. Document why patient receives no respiratory treatments yet has significant SOB." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and Breathing_M0490.indexOf("0") eq "-1" and Breathing_M0490.indexOf("1") eq "-1"
and Breathing_M0490 neq "" and Resp_Treatments_M0500.indexOf("4") neq "-1">
  <cfset Error_M1410_O = "ALERT (M1410): Patient has significant SOB but is receiving no respiratory treatments. Document why patient receives no respiratory treatments yet has significant SOB." />
  <cfelse>
  <cfset Error_M1410_O = ""	 />
</cfif>
<cfif Error_M1410_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1410_O />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1410_O>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																25. Find Error_M1410
********************************************************************************************************************************-->
<cfset Error_M1410 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and (Diagnoses_All.indexOf("599.0") neq "-1" or Diagnoses_All.indexOf("V13.02") neq "-1") and UTI_M0510.indexOf("0") neq "-1" and UTI_M0510 neq "">
  <cfset Error_M1410 = "ALERT (M0510): Unstable diagnosis that indicates UTI but no UTI reported. Document why UTI diagnosis is unstable yet patient is free of UTI." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and (Diagnoses_All.indexOf("599.0") eq "-1" or Diagnoses_All.indexOf("V13.02") eq "-1") and UTI_M0510.indexOf("0") eq "-1" and UTI_M0510 neq "">
  <cfset Error_M1410 = "ALERT (M0510): UTI recorded but no related diagnosis. Since patient has a history of UTI which is a risk factor for re-hospitalization, add a related diagnosis." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and (Diagnoses_All.indexOf("599.0") neq "-1" or Diagnoses_All.indexOf("V13.02") neq "-1") and UTI_M0510.indexOf("0") neq "-1" and UTI_M0510 neq "">
  <cfset Error_M1410 = "ALERT (M1600): Unstable diagnosis that indicates UTI but no UTI reported. Document why UTI diagnosis is unstable yet patient is free of UTI." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and (Diagnoses_All.indexOf("599.0") eq "-1" or Diagnoses_All.indexOf("V13.02") eq "-1") and UTI_M0510.indexOf("0") eq "-1" and UTI_M0510 neq "">
  <cfset Error_M1410 = "ALERT (M1600): UTI recorded but no related diagnosis. Since patient has a history of UTI which is a risk factor for re-hospitalization, add a related diagnosis." />
  <cfelse>
  <cfset Error_M1410 = ""	 />
</cfif>
<cfif Error_M1410.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1410 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1410>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																26. Find Error_M1610
********************************************************************************************************************************-->
<cfset Error_M1610 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Pathway_All.indexOf("genitourinary") eq "-1" and 
(Urinary_INcont_M0520.indexOf("1") neq "-1" or Urinary_INcont_M0520.indexOf("2") neq "-1" )>
  <cfset Error_M1610 = "ALERT (M0520): Urinary incontinence or catheter recorded but no related unstable diagnosis. Since patient has a urinary issue which is a risk factor for re-hospitalization, add a related diagnosis." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Pathway_All.indexOf("genitourinary") eq "-1" and 
(Urinary_INcont_M0520.indexOf("1") neq "-1" or Urinary_INcont_M0520.indexOf("2") neq "-1" )>
  <cfset Error_M1610 = "ALERT (M1610): Urinary incontinence or catheter recorded but no related unstable diagnosis. Since patient has a urinary issue which is a risk factor for re-hospitalization, add a related diagnosis." />
  <cfelse>
  <cfset Error_M1610 = ""	 />
</cfif>
<cfif Error_M1610.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1610 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1610>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																27. Find Error_M1620
********************************************************************************************************************************-->
<cfset Error_M1620 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Pathway_All.indexOf("gastric") eq "-1" and 
Bowel_Incont_M0540.indexOf("0") eq "-1" and Bowel_Incont_M0540 neq "" >
  <cfset Error_M1620 = "ALERT (M0540): Bowel incontinence recorded but no related unstable diagnosis. Since patient has bowel incontinence, add a related diagnosis." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Pathway_All.indexOf("gastric") eq "-1" and 
Bowel_Incont_M0540.indexOf("0") eq "-1" and Bowel_Incont_M0540 neq "" >
  <cfset Error_M1620 = "ALERT (M1620): Bowel incontinence recorded but no related unstable diagnosis. Since patient has bowel incontinence add a related diagnosis." />
  <cfelse>
  <cfset Error_M1620 = ""	 />
</cfif>
<cfif Error_M1620.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1620 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1620>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																28. Find Error_M1700
********************************************************************************************************************************-->
<cfset Error_M1700 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Problem_All.indexOf("behav") eq "-1" and 
Cog_Function_M0560.indexOf("0") eq "-1" and Cog_Function_M0560 neq "" >
  <cfset Error_M1700 = "ALERT (M0560): Cognitive deficits recorded but no unstable related diagnosis. A psychiatric case mix diagnosis indicating cognitive deficits could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Problem_All.indexOf("behav") eq "-1" and 
Cog_Function_M0560.indexOf("0") eq "-1" and Cog_Function_M0560 neq "" >
  <cfset Error_M1700 = "ALERT (M1700): Cognitive deficits recorded but no unstable related diagnosis. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1700 = ""	 />
</cfif>
<cfif Error_M1700.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1700 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1700>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																29. Find Error_M1700_O
********************************************************************************************************************************-->
<cfset Error_M1700_O = "0" />
<cfif (Cog_Function_M0560.indexOf("3") neq "-1" or Cog_Function_M0560.indexOf("4") neq "-1" ) and
(Grooming_M0640.indexOf("0") neq "-1" or 
Dress_Upper_M0650.indexOf("0") neq "-1" or 
Dress_Lower_M0660.indexOf("0") neq "-1" or 
Bathing_M0670.indexOf("0") neq "-1" or 
Toileting_M0680.indexOf("0") neq "-1" or 
Transferring_M0690.indexOf("0") neq "-1" or 
Ambulation_M0700.indexOf("0") neq "-1" or 
Eating_M0710.indexOf("0") neq "-1" or 
Meal_Prep_M0720.indexOf("0") neq "-1" or
Use_Phone_M0770.indexOf("0") neq "-1" or
Inject_Meds_M0800.indexOf("0") neq "-1" or
Oral_Meds_M0780.indexOf("0") neq "-1" 
) >
  <cfset Error_M1700_O = "ALERT Cognition/ADL: Significant cognitive deficits recorded but patient is independent in one or more ADLs/IADLs. Document why the cognition deficit has no effect on some ADLs." />
  <cfelse>
  <cfset Error_M1700_O = "" />
</cfif>
<cfif Error_M1700_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1700_O  />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1700_O >
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																30. Find Error_M1710
********************************************************************************************************************************-->
<cfset Error_M1710 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Problem_All.indexOf("behav") eq "-1" and 
When_Confused_M0570.indexOf("0") eq "-1" and When_Confused_M0570 neq "" >
  <cfset Error_M1710 = "ALERT (M0570): Confusion recorded but no unstable related diagnosis.  A psychiatric case mix diagnosis indicating confusion could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Problem_All.indexOf("behav") eq "-1" and 
When_Confused_M0570.indexOf("0") eq "-1" and When_Confused_M0570 neq "" >
  <cfset Error_M1710 = "ALERT (M1710): Confusion recorded but no unstable related diagnosis. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1710 = ""	 />
</cfif>
<cfif Error_M1710.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1710 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1710>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																31. Find Error_M1710_O
********************************************************************************************************************************-->
<cfset Error_M1710_O = "0" />
<cfif (When_Confused_M0570.indexOf("3") neq "-1" or Cog_Function_M0560.indexOf("4") neq "-1" or Cog_Function_M0560.indexOf("NA -") neq "-1") and
(Grooming_M0640.indexOf("0") neq "-1" or 
Dress_Upper_M0650.indexOf("0") neq "-1" or 
Dress_Lower_M0660.indexOf("0") neq "-1" or 
Bathing_M0670.indexOf("0") neq "-1" or 
Toileting_M0680.indexOf("0") neq "-1" or 
Transferring_M0690.indexOf("0") neq "-1" or 
Ambulation_M0700.indexOf("0") neq "-1" or 
Eating_M0710.indexOf("0") neq "-1" or 
Meal_Prep_M0720.indexOf("0") neq "-1" or
Use_Phone_M0770.indexOf("0") neq "-1" or
Inject_Meds_M0800.indexOf("0") neq "-1" or
Oral_Meds_M0780.indexOf("0") neq "-1" 
) >
  <cfset Error_M1710_O = "ALERT Confusion/ADL: Significant confusion recorded but patient is independent in one or more ADLs/IADLs. Document why the confusion has no effect on some ADLs." />
  <cfelse>
  <cfset Error_M1710_O = "" />
</cfif>
<cfif Error_M1710_O.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1710_O  />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1710_O >
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																32. Find Error_M1720
********************************************************************************************************************************-->
<cfset Error_M1720 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Pathway_All.indexOf("super") eq "-1" and 
When_Anxious_M0580.indexOf("0") eq "-1" and When_Anxious_M0580 neq "" >
  <cfset Error_M1720 = "ALERT (M0580): Anxiety recorded but no related unstable diagnosis. A psychiatric case mix diagnosis indicating anxiety could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Pathway_All.indexOf("super") eq "-1" and 
When_Anxious_M0580.indexOf("0") eq "-1" and When_Anxious_M0580 neq "" >
  <cfset Error_M1720 = "ALERT (M1720): Anxiety recorded but no related unstable diagnosis. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1720 = ""	 />
</cfif>
<cfif Error_M1720.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1720 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1720>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																33. Find Error_M1590
********************************************************************************************************************************-->
<cfset Error_M1590 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Pathway_All.indexOf("crazy") eq "-1" and 
Depressive_Feelings_M0590.indexOf("6") eq "-1" and Depressive_Feelings_M0590 neq "" >
  <cfset Error_M1590 = "ALERT (M0590): Depressive feelings recorded but no related unstable diagnosis. Since patient has depression, add a related diagnosis." />
  <cfelse>
  <cfset Error_M1590 = ""	 />
</cfif>
<cfif Error_M1590.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1590 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1590>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																34. Find Error_M1730
********************************************************************************************************************************-->
<cfset Error_M1730 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Problem_All.indexOf("behav") neq "-1" and Assessment_Reason_M0100.indexOf("1") neq "-1"
and M1730_Depression.indexOf("0") neq "-1" >
  <cfset Error_M1730 = "ALERT (M1730): Unstable mental diagnosis recorded yet no depression screening performed. Document the rationale for not performing a depression screening when the patient has a related diagnosis." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Problem_All.indexOf("behav") eq "-1" and Assessment_Reason_M0100.indexOf("1") neq "-1"
and M1730a.indexOf("0") eq "-1" and M1730a neq "">
  <cfset Error_M1730 ="ALERT (M1730): patient demonstrates signs of depression yet there is no related diagnosis. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1730 = ""	 />
</cfif>
<cfif Error_M1730.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1730 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1730>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																35. Find Error_M1740
********************************************************************************************************************************-->
<cfset Error_M1740 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and DX_Problem_All.indexOf("behav") eq "-1" 
and Patient_Behav_Weekly_M0610.indexOf("7") eq "-1" and Patient_Behav_Weekly_M0610 neq "" >
  <cfset Error_M1740 = "ALERT (M0610): Behavioral issues recorded but no related unstable diagnosis. A psychiatric case mix diagnosis indicating behavioral issues could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and DX_Problem_All.indexOf("behav") eq "-1" 
and Patient_Behav_Weekly_M0610.indexOf("7") eq "-1" and Patient_Behav_Weekly_M0610 neq "" >
  <cfset Error_M1740 ="ALERT (M1740): Behavioral issues recorded but no related unstable diagnosis. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1740 = ""	 />
</cfif>
<cfif Error_M1740.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1740 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" &Error_M1740>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																36. Find Error_M1800
********************************************************************************************************************************-->
<cfset Error_M1800 = "0" />
<cfif DX_Pathway_All.indexOf("crazy") neq "-1" or DX_Pathway_All.indexOf("recover") neq "-1" OR DX_Pathway_All.indexOf("lung") neq "-1" 
OR DX_Pathway_All.indexOf("heart") neq "-1" OR DX_Pathway_All.indexOf("brain") neq "-1" OR DX_Pathway_All.indexOf("ADL") neq "-1">
  <cfset ADL_Deficit = "Yes" />
  <cfelse>
  <cfset ADL_Deficit = "No" />
</cfif>
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Grooming_M0640.indexOf("0") neq "-1" >
  <cfset Error_M1800 = "ALERT (M0640): Unstable diagnosis that affects endurance/motor control but patient is independent in grooming. Document why the diagnosis is unstable but there is no effect on fine motor function needed for grooming (M0640)." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Grooming_M0640.indexOf("0") eq "-1" 
and Grooming_M0640 neq "">
  <cfset Error_M1800 = "ALERT (M0640): Grooming deficit but no related unstable diagnosis that affects fine motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Grooming_M0640.indexOf("0") neq "-1" >
  <cfset Error_M1800 = "ALERT (M1800): Unstable diagnosis that affects endurance/motor control but patient is independent in grooming. Document why the diagnosis is unstable but there is no effect on fine motor function needed for grooming (M0640)." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Grooming_M0640.indexOf("0") eq "-1" 
and Grooming_M0640 neq "">
  <cfset Error_M1800 = "ALERT (M1800): Grooming deficit but no related unstable diagnosis that affects fine motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1800 = ""	 />
</cfif>
<cfif Error_M1800.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1800 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1800>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																37. Find Error_M1810
********************************************************************************************************************************-->
<cfset Error_M1810 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Dress_Upper_M0650.indexOf("0") neq "-1" >
  <cfset Error_M1810 = "ALERT (M0650): Unstable diagnosis that affects endurance/motor control but patient is independent in upper body dressing. Document why the diagnosis is unstable but there is no effect on fine motor function needed for upper body dressing." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Dress_Upper_M0650.indexOf("0") eq "-1" 
and Dress_Upper_M0650 neq "">
  <cfset Error_M1810 = "ALERT (M0650): Upper body dressing deficit but no related unstable diagnosis that affects motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Dress_Upper_M0650.indexOf("0") neq "-1" >
  <cfset Error_M1810 = "ALERT (M1810): Unstable diagnosis that affects endurance/motor control but patient is independent in upper body dressing. Document why the diagnosis is unstable but there is no effect on fine motor function needed for upper body dressing." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Dress_Upper_M0650.indexOf("0") eq "-1" 
and Dress_Upper_M0650 neq "">
  <cfset Error_M1810 = "ALERT (M1810): Upper body dressing deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1810 = ""	 />
</cfif>
<cfif Error_M1810.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1810 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1810>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																38. Find Error_M1820
********************************************************************************************************************************-->
<cfset Error_M1820 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Dress_Lower_M0660.indexOf("0") neq "-1" >
  <cfset Error_M1820 = "ALERT (M0660): Unstable diagnosis that affects endurance/motor control but patient is independent in lower body dressing. Document why the diagnosis is unstable but there is no effect on fine motor function needed for upper body dressing." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Dress_Lower_M0660.indexOf("0") eq "-1" 
and Dress_Lower_M0660 neq "">
  <cfset Error_M1820 = "ALERT (M0660): Lower body dressing deficit but no related unstable diagnosis that affects motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Dress_Lower_M0660.indexOf("0") neq "-1" >
  <cfset Error_M1820 = "ALERT (M1820): Unstable diagnosis that affects endurance/motor control but patient is independent in lower body dressing. Document why the diagnosis is unstable but there is no effect on fine motor function needed for upper body dressing." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Dress_Lower_M0660.indexOf("0") eq "-1" 
and Dress_Lower_M0660 neq "">
  <cfset Error_M1820 = "ALERT (M1820): Lower body dressing deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1820 = ""	 />
</cfif>
<cfif Error_M1820.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1820 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1820>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																39. Find Error_M1830
********************************************************************************************************************************-->
<cfset Error_M1830 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Bathing_M0670.indexOf("0") neq "-1" >
  <cfset Error_M1830 = "ALERT (M0670): Unstable diagnosis that affects endurance/motor control but patient is independent in bathing. Document why the diagnosis is unstable but there is no effect on fine motor function needed for bathing." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Bathing_M0670.indexOf("0") eq "-1" 
and Bathing_M0670 neq "">
  <cfset Error_M1830 = "ALERT (M0670): Bathing deficit but no related unstable diagnosis that affects motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Bathing_M0670.indexOf("0") neq "-1" >
  <cfset Error_M1830 = "ALERT (M1830): Unstable diagnosis that affects endurance/motor control but patient is independent in bathing. Document why the diagnosis is unstable but there is no effect on fine motor function needed for bathing." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Bathing_M0670.indexOf("0") eq "-1" 
and Bathing_M0670 neq "">
  <cfset Error_M1830 = "ALERT (M1830): Bathing deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1830 = ""	 />
</cfif>
<cfif Error_M1830.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1830 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1830>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																40. Find Error_M1840
********************************************************************************************************************************-->
<cfset Error_M1840 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and M1840_Toilet.indexOf("0") neq "-1" >
  <cfset Error_M1840 = "ALERT (M1840): Unstable diagnosis that affects endurance/motor control but patient is independent in toilet transferring. Document why the diagnosis is unstable but there is no effect on fine motor function needed for toilet transferring." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and M1840_Toilet.indexOf("0") eq "-1" 
and Bathing_M0670 neq "">
  <cfset Error_M1840 = "ALERT (M1840): Toilet transferring deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1840 = ""	 />
</cfif>
<cfif Error_M1840.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1840 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1840>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																41. Find Error_M1845
********************************************************************************************************************************-->
<cfset Error_M1845 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and M1845_Toilet.indexOf("0") neq "-1" >
  <cfset Error_M1845 = "ALERT (M1845): Unstable diagnosis that affects endurance/motor control but patient is independent in toileting hygiene. Document why the diagnosis is unstable but there is no effect on fine motor function needed for toileting hygiene." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and M1845_Toilet.indexOf("0") eq "-1" 
and M1845_Toilet neq "">
  <cfset Error_M1845 = "ALERT (M1845): Toileting hygiene deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1845 = ""	 />
</cfif>
<cfif Error_M1845.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1845 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1845>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																42. Find Error_M0680
********************************************************************************************************************************-->
<cfset Error_M0680 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Toileting_M0680.indexOf("0") neq "-1" >
  <cfset Error_M0680 = "ALERT (M0680): Unstable diagnosis that affects endurance/motor control but patient is independent in toileting. Document why the diagnosis is unstable but there is no effect on gross motor function needed for toileting." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Toileting_M0680.indexOf("0") eq "-1" 
and Toileting_M0680 neq "">
  <cfset Error_M0680 = "ALERT (M0680): Toileting deficit but no related unstable diagnosis that affects motor control. Since patient has a gross motor deficit add a related diagnosis." />
  <cfelse>
  <cfset Error_M0680 = ""	 />
</cfif>
<cfif Error_M0680.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M0680 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M0680>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																43. Find Error_M1850
********************************************************************************************************************************-->
<cfset Error_M1850 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Transferring_M0690.indexOf("0") neq "-1" >
  <cfset Error_M1850 = "ALERT (M0690): Unstable diagnosis that affects endurance/motor control but patient is independent in transferring. Document why the diagnosis is unstable but there is no effect on gross motor function needed for transferring." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Transferring_M0690.indexOf("0") eq "-1" 
and Transferring_M0690 neq "">
  <cfset Error_M1850 = "ALERT (M0690): Transferring deficit but no related unstable diagnosis that affects motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Transferring_M0690.indexOf("0") neq "-1" >
  <cfset Error_M1850 = "ALERT (M1850): Unstable diagnosis that affects endurance/motor control but patient is independent in transferring. Document why the diagnosis is unstable but there is no effect on gross motor function needed for transferring." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Transferring_M0690.indexOf("0") eq "-1" 
and Transferring_M0690 neq "">
  <cfset Error_M1850 = "ALERT (M1850): Transferring deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1850 = ""	 />
</cfif>
<cfif Error_M1850.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1850 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1850>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																44. Find Error_M1860
********************************************************************************************************************************-->
<cfset Error_M1860 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Ambulation_M0700.indexOf("0") neq "-1" >
  <cfset Error_M1860 = "ALERT (M0700): Unstable diagnosis that affects endurance/motor control but patient is independent in ambulation. Document why the diagnosis is unstable but there is no effect on gross motor function needed for ambulation." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Ambulation_M0700.indexOf("0") eq "-1" 
and Ambulation_M0700 neq "">
  <cfset Error_M1860 = "ALERT (M0690): Ambulation deficit but no related unstable diagnosis that affects motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Ambulation_M0700.indexOf("0") neq "-1" >
  <cfset Error_M1860 = "ALERT (M1860): Unstable diagnosis that affects endurance/motor control but patient is independent in ambulation. Document why the diagnosis is unstable but there is no effect on gross motor function needed for ambulation." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Ambulation_M0700.indexOf("0") eq "-1" 
and Ambulation_M0700 neq "">
  <cfset Error_M1860 = "ALERT (M1860): Ambulation deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1860 = ""	 />
</cfif>
<cfif Error_M1860.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1860 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1860>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																45. Find Error_M1870
********************************************************************************************************************************-->
<cfset Error_M1870 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Eating_M0710.indexOf("0") neq "-1" >
  <cfset Error_M1870 = "ALERT (M0710): Unstable diagnosis that affects endurance/motor control but patient is independent in feeding/eating. Document why the diagnosis is unstable but there is no effect on fine motor function needed for feeding/eating." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Eating_M0710.indexOf("0") eq "-1" 
and Eating_M0710 neq "">
  <cfset Error_M1870 = "ALERT (M0710): Feeding/eating deficit but no related unstable diagnosis that affects fine motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Eating_M0710.indexOf("0") neq "-1" >
  <cfset Error_M1870 = "ALERT (M1870): Unstable diagnosis that affects endurance/motor control but patient is independent in feeding/eating. Document why the diagnosis is unstable but there is no effect on fine motor function needed for feeding/eating." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Eating_M0710.indexOf("0") eq "-1" 
and Eating_M0710 neq "">
  <cfset Error_M1870 = "ALERT (M1870): Feeding/eating deficit but no related unstable diagnosis that affects fine motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1870 = ""	 />
</cfif>
<cfif Error_M1870.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1870 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1870>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																46. Find Error_M1880
********************************************************************************************************************************-->
<cfset Error_M1880 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit eq "Yes" and Meal_Prep_M0720.indexOf("0") neq "-1" >
  <cfset Error_M1880 = "ALERT (M0720): Unstable diagnosis that affects endurance/motor control but patient is independent in meal preparation. Document why the diagnosis is unstable but there is no effect on fine motor function needed for meal preparation." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and ADL_Deficit neq "Yes" and Meal_Prep_M0720.indexOf("0") eq "-1" 
and Meal_Prep_M0720 neq "">
  <cfset Error_M1880 = "ALERT (M0720): Meal preparation deficit but no related unstable diagnosis that affects motor control. An orthopedic case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit eq "Yes" and Meal_Prep_M0720.indexOf("0") neq "-1" >
  <cfset Error_M1880 = "ALERT (M1880): Unstable diagnosis that affects endurance/motor control but patient is independent in meal preparation. Document why the diagnosis is unstable but there is no effect on fine motor function needed for meal preparation." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and ADL_Deficit neq "Yes" and Meal_Prep_M0720.indexOf("0") eq "-1" 
and Meal_Prep_M0720 neq "">
  <cfset Error_M1880 = "ALERT (M1880): Meal preparation deficit but no related unstable diagnosis that affects motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1880 = ""	 />
</cfif>
<cfif Error_M1880.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1880 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1880>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																47. Find Error_M1890
********************************************************************************************************************************-->
<cfset Error_M1890 = "0" />
<cfif DX_Problem_All.indexOf("cogni") neq "-1" or DX_Pathway_All.indexOf("won't recover") neq "-1" or DX_Pathway_All.indexOf("brain") neq "-1">
  <cfset IADL_Deficit = "Yes"  />
  <cfelse>
  <cfset IADL_Deficit = "No"  />
</cfif>
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and IADL_Deficit eq "Yes" and Use_Phone_M0770.indexOf("0") neq "-1" >
  <cfset Error_M1890 = "ALERT (M0770): Unstable diagnosis that affects fine motor control but patient is independent in telephone use. Document why the diagnosis is unstable but there is no effect on fine motor function needed for telephone." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and IADL_Deficit neq "Yes" and Use_Phone_M0770.indexOf("0") eq "-1" 
and Use_Phone_M0770 neq "">
  <cfset Error_M1890 = "ALERT (M0770): Telephone use deficit but no related unstable diagnosis that affects fine motor control. An orthopedic or neuro case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and IADL_Deficit eq "Yes" and Use_Phone_M0770.indexOf("0") neq "-1" >
  <cfset Error_M1890 = "ALERT (M1890): Unstable diagnosis that affects endurance/motor control but patient is independent in telephone use. Document why the diagnosis is unstable but there is no effect on fine motor function needed for telephone use." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and IADL_Deficit neq "Yes" and Use_Phone_M0770.indexOf("0") eq "-1" 
and Use_Phone_M0770 neq "">
  <cfset Error_M1890 = "ALERT (M1890): Telephone use deficit but no related unstable diagnosis that affects fine motor control. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M1890 = ""	 />
</cfif>
<cfif Error_M1890.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M1890 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M1890>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																48. Find Error_M2020
********************************************************************************************************************************-->
<cfset Error_M2020 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and IADL_Deficit eq "Yes" and Oral_Meds_M0780.indexOf("0") neq "-1" >
  <cfset Error_M2020 = "ALERT (M0780): Unstable diagnosis that affects cognition but patient is independent in oral medication management. Document why the patient is dependent in medication management." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and IADL_Deficit neq "Yes" and (Oral_Meds_M0780.indexOf("1 -") neq "-1" or
Oral_Meds_M0780.indexOf("2 -") neq "-1" )>
  <cfset Error_M2020 = "ALERT (M0780): Oral medication management deficit but no related unstable diagnosis that affects cognition. A psych or neuro case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and IADL_Deficit eq "Yes" and Oral_Meds_M0780.indexOf("0") neq "-1" >
  <cfset Error_M2020 = "ALERT (M2020): Unstable diagnosis that affects cognition but patient is independent in oral medication management. Document why the diagnosis is unstable but there is no effect on cognition needed for oral medication management." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and IADL_Deficit neq "Yes" and (Oral_Meds_M0780.indexOf("1 -") neq "-1" or
Oral_Meds_M0780.indexOf("2 -") neq "-1" )>
  <cfset Error_M2020 = "ALERT (M2020): Oral medication management deficit but no related unstable diagnosis that affects cognition. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M2020 = ""	 />
</cfif>
<cfif Error_M2020.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2020 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2020>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																49. Find Error_M2030
********************************************************************************************************************************-->
<cfset Error_M2030 = "0" />
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and IADL_Deficit eq "Yes" and Inject_Meds_M0800.indexOf("0") neq "-1" >
  <cfset Error_M2030 = "ALERT (M0800): Unstable diagnosis that affects cognition but patient is independent in injectable medication management. Document why the diagnosis is unstable but there is no effect on cognition needed for injectable medication management." />
  <cfelseif OASIS_Version_Code_1.indexOf("B") neq "-1" and IADL_Deficit neq "Yes" and (Inject_Meds_M0800.indexOf("1 -") neq "-1" or
Inject_Meds_M0800.indexOf("2 -") neq "-1" )>
  <cfset Error_M2030 = "ALERT (M0800): Injectable medication management deficit but no related unstable diagnosis that affects cognition. A psych or neuro case mix diagnosis could increase your reimbursement." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and IADL_Deficit eq "Yes" and Inject_Meds_M0800.indexOf("0") neq "-1" >
  <cfset Error_M2030 = "ALERT (M2030): Unstable diagnosis that affects cognition but patient is independent in injectable medication management. Document why the diagnosis is unstable but there is no effect on cognition needed for injectable medication management." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and IADL_Deficit neq "Yes" and (Inject_Meds_M0800.indexOf("1 -") neq "-1" or
Inject_Meds_M0800.indexOf("2 -") neq "-1" )>
  <cfset Error_M2030 = "ALERT (M2030): Injectable medication management deficit but no related unstable diagnosis that affects cognition. Re-evaluate the diagnosis list." />
  <cfelse>
  <cfset Error_M2030 = ""	 />
</cfif>
<cfif Error_M2030.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2030 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2030>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																50. Find Error_M2200
********************************************************************************************************************************-->
<cfset Error_M2200 = "0" />
<cfset ADLs_Some_Dependent = "" />
<cfif (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1") and 
Grooming_M0640.indexOf("0") neq "-1" or 
Dress_Upper_M0650.indexOf("0") neq "-1" or 
Dress_Lower_M0660.indexOf("0") neq "-1" or 
Bathing_M0670.indexOf("0") neq "-1" or 
Toileting_M0680.indexOf("0") neq "-1" or 
Transferring_M0690.indexOf("0") neq "-1" or 
Ambulation_M0700.indexOf("0") neq "-1" or 
Eating_M0710.indexOf("0") neq "-1" or 
Meal_Prep_M0720.indexOf("0") neq "-1" or 
(M1840_Toilet.indexOf("0") eq "-1"  and M1840_Toilet eq "")or 
(M1845_Toilet.indexOf("0") eq "-1"  and M1845_Toilet eq "")
>
  <cfset ADLs_Some_Dependent = "Yes" />
  <cfelse>
  <cfset ADLs_Some_Dependent = "No" />
</cfif>
<cfif OASIS_Version_Code_1.indexOf("B") neq "-1" and (M0370_Freq_Prm_Asstance.indexOf("4") neq "-1" or 
M0370_Freq_Prm_Asstance.indexOf("5") neq "-1" or M0370_Freq_Prm_Asstance.indexOf("6") neq "-1"  ) and ADLs_Some_Dependent eq "Yes" and 
M0826_Ther_Need eq "0">
  <cfset Error_M2200 = "ALERT (M0826): Patient does not have daily help, has ADL deficits, and has no therapy ordered. Document why the patient is not receiving therapy." />
  <cfelseif OASIS_Version_Code_1.indexOf("C") neq "-1" and (M1100_Living_Situation.indexof("04") neq "-1" or 
M1100_Living_Situation.indexof("05") neq "-1" or M1100_Living_Situation.indexof("09") neq "-1" or M1100_Living_Situation.indexof("10") neq "-1" or 
M1100_Living_Situation.indexof("14") neq "-1" or M1100_Living_Situation.indexof("15") neq "-1" )
and ADLs_Some_Dependent eq "Yes" and M0826_Ther_Need eq "0">
  <cfset Error_M2200 = "ALERT (M2200): Patient does not have daily help, has ADL deficits, and has no therapy ordered. Document why the patient is not receiving therapy." />
  <cfelse>
  <cfset Error_M2200 = ""	 />
</cfif>
<cfif Error_M2200.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2200 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2200>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																51. Find Error_M2250b
********************************************************************************************************************************-->
<cfset Error_M2250b = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1")
and DX_Pathway_All.indexof("diabetes") neq "-1" and M2250b_Diabetic.indexOf("1") eq "-1" and M2250b_Diabetic neq "" >
  <cfset Error_M2250b = "ALERT (M2250b): Patient has diabetes yet diabetic foot care is omitted from the plan of care. Document the explanation for omitting diabetic foot care when the patient has diabetes." />
  <cfelse>
  <cfset Error_M2250b = ""	 />
</cfif>
<cfif Error_M2250b.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2250b />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2250b>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																52. Find Error_M2250c
********************************************************************************************************************************-->
<cfset Error_M2250c = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1")
and (M1100_Living_Situation.indexof("04") neq "-1" or 
M1100_Living_Situation.indexof("05") neq "-1" or M1100_Living_Situation.indexof("09") neq "-1" or M1100_Living_Situation.indexof("10") neq "-1" or 
M1100_Living_Situation.indexof("14") neq "-1" or M1100_Living_Situation.indexof("15") neq "-1" )
and ADLs_Some_Dependent eq "Yes" and M2250c_FallsPrev.indexOf("1") eq "-1" and M2250c_FallsPrev neq "-1">
  <cfset Error_M2250c = "ALERT (M2250c): Patient does not have daily help and has ADL deficits yet falls prevention interventions are omitted from the plan of care. Document the explanation for omitting falls prevention interventions when the patient is at risk for falls." />
  <cfelse>
  <cfset Error_M2250c = ""	 />
</cfif>
<cfif Error_M2250c.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2250c />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2250c>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																53. Find Error_M2250c_0
********************************************************************************************************************************-->
<cfset Error_M2250c_0 = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1")
and M1032_Frailty.indexOf("3") neq "-1" and (M2250c_FallsPrev.indexOf("0") neq "-1" or M2250c_FallsPrev.indexOf("NA") neq "-1") >
  <cfset Error_M2250c_0 = "ALERT (M2250): History of falls reported on M1032 but no careplan for fall risk will be included. Document why, with a history of falls, a fall risk careplan will not be included." />
  <cfelse>
  <cfset Error_M2250c_0 = ""	 />
</cfif>
<cfif Error_M2250c_0.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2250c_0 />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2250c_0>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																54. Find Error_M2250d
********************************************************************************************************************************-->
<cfset Error_M2250d = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1")
and DX_Pathway_All.indexOf("crazy") neq "-1" and (M2250d_Depress.indexOf("0") neq "-1" or M2250d_Depress.indexOf("NA") neq "-1") >
  <cfset Error_M2250d = "ALERT (M2250d): Patient has a mental disorder diagnosis or has depressive symptoms (M1730)  yet depression intervention is omitted from the plan of care. Document the explanation for omitting depression intervention when the patient has depression." />
  <cfelse>
  <cfset Error_M2250d = ""	 />
</cfif>
<cfif Error_M2250d.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2250d />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2250d>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																55. Find Error_M2250e
********************************************************************************************************************************-->
<cfset Error_M2250e = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1")
and (Freq_of_Pain_M0420.indexOf("3") neq "-1" or Freq_of_Pain_M0420.indexOf("4") neq "-1") and 
M2250e_Pain.indexOf("1") eq "-1" and M2250e_Pain  neq "" >
  <cfset Error_M2250e = "ALERT (M2250e): Patient has pain yet pain intervention is omitted from the plan of care. Document the explanation for omitting pain intervention when the patient has pain." />
  <cfelse>
  <cfset Error_M2250e = ""	 />
</cfif>
<cfif Error_M2250e.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2250e />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2250e>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																56. Find Error_M2250f
********************************************************************************************************************************-->
<cfset Error_M2250f = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1")
and Pressure_Ulcer_Stage_M0460.indexOf("NA") eq "-1" and Pressure_Ulcer_Stage_M0460  neq "" 
and M2250f_PressUlc.indexOf("1") eq "-1" and M2250f_PressUlc  neq "" >
  <cfset Error_M2250f = "ALERT (M2250f): Patient has pressure ulcers yet pressure ulcer intervention is omitted from the plan of care. Document the explanation for omitting pressure ulcer intervention when the patient has pressure ulcers." />
  <cfelse>
  <cfset Error_M2250f = ""	 />
</cfif>
<cfif Error_M2250f.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2250f />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2250f>
  </cfif>
</cfif>
<!--**************************************************************************************************************************
																57. Find Error_M2250g
********************************************************************************************************************************-->
<cfset Error_M2250g = "0" />
<cfif OASIS_Version_Code_1.indexOf("C") neq "-1" and  (Assessment_Reason_M0100.indexof("1") neq "-1" or Assessment_Reason_M0100.indexof("3") neq "-1")
and M1302_Pressure.indexOf("1") neq "-1" 
and M2250g_PressUlcMoist.indexOf("1") eq "-1" and M2250g_PressUlcMoist  neq "" >
  <cfset Error_M2250g = "ALERT (M2250g): Patient has pressure ulcers at Stage II or higher yet moist wound healing (indicated for partial-full thickness loss) is omitted from the plan of care. Document the explanation for omitting moist wound healing when it is indicated." />
  <cfelse>
  <cfset Error_M2250g = ""	 />
</cfif>
<cfif Error_M2250g.indexOf("ALERT") neq "-1" >
  <cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = Error_M2250g />
    <cfelse>
    <cfset Message_Dx_Consistency = Message_Dx_Consistency & "<br/><br/>" & Error_M2250g>
  </cfif>
</cfif>

<cfif Message_Dx_Consistency eq "">
    <cfset Message_Dx_Consistency = "There are NO diagnosis consistency alerts."  />
</cfif>



<cfdocument format="pdf" orientation="portrait" overwrite="yes">
<cfdocumentsection>
  <cfdocumentitem type="header"  evalatprint="true">
  <cfif (cfdocument.currentpagenumber neq 1) is 0>
    <cfelse>
		<table cellpadding="0" cellspacing="0" border="0" width="100%">
			<tr>
				<td height="15px"></td>
			</tr>
			<tr>
				<td style="padding-left:10px; font-family: Arial; font-size: 18px; font-weight: bold;font-style: italic;">
					<cfoutput>#First_Name_M0040# #Last_Name_M0040#</cfoutput>
				</td>
			</tr>
		</table>
  </cfif>
  </cfdocumentitem>

<table border="0" align="center" cellpadding="0" cellspacing="0" width="100%">
<tr>
	<td valign="top" style="padding-top:10px;height:80px;">
		<table cellpadding="0" cellspacing="0" border="0" width="100%">
			<tr>
				<td align="left" width="50%">
					<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td style="padding-left:10px; font-family: Arial; font-size: 23px; font-weight: bold;font-style: italic;">
							<cfoutput>#First_Name_M0040# #Last_Name_M0040#</cfoutput>
						</td>
					</tr>
					<tr>
						<td height="5px"></td>
					</tr>
					<tr>
						<td style="padding-left:60px; font-family: Arial; font-size: 23px; font-weight: bold;font-style: italic;"> 
							Coding Expert 
						</td>
					</tr>
					</table>
				</td>
				<td align="right" width="50%">
					<table cellpadding="0" cellspacing="0" border="0" width="100%">
						<tr>
						  	<td align="right" style="font-family: Arial;font-size: 12px; font-weight: bold; font-style: italic;"> Assessment </td>
						  	<td style="font-family: Verdana;font-size: 12px;">
						  		<cfoutput>#Assessment_Reason_M0100#</cfoutput> 
							</td>
						</tr>
						<tr>
						  <td height="3px"></td>
						</tr>
						<tr>
						  	<td align="right" style="font-family: Arial;font-size: 12px; font-weight: bold; font-style: italic;"> SOC Date </td>
						  	<td style="font-family: Verdana;font-size: 12px;">
								<cfoutput>#DateFormat(Start_of_Care_M0030, "mm/dd/yyyy")#</cfoutput> 
							</td>
						</tr>
						<tr>
							<td height="3px"></td>
						</tr>
						<tr>
						  <td align="right" style="font-family: Arial; font-size: 12px;font-weight: bold; font-style: italic"> Certification </td>
						  <td style="font-family: Verdana; font-size: 12px;">
						  <cfoutput>#DateFormat(Certification_Start, "mm/dd/yyyy")#</cfoutput>     
						  <b><i><font  style="font-family: Arial; font-size: 12px;font-weight: bold; font-style: italic">to</font></i></b> 
						       
						  <cfoutput>#DateFormat(Certification_End, "mm/dd/yyyy")#</cfoutput> 
						  </td>
						</tr>
				  </table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td height="30px"></td>
</tr>
<tr>
	<td valign="top">
		<table cellpadding="0" style="font-family: Verdana; font-size: 14px;" align="center" cellspacing="0" border="0" width="90%">
			<tr>
				<td>DIAGNOSES RECORDED ON M1021/3 </td>
			</tr>
			<tr>
				<td height="10px"></td>
			</tr>
			<tr>
				<td valign="top" > 
					<cfif Short_Diagnosis_1 neq "">
						<!---<cfset Short_Diagnosis_1 = replace(Short_Diagnosis_1,"(\b\w)", "\u\1", "all") />--->
						1. <cfoutput>#Short_Diagnosis_1# (#Severity_1#) (#Problem_1#)</cfoutput>
					</cfif>
				</td>
			</tr>
			<tr>
				<td valign="top" > 
					<cfif Short_Diagnosis_2 neq "">
						2. <cfoutput>#Short_Diagnosis_2# (#Severity_2#) (#Problem_2#)</cfoutput>
					</cfif>
				</td>
			</tr>
			<tr>
				<td valign="top"  > 
					<cfif Short_Diagnosis_3 neq "">
						3. <cfoutput>#Short_Diagnosis_3# (#Severity_3#) (#Problem_3#)</cfoutput>
					</cfif>
				</td>
			</tr>
			<tr>
				<td valign="top" > 
					<cfif Short_Diagnosis_4 neq "">
						4. <cfoutput>#Short_Diagnosis_4# (#Severity_4#) (#Problem_4#)</cfoutput>
					</cfif>
				</td>
			</tr>
			<tr>
				<td valign="top" > 
					<cfif Short_Diagnosis_5 neq "">
						5. <cfoutput>#Short_Diagnosis_5# (#Severity_5#) (#Problem_5#)</cfoutput>
					</cfif>
				</td>
			</tr>
			<tr>
				<td valign="top" > 
					<cfif Short_Diagnosis_6 neq "">
						6. <cfoutput>#Short_Diagnosis_6# (#Severity_6#) (#Problem_6#)</cfoutput>
					</cfif>
				</td>
			</tr>
			
			<tr>
				<td valign="top" style="height:50px;"></td>
			</tr>
			<tr>
				<td valign="top"><div style="border-bottom:1px solid black;width:75%;"> </div></td>
			</tr>
			<tr>
				<td height="20px"></td>
			</tr>
			<tr>
				<td>CASE MIX ALERTS </td>
			</tr>
			<tr>
				<td height="10px"></td>
			</tr>
			<tr>
				<td valign="top" ><cfoutput>#Case_Mix_Compilation#</cfoutput> </td>
			</tr>
			<tr>
				<td valign="top" style="height:50px;"></td>
			</tr>
			<tr>
				<td valign="top"><div style="border-bottom:1px solid black;width:75%;"> </div></td>
			</tr>
			<tr>
				<td height="20px"></td>
			</tr>
			<tr>
				<td>HOMECARE COMPARE ALERTS </td>
			</tr>
			<tr>
				<td height="10px"></td>
			</tr>
			<tr>
				<td valign="top" ><cfoutput>#Message_COMPARE#</cfoutput> </td>
			</tr>
			<tr>
				<td valign="top" style="height:50px;"></td>
			</tr>
			<tr>
				<td valign="top"><div style="border-bottom:1px solid black;width:75%;"> </div></td>
			</tr>
			<tr>
				<td height="20px"></td>
			</tr>
			<tr>
				<td>DIAGNOSIS CONSISTENCY ALERTS </td>
			</tr>
			<tr>
				<td height="10px"></td>
			</tr>
			<tr>
				<td valign="top" ><cfoutput>#Message_Dx_Consistency#</cfoutput> </td>
			</tr>
			<tr>
				<td valign="top" style="height:50px;"></td>
			</tr>
			<tr>
				<td valign="top"><div style="border-bottom:1px solid black;width:100%;"> </div></td>
			</tr>
			<tr>
				<td height="20px"></td>
			</tr>
			<tr>
				<td style="font-family: Arial;font-size: 15px; font-weight: bold; "> Assessment Notes </td>
			</tr>
			<tr>
				<td height="10px"></td>
			</tr>
			<tr>
				<td valign="top" ></td>
			</tr>  
		</table>
	</td>
</tr>
</table>


  <cfdocumentitem type="footer" >
  <table cellpadding="0" align="center" style="border-top:: solid 1px black;" cellspacing="0" border="0" height="150px" width="100%">
    <tr>
      <td><table align="center" cellpadding="0" cellspacing="0" border="0" width="40%" 
	  style="font-family: Verdana; font-size: 18px; ">
          <tr>
            <td height="8px"></td>
          </tr>
          <tr>
            <td align="center" style="font-family: Verdana;font-size: 40pt;"> Assessment Inconsistencies </td>
          </tr>
          <tr>
            <td height="3px"></td>
          </tr>
          <tr>
            <td align="center" style="font-family: Verdana;font-size: 40pt;"> Home Care Business Services </td>
          </tr>
          <tr>
            <td height="3px"></td>
          </tr>
          <tr>
            <td align="center" style="font-family: Verdana;font-size: 40pt;"> page <cfoutput>#cfdocument.currentpagenumber#</cfoutput> </td>
          </tr>
          <tr>
            <td height="25px"></td>
          </tr>
        </table></td>
    </tr>
  </table>
  </cfdocumentitem>
</cfdocumentsection>
</cfdocument>
</cfif>