SELECT s.*, an.Freq_of_Pain_M0420, an.Pressure_Ulcer_Stage_M0460, an.Pressure_Ulcer_Status_M0464, an.Stasis_Ulcer_M0468, an.Surgical_Wound_M0482, an.Stasis_Ulcer_Hidden_M0474, an.Stasis_Ulcer_Status_M0476, an.Surgical_Wound_Status_M0488, an.Breathing_M0490, an.UTI_M0510, an.Urinary_INcont_M0520, an.Bathing_M0670, an.Transferring_M0690, an.Ambulation_M0700, an.Oral_Meds_M0780, an.Emergent_Care_M0830, an.Inpatient_Facility_M0855, an.Discharge_Disposition_M0870, an.SOC_420, an.SOC_490, an.SOC_520, an.SOC_680, an.SOC_690, an.SOC_700, an.SOC_780, an.MR_420, an.MR_488, an.MR_490, an.MR_670, an.MR_690, an.MR_700, an.MR_780, an.M0104_Date_of_Referral, an.M1032_Frailty, an.M1240_Pain_Assess, an.M1300_Pressure, an.M1730_Depression, an.M1845_Toilet, an.M2010_Med_Edu, an.M2015_Drug_Edu, an.M1840_Toilet, an.M2100a_Equip, an.M2100b_Equip, an.M2100c_Equip, an.M2100d_Equip, an.M2100e_Equip, an.M2100f_Equip, an.M2100g_Equip, an.M0102_Physician_SOC, an.M1040_Influ, an.M1045_Influ, an.M1050_Pneu, an.M1055_Pneu, an.M1500_Symptoms, an.M1510_Hrt_FU, an.M1910_Fall_Risk, an.M2250b_Diabetic, an.M2250e_Pain, an.M2250f_PressUlc, an.M2250g_PressUlcMoist, an.Start_of_Care_M0030, p.Last_Name_M0040,p.First_Name_M0040, p.First_Name_M0040, e.Last_Name,e.First_Name FROM #Request.prefix_db_agency#.Assessment_Score s JOIN #Request.prefix_db_agency#.Assessment_New an ON s.Assessment_ID = an.Assessment_ID JOIN #Request.prefix_db_agency#.patient p ON p.Patient_ID = an.Patient_ID JOIN #Request.prefix_db_lookup#.Employee e ON e.Employee_ID = an.Record_Created_By WHERE an.Assessment_ID = '#url.Assessment_ID#' AND an.Certification_End > '2015-12-31' AND an.Deleted = 0 AND an.Admission_Status = 'complete' AND (an.Medical_or_Treatment_Change_M0200 != 'discharged' or an.Medical_or_Treatment_Change_M0200 is null) AND (an.Medical_or_Treatment_Change_M0200 != 'transfer/discharged' or an.Medical_or_Treatment_Change_M0200 is null)
REAL-TIME HOME HEALTH COMPARE SCORE FOR #UCASE(GET_Score.First_Name_M0040)# #UCASE(GET_Score.Last_Name_M0040)# admitted #DateFormat(GET_Score.Start_of_Care_M0030,"mm/dd/yyyy")# by #GET_Score.First_Name# #GET_Score.Last_Name#

5-STAR MEASURE TODAY'S HOME HEALTH COMPARE SCORE:  #GET_Score.AvgHHC_SOC# START OF CARE > TODAY
M0102/M0104 > M0030 care initiated within 2 days #GET_Score.M0104# #DateFormat(GET_Score.M0104_Date_of_Referral,"mm/dd/yyyy")# #DateFormat(GET_Score.M0102_Physician_SOC,"mm/dd/yyyy")#  > #DateFormat(GET_Score.Start_of_Care_M0030,"mm/dd/yyyy")#
M1240 formal pain assessment #GET_Score.M1240# #GET_Score.M1240_Pain_Assess#
M1242 pain improved since admission #GET_Score.M1242# #GET_Score.SOC_420# > not tracked #GET_Score.MR_420#
M1300 pressure ulcer assessment #GET_Score.M1300# #Left(GET_Score.M1300_Pressure,35)#...
M1342 surgical wound improved since admission #GET_Score.M1342# #GET_Score.Surgical_Wound_M0482# > not tracked #GET_Score.MR_488#
M1400 dyspnea improved since admission #GET_Score.M1400# #GET_Score.SOC_490# > not tracked #GET_Score.MR_490#
M1730 Depression Screening #GET_Score.M1730# #Left(GET_Score.M1730_Depression,35)#...
M1830 bathing improved since admission #GET_Score.M1830# #GET_Score.SOC_680# > not tracked #GET_Score.MR_670#
M1850 transferring improved since admission #GET_Score.M1850# #GET_Score.SOC_690# > not tracked #GET_Score.MR_690#
M1860 ambulation improved since admission #GET_Score.M1860# #GET_Score.SOC_700# > not tracked #GET_Score.MR_700#
M1910 multi-factor falls risk assessment #GET_Score.M1910# #GET_Score.M1910_Fall_Risk#
M2010 high-risk medication teaching performed #GET_Score.M2010# #Left(GET_Score.M2010_Med_Edu,37)#...
M2020 oral medication mgmt improved since admission #GET_Score.M2020# #GET_Score.SOC_780# > not tracked #GET_Score.MR_780#
M2250b diabetic foot care #GET_Score.M2250_b# #GET_Score.M2250b_Diabetic#
M2250e monitor and mitigate pain #GET_Score.M2250_e# #GET_Score.M2250e_Pain#
M2250f prevent pressure ulcers #GET_Score.M2250_f# #GET_Score.M2250f_PressUlc#
M2250g moist pressure ulcer treatment #GET_Score.M2250_f# #GET_Score.M2250g_PressUlcMoist#