BGPMUFP5 ; IHS/MSC/MMT - Print MU EP measures NQF0075 ;20-JUL-2011 11:27;DU
;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
;Printed output reports for this measure
IVDLDL ;EP
D P1
K ^TMP("BGPMU0075",$J)
Q
P1 ;Write individual measure
N X,Y,Z,DEN,NUM1,NUM2,PC1,PC2,PC3,PC4,STRING1,STRING2,STRING3
N PRD,PRN,PRD1,PRN1,PRD2,PRN2,PRD3,PRN3
S STRING1=$$D75("C")
S STRING2=$$D75("P")
S STRING3=$$D75("B")
S PRD=$P(STRING1,U,3)-$P(STRING2,U,3)
S PRN=$P(STRING1,U,3)-$P(STRING3,U,3)
S PRD1=$P(STRING1,U,5)-$P(STRING2,U,5)
S PRN1=$P(STRING1,U,5)-$P(STRING3,U,5)
S PRD2=$P(STRING1,U,7)-$P(STRING2,U,7)
S PRN2=$P(STRING1,U,7)-$P(STRING3,U,7)
S PRD3=$P(STRING1,U,8)-$P(STRING2,U,8)
S PRN3=$P(STRING1,U,8)-$P(STRING3,U,8)
D HEADER^BGPMUPH Q:BGPQUIT
D HDRBLK^BGPMUPH
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH Q:BGPQUIT
W !,"Pts 18+ w/PTCA, AMI, CABG",?33,($P(STRING1,U,1)+$P(STRING1,U,4)),?44,($P(STRING2,U,1)+$P(STRING2,U,4)),?64,($P(STRING3,U,1)+$P(STRING3,U,4))
W !,"or IVD"
I $Y>(BGPIOSL-5) D HEADER^BGPMUPH Q:BGPQUIT
W !!,"Numerator 1"
W !,"# w/LDL test result",?33,$P(STRING1,U,2),?38,$J($P(STRING1,U,3),5,1),?44,$P(STRING2,U,2),?49,$J($P(STRING2,U,3),5,1),?56,$J($FN(PRD,",+",1),6),?64,$P(STRING3,U,2),?68,$J($P(STRING3,U,3),5,1),?74,$J($FN(PRN,",+",1),6)
W !,"# w/o LDL test result",?33,($P(STRING1,U,1)-$P(STRING1,U,2)),?38,$J($P(STRING1,U,5),5,1),?44,($P(STRING2,U,1)-$P(STRING2,U,2)),?49,$J($P(STRING2,U,5),5,1),?56,$J($FN(PRD1,",+",1),6)
W ?64,($P(STRING3,U,1)-$P(STRING3,U,2)),?68,$J($P(STRING3,U,5),5,1),?74,$J($FN(PRN1,",+",1),6)
I $Y>(BGPIOSL-5) D HEADER^BGPMUPH Q:BGPQUIT
W !!,"Numerator 2"
W !,"w/LDL < 100mg/dL",?33,$P(STRING1,U,6),?38,$J($P(STRING1,U,7),5,1),?44,$P(STRING2,U,6),?49,$J($P(STRING2,U,7),5,1),?56,$J($FN(PRD2,",+",1),6),?64,$P(STRING3,U,6),?68,$J($P(STRING3,U,7),5,1),?74,$J($FN(PRN2,",+",1),6)
W !,"w/o LDL < 100mg/dL",?33,($P(STRING1,U,1)-$P(STRING1,U,6)),?38,$J($P(STRING1,U,8),5,1),?44,($P(STRING2,U,1)-$P(STRING2,U,6)),?49,$J($P(STRING2,U,8),5,1),?56,$J($FN(PRD3,",+",1),6)
W ?64,($P(STRING3,U,1)-$P(STRING3,U,6)),?68,$J($P(STRING3,U,8),5,1),?74,$J($FN(PRN3,",+",1),6)
I $D(BGPLIST(BGPIC)) D P2
D SUM75
K X,Y,Z,DEN,NUM1,NUM2,PC1,PC2,PC3,PC4,STRING1,STRING2,STRING3
K PRD,PRN,PRD1,PRN1,PRD2,PRN2,PRD3,PRN3
Q
D75(TF) ;Get the numbers for this measure
N DATA
S DEN=+$G(^TMP("BGPMU0075",$J,TF,"DEN"))
S NUM1=+$G(^TMP("BGPMU0075",$J,TF,"NUM",1))
S NUM2=+$G(^TMP("BGPMU0075",$J,TF,"NUM",2))
I DEN=0 S (PC1,PC2,PC3,PC4)=0
I DEN>0 D
.S PC1=$$ROUND^BGPMUA01((NUM1/DEN),3)*100,PC2=$$ROUND^BGPMUA01(((DEN-NUM1)/DEN),3)*100
.S PC3=$$ROUND^BGPMUA01((NUM2/DEN),3)*100,PC4=$$ROUND^BGPMUA01(((DEN-NUM2)/DEN),3)*100
S DATA=DEN_U_NUM1_U_PC1_U_""_U_PC2_U_NUM2_U_PC3_U_PC4
Q DATA
P2 ;Do the Details
N PT,NODE,NAME,VST,COLON,FOL,BGPARR,LINE,PTCT,NOTMET
D HEADERL^BGPMUPH
S X="Patients 18+ and (a) who had at least 1 acute inpatient encounter with the" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="EP 14-24 months prior to the reporting period end date AND who underwent" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="percutaneous transluminal coronary angioplasty (PTCA), acute myocardial" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="infarction (AMI), or coronary artery bypass graft (CABG); OR (b) who had least" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="1 acute inpatient or outpatient encounter with the EP within 2 years of the" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="reporting period end date with a diagnosis of ischemic vascular disease (IVD);" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="AND (c) who had a complete lipid profile performed during the measurement year;" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="AND (d) whose LDL=C was <100 mg/dL, if any." D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="Patients who do not meet the numerator criteria are listed first (NM:)," D W^BGPMUPP(X,0,2,BGPPTYPE)
S X="followed by patients who do meet the numerator criteria (M:)." 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,2,BGPPTYPE)
S X="columns:" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="PTCA=PTCA Procedure" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="AMI=AMI Diagnosis" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="CABG=CABG Procedure" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="IVD=IVD Diagnosis" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="EN=Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="LDL=LDL Lab Test" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="CHL=Cholesterol Lab Test" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="HDL=High Density Lipoprotein Lab Test" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="TRI=Triglycerides Test" D W^BGPMUPP(X,0,1,BGPPTYPE)
I $Y>(BGPIOSL-8) D HEADERL^BGPMUPH Q:BGPQUIT
S X="Numerator 1: Patients with LDL Test" D W^BGPMUPP(X,0,2,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
S PTCT=0
W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
S LINE="",$P(LINE,"-",81)="" W !,LINE
I BGPLIST="D"!(BGPLIST="A") D
.S NOTMET=1
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$J_",""PAT"",""C"",""NOT"",1)")
.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
.S NOTMET=0
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$J_",""PAT"",""C"",""NUM"",1)")
.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
I $Y>(BGPIOSL-8) D HEADERL^BGPMUPH Q:BGPQUIT
S X="Numerator 2: Patients with LDL Test Result < 100mg/dL" D W^BGPMUPP(X,0,2,BGPPTYPE)
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
S PTCT=0
W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
S LINE="",$P(LINE,"-",81)="" W !,LINE
I BGPLIST="D"!(BGPLIST="A") D
.S NOTMET=1
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$J_",""PAT"",""C"",""NOT"",2)")
.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
.S NOTMET=0
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$J_",""PAT"",""C"",""NUM"",2)")
.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
K PT,NODE,NAME,VST,COLON,FOL
Q
DATA(NODE) ;DISPLAY DATA
N X,NAME,HRN,DEN,DEN1,DEN2,NUM1,NUM2,NUM3,AGE,DFN,LINE,COMM,SEX
N NUMVALS,NUMDATES
S (DEN1,DEN2,NUM1,NUM2,NUM3)=""
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 COMM=$E($$GET1^DIQ(9000001,DFN,1118),1,11)
S SEX=$P(^DPT(DFN,0),U,2)
S DEN=$P(NODE,U,2),NUMDATES=$P(NODE,U,3),NUMVALS=$P(NODE,U,4)
S DEN1=$P(DEN,";",1),DEN2=$P(DEN,";",2)
S:NUMVALS'="" NUM1=$P(NUMVALS,";",1)_" "_$$DATE^BGPMUUTL($P(NUMDATES,";",1))
S:$P(NUMVALS,";",2)'="" NUM2=$P(NUMVALS,";",2)_" "_$$DATE^BGPMUUTL($P(NUMDATES,";",2))
S:$P(NUMVALS,";",3)'="" NUM3=$P(NUMVALS,";",3)_" "_$$DATE^BGPMUUTL($P(NUMDATES,";",3))
I $Y>(BGPIOSL-2) D
.D HEADERL^BGPMUPH Q:BGPQUIT
.W !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
.S LINE="",$P(LINE,"-",81)="" W !,LINE
W !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,DEN1,?64,$S(NOTMET:"NM:",1:"M:"),NUM1
W:(DEN2'="")!(NUM2'="") !,?50,DEN2,?66,NUM2
W:NUM3'="" !,?66,NUM3
K X,NAME,HRN,DEN,DEN1,DEN2,NUM1,NUM2,NUM3,AGE,DFN,LINE,COMM,SEX
K NUMVALS,NUMDATES
Q
XML75 ;Populate the BGPXML array with data for each population/numerator
; BGPXMLOUT(i)=PQRI number^""^Denominator Count^Numerator Count^Exclusion Count
;NOTE: the first pieces below are INCORRECT but no PQRI number is defined for this measure
S BGPXML(1)="0075.1"_U_""_U_+$G(^TMP("BGPMU0075",$J,"C","DEN"))_U_+$G(^TMP("BGPMU0075",$J,"C","NUM",1))
S BGPXML(1)="0075.2"_U_""_U_+$G(^TMP("BGPMU0075",$J,"C","DEN"))_U_+$G(^TMP("BGPMU0075",$J,"C","NUM",2))
K ^TMP("BGPMU0075",$J)
Q
SUM75 ;Populate "BGPMU SUMMARY" for IVD LDL
;Initialize iCare/summary global
N BGPDNCNT,BGPSSTR,J,N
S BGPDNCNT=0
K ^TMP("BGPMU SUMMARY",$J,BGPIC)
S ^TMP("BGPMU SUMMARY",$J,BGPIC)="0075"_U_"N/A"
S N=1 ;only 1 numerator
;Setup summary page/iCare ^TMP global
S CDEN1CT=+$G(^TMP("BGPMU0075",$J,"C","DEN")) ;current
S CNUM1CT=+$G(^TMP("BGPMU0075",$J,"C","NUM",1))
S CNUM2CT=+$G(^TMP("BGPMU0075",$J,"C","NUM",2))
S CMP=$S(CDEN1CT>0:$$ROUND^BGPMUA01(CNUM1CT/CDEN1CT,3)*100,1:0)
S CMP2=$S(CDEN1CT>0:$$ROUND^BGPMUA01(CNUM2CT/CDEN1CT,3)*100,1:0)
S PDEN1CT=+$G(^TMP("BGPMU0075",$J,"P","DEN")) ;previous
S PNUM1CT=+$G(^TMP("BGPMU0075",$J,"P","NUM",1))
S PNUM2CT=+$G(^TMP("BGPMU0075",$J,"P","NUM",2))
S PMP=$S(PDEN1CT>0:$$ROUND^BGPMUA01(PNUM1CT/PDEN1CT,3)*100,1:0)
S PMP2=$S(PDEN1CT>0:$$ROUND^BGPMUA01(PNUM2CT/PDEN1CT,3)*100,1:0)
S BDEN1CT=+$G(^TMP("BGPMU0075",$J,"B","DEN")) ;baseline
S BNUM1CT=+$G(^TMP("BGPMU0075",$J,"B","NUM",1))
S BNUM2CT=+$G(^TMP("BGPMU0075",$J,"B","NUM",2))
S BMP=$S(BDEN1CT>0:$$ROUND^BGPMUA01(BNUM1CT/BDEN1CT,3)*100,1:0)
S BMP2=$S(BDEN1CT>0:$$ROUND^BGPMUA01(BNUM2CT/BDEN1CT,3)*100,1:0)
;FIRST NUMERATOR
S BGPDNCNT=BGPDNCNT+1
S BGPSSTR="MU.EP.0075.1"_U_"18+ # w/LDL test result"_U_""_U_CDEN1CT_U_CNUM1CT_U_CMP_U_U_U_U
; 11 12 13 14
S BGPSSTR=BGPSSTR_U_""_U_PDEN1CT_U_PNUM1CT_U_PMP
; 15 16 17 18
S BGPSSTR=BGPSSTR_U_""_U_BDEN1CT_U_BNUM1CT_U_BMP
S ^TMP("BGPMU SUMMARY",$J,BGPIC,BGPDNCNT)=BGPSSTR
;SECOND NUMERATOR
S BGPDNCNT=BGPDNCNT+1,BGPSSTR=""
S BGPSSTR="MU.EP.0075.2"_U_"18+ # w/LDL < 100mg/dL"_U_""_U_CDEN1CT_U_CNUM2CT_U_CMP2_U_U_U_U
; 11 12 13 14
S BGPSSTR=BGPSSTR_U_""_U_PDEN1CT_U_PNUM2CT_U_PMP2
; 15 16 17 18
S BGPSSTR=BGPSSTR_U_""_U_BDEN1CT_U_BNUM2CT_U_BMP2
S ^TMP("BGPMU SUMMARY",$J,BGPIC,BGPDNCNT)=BGPSSTR
Q
BGPMUFP5 ; IHS/MSC/MMT - Print MU EP measures NQF0075 ;20-JUL-2011 11:27;DU
+1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
+2 ;Printed output reports for this measure
IVDLDL ;EP
+1 DO P1
+2 KILL ^TMP("BGPMU0075",$JOB)
+3 QUIT
P1 ;Write individual measure
+1 NEW X,Y,Z,DEN,NUM1,NUM2,PC1,PC2,PC3,PC4,STRING1,STRING2,STRING3
+2 NEW PRD,PRN,PRD1,PRN1,PRD2,PRN2,PRD3,PRN3
+3 SET STRING1=$$D75("C")
+4 SET STRING2=$$D75("P")
+5 SET STRING3=$$D75("B")
+6 SET PRD=$PIECE(STRING1,U,3)-$PIECE(STRING2,U,3)
+7 SET PRN=$PIECE(STRING1,U,3)-$PIECE(STRING3,U,3)
+8 SET PRD1=$PIECE(STRING1,U,5)-$PIECE(STRING2,U,5)
+9 SET PRN1=$PIECE(STRING1,U,5)-$PIECE(STRING3,U,5)
+10 SET PRD2=$PIECE(STRING1,U,7)-$PIECE(STRING2,U,7)
+11 SET PRN2=$PIECE(STRING1,U,7)-$PIECE(STRING3,U,7)
+12 SET PRD3=$PIECE(STRING1,U,8)-$PIECE(STRING2,U,8)
+13 SET PRN3=$PIECE(STRING1,U,8)-$PIECE(STRING3,U,8)
+14 DO HEADER^BGPMUPH
IF BGPQUIT
QUIT
+15 DO HDRBLK^BGPMUPH
+16 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
IF BGPQUIT
QUIT
+17 WRITE !,"Pts 18+ w/PTCA, AMI, CABG",?33,($PIECE(STRING1,U,1)+$PIECE(STRING1,U,4)),?44,($PIECE(STRING2,U,1)+$PIECE(STRING2,U,4)),?64,($PIECE(STRING3,U,1)+$PIECE(STRING3,U,4))
+18 WRITE !,"or IVD"
+19 IF $Y>(BGPIOSL-5)
DO HEADER^BGPMUPH
IF BGPQUIT
QUIT
+20 WRITE !!,"Numerator 1"
+21 WRITE !,"# w/LDL test result",?33,$PIECE(STRING1,U,2),?38,$JUSTIFY($PIECE(STRING1,U,3),5,1),?44,$PIECE(STRING2,U,2),?49,$JUSTIFY($PIECE(STRING2,U,3),5,1),?56,...
... $JUSTIFY($FNUMBER(PRD,",+",1),6),?64,$PIECE(STRING3,U,2),?68,$JUSTIFY($PIECE(STRING3,U,3),5,1),?74,$JUSTIFY($FNUMBER(PRN,",+",1),6)
+22 WRITE !,"# w/o LDL test result",?33,($PIECE(STRING1,U,1)-$PIECE(STRING1,U,2)),?38,$JUSTIFY($PIECE(STRING1,U,5),5,1),?44,($PIECE(STRING2,U,1)-$PIECE(STRING2,U,2)),?49,$JUSTIFY($PIECE(STRING2,U,5),5,1),?56,$JUSTIFY($FNUMBER(PRD1,",+",1),6)
+23 WRITE ?64,($PIECE(STRING3,U,1)-$PIECE(STRING3,U,2)),?68,$JUSTIFY($PIECE(STRING3,U,5),5,1),?74,$JUSTIFY($FNUMBER(PRN1,",+",1),6)
+24 IF $Y>(BGPIOSL-5)
DO HEADER^BGPMUPH
IF BGPQUIT
QUIT
+25 WRITE !!,"Numerator 2"
+26 WRITE !,"w/LDL < 100mg/dL",?33,$PIECE(STRING1,U,6),?38,$JUSTIFY($PIECE(STRING1,U,7),5,1),?44,$PIECE(STRING2,U,6),?49,$JUSTIFY($PIECE(STRING2,U,7),5,1),?56,...
... $JUSTIFY($FNUMBER(PRD2,",+",1),6),?64,$PIECE(STRING3,U,6),?68,$JUSTIFY($PIECE(STRING3,U,7),5,1),?74,$JUSTIFY($FNUMBER(PRN2,",+",1),6)
+27 WRITE !,"w/o LDL < 100mg/dL",?33,($PIECE(STRING1,U,1)-$PIECE(STRING1,U,6)),?38,$JUSTIFY($PIECE(STRING1,U,8),5,1),?44,($PIECE(STRING2,U,1)-$PIECE(STRING2,U,6)),?49,$JUSTIFY($PIECE(STRING2,U,8),5,1),?56,$JUSTIFY($FNUMBER(PRD3,",+",1),6)
+28 WRITE ?64,($PIECE(STRING3,U,1)-$PIECE(STRING3,U,6)),?68,$JUSTIFY($PIECE(STRING3,U,8),5,1),?74,$JUSTIFY($FNUMBER(PRN3,",+",1),6)
+29 IF $DATA(BGPLIST(BGPIC))
DO P2
+30 DO SUM75
+31 KILL X,Y,Z,DEN,NUM1,NUM2,PC1,PC2,PC3,PC4,STRING1,STRING2,STRING3
+32 KILL PRD,PRN,PRD1,PRN1,PRD2,PRN2,PRD3,PRN3
+33 QUIT
D75(TF) ;Get the numbers for this measure
+1 NEW DATA
+2 SET DEN=+$GET(^TMP("BGPMU0075",$JOB,TF,"DEN"))
+3 SET NUM1=+$GET(^TMP("BGPMU0075",$JOB,TF,"NUM",1))
+4 SET NUM2=+$GET(^TMP("BGPMU0075",$JOB,TF,"NUM",2))
+5 IF DEN=0
SET (PC1,PC2,PC3,PC4)=0
+6 IF DEN>0
Begin DoDot:1
+7 SET PC1=$$ROUND^BGPMUA01((NUM1/DEN),3)*100
SET PC2=$$ROUND^BGPMUA01(((DEN-NUM1)/DEN),3)*100
+8 SET PC3=$$ROUND^BGPMUA01((NUM2/DEN),3)*100
SET PC4=$$ROUND^BGPMUA01(((DEN-NUM2)/DEN),3)*100
End DoDot:1
+9 SET DATA=DEN_U_NUM1_U_PC1_U_""_U_PC2_U_NUM2_U_PC3_U_PC4
+10 QUIT DATA
P2 ;Do the Details
+1 NEW PT,NODE,NAME,VST,COLON,FOL,BGPARR,LINE,PTCT,NOTMET
+2 DO HEADERL^BGPMUPH
+3 SET X="Patients 18+ and (a) who had at least 1 acute inpatient encounter with the"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+4 SET X="EP 14-24 months prior to the reporting period end date AND who underwent"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+5 SET X="percutaneous transluminal coronary angioplasty (PTCA), acute myocardial"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+6 SET X="infarction (AMI), or coronary artery bypass graft (CABG); OR (b) who had least"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+7 SET X="1 acute inpatient or outpatient encounter with the EP within 2 years of the"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+8 SET X="reporting period end date with a diagnosis of ischemic vascular disease (IVD);"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+9 SET X="AND (c) who had a complete lipid profile performed during the measurement year;"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+10 SET X="AND (d) whose LDL=C was <100 mg/dL, if any."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+11 SET X="Patients who do not meet the numerator criteria are listed first (NM:),"
DO W^BGPMUPP(X,0,2,BGPPTYPE)
+12 SET X="followed by patients who do meet the numerator criteria (M:)."
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,2,BGPPTYPE)
+14 SET X="columns:"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+15 SET X="PTCA=PTCA Procedure"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+16 SET X="AMI=AMI Diagnosis"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+17 SET X="CABG=CABG Procedure"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+18 SET X="IVD=IVD Diagnosis"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+19 SET X="EN=Encounter"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+20 SET X="LDL=LDL Lab Test"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+21 SET X="CHL=Cholesterol Lab Test"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+22 SET X="HDL=High Density Lipoprotein Lab Test"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+23 SET X="TRI=Triglycerides Test"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+24 IF $Y>(BGPIOSL-8)
DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+25 SET X="Numerator 1: Patients with LDL Test"
DO W^BGPMUPP(X,0,2,BGPPTYPE)
+26 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+27 SET PTCT=0
+28 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
+29 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
+30 IF BGPLIST="D"!(BGPLIST="A")
Begin DoDot:1
+31 SET NOTMET=1
+32 KILL BGPARR
+33 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$JOB_",""PAT"",""C"",""NOT"",1)")
+34 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+35 SET PTCT=PTCT+1
+36 SET NODE=$GET(BGPARR(PT))
+37 DO DATA(NODE)
End DoDot:2
End DoDot:1
+38 IF BGPLIST="N"!(BGPLIST="A")
Begin DoDot:1
+39 SET NOTMET=0
+40 KILL BGPARR
+41 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$JOB_",""PAT"",""C"",""NUM"",1)")
+42 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+43 SET PTCT=PTCT+1
+44 SET NODE=$GET(BGPARR(PT))
+45 DO DATA(NODE)
End DoDot:2
End DoDot:1
+46 WRITE !!,"Total # of patients on list: "_PTCT
+47 IF $Y>(BGPIOSL-8)
DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+48 SET X="Numerator 2: Patients with LDL Test Result < 100mg/dL"
DO W^BGPMUPP(X,0,2,BGPPTYPE)
+49 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+50 SET PTCT=0
+51 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
+52 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
+53 IF BGPLIST="D"!(BGPLIST="A")
Begin DoDot:1
+54 SET NOTMET=1
+55 KILL BGPARR
+56 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$JOB_",""PAT"",""C"",""NOT"",2)")
+57 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+58 SET PTCT=PTCT+1
+59 SET NODE=$GET(BGPARR(PT))
+60 DO DATA(NODE)
End DoDot:2
End DoDot:1
+61 IF BGPLIST="N"!(BGPLIST="A")
Begin DoDot:1
+62 SET NOTMET=0
+63 KILL BGPARR
+64 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0075"","_$JOB_",""PAT"",""C"",""NUM"",2)")
+65 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+66 SET PTCT=PTCT+1
+67 SET NODE=$GET(BGPARR(PT))
+68 DO DATA(NODE)
End DoDot:2
End DoDot:1
+69 WRITE !!,"Total # of patients on list: "_PTCT
+70 KILL PT,NODE,NAME,VST,COLON,FOL
+71 QUIT
DATA(NODE) ;DISPLAY DATA
+1 NEW X,NAME,HRN,DEN,DEN1,DEN2,NUM1,NUM2,NUM3,AGE,DFN,LINE,COMM,SEX
+2 NEW NUMVALS,NUMDATES
+3 SET (DEN1,DEN2,NUM1,NUM2,NUM3)=""
+4 SET DFN=$PIECE(NODE,U,1)
+5 SET NAME=$EXTRACT($$GET1^DIQ(2,$PIECE(NODE,U,1),.01),1,22)
+6 SET HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
+7 SET AGE=$$AGE^AUPNPAT(DFN,BGPED)
+8 SET COMM=$EXTRACT($$GET1^DIQ(9000001,DFN,1118),1,11)
+9 SET SEX=$PIECE(^DPT(DFN,0),U,2)
+10 SET DEN=$PIECE(NODE,U,2)
SET NUMDATES=$PIECE(NODE,U,3)
SET NUMVALS=$PIECE(NODE,U,4)
+11 SET DEN1=$PIECE(DEN,";",1)
SET DEN2=$PIECE(DEN,";",2)
+12 IF NUMVALS'=""
SET NUM1=$PIECE(NUMVALS,";",1)_" "_$$DATE^BGPMUUTL($PIECE(NUMDATES,";",1))
+13 IF $PIECE(NUMVALS,";",2)'=""
SET NUM2=$PIECE(NUMVALS,";",2)_" "_$$DATE^BGPMUUTL($PIECE(NUMDATES,";",2))
+14 IF $PIECE(NUMVALS,";",3)'=""
SET NUM3=$PIECE(NUMVALS,";",3)_" "_$$DATE^BGPMUUTL($PIECE(NUMDATES,";",3))
+15 IF $Y>(BGPIOSL-2)
Begin DoDot:1
+16 DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+17 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?64,"NUMERATOR"
+18 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
End DoDot:1
+19 WRITE !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,DEN1,?64,$SELECT(NOTMET:"NM:",1:"M:"),NUM1
+20 IF (DEN2'="")!(NUM2'="")
WRITE !,?50,DEN2,?66,NUM2
+21 IF NUM3'=""
WRITE !,?66,NUM3
+22 KILL X,NAME,HRN,DEN,DEN1,DEN2,NUM1,NUM2,NUM3,AGE,DFN,LINE,COMM,SEX
+23 KILL NUMVALS,NUMDATES
+24 QUIT
XML75 ;Populate the BGPXML array with data for each population/numerator
+1 ; BGPXMLOUT(i)=PQRI number^""^Denominator Count^Numerator Count^Exclusion Count
+2 ;NOTE: the first pieces below are INCORRECT but no PQRI number is defined for this measure
+3 SET BGPXML(1)="0075.1"_U_""_U_+$GET(^TMP("BGPMU0075",$JOB,"C","DEN"))_U_+$GET(^TMP("BGPMU0075",$JOB,"C","NUM",1))
+4 SET BGPXML(1)="0075.2"_U_""_U_+$GET(^TMP("BGPMU0075",$JOB,"C","DEN"))_U_+$GET(^TMP("BGPMU0075",$JOB,"C","NUM",2))
+5 KILL ^TMP("BGPMU0075",$JOB)
+6 QUIT
SUM75 ;Populate "BGPMU SUMMARY" for IVD LDL
+1 ;Initialize iCare/summary global
+2 NEW BGPDNCNT,BGPSSTR,J,N
+3 SET BGPDNCNT=0
+4 KILL ^TMP("BGPMU SUMMARY",$JOB,BGPIC)
+5 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC)="0075"_U_"N/A"
+6 ;only 1 numerator
SET N=1
+7 ;Setup summary page/iCare ^TMP global
+8 ;current
SET CDEN1CT=+$GET(^TMP("BGPMU0075",$JOB,"C","DEN"))
+9 SET CNUM1CT=+$GET(^TMP("BGPMU0075",$JOB,"C","NUM",1))
+10 SET CNUM2CT=+$GET(^TMP("BGPMU0075",$JOB,"C","NUM",2))
+11 SET CMP=$SELECT(CDEN1CT>0:$$ROUND^BGPMUA01(CNUM1CT/CDEN1CT,3)*100,1:0)
+12 SET CMP2=$SELECT(CDEN1CT>0:$$ROUND^BGPMUA01(CNUM2CT/CDEN1CT,3)*100,1:0)
+13 ;previous
SET PDEN1CT=+$GET(^TMP("BGPMU0075",$JOB,"P","DEN"))
+14 SET PNUM1CT=+$GET(^TMP("BGPMU0075",$JOB,"P","NUM",1))
+15 SET PNUM2CT=+$GET(^TMP("BGPMU0075",$JOB,"P","NUM",2))
+16 SET PMP=$SELECT(PDEN1CT>0:$$ROUND^BGPMUA01(PNUM1CT/PDEN1CT,3)*100,1:0)
+17 SET PMP2=$SELECT(PDEN1CT>0:$$ROUND^BGPMUA01(PNUM2CT/PDEN1CT,3)*100,1:0)
+18 ;baseline
SET BDEN1CT=+$GET(^TMP("BGPMU0075",$JOB,"B","DEN"))
+19 SET BNUM1CT=+$GET(^TMP("BGPMU0075",$JOB,"B","NUM",1))
+20 SET BNUM2CT=+$GET(^TMP("BGPMU0075",$JOB,"B","NUM",2))
+21 SET BMP=$SELECT(BDEN1CT>0:$$ROUND^BGPMUA01(BNUM1CT/BDEN1CT,3)*100,1:0)
+22 SET BMP2=$SELECT(BDEN1CT>0:$$ROUND^BGPMUA01(BNUM2CT/BDEN1CT,3)*100,1:0)
+23 ;FIRST NUMERATOR
+24 SET BGPDNCNT=BGPDNCNT+1
+25 SET BGPSSTR="MU.EP.0075.1"_U_"18+ # w/LDL test result"_U_""_U_CDEN1CT_U_CNUM1CT_U_CMP_U_U_U_U
+26 ; 11 12 13 14
+27 SET BGPSSTR=BGPSSTR_U_""_U_PDEN1CT_U_PNUM1CT_U_PMP
+28 ; 15 16 17 18
+29 SET BGPSSTR=BGPSSTR_U_""_U_BDEN1CT_U_BNUM1CT_U_BMP
+30 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC,BGPDNCNT)=BGPSSTR
+31 ;SECOND NUMERATOR
+32 SET BGPDNCNT=BGPDNCNT+1
SET BGPSSTR=""
+33 SET BGPSSTR="MU.EP.0075.2"_U_"18+ # w/LDL < 100mg/dL"_U_""_U_CDEN1CT_U_CNUM2CT_U_CMP2_U_U_U_U
+34 ; 11 12 13 14
+35 SET BGPSSTR=BGPSSTR_U_""_U_PDEN1CT_U_PNUM2CT_U_PMP2
+36 ; 15 16 17 18
+37 SET BGPSSTR=BGPSSTR_U_""_U_BDEN1CT_U_BNUM2CT_U_BMP2
+38 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC,BGPDNCNT)=BGPSSTR
+39 QUIT