PXRMG2R1 ;SLC/JVS -GEC #2 REPORT #1 ;7/14/05 08:12
;;2.0;CLINICAL REMINDERS;**2,4**;Feb 04, 2005;Build 21
Q
EN ;Entry Point for Local Report
N NAME,ARY,SSN,CRITER,DATE,DATEF,NAME2,PAGE
N CRP1,CRP2,CRP3,CRP4,CRP5,CNT,PROG
S (CRP1,CRP2,CRP3,CRP4,CRP5)=""
D EN^PXRMG2E2
W @IOF
W "============================================================================="
W !,"Referred to Homemaker/Home Health Aide(HHHA) or Adult Day Health Care(ADHC)"
W !,"or VA In-Home Respite(VAIHR) or Care Coordination programs(CC)"
W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
W !,"Fiscal Quarter: "_FQUARTER_" (Calendar Quarter "_QUARTER_")"
W !,?39," Criteria ",?65,"Measured"
W !,"Name",?25,"SSN",?32,"Prog.",?39,"0",?42,"#1",?45,"#2",?48,"#3",?51,"#4",?54,"Date",?65,"Criteria"
W !,"============================================================================="
W ! D PB Q:Y=0
S CNT=0
S ARY="^TMP(""PXRMGEC"",$J,""GEC2"",""RPT"")"
S NAME="" F S NAME=$O(@ARY@(NAME)) Q:NAME="" D
.S CNT=1
.S SSN="" F S SSN=$O(@ARY@(NAME,SSN)) Q:SSN="" D
..S DATE="" F S DATE=$O(@ARY@(NAME,SSN,DATE)) Q:DATE="" D
...S DATEF=$$FMTE^XLFDT(DATE,"5ZM")
...S CRITER="" F S CRITER=$O(@ARY@(NAME,SSN,DATE,CRITER)) Q:CRITER="" D
....I CRITER=0 S CRP1="X"
....I CRITER[1 S CRP2="X"
....I CRITER[2 S CRP3="X"
....I CRITER[3 S CRP4="X"
....I CRITER[4 S CRP5="X"
....S PROG=$O(@ARY@(NAME,SSN,DATE,CRITER,""))
....I $D(XYZ) S NAME2="CPRS PATIENT "_$E(SSN,4,5)
....W !,$S($D(XYZ):NAME2,1:NAME),?25,SSN,?32,PROG,?39,CRP1,?42,CRP2,?45,CRP3,?48,CRP4,?51,CRP5,?54,$P(DATEF,"@",1),?65,$S(CRP1="X":"Not Met",1:"")
....S (CRP1,CRP2,CRP3,CRP4,CRP5)=""
....D PB Q:Y=0
I CNT=0 W !," < NO PATIENT DATA FOUND >",!
W ! D PB Q:Y=0
W !,"Criteria" D PB Q:Y=0
W !,"0: Not eligible under any criteria." D PB Q:Y=0
W !,"1: Problems with 3 or more ADL's." D PB Q:Y=0
W !,"2: 1 or more patient behavior or cognitive problem." D PB Q:Y=0
W !,"3: Expected life limit of less than 6 months." D PB Q:Y=0
W !,"4: Combination of the following:" D PB Q:Y=0
W !," 2 or more ADL dependencies" D PB Q:Y=0
W !," <AND> 2 or more of the following:" D PB Q:Y=0
W !," Problems with 3 or more IADL's" D PB Q:Y=0
W !," <OR> age of patients is 75 or more." D PB Q:Y=0
W !," <OR> living alone in the community." D PB Q:Y=0
W !," <OR> utilizes the clinics 12 or more time in the" D PB Q:Y=0
W !," preceding 12 months." D PB Q:Y=0
D EXIT
Q
;========================================================
ENP ;Entry Point for Local Report
N NAME,ARY,SSN,CRITER,DATE,DATEF,PAGE
N CRP1,CRP2,CRP3,CRP4,CRP5,CNT,PROG
S (CRP1,CRP2,CRP3,CRP4,CRP5)=""
D EN^PXRMG2E2
W @IOF
W "============================================================================="
W !,"Referred to Homemaker/Home Health Aide(HHHA) or Adult Day Health Care(ADHC)"
W !,"or VA In-Home Respite(VAIHR) or Care Coordination programs(CC)"
W !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
W !,"Fiscal Quarter: "_FQUARTER_" (Calendar Quarter "_QUARTER_")"
W !,?39," Criteria ",?65,"Measured"
W !,"Name",?25,"SSN",?32,"Prog.",?39,"0",?42,"#1",?45,"#2",?48,"#3",?51,"#4",?54,"Date",?65,"Criteria"
W !,"==========================================================================="
S ARY="^TMP(""PXRMGEC"",$J,""GEC2"",""RPT"")"
S CNT=0
S NAME="" F S NAME=$O(@ARY@(NAME)) Q:NAME="" D
.S CNT=1
.S SSN="" F S SSN=$O(@ARY@(NAME,SSN)) Q:SSN="" D
..S DATE="" F S DATE=$O(@ARY@(NAME,SSN,DATE)) Q:DATE="" D
...S DATEF=$$FMTE^XLFDT(DATE,"5ZM")
...S CRITER="" F S CRITER=$O(@ARY@(NAME,SSN,DATE,CRITER)) Q:CRITER="" D
....I CRITER=0 S CRP1="X"
....I CRITER[1 S CRP2="X"
....I CRITER[2 S CRP3="X"
....I CRITER[3 S CRP4="X"
....I CRITER[4 S CRP5="X"
....S PROG=$O(@ARY@(NAME,SSN,DATE,CRITER,""))
....W !,$S($D(XYZ):NAME2,1:NAME),?25,SSN,?32,PROG,?39,CRP1,?42,CRP2,?45,CRP3,?48,CRP4,?51,CRP5,?54,$P(DATEF,"@",1),?65,$S(CRP1="X":"Not Met",1:"") D PAGE^PXRMGECZ
....S (CRP1,CRP2,CRP3,CRP4,CRP5)=""
I CNT=0 W !," < NO PATIENT DATA FOUND >",! D PAGE^PXRMGECZ
W !
W !,"Criteria"
W !,"0: Not eligible under any criteria."
W !,"1: Problems with 3 or more ADL's."
W !,"2: 1 or more patient behavior or cognitive problem."
W !,"3: Expected life limit of less than 6 months."
W !,"4: Combination of the following:"
W !," 2 or more ADL dependencies"
W !," <AND> 2 or more of the following:"
W !," Problems with 3 or more IADL's"
W !," <OR> age of patients is 75 or more."
W !," <OR> living alone in the community."
W !," <OR> utilizes the clinics 12 or more time in the"
W !," preceding 12 months."
D EXIT
Q
PB ;Page Break
S Y=""
I $Y=(IOSL-2) D
.K DIR
.S DIR(0)="E"
.D ^DIR
.I Y=1 W @IOF S $Y=0
K DIR
Q
EXIT ;Exit and Clean up Variables
K XYZ,FQUARTER
K ^TMP("PXRMGEC",$J)
Q
PXRMG2R1 ;SLC/JVS -GEC #2 REPORT #1 ;7/14/05 08:12
+1 ;;2.0;CLINICAL REMINDERS;**2,4**;Feb 04, 2005;Build 21
+2 QUIT
EN ;Entry Point for Local Report
+1 NEW NAME,ARY,SSN,CRITER,DATE,DATEF,NAME2,PAGE
+2 NEW CRP1,CRP2,CRP3,CRP4,CRP5,CNT,PROG
+3 SET (CRP1,CRP2,CRP3,CRP4,CRP5)=""
+4 DO EN^PXRMG2E2
+5 WRITE @IOF
+6 WRITE "============================================================================="
+7 WRITE !,"Referred to Homemaker/Home Health Aide(HHHA) or Adult Day Health Care(ADHC)"
+8 WRITE !,"or VA In-Home Respite(VAIHR) or Care Coordination programs(CC)"
+9 WRITE !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
+10 WRITE !,"Fiscal Quarter: "_FQUARTER_" (Calendar Quarter "_QUARTER_")"
+11 WRITE !,?39," Criteria ",?65,"Measured"
+12 WRITE !,"Name",?25,"SSN",?32,"Prog.",?39,"0",?42,"#1",?45,"#2",?48,"#3",?51,"#4",?54,"Date",?65,"Criteria"
+13 WRITE !,"============================================================================="
+14 WRITE !
DO PB
IF Y=0
QUIT
+15 SET CNT=0
+16 SET ARY="^TMP(""PXRMGEC"",$J,""GEC2"",""RPT"")"
+17 SET NAME=""
FOR
SET NAME=$ORDER(@ARY@(NAME))
IF NAME=""
QUIT
Begin DoDot:1
+18 SET CNT=1
+19 SET SSN=""
FOR
SET SSN=$ORDER(@ARY@(NAME,SSN))
IF SSN=""
QUIT
Begin DoDot:2
+20 SET DATE=""
FOR
SET DATE=$ORDER(@ARY@(NAME,SSN,DATE))
IF DATE=""
QUIT
Begin DoDot:3
+21 SET DATEF=$$FMTE^XLFDT(DATE,"5ZM")
+22 SET CRITER=""
FOR
SET CRITER=$ORDER(@ARY@(NAME,SSN,DATE,CRITER))
IF CRITER=""
QUIT
Begin DoDot:4
+23 IF CRITER=0
SET CRP1="X"
+24 IF CRITER[1
SET CRP2="X"
+25 IF CRITER[2
SET CRP3="X"
+26 IF CRITER[3
SET CRP4="X"
+27 IF CRITER[4
SET CRP5="X"
+28 SET PROG=$ORDER(@ARY@(NAME,SSN,DATE,CRITER,""))
+29 IF $DATA(XYZ)
SET NAME2="CPRS PATIENT "_$EXTRACT(SSN,4,5)
+30 WRITE !,$SELECT($DATA(XYZ):NAME2,1:NAME),?25,SSN,?32,PROG,?39,CRP1,?42,CRP2,?45,CRP3,?48,CRP4,?51,CRP5,?54,$PIECE(DATEF,"@",1),?65,$SELECT(CRP1="X":"Not Met",1:"")
+31 SET (CRP1,CRP2,CRP3,CRP4,CRP5)=""
+32 DO PB
IF Y=0
QUIT
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+33 IF CNT=0
WRITE !," < NO PATIENT DATA FOUND >",!
+34 WRITE !
DO PB
IF Y=0
QUIT
+35 WRITE !,"Criteria"
DO PB
IF Y=0
QUIT
+36 WRITE !,"0: Not eligible under any criteria."
DO PB
IF Y=0
QUIT
+37 WRITE !,"1: Problems with 3 or more ADL's."
DO PB
IF Y=0
QUIT
+38 WRITE !,"2: 1 or more patient behavior or cognitive problem."
DO PB
IF Y=0
QUIT
+39 WRITE !,"3: Expected life limit of less than 6 months."
DO PB
IF Y=0
QUIT
+40 WRITE !,"4: Combination of the following:"
DO PB
IF Y=0
QUIT
+41 WRITE !," 2 or more ADL dependencies"
DO PB
IF Y=0
QUIT
+42 WRITE !," <AND> 2 or more of the following:"
DO PB
IF Y=0
QUIT
+43 WRITE !," Problems with 3 or more IADL's"
DO PB
IF Y=0
QUIT
+44 WRITE !," <OR> age of patients is 75 or more."
DO PB
IF Y=0
QUIT
+45 WRITE !," <OR> living alone in the community."
DO PB
IF Y=0
QUIT
+46 WRITE !," <OR> utilizes the clinics 12 or more time in the"
DO PB
IF Y=0
QUIT
+47 WRITE !," preceding 12 months."
DO PB
IF Y=0
QUIT
+48 DO EXIT
+49 QUIT
+50 ;========================================================
ENP ;Entry Point for Local Report
+1 NEW NAME,ARY,SSN,CRITER,DATE,DATEF,PAGE
+2 NEW CRP1,CRP2,CRP3,CRP4,CRP5,CNT,PROG
+3 SET (CRP1,CRP2,CRP3,CRP4,CRP5)=""
+4 DO EN^PXRMG2E2
+5 WRITE @IOF
+6 WRITE "============================================================================="
+7 WRITE !,"Referred to Homemaker/Home Health Aide(HHHA) or Adult Day Health Care(ADHC)"
+8 WRITE !,"or VA In-Home Respite(VAIHR) or Care Coordination programs(CC)"
+9 WRITE !,"From: "_$$FMTE^XLFDT(BDT,"5ZM")_" To: "_$$FMTE^XLFDT(EDT,"5ZM")
+10 WRITE !,"Fiscal Quarter: "_FQUARTER_" (Calendar Quarter "_QUARTER_")"
+11 WRITE !,?39," Criteria ",?65,"Measured"
+12 WRITE !,"Name",?25,"SSN",?32,"Prog.",?39,"0",?42,"#1",?45,"#2",?48,"#3",?51,"#4",?54,"Date",?65,"Criteria"
+13 WRITE !,"==========================================================================="
+14 SET ARY="^TMP(""PXRMGEC"",$J,""GEC2"",""RPT"")"
+15 SET CNT=0
+16 SET NAME=""
FOR
SET NAME=$ORDER(@ARY@(NAME))
IF NAME=""
QUIT
Begin DoDot:1
+17 SET CNT=1
+18 SET SSN=""
FOR
SET SSN=$ORDER(@ARY@(NAME,SSN))
IF SSN=""
QUIT
Begin DoDot:2
+19 SET DATE=""
FOR
SET DATE=$ORDER(@ARY@(NAME,SSN,DATE))
IF DATE=""
QUIT
Begin DoDot:3
+20 SET DATEF=$$FMTE^XLFDT(DATE,"5ZM")
+21 SET CRITER=""
FOR
SET CRITER=$ORDER(@ARY@(NAME,SSN,DATE,CRITER))
IF CRITER=""
QUIT
Begin DoDot:4
+22 IF CRITER=0
SET CRP1="X"
+23 IF CRITER[1
SET CRP2="X"
+24 IF CRITER[2
SET CRP3="X"
+25 IF CRITER[3
SET CRP4="X"
+26 IF CRITER[4
SET CRP5="X"
+27 SET PROG=$ORDER(@ARY@(NAME,SSN,DATE,CRITER,""))
+28 WRITE !,$SELECT($DATA(XYZ):NAME2,1:NAME),?25,SSN,?32,PROG,?39,CRP1,?42,CRP2,?45,CRP3,?48,CRP4,?51,CRP5,?54,$PIECE(DATEF,"@",1),?65,$SELECT(CRP1="X":"Not Met",1:"")
DO PAGE^PXRMGECZ
+29 SET (CRP1,CRP2,CRP3,CRP4,CRP5)=""
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+30 IF CNT=0
WRITE !," < NO PATIENT DATA FOUND >",!
DO PAGE^PXRMGECZ
+31 WRITE !
+32 WRITE !,"Criteria"
+33 WRITE !,"0: Not eligible under any criteria."
+34 WRITE !,"1: Problems with 3 or more ADL's."
+35 WRITE !,"2: 1 or more patient behavior or cognitive problem."
+36 WRITE !,"3: Expected life limit of less than 6 months."
+37 WRITE !,"4: Combination of the following:"
+38 WRITE !," 2 or more ADL dependencies"
+39 WRITE !," <AND> 2 or more of the following:"
+40 WRITE !," Problems with 3 or more IADL's"
+41 WRITE !," <OR> age of patients is 75 or more."
+42 WRITE !," <OR> living alone in the community."
+43 WRITE !," <OR> utilizes the clinics 12 or more time in the"
+44 WRITE !," preceding 12 months."
+45 DO EXIT
+46 QUIT
PB ;Page Break
+1 SET Y=""
+2 IF $Y=(IOSL-2)
Begin DoDot:1
+3 KILL DIR
+4 SET DIR(0)="E"
+5 DO ^DIR
+6 IF Y=1
WRITE @IOF
SET $Y=0
End DoDot:1
+7 KILL DIR
+8 QUIT
EXIT ;Exit and Clean up Variables
+1 KILL XYZ,FQUARTER
+2 KILL ^TMP("PXRMGEC",$JOB)
+3 QUIT