BGPMUAP7 ; IHS/MSC/MGH - MU EP measures NQF0067 and NQF0070 ;21-Jul-2011 15:08;DU
;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
;This rouine does the printed output of these 2 EP measures
;Printout for CAD on antiplatelet therapy
CAD1 ;EP
D P1
K ^TMP("BGPMU0067",$J)
Q
P1 ;Write individual measure
N X,Y,Z,LIST1,LIST2,LIST3
N DEN1,NUM1,DEN2,NUM2,PC1,PC2,EXC1,EXC2,STRING1,STRING2,STRING3,SUMCT
N PRD1,PRD2,PRD3,PRD4,PRN1,PRN2,PRN3,PRN4,PRN5,PRN6,PRD5,PRD6
S SUMCT=0
S STRING1=$$NUM67("C")
S STRING2=$$NUM67("P")
S STRING3=$$NUM67("B")
D SUMMARY1(STRING1,STRING2,STRING3)
;Population
S PRD1=$P(STRING1,U,5)-$P(STRING2,U,5)
S PRD2=$P(STRING1,U,6)-$P(STRING2,U,6)
S PRD3=$P(STRING1,U,7)-$P(STRING2,U,7)
S PRD4=$P(STRING1,U,9)-$P(STRING2,U,9)
S PRN1=$P(STRING1,U,5)-$P(STRING3,U,5)
S PRN2=$P(STRING1,U,6)-$P(STRING3,U,6)
S PRN3=$P(STRING1,U,7)-$P(STRING3,U,7)
S PRN4=$P(STRING1,U,9)-$P(STRING3,U,9)
D HEADER^BGPMUPH Q:BGPQUIT
D HDRBLK^BGPMUPH
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"Pts 18+ w/CAD or cardiac",?33,$P(STRING1,U,1),?44,$P(STRING2,U,1),?64,$P(STRING3,U,1)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"surgery"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# Excluded (Exc)",?33,$P(STRING1,U,4),?44,$P(STRING2,U,4),?64,$P(STRING3,U,4)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"Pts 18+ w/CAD or cardiac",?33,$P(STRING1,U,3),?44,$P(STRING2,U,3),?64,$P(STRING3,U,3)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"surgery less Exc"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !!,"# w/antiplatelet therapy",?33,$P(STRING1,U,2),?38,$J($P(STRING1,U,5),5,1),?44,$P(STRING2,U,2),?49,$J($P(STRING2,U,5),5,1),?56,$J($FN(PRD1,",+",1),6),?64,$P(STRING3,U,2),?68,$J($P(STRING3,U,5),5,1),?74,$J($FN(PRN1,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# w/o antiplatelet therapy",?33,$P(STRING1,U,8),?38,$J($P(STRING1,U,9),5,1),?44,$P(STRING2,U,8),?49,$J($P(STRING2,U,9),5,1),?56,$J($FN(PRD4,",+",1),6),?64,$P(STRING3,U,8),?68,$J($P(STRING3,U,9),5,1),?74,$J($FN(PRN4,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
I $D(BGPLIST(BGPIC)) D P2
;
Q
NUM67(TF) ;Get the numbers for this measure
N ARRAY,DEN,NUM,EXC,NOT,PC1,PC11,PC2,PC13,NNUM,PC14
S DEN=+$G(^TMP("BGPMU0067",$J,TF,"DEN"))
S NUM=+$G(^TMP("BGPMU0067",$J,TF,"NUM"))
S NOT=+$G(^TMP("BGPMU0067",$J,TF,"NOT"))
S EXC=+$G(^TMP("BGPMU0067",$J,TF,"EXC"))
S NNUM=DEN-EXC
I DEN=0 S (PC1,PC11,PC13,PC14)=0
I DEN>0&(NNUM=0) D
.S (PC1,PC11,PC14)=0
.S PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
I DEN>0&(NNUM>0) D
.S PC1=$$ROUND^BGPMUA01((NUM/NNUM),3)*100
.S PC11=$$ROUND^BGPMUA01((NNUM/DEN),3)*100
.S PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
.S PC14=$$ROUND^BGPMUA01((NOT/NNUM),3)*100
S ARRAY=DEN_U_NUM_U_NNUM_U_EXC_U_PC1_U_PC11_U_PC13_U_NOT_U_PC14
Q ARRAY
P2 ;Do the Details
N PT,NODE,NAME,VST,BMI,FOL,X,PTCT,BGPARR,LINE
S PTCT=0
D HEADERL^BGPMUPH
S X="Patients 18+ with a diagnosis of CAD (includes MI) or who had cardiac surgery," D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="AND who had at least 2 outpatient or 2 nursing facility encounters or 1" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="inpatient encounter with the EP during the reporting period, AND who were" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="prescribed oral antiplatelet therapy during the reporting period, if any." D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="Patients who did not meet the numerator criteria are listed first (NM:)," D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="followed by patients who do meet the numerator criteria (M:). Excluded patients" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="are listed last." D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="The following are the abbreviations used in the denominator and numerator" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="columns:" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="CAD=Coronary Arterery Disease Diagnosis" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="CSP=Cardiac Surgery Procedure" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="EN=Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="MED=Antiplatelet Therapy" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
I $Y>(BGPIOSL-5) D HEADERL^BGPMUPH Q:BGPQUIT
W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
S LINE="",$P(LINE,"-",81)="" W !,LINE
I BGPLIST="D"!(BGPLIST="A") D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0067"","_$J_",""PAT"",""C"",""NOT"")")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA(NODE)
I BGPLIST="N"!(BGPLIST="A") D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0067"","_$J_",""PAT"",""C"",""NUM"")")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA(NODE)
I BGPLIST="A" D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0067"","_$J_",""PAT"",""C"",""EXC"")")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA(NODE)
W !!,"Total # of patients on list: "_PTCT
Q
DATA(NODE) ;GET DATA
N NAME,HRN,DEN,NUM,AGE,DFN,SEX,COMM,NUM1,NUM2,DEN1,DEN2,DEN3,LINE
S DFN=$P(NODE,U,1)
S NAME=$E($$GET1^DIQ(2,$P(NODE,U,1),.01),1,22)
S HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
S AGE=$$AGE^AUPNPAT(DFN,BGPED)
S DEN=$P(NODE,U,2)
S DEN1=$P(DEN,";",1),DEN2=$P(DEN,";",2),DEN3=$P(DEN,";",3)
S NUM=$P(NODE,U,3)
S NUM1=$P(NUM,";",1),NUM2=$$DATE^BGPMUAP3($P($P(NUM,";",2),".",1))
S COMM=$E($$GET1^DIQ(9000001,DFN,1118),1,11)
S SEX=$P(^DPT(DFN,0),U,2)
I $Y>(BGPIOSL-2) D
.D HEADERL^BGPMUPH Q:BGPQUIT
.W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
.S LINE="",$P(LINE,"-",81)="" W !,LINE
W !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,DEN1,?65,NUM1_" "_NUM2
I DEN2'="" D
.W !,?50,DEN2
I DEN3'="" D
.W !,?50,DEN3
Q
DATA2(NODE) ;GET DATA
N NAME,HRN,DEN,SEX,COMM,DEN1,DEN2,DEN3,NUM1,NUM2,LINE
S DFN=$P(NODE,U,1)
S NAME=$E($$GET1^DIQ(2,$P(NODE,U,1),.01),1,18)
S HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
S AGE=$$AGE^AUPNPAT(DFN,BGPED)
S SEX=$P(^DPT(DFN,0),U,2)
S COMM=$E($$GET1^DIQ(9000001,DFN,1118),1,11)
S DEN=$P(NODE,U,2)
S DEN1=$P(DEN,";",1),DEN2=$P(DEN,";",2),DEN3=$P(DEN,";",3)
S NUM=$P(NODE,U,3)
S NUM1=$P(NUM,";",1),NUM2=$$DATE^BGPMUAP3($P($P(NUM,";",2),".",1))
I $Y>(BGPIOSL-2) D
.D HEADERL^BGPMUPH Q:BGPQUIT
.W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
.S LINE="",$P(LINE,"-",81)="" W !,LINE
W !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,DEN1,?65,NUM1_" "_NUM2
I DEN2'="" D
.W !,?50,DEN2
I DEN3'="" D
.W !,?50,DEN3
Q
;Get printout CAD with prior MI and beta blocker therapy
CADBB ;EP
D BETA
K ^TMP("BGPMU0070",$J)
Q
BETA ;Write individual measure
N X,Y,Z,DEN,NUM,PC,STRING1,STRING2,PRD,PRD2,PRN,PRN1,PRN2,PRD1,PRD3,PRN3,PRN4,PRN5,PRD4,PRD5
S STRING1=$$NUM70("C")
S STRING2=$$NUM70("P")
S STRING3=$$NUM70("B")
D SUMMARY2(STRING1,STRING2,STRING3)
;Population
S PRD1=$P(STRING1,U,5)-$P(STRING2,U,5)
S PRD2=$P(STRING1,U,6)-$P(STRING2,U,6)
S PRD3=$P(STRING1,U,7)-$P(STRING2,U,7)
S PRD4=$P(STRING1,U,9)-$P(STRING2,U,9)
S PRN1=$P(STRING1,U,5)-$P(STRING3,U,5)
S PRN2=$P(STRING1,U,6)-$P(STRING3,U,6)
S PRN3=$P(STRING1,U,7)-$P(STRING3,U,7)
S PRN4=$P(STRING1,U,9)-$P(STRING3,U,9)
D HEADER^BGPMUPH Q:BGPQUIT
D HDRBLK^BGPMUPH
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"Pts 18+ w/CAD or cardiac",?33,$P(STRING1,U,1),?44,$P(STRING2,U,1),?64,$P(STRING3,U,1)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"surgery"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# Excluded (Exc)",?33,$P(STRING1,U,4),?44,$P(STRING2,U,4),?64,$P(STRING3,U,4)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"Pts 18+ w/CAD or cardiac",?33,$P(STRING1,U,3),?44,$P(STRING2,U,3),?64,$P(STRING3,U,3)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"surgery less exc"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !!,"# w/beta-blocker therapy",?33,$P(STRING1,U,2),?38,$J($P(STRING1,U,5),5,1),?44,$P(STRING2,U,2),?49,$J($P(STRING2,U,5),5,1),?56,$J($FN(PRD1,",+",1),6),?64,$P(STRING3,U,2),?68,$J($P(STRING3,U,5),5,1),?74,$J($FN(PRN1,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# w/o beta-blocker therapy",?33,$P(STRING1,U,8),?38,$J($P(STRING1,U,9),5,1),?44,$P(STRING2,U,8),?49,$J($P(STRING2,U,9),5,1),?56,$J($FN(PRD4,",+",1),6),?64,$P(STRING3,U,8),?68,$J($P(STRING3,U,9),5,1),?74,$J($FN(PRN4,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
I $D(BGPLIST(BGPIC)) D BETA2
Q
NUM70(TF) ;Get the numbers for this measure
N ARRAY,DEN,NUM,EXC,NOT,PC1,PC11,PC2,PC13,NNUM,PC14
S DEN=+$G(^TMP("BGPMU0070",$J,TF,"DEN"))
S NUM=+$G(^TMP("BGPMU0070",$J,TF,"NUM"))
S NOT=+$G(^TMP("BGPMU0070",$J,TF,"NOT"))
S EXC=+$G(^TMP("BGPMU0070",$J,TF,"EXC"))
S NNUM=DEN-EXC
I DEN=0 S (PC1,PC11,PC13,PC14)=0
I DEN>0&(NNUM=0) D
.S (PC1,PC11,PC14)=0
.S PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
I DEN>0&(NNUM>0) D
.S PC1=$$ROUND^BGPMUA01((NUM/NNUM),3)*100
.S PC11=$$ROUND^BGPMUA01((NNUM/DEN),3)*100
.S PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
.S PC14=$$ROUND^BGPMUA01((NOT/NNUM),3)*100
S ARRAY=DEN_U_NUM_U_NNUM_U_EXC_U_PC1_U_PC11_U_PC13_U_NOT_U_PC14
Q ARRAY
Q ARRAY
BETA2 ;Do the Details
N PT,NODE,NAME,BP,PTCT,BGPARR,LINE
D HEADERL^BGPMUPH
S X="Patients 18+ with a diagnosis of CAD or who had a cardiac surgery procedure, and" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="inactive MI, AND at least 2 outpatient or 2 nursing facility encounters or 1" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="inpatient encounter with the EP during the reporting period, AND who were" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="prescribed beta-blocker therapy during the reporting period, if any." D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="Patients who do not meet the numerator criteria are listed first (NM:), followed" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="by patients who do meet the numerator criteria (M:). Excluded patients" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="are listed last." D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="The following are the abbreviations used in the denominator and numerator" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="columns:" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="CAD=Coronary Artery Disease Diagnosis" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="CSP=Cardiac Surgery Procedure" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="EN=Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="MED=Beta-Blocker Therapy" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
S PTCT=0
I $Y>(BGPIOSL-5) D HEADERL^BGPMUPH Q:BGPQUIT
W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?70,"NUMERATOR"
S LINE="",$P(LINE,"-",81)="" W !,LINE
I BGPLIST="D"!(BGPLIST="A") D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0070"","_$J_",""PAT"",""C"",""NOT"")")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA2(NODE)
I BGPLIST="N"!(BGPLIST="A") D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0070"","_$J_",""PAT"",""C"",""NUM"")")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA2(NODE)
I BGPLIST="A" D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0070"","_$J_",""PAT"",""C"",""EXC"")")
.S PT=0 F S PT=$O(BGPARR(PT)) Q:PT="" D
..S PTCT=PTCT+1
..S NODE=$G(BGPARR(PT))
..D DATA2(NODE)
W !!,"Total # of patients on list: "_PTCT
Q
SUMMARY1(STRING1,STRING2,STRING3,CT) ;Summmary setup
N DESC,DESC2,LINE
K ^TMP("BGPMU SUMMARY",$J,BGPIC)
S ^TMP("BGPMU SUMMARY",$J,BGPIC)="0067^6"
S DESC="18+ # w/antiplatelet therapy"
S LINE="MU.EP.0067.1"_U_DESC_U_$P(STRING1,U,4)_U_$P(STRING1,U,1)_U_$P(STRING1,U,2)_U_$P(STRING1,U,5)_U_U_U_U_U
S LINE=LINE_$P(STRING2,U,4)_U_$P(STRING2,U,3)_U_$P(STRING2,U,2)_U_$P(STRING2,U,5)_U_$P(STRING3,U,4)_U_$P(STRING3,U,3)_U_$P(STRING3,U,2)_U_$P(STRING3,U,5)
S ^TMP("BGPMU SUMMARY",$J,BGPIC,1)=LINE
Q
SUMMARY2(STRING1,STRING2,STRING3) ;Summary setup
N DESC
K ^TMP("BGPMU SUMMARY",$J,BGPIC)
S ^TMP("BGPMU SUMMARY",$J,BGPIC)="0070^7"
S DESC="18+ # w/beta-blocker therapy"
S LINE="MU.EP.0070.1"_U_DESC_U_$P(STRING1,U,4)_U_$P(STRING1,U,1)_U_$P(STRING1,U,2)_U_$P(STRING1,U,5)_U_U_U_U_U
S LINE=LINE_$P(STRING2,U,4)_U_$P(STRING2,U,1)_U_$P(STRING2,U,2)_U_$P(STRING2,U,5)_U_$P(STRING3,U,4)_U_$P(STRING3,U,1)_U_$P(STRING3,U,2)_U_$P(STRING3,U,5)
S ^TMP("BGPMU SUMMARY",$J,BGPIC,1)=LINE
Q
DATE(D) ;EP
I D="" Q ""
Q $E(D,4,5)_"/"_$E(D,6,7)_"/"_$E(D,2,3)
BGPMUAP7 ; IHS/MSC/MGH - MU EP measures NQF0067 and NQF0070 ;21-Jul-2011 15:08;DU
+1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
+2 ;This rouine does the printed output of these 2 EP measures
+3 ;Printout for CAD on antiplatelet therapy
CAD1 ;EP
+1 DO P1
+2 KILL ^TMP("BGPMU0067",$JOB)
+3 QUIT
P1 ;Write individual measure
+1 NEW X,Y,Z,LIST1,LIST2,LIST3
+2 NEW DEN1,NUM1,DEN2,NUM2,PC1,PC2,EXC1,EXC2,STRING1,STRING2,STRING3,SUMCT
+3 NEW PRD1,PRD2,PRD3,PRD4,PRN1,PRN2,PRN3,PRN4,PRN5,PRN6,PRD5,PRD6
+4 SET SUMCT=0
+5 SET STRING1=$$NUM67("C")
+6 SET STRING2=$$NUM67("P")
+7 SET STRING3=$$NUM67("B")
+8 DO SUMMARY1(STRING1,STRING2,STRING3)
+9 ;Population
+10 SET PRD1=$PIECE(STRING1,U,5)-$PIECE(STRING2,U,5)
+11 SET PRD2=$PIECE(STRING1,U,6)-$PIECE(STRING2,U,6)
+12 SET PRD3=$PIECE(STRING1,U,7)-$PIECE(STRING2,U,7)
+13 SET PRD4=$PIECE(STRING1,U,9)-$PIECE(STRING2,U,9)
+14 SET PRN1=$PIECE(STRING1,U,5)-$PIECE(STRING3,U,5)
+15 SET PRN2=$PIECE(STRING1,U,6)-$PIECE(STRING3,U,6)
+16 SET PRN3=$PIECE(STRING1,U,7)-$PIECE(STRING3,U,7)
+17 SET PRN4=$PIECE(STRING1,U,9)-$PIECE(STRING3,U,9)
+18 DO HEADER^BGPMUPH
IF BGPQUIT
QUIT
+19 DO HDRBLK^BGPMUPH
+20 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+21 WRITE !,"Pts 18+ w/CAD or cardiac",?33,$PIECE(STRING1,U,1),?44,$PIECE(STRING2,U,1),?64,$PIECE(STRING3,U,1)
+22 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+23 WRITE !,"surgery"
+24 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+25 WRITE !,"# Excluded (Exc)",?33,$PIECE(STRING1,U,4),?44,$PIECE(STRING2,U,4),?64,$PIECE(STRING3,U,4)
+26 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+27 WRITE !,"Pts 18+ w/CAD or cardiac",?33,$PIECE(STRING1,U,3),?44,$PIECE(STRING2,U,3),?64,$PIECE(STRING3,U,3)
+28 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+29 WRITE !,"surgery less Exc"
+30 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+31 WRITE !!,"# w/antiplatelet therapy",?33,$PIECE(STRING1,U,2),?38,$JUSTIFY($PIECE(STRING1,U,5),5,1),?44,$PIECE(STRING2,U,2),?49,$JUSTIFY(...
... $PIECE(STRING2,U,5),5,1),?56,$JUSTIFY($FNUMBER(PRD1,",+",1),6),?64,$PIECE(STRING3,U,2),?68,$JUSTIFY($PIECE(STRING3,U,5),5,1),?74,$JUSTIFY($FNUMBER(PRN1,",+",1),6)
+32 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+33 WRITE !,"# w/o antiplatelet therapy",?33,$PIECE(STRING1,U,8),?38,$JUSTIFY($PIECE(STRING1,U,9),5,1),?44,$PIECE(STRING2,U,8),?49,...
... $JUSTIFY($PIECE(STRING2,U,9),5,1),?56,$JUSTIFY($FNUMBER(PRD4,",+",1),6),?64,$PIECE(STRING3,U,8),?68,$JUSTIFY($PIECE(STRING3,U,9),5,1),?74,$JUSTIFY($FNUMBER(PRN4,",+",1),6)
+34 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+35 IF $DATA(BGPLIST(BGPIC))
DO P2
+36 ;
+37 QUIT
NUM67(TF) ;Get the numbers for this measure
+1 NEW ARRAY,DEN,NUM,EXC,NOT,PC1,PC11,PC2,PC13,NNUM,PC14
+2 SET DEN=+$GET(^TMP("BGPMU0067",$JOB,TF,"DEN"))
+3 SET NUM=+$GET(^TMP("BGPMU0067",$JOB,TF,"NUM"))
+4 SET NOT=+$GET(^TMP("BGPMU0067",$JOB,TF,"NOT"))
+5 SET EXC=+$GET(^TMP("BGPMU0067",$JOB,TF,"EXC"))
+6 SET NNUM=DEN-EXC
+7 IF DEN=0
SET (PC1,PC11,PC13,PC14)=0
+8 IF DEN>0&(NNUM=0)
Begin DoDot:1
+9 SET (PC1,PC11,PC14)=0
+10 SET PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
End DoDot:1
+11 IF DEN>0&(NNUM>0)
Begin DoDot:1
+12 SET PC1=$$ROUND^BGPMUA01((NUM/NNUM),3)*100
+13 SET PC11=$$ROUND^BGPMUA01((NNUM/DEN),3)*100
+14 SET PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
+15 SET PC14=$$ROUND^BGPMUA01((NOT/NNUM),3)*100
End DoDot:1
+16 SET ARRAY=DEN_U_NUM_U_NNUM_U_EXC_U_PC1_U_PC11_U_PC13_U_NOT_U_PC14
+17 QUIT ARRAY
P2 ;Do the Details
+1 NEW PT,NODE,NAME,VST,BMI,FOL,X,PTCT,BGPARR,LINE
+2 SET PTCT=0
+3 DO HEADERL^BGPMUPH
+4 SET X="Patients 18+ with a diagnosis of CAD (includes MI) or who had cardiac surgery,"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+5 SET X="AND who had at least 2 outpatient or 2 nursing facility encounters or 1"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+6 SET X="inpatient encounter with the EP during the reporting period, AND who were"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+7 SET X="prescribed oral antiplatelet therapy during the reporting period, if any."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+8 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+9 SET X="Patients who did not meet the numerator criteria are listed first (NM:),"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+10 SET X="followed by patients who do meet the numerator criteria (M:). Excluded patients"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+11 SET X="are listed last."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+12 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+13 SET X="The following are the abbreviations used in the denominator and numerator"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+14 SET X="columns:"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+15 SET X="CAD=Coronary Arterery Disease Diagnosis"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+16 SET X="CSP=Cardiac Surgery Procedure"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+17 SET X="EN=Encounter"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+18 SET X="MED=Antiplatelet Therapy"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+19 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+20 IF $Y>(BGPIOSL-5)
DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+21 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
+22 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
+23 IF BGPLIST="D"!(BGPLIST="A")
Begin DoDot:1
+24 KILL BGPARR
+25 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0067"","_$JOB_",""PAT"",""C"",""NOT"")")
+26 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+27 SET PTCT=PTCT+1
+28 SET NODE=$GET(BGPARR(PT))
+29 DO DATA(NODE)
End DoDot:2
End DoDot:1
+30 IF BGPLIST="N"!(BGPLIST="A")
Begin DoDot:1
+31 KILL BGPARR
+32 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0067"","_$JOB_",""PAT"",""C"",""NUM"")")
+33 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+34 SET PTCT=PTCT+1
+35 SET NODE=$GET(BGPARR(PT))
+36 DO DATA(NODE)
End DoDot:2
End DoDot:1
+37 IF BGPLIST="A"
Begin DoDot:1
+38 KILL BGPARR
+39 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0067"","_$JOB_",""PAT"",""C"",""EXC"")")
+40 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+41 SET PTCT=PTCT+1
+42 SET NODE=$GET(BGPARR(PT))
+43 DO DATA(NODE)
End DoDot:2
End DoDot:1
+44 WRITE !!,"Total # of patients on list: "_PTCT
+45 QUIT
DATA(NODE) ;GET DATA
+1 NEW NAME,HRN,DEN,NUM,AGE,DFN,SEX,COMM,NUM1,NUM2,DEN1,DEN2,DEN3,LINE
+2 SET DFN=$PIECE(NODE,U,1)
+3 SET NAME=$EXTRACT($$GET1^DIQ(2,$PIECE(NODE,U,1),.01),1,22)
+4 SET HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
+5 SET AGE=$$AGE^AUPNPAT(DFN,BGPED)
+6 SET DEN=$PIECE(NODE,U,2)
+7 SET DEN1=$PIECE(DEN,";",1)
SET DEN2=$PIECE(DEN,";",2)
SET DEN3=$PIECE(DEN,";",3)
+8 SET NUM=$PIECE(NODE,U,3)
+9 SET NUM1=$PIECE(NUM,";",1)
SET NUM2=$$DATE^BGPMUAP3($PIECE($PIECE(NUM,";",2),".",1))
+10 SET COMM=$EXTRACT($$GET1^DIQ(9000001,DFN,1118),1,11)
+11 SET SEX=$PIECE(^DPT(DFN,0),U,2)
+12 IF $Y>(BGPIOSL-2)
Begin DoDot:1
+13 DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+14 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
+15 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
End DoDot:1
+16 WRITE !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,DEN1,?65,NUM1_" "_NUM2
+17 IF DEN2'=""
Begin DoDot:1
+18 WRITE !,?50,DEN2
End DoDot:1
+19 IF DEN3'=""
Begin DoDot:1
+20 WRITE !,?50,DEN3
End DoDot:1
+21 QUIT
DATA2(NODE) ;GET DATA
+1 NEW NAME,HRN,DEN,SEX,COMM,DEN1,DEN2,DEN3,NUM1,NUM2,LINE
+2 SET DFN=$PIECE(NODE,U,1)
+3 SET NAME=$EXTRACT($$GET1^DIQ(2,$PIECE(NODE,U,1),.01),1,18)
+4 SET HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
+5 SET AGE=$$AGE^AUPNPAT(DFN,BGPED)
+6 SET SEX=$PIECE(^DPT(DFN,0),U,2)
+7 SET COMM=$EXTRACT($$GET1^DIQ(9000001,DFN,1118),1,11)
+8 SET DEN=$PIECE(NODE,U,2)
+9 SET DEN1=$PIECE(DEN,";",1)
SET DEN2=$PIECE(DEN,";",2)
SET DEN3=$PIECE(DEN,";",3)
+10 SET NUM=$PIECE(NODE,U,3)
+11 SET NUM1=$PIECE(NUM,";",1)
SET NUM2=$$DATE^BGPMUAP3($PIECE($PIECE(NUM,";",2),".",1))
+12 IF $Y>(BGPIOSL-2)
Begin DoDot:1
+13 DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+14 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
+15 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
End DoDot:1
+16 WRITE !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,DEN1,?65,NUM1_" "_NUM2
+17 IF DEN2'=""
Begin DoDot:1
+18 WRITE !,?50,DEN2
End DoDot:1
+19 IF DEN3'=""
Begin DoDot:1
+20 WRITE !,?50,DEN3
End DoDot:1
+21 QUIT
+22 ;Get printout CAD with prior MI and beta blocker therapy
CADBB ;EP
+1 DO BETA
+2 KILL ^TMP("BGPMU0070",$JOB)
+3 QUIT
BETA ;Write individual measure
+1 NEW X,Y,Z,DEN,NUM,PC,STRING1,STRING2,PRD,PRD2,PRN,PRN1,PRN2,PRD1,PRD3,PRN3,PRN4,PRN5,PRD4,PRD5
+2 SET STRING1=$$NUM70("C")
+3 SET STRING2=$$NUM70("P")
+4 SET STRING3=$$NUM70("B")
+5 DO SUMMARY2(STRING1,STRING2,STRING3)
+6 ;Population
+7 SET PRD1=$PIECE(STRING1,U,5)-$PIECE(STRING2,U,5)
+8 SET PRD2=$PIECE(STRING1,U,6)-$PIECE(STRING2,U,6)
+9 SET PRD3=$PIECE(STRING1,U,7)-$PIECE(STRING2,U,7)
+10 SET PRD4=$PIECE(STRING1,U,9)-$PIECE(STRING2,U,9)
+11 SET PRN1=$PIECE(STRING1,U,5)-$PIECE(STRING3,U,5)
+12 SET PRN2=$PIECE(STRING1,U,6)-$PIECE(STRING3,U,6)
+13 SET PRN3=$PIECE(STRING1,U,7)-$PIECE(STRING3,U,7)
+14 SET PRN4=$PIECE(STRING1,U,9)-$PIECE(STRING3,U,9)
+15 DO HEADER^BGPMUPH
IF BGPQUIT
QUIT
+16 DO HDRBLK^BGPMUPH
+17 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+18 WRITE !,"Pts 18+ w/CAD or cardiac",?33,$PIECE(STRING1,U,1),?44,$PIECE(STRING2,U,1),?64,$PIECE(STRING3,U,1)
+19 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+20 WRITE !,"surgery"
+21 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+22 WRITE !,"# Excluded (Exc)",?33,$PIECE(STRING1,U,4),?44,$PIECE(STRING2,U,4),?64,$PIECE(STRING3,U,4)
+23 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+24 WRITE !,"Pts 18+ w/CAD or cardiac",?33,$PIECE(STRING1,U,3),?44,$PIECE(STRING2,U,3),?64,$PIECE(STRING3,U,3)
+25 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+26 WRITE !,"surgery less exc"
+27 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+28 WRITE !!,"# w/beta-blocker therapy",?33,$PIECE(STRING1,U,2),?38,$JUSTIFY($PIECE(STRING1,U,5),5,1),?44,$PIECE(STRING2,U,2),?49,$JUSTIFY(...
... $PIECE(STRING2,U,5),5,1),?56,$JUSTIFY($FNUMBER(PRD1,",+",1),6),?64,$PIECE(STRING3,U,2),?68,$JUSTIFY($PIECE(STRING3,U,5),5,1),?74,$JUSTIFY($FNUMBER(PRN1,",+",1),6)
+29 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+30 WRITE !,"# w/o beta-blocker therapy",?33,$PIECE(STRING1,U,8),?38,$JUSTIFY($PIECE(STRING1,U,9),5,1),?44,$PIECE(STRING2,U,8),?49,...
... $JUSTIFY($PIECE(STRING2,U,9),5,1),?56,$JUSTIFY($FNUMBER(PRD4,",+",1),6),?64,$PIECE(STRING3,U,8),?68,$JUSTIFY($PIECE(STRING3,U,9),5,1),?74,$JUSTIFY($FNUMBER(PRN4,",+",1),6)
+31 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+32 IF $DATA(BGPLIST(BGPIC))
DO BETA2
+33 QUIT
NUM70(TF) ;Get the numbers for this measure
+1 NEW ARRAY,DEN,NUM,EXC,NOT,PC1,PC11,PC2,PC13,NNUM,PC14
+2 SET DEN=+$GET(^TMP("BGPMU0070",$JOB,TF,"DEN"))
+3 SET NUM=+$GET(^TMP("BGPMU0070",$JOB,TF,"NUM"))
+4 SET NOT=+$GET(^TMP("BGPMU0070",$JOB,TF,"NOT"))
+5 SET EXC=+$GET(^TMP("BGPMU0070",$JOB,TF,"EXC"))
+6 SET NNUM=DEN-EXC
+7 IF DEN=0
SET (PC1,PC11,PC13,PC14)=0
+8 IF DEN>0&(NNUM=0)
Begin DoDot:1
+9 SET (PC1,PC11,PC14)=0
+10 SET PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
End DoDot:1
+11 IF DEN>0&(NNUM>0)
Begin DoDot:1
+12 SET PC1=$$ROUND^BGPMUA01((NUM/NNUM),3)*100
+13 SET PC11=$$ROUND^BGPMUA01((NNUM/DEN),3)*100
+14 SET PC13=$$ROUND^BGPMUA01((EXC/DEN),3)*100
+15 SET PC14=$$ROUND^BGPMUA01((NOT/NNUM),3)*100
End DoDot:1
+16 SET ARRAY=DEN_U_NUM_U_NNUM_U_EXC_U_PC1_U_PC11_U_PC13_U_NOT_U_PC14
+17 QUIT ARRAY
+18 QUIT ARRAY
BETA2 ;Do the Details
+1 NEW PT,NODE,NAME,BP,PTCT,BGPARR,LINE
+2 DO HEADERL^BGPMUPH
+3 SET X="Patients 18+ with a diagnosis of CAD or who had a cardiac surgery procedure, and"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+4 SET X="inactive MI, AND at least 2 outpatient or 2 nursing facility encounters or 1"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+5 SET X="inpatient encounter with the EP during the reporting period, AND who were"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+6 SET X="prescribed beta-blocker therapy during the reporting period, if any."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+7 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+8 SET X="Patients who do not meet the numerator criteria are listed first (NM:), followed"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+9 SET X="by patients who do meet the numerator criteria (M:). Excluded patients"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+10 SET X="are listed last."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+11 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+12 SET X="The following are the abbreviations used in the denominator and numerator"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+13 SET X="columns:"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+14 SET X="CAD=Coronary Artery Disease Diagnosis"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+15 SET X="CSP=Cardiac Surgery Procedure"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+16 SET X="EN=Encounter"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+17 SET X="MED=Beta-Blocker Therapy"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+18 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+19 SET PTCT=0
+20 IF $Y>(BGPIOSL-5)
DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+21 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?70,"NUMERATOR"
+22 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
+23 IF BGPLIST="D"!(BGPLIST="A")
Begin DoDot:1
+24 KILL BGPARR
+25 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0070"","_$JOB_",""PAT"",""C"",""NOT"")")
+26 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+27 SET PTCT=PTCT+1
+28 SET NODE=$GET(BGPARR(PT))
+29 DO DATA2(NODE)
End DoDot:2
End DoDot:1
+30 IF BGPLIST="N"!(BGPLIST="A")
Begin DoDot:1
+31 KILL BGPARR
+32 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0070"","_$JOB_",""PAT"",""C"",""NUM"")")
+33 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+34 SET PTCT=PTCT+1
+35 SET NODE=$GET(BGPARR(PT))
+36 DO DATA2(NODE)
End DoDot:2
End DoDot:1
+37 IF BGPLIST="A"
Begin DoDot:1
+38 KILL BGPARR
+39 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0070"","_$JOB_",""PAT"",""C"",""EXC"")")
+40 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+41 SET PTCT=PTCT+1
+42 SET NODE=$GET(BGPARR(PT))
+43 DO DATA2(NODE)
End DoDot:2
End DoDot:1
+44 WRITE !!,"Total # of patients on list: "_PTCT
+45 QUIT
SUMMARY1(STRING1,STRING2,STRING3,CT) ;Summmary setup
+1 NEW DESC,DESC2,LINE
+2 KILL ^TMP("BGPMU SUMMARY",$JOB,BGPIC)
+3 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC)="0067^6"
+4 SET DESC="18+ # w/antiplatelet therapy"
+5 SET LINE="MU.EP.0067.1"_U_DESC_U_$PIECE(STRING1,U,4)_U_$PIECE(STRING1,U,1)_U_$PIECE(STRING1,U,2)_U_$PIECE(STRING1,U,5)_U_U_U_U_U
+6 SET LINE=LINE_$PIECE(STRING2,U,4)_U_$PIECE(STRING2,U,3)_U_$PIECE(STRING2,U,2)_U_$PIECE(STRING2,U,5)_U_$PIECE(STRING3,U,4)_U_$PIECE(STRING3,U,3)_U_$PIECE(STRING3,U,2)_U_$PIECE(STRING3,U,5)
+7 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC,1)=LINE
+8 QUIT
SUMMARY2(STRING1,STRING2,STRING3) ;Summary setup
+1 NEW DESC
+2 KILL ^TMP("BGPMU SUMMARY",$JOB,BGPIC)
+3 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC)="0070^7"
+4 SET DESC="18+ # w/beta-blocker therapy"
+5 SET LINE="MU.EP.0070.1"_U_DESC_U_$PIECE(STRING1,U,4)_U_$PIECE(STRING1,U,1)_U_$PIECE(STRING1,U,2)_U_$PIECE(STRING1,U,5)_U_U_U_U_U
+6 SET LINE=LINE_$PIECE(STRING2,U,4)_U_$PIECE(STRING2,U,1)_U_$PIECE(STRING2,U,2)_U_$PIECE(STRING2,U,5)_U_$PIECE(STRING3,U,4)_U_$PIECE(STRING3,U,1)_U_$PIECE(STRING3,U,2)_U_$PIECE(STRING3,U,5)
+7 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC,1)=LINE
+8 QUIT
DATE(D) ;EP
+1 IF D=""
QUIT ""
+2 QUIT $EXTRACT(D,4,5)_"/"_$EXTRACT(D,6,7)_"/"_$EXTRACT(D,2,3)