<cfparam name="url.redirect_from" default="">
<cfparam name="url.download" default="">
<cfparam name="url.report" default="visit_utlization">
<cfset Redirect_to = #url.redirect_from# />
<cfset session.cs.patientid = #url.ID# />
<cfif isNumeric(url.AID)>
  <cfset Assessment_ID = #url.AID# />  
<cfelse>
 <cfset Assessment_ID   = decrypt(#url.AID#,"54kczhzgHTj4a8n+SRZPyg==","AES","Hex") />
  <cfset url.AID   = decrypt(#url.AID#,"54kczhzgHTj4a8n+SRZPyg==","AES","Hex") />
</cfif>
<cfset Patient_ID = #url.ID# />
<cfset Request.prefix_db_lookup = 'hhapowerpath' />
<cfset SN_2020 = '0' />
<cfset Th_2020 = '0' />
<cfset HHA_2020 = '0' />
<cfset SN_20201 = '0' />
<cfset Th_20201 = '0' />
<cfset HHA_20201 = '0' />
<cfset All_2020 = '0' />
<cfset All_2020_Profit = '0' />
<cfset All_20201 = '0' />
<cfset All_20201_Profit = '0' />
<cfset rank_2020 = '0'>
<cfset Summary = ''>
<cfset OT_percent = '0'>
<cfset PT_percent = '0'>
<cfset OT_visits_2019 = '0'>
<cfset PT_visits_2019 = '0'>
<cfset OT_visits_2020 = '0'>
<cfset PT_visits_2020 = '0'>
<cfquery name="Get_Session" datasource="#Application.DataSrc#">
    SELECT * from #Request.prefix_db_agency#.Coding_Results
    where Assessment_ID = #url.AID#
    and Patient_ID = #url.ID#
    and Message_ID = 78
    </cfquery>
<cfset Session.CS.PDGM_4 = Get_Session.M0_Item_Medication />
<cfset Session.CS.Count_Thpy = Get_Session.Order_ID />
<cfset Session.CS.Count_PT = Get_Session.Diagnosis />
<cfset Session.CS.Count_OT = Get_Session.Textfield_10 />
<cfset Session.CS.Caregiver = Get_Session.Textfield_11 />
<cfset Session.CS.Confusion = Get_Session.Textfield_14 />
<cfset Session.CS.Therapy_Analysis = Get_Session.Textfield_15 />
<cfquery  name="update" datasource="#Application.DataSrc#">
    Update #Request.prefix_db_agency#.Coding_Results c, #Request.prefix_db_lookup#.CW_Coding_Class_PDGM u
    set c.Textfield_8 = u.Goal
    where c.Assessment_ID = #url.AID#
    and c.Patient_ID = #url.ID#
    and c.Order_ID = u.Priority
     </cfquery>
<cfquery name="Get_CW_Therapy" datasource="#Application.DataSrc#">
    SELECT OASIS
    FROM #Request.prefix_db_agency#.Coding_Results
    where Assessment_ID = #url.AID#
    and Patient_ID = #url.ID#
    and Message_ID = 10
    order by Results_ID
    </cfquery>
<cfloop query="Get_CW_Therapy" >
  <cfset Get_CW_Subject = "Get_CW_Therapy "&#OASIS#&"<br><br>">
</cfloop>
<cfquery  name="Get_HIPPS" datasource="#Application.DataSrc#">
    Select a.HIPPS_Code,a.Certification_Start,DATE_ADD(a.Certification_Start, INTERVAL 30 DAY) as Certification_End,a.Assessment_Reason_M0100 
    from #Request.prefix_db_agency#.Assessment_New a
    where a.Assessment_ID = #url.AID#
    and a.Patient_ID = #url.ID#
    </cfquery>
<cfset HIPPS20201 = Get_HIPPS.HIPPS_Code />
<cfset Second = "3" />
<cfset HIPPS20202 = Second & Mid(HIPPS20201,2,4) />
<cfif Session.CS.Count_Thpy neq 0>
  <cfset OT_percent = #Session.CS.Count_OT#/#Session.CS.Count_Thpy#*100>
  <cfset PT_percent = #Session.CS.Count_PT#/#Session.CS.Count_Thpy#*100>
  <cfelse>
  <cfset OT_percent = 0>
  <cfset PT_percent = 0>
</cfif>
<cfquery  name="redo_coding" datasource="#Application.DataSrc#">
    Delete from #Request.prefix_db_agency#.Coding_Scrub where Patient_ID = #session.cs.patientid#  <cfif isdefined('url.AID')> AND Assessment_ID = #url.AID#   </cfif>
</cfquery>
<cfquery  name="Insert_Coding_results" datasource="#Application.DataSrc#">
       INSERT IGNORE INTO #Request.prefix_db_agency#.Coding_Scrub
		  (Assessment_ID,Patient_ID,Message_ID,Field_9,GG_2,Created_Date)
		 VALUES (#url.AID#,#url.ID#,76,'#HIPPS20201#','#HIPPS20202#','#DateFormat(Now(),"yyyy-mm-dd")#')
	  </cfquery>
<cfset Summary = ''>
<cfif Session.CS.Count_Thpy eq 0>
  <cfset rank_2020 = '0'>
  <cfif Session.CS.Caregiver eq 'A'>
    <cfset Summary = 'PATIENT HAS A TEACHABLE CAREGIVER AVAILABLE DURING THE DAY. CAREGIVER WILL BE TAUGHT SYMPTOM MANAGEMENT AND DISEASE PREVENTION.'>
    <cfelseif Session.CS.Caregiver eq 'B' and Session.CS.Confusion eq 'A' >
    <cfset Summary = 'PATIENT HAS NO TEACHABLE CAREGIVER AVAILABLE DURING THE DAY. PATIENT IS TEACHABLE AND WILL BE TAUGHT SYMPTOM MANAGEMENT AND DISEASE PREVENTION.'>
    <cfelseif Session.CS.Caregiver eq 'B' and Session.CS.Confusion eq 'B' >
    <cfset Summary = 'PATIENT HAS NO TEACHABLE CAREGIVER AND IS CONFUSED. LONG-TERM SYMPTOM MONITORING AND DISEASE PREVENTION POSSIBLE.'>
  </cfif>
</cfif>
<cfif Session.CS.Count_Thpy gt 0>
  <cfif Session.CS.Caregiver eq 'A'>
    <cfset rank_2020 = '1'>
    <cfset Summary = 'PATIENT HAS A TEACHABLE CAREGIVER AVAILABLE DURING THE DAY. CAREGIVER WILL BE TAUGHT SYMPTOM MANAGEMENT AND DISEASE PREVENTION.' & '<br><br>' & 'Patient has ' & #Session.CS.Count_Thpy# & ' ADL/mobility deficits requiring therapy. Since there is a caregiver available during the day, home health aide is not indicated.'>
    <cfelseif Session.CS.Caregiver eq 'B' and Session.CS.Confusion eq 'A'>
    <cfset rank_2020 = '2'>
    <cfset Summary = 'PATIENT HAS NO TEACHABLE CAREGIVER AVAILABLE DURING THE DAY. PATIENT IS TEACHABLE AND WILL BE TAUGHT SYMPTOM MANAGEMENT AND DISEASE PREVENTION.' & '<br><br>' & 'Patient has ' & #Session.CS.Count_Thpy# & ' ADL/mobility deficits requiring therapy. Since there is no caregiver available during the day and the patient has ADL deficits home health aide IS INDICATED.'>
    <cfelseif Session.CS.Caregiver eq 'B' and Session.CS.Confusion eq 'B' >
    <cfset rank_2020 = '3'>
    <cfset Summary = 'PATIENT HAS NO TEACHABLE CAREGIVER AND IS CONFUSED. LONG-TERM SYMPTOM MONITORING AND DISEASE PREVENTION POSSIBLE.' & '<br><br>' & 'Patient has ' & #Session.CS.Count_Thpy# & ' ADL/mobility deficits requiring therapy. Since patient is confused and has no caregiver, home health aide IS INDICATED. Since patient is not teachable, intermittent long-term rehabilitation and home health aide services is possible.'>
  </cfif>
  <cfelse>
  <cfset Summary = '#Summary#' & '<br><br>' & ' PATIENT HAS NO ADL DEFICITS REQUIRING THERAPY. VIEW THERAPY ANALYSIS BELOW.'>
</cfif>

<cfquery  name="update" datasource="#Application.DataSrc#">
    Update #Request.prefix_db_agency#.Coding_Scrub c, #Request.prefix_db_lookup#.CW_Utilization_2020 u
    set c.Field_3 = u.Visits_SN, c.Field_4 = u.Visits_Therapy, c.Field_5 = u.Visits_HHA, c.Field_6 = u.Total_Reimburse, c.Risk_Type = u.LUPA
    where c.Assessment_ID = #url.AID#
    and c.Patient_ID = #url.ID#
    and u.HIPPS_Code = '#HIPPS20201#'
    and u.rank = '#rank_2020#'
</cfquery>

<cfquery  name="update" datasource="#Application.DataSrc#">
    Update #Request.prefix_db_agency#.Coding_Scrub c, #Request.prefix_db_lookup#.CW_Utilization_2020 u
    set c.Subject = u.Visits_SN, c.Desired = u.Visits_Therapy, c.Short = u.Visits_HHA, c.Field_1 = u.Total_Reimburse, c.Risk = u.LUPA
    where c.Assessment_ID = #url.AID#
    and c.Patient_ID = #url.ID#
    and u.HIPPS_Code = '#HIPPS20202#'
    and u.rank = '#rank_2020#'
</cfquery>

<cfquery  name="Get_PD" datasource="#Application.DataSrc#">
    Select IFNULL(Field_3,0) as Field_3,IFNULL(Field_4,0) as Field_4,IFNULL(Field_5,0) as Field_5 , IFNULL(Field_6,0) as Field_6, Risk_Type
    from #Request.prefix_db_agency#.Coding_Scrub
    where Assessment_ID = #url.AID#
    and Patient_ID = #url.ID#
    and Message_ID = 76
    </cfquery>
<cfquery  name="Get_PDQ" datasource="#Application.DataSrc#">
    Select IFNULL(Subject,0) as Subject,IFNULL(Desired,0) as Desired,IFNULL(Short,0) as Short , IFNULL(Field_1,0) as Field_1, Risk
    from #Request.prefix_db_agency#.Coding_Scrub
    where Assessment_ID = #url.AID#
    and Patient_ID = #url.ID#
    and Message_ID = 76
    </cfquery>
<cfif OT_Percent neq 0>
  <cfset OT_Visits_2020 = Get_PD.Field_4 * #OT_Percent#/100>
  <cfset OT_Visits_20201 = Get_PDQ.Desired * #OT_Percent#/100>
  <cfelse>
  <cfset OT_Visits_2020 = '0'>
  <cfset OT_Visits_20201 = '0'>
</cfif>
<cfif PT_Percent neq 0>
  <cfset PT_Visits_2020 = Get_PD.Field_4 * #PT_Percent#/100>
  <cfset PT_Visits_20201 = Get_PDQ.Desired * #PT_Percent#/100>
  <cfelse>
  <cfset PT_Visits_2020 = '0'>
  <cfset PT_Visits_20201 = '0'>
</cfif>
<cfif session.AgencyID eq '1057'>
    <cfset SN_amount = 228  />
    <cfset Th_amount = 228  />
    <cfset HHA_amount = 228  />  
<cfelse>
    <cfset SN_amount = 146 />
    <cfset Th_amount = 157 />
    <cfset HHA_amount = 65 /> 
</cfif>
<cfif Get_PD.Field_3 neq ''>
  <cfset SN_2020 = Get_PD.Field_3 * SN_amount>
  <cfset SN_20201 = Get_PDQ.Subject * SN_amount>
  <cfelse>
  <cfset SN_2020 = '0'>
  <cfset SN_20201 = '0'>
</cfif>
<cfif Get_PD.Field_4 neq ''>
  <cfset Th_2020 = Get_PD.Field_4 * Th_amount>
   <cfset Th_20201 = Get_PDQ.Desired * Th_amount>
  <cfelse>
  <cfset Th_2020 = '0'>
  <cfset Th_20201 = '0'>
</cfif>
<cfif Get_PD.Field_5 neq ''>
  <cfset HHA_2020 = Get_PD.Field_5 * HHA_amount>
  <cfset HHA_20201 = Get_PDQ.Short * HHA_amount>
  <cfelse>
  <cfset HHA_2020 = '0'>
  <cfset HHA_20201 = '0'>
</cfif>
<cfset All_2020 =  SN_2020 + Th_2020 + HHA_2020>
<cfset All_2020_Profit = Get_PD.Field_6 - All_2020>
<cfset All_20201 =  SN_20201 + Th_20201 + HHA_20201>
<cfset All_20201_Profit = Get_PDQ.Field_1 - All_20201>
<cfoutput>#Get_HIPPS.Assessment_Reason_M0100#
<cfif LEFT(Get_HIPPS.Assessment_Reason_M0100,1) neq '3'> dai
</cfif>
'#Summary#','<br><br><br>','2020 PDGM HIPPS code 1st 30 days > ','#HIPPS20201#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-day > ', '#HIPPS20202#', 
    '<br><br>1st 30-Day Episode Reimbursement > ','#LSEuroCurrencyFormat(Get_PD.Field_6, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-day > ','#LSEuroCurrencyFormat(Get_PDQ.Field_1, "local")#',
    '<br><br>1st 30-Day Total Cost > ','#LSEuroCurrencyFormat(All_2020, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-Day > ','#LSEuroCurrencyFormat(All_20201, "local")#',
    '<br><br>1st 30-Day Net Profit > ','#LSEuroCurrencyFormat(All_2020_Profit, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-Day > ','#LSEuroCurrencyFormat(All_20201_Profit, "local")#',
   <cfif LEFT(Get_HIPPS.Assessment_Reason_M0100,1) neq '3'>
    '<br><br><br>VISITS FOR 1ST 30-DAYS','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LUPA > ','#Get_PD.Risk_Type#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#DateFormat(Get_HIPPS.Certification_start,"mm/dd/yyyy")# - #DateFormat(Get_HIPPS.Certification_End,"mm/dd/yyyy")# '
    '<br><br>SN ','#Get_PD.Field_3#',' visits | Cost > ','#LSEuroCurrencyFormat(SN_2020, "local")#', ' *Allows for multiple careplan changes. If no changes occur less visits may be sufficient.',
    '<br><br>PT ', '#NumberFormat(PT_Visits_2020, "_")#',' visits | OT ','#NumberFormat(OT_Visits_2020, "_")#',' visits | Cost > ','#LSEuroCurrencyFormat(Th_2020, "local")#', 
    '<br><br>HHA ','#Get_PD.Field_5#',' visits | Cost > ','#LSEuroCurrencyFormat(HHA_2020, "local")#',
    </cfif>
    '<br><br><br>VISITS FOR 2ND 30-DAYS','&nbsp;&nbsp;(2nd 30-days warranted when there are physician-order changes after the 1st week)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LUPA > ','#Get_PDQ.Risk#',
    '<br><br>SN ','#Get_PDQ.Subject#',' visits | Cost > ','#LSEuroCurrencyFormat(SN_20201, "local")#', ' *Allows for multiple careplan changes. If no changes occur less visits may be sufficient.',
    '<br><br>PT ', '#NumberFormat(PT_Visits_20201, "_")#',' visits | OT ','#NumberFormat(OT_Visits_20201, "_")#',' visits | Cost > ','#LSEuroCurrencyFormat(Th_20201, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#DateFormat(Get_HIPPS.Certification_start,"mm/dd/yyyy")# - #DateFormat(Get_HIPPS.Certification_End,"mm/dd/yyyy")# '
    '<br><br>HHA ','#Get_PDQ.Short#',' visits | Cost > ','#LSEuroCurrencyFormat(HHA_20201, "local")#',
    '<br><br><br><br>THERAPY ANALYSIS', '<br><br>#Session.CS.Therapy_Analysis# ~'</cfoutput>
<cfquery  name="update" datasource="#Application.DataSrc#">
    Update #Request.prefix_db_agency#.Coding_Scrub 
    set Field_7 = 
    concat('#Summary#','<br><br><br>','2020 PDGM HIPPS code 1st 30 days > ','#HIPPS20201#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-day > ', '#HIPPS20202#', 
    '<br><br>1st 30-Day Episode Reimbursement > ','#LSEuroCurrencyFormat(Get_PD.Field_6, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-day > ','#LSEuroCurrencyFormat(Get_PDQ.Field_1, "local")#',
    '<br><br>1st 30-Day Total Cost > ','#LSEuroCurrencyFormat(All_2020, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-Day > ','#LSEuroCurrencyFormat(All_20201, "local")#',
    '<br><br>1st 30-Day Net Profit > ','#LSEuroCurrencyFormat(All_2020_Profit, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2nd 30-Day > ','#LSEuroCurrencyFormat(All_20201_Profit, "local")#',
    <cfif LEFT(Get_HIPPS.Assessment_Reason_M0100,1) neq '3'>
    '<br><br><br>VISITS FOR 1ST 30-DAYS','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LUPA > ','#Get_PD.Risk_Type#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#DateFormat(Get_HIPPS.Certification_start,"mm/dd/yyyy")# - #DateFormat(Get_HIPPS.Certification_End,"mm/dd/yyyy")# '
    '<br><br>SN ','#Get_PD.Field_3#',' visits | Cost > ','#LSEuroCurrencyFormat(SN_2020, "local")#', ' *Allows for multiple careplan changes. If no changes occur less visits may be sufficient.',
    '<br><br>PT ', '#NumberFormat(PT_Visits_2020, "_")#',' visits | OT ','#NumberFormat(OT_Visits_2020, "_")#',' visits | Cost > ','#LSEuroCurrencyFormat(Th_2020, "local")#', 
    '<br><br>HHA ','#Get_PD.Field_5#',' visits | Cost > ','#LSEuroCurrencyFormat(HHA_2020, "local")#',
    </cfif>
    '<br><br><br>VISITS FOR 2ND 30-DAYS','&nbsp;&nbsp;(2nd 30-days warranted when there are physician-order changes after the 1st week)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LUPA > ','#Get_PDQ.Risk#',
    '<br><br>SN ','#Get_PDQ.Subject#',' visits | Cost > ','#LSEuroCurrencyFormat(SN_20201, "local")#', ' *Allows for multiple careplan changes. If no changes occur less visits may be sufficient.',
    '<br><br>PT ', '#NumberFormat(PT_Visits_20201, "_")#',' visits | OT ','#NumberFormat(OT_Visits_20201, "_")#',' visits | Cost > ','#LSEuroCurrencyFormat(Th_20201, "local")#','&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#DateFormat(Get_HIPPS.Certification_start,"mm/dd/yyyy")# - #DateFormat(Get_HIPPS.Certification_End,"mm/dd/yyyy")# '
    '<br><br>HHA ','#Get_PDQ.Short#',' visits | Cost > ','#LSEuroCurrencyFormat(HHA_20201, "local")#',
    '<br><br><br><br>THERAPY ANALYSIS', '<br><br>#Session.CS.Therapy_Analysis# ~')
    where Assessment_ID = #url.AID#
    and Patient_ID = #url.ID#
    and Message_ID = 76
    </cfquery>
    <cfabort>
<cfquery  name="Get_Diagnosis" datasource="#Application.DataSrc#">
    Select M0_Item_Medication, Diagnosis
    from #Request.prefix_db_agency#.Coding_Results
    where Assessment_ID = #url.AID#
    and Patient_ID = #url.ID#
    and M0_Item_Medication like '%M102%'
    Order by Dx_Order ASC
    </cfquery>
<cfset list = ''>
<cfloop query="Get_Diagnosis">
  <cfset list = list & '#Diagnosis#' &'<br>' & 'clinician-entered | from Face-to-Face | from H&P | from H&P - PDGM co-morbidity that adds casemix points | from OASIS - PDGM co-morbidity that adds casemix points | from clinician OASIS narrative'&'<br>' >
</cfloop>
<cfset CG = ''>
<cfset CF = ''>
<cfif Session.CS.Caregiver eq 'A'>
  <cfset CG = 'According to the OASIS assessment the patient has a teachable daytime caregiver - see M1100.'>
  <cfelse>
  <cfset CG = 'According to the OASIS assessment the patient does not have a teachable daytime caregiver - see M1100.'>
</cfif>
<cfif Session.CS.Confusion eq 'A'>
  <cfset CF = ' However the patient is teachable - see M1710.'>
  <cfelse>
  <cfset CF = ' Additionally, the patient is confused and not teachable - see M1710 or M1740-2.'>
</cfif>
<cfset Team_Message = ''>
<cfset Team_Message = 'PROCESS 3 - message1' & '<br><br>' & 'Please authorize/change recommended Diagnoses, Utilization' & '<br><br>' & 
'Hi All,'    & '<br><br>' &
'We have completed our document review and coded the OASIS with the following diagnosis codes.  Please see the attached report for rationale.'& '<br><br>' &
#list#    & '<br><br>' &  #CG# & #CF#    & '<br><br>' &
'The patient has ' & #Session.CS.Count_Thpy# &' deficits requiring therapy.'  & '<br><br>' & 
'Based on caregiver availability and number of ADL/IADL deficits we recommend the following utilization. Refer to the Utilization Report for complete therapy rationale.'  & 
'<br><br>' & 'FIRST 30 DAYS' & 
'<br><br>' &  
'SN - ' & #Get_PD.Field_3# & ' visits'   & '<br>' &
'OT - ' & '#NumberFormat(OT_Visits_2020, "_")#' & ' visits'  & '<br>' &
'PT - ' & '#NumberFormat(PT_Visits_2020, "_")#' & ' visits'  & '<br>' &
'HHA - ' & '#NumberFormat(Get_PD.Field_5, "_")#' & ' visits'   & '<br><br>' &
'SECOND 30 DAYS' & '<br><br>' & 'A second 30-day episode is warranted if there changes to physician orders after the 1st week.'  & '<br><br>' &
'SN - ' & #Get_PDQ.Subject# & ' visits'   & '<br>' &
'OT - ' & '#NumberFormat(OT_Visits_20201, "_")#' & ' visits'  & '<br>' &
'PT - ' & '#NumberFormat(PT_Visits_20201, "_")#' & ' visits'  & '<br>' &
'HHA - ' & '#NumberFormat(Get_PDQ.Short, "_")#' & ' visits'   & '<br><br>' &
'So that we can update the CMS485 with goals and interventions and upload the final reports, please reply with any changes to the above recommendations. Once your changes and/or approval is received, we’ll upload all updated reports, including Teaching, Patient Recall and Visit Plans.' & '<br><br>' &
'Coding Wizard Team' & '<br><br><br><br>' & 
'message3' & '<br><br>' & 
'Visit Plan(s) and Patient Recall Sheet(s) Attached' & '<br><br>' & 
'Hi All,'    & '<br><br>' &
'Attached are:' & '<br><br>' & 
'(1) Patient Recall Sheet'& '<br>' &
'(2) Visits Plans based on approved Utilization'& '<br><br>' &
'Please advise if additional changes are needed.'& '<br><br>' & 'Coding Wizard Team'>
<cfset Team_Message = Trim(#Team_Message#)>
<cfquery  name="update" datasource="#Application.DataSrc#">
    Update #Request.prefix_db_agency#.Coding_Scrub 
    set Field_11 = '#Team_Message#'
    where Assessment_ID = #url.AID#
    and Patient_ID = #url.ID#
    and Message_ID = 76
    </cfquery>

<cfinclude template="cron_coding_CREATEVISIT_SN.cfm" />