BGPMUDP5 ; IHS/MSC/SAT - MU EP measures NQF0033 ;29-AUG-2011 11:26;DU
;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
;Printed output reports for this measure
PCHL ;EP
D P1
K ^TMP("BGPMU0033",$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=$$NUM33("C")
S STRING2=$$NUM33("P")
S STRING3=$$NUM33("B")
D SUMMARY1(STRING1,STRING2,STRING3)
;Population
S PRD11=$P(STRING1,U,5)-$P(STRING2,U,5)
S PRD14=$P(STRING1,U,9)-$P(STRING2,U,9)
S PRN11=$P(STRING1,U,5)-$P(STRING3,U,5)
S PRN14=$P(STRING1,U,9)-$P(STRING3,U,9)
S PRD21=$P(STRING1,U,14)-$P(STRING2,U,14)
S PRD24=$P(STRING1,U,18)-$P(STRING2,U,18)
S PRN21=$P(STRING1,U,14)-$P(STRING3,U,14)
S PRN24=$P(STRING1,U,18)-$P(STRING3,U,18)
S PRD31=$P(STRING1,U,23)-$P(STRING2,U,23)
S PRD34=$P(STRING1,U,27)-$P(STRING2,U,27)
S PRN31=$P(STRING1,U,23)-$P(STRING3,U,23)
S PRN34=$P(STRING1,U,27)-$P(STRING3,U,27)
D HEADER^BGPMUPH Q:BGPQUIT
D HDRBLK^BGPMUPH
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
;
W !,"Denominator 1"
W !!,"Pts 15-24 sexually active",?33,$P(STRING1,U,1),?44,$P(STRING2,U,1),?64,$P(STRING3,U,1)
W !,"females"
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 15-24 sexually active",?33,$P(STRING1,U,3),?44,$P(STRING2,U,3),?64,$P(STRING3,U,3)
W !,"females less Exc"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !!,"# w/chlamydia screening",?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(PRD11,",+",1),6),?64,+$P(STRING3,U,2),?68,$J($P(STRING3,U,5),5,1),?74,$J($FN(PRN11,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# w/o chlamydia screening",?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(PRD14,",+",1),6),?64,+$P(STRING3,U,8),?68,$J($P(STRING3,U,9),5,1),?74,$J($FN(PRN14,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
;
W !!,"Denominator 2"
W !!,"Pts 15-19 sexually active",?33,+$P(STRING1,U,10),?44,+$P(STRING2,U,10),?64,+$P(STRING3,U,10)
W !,"females"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# Excluded (Exc)",?33,+$P(STRING1,U,13),?44,+$P(STRING2,U,13),?64,+$P(STRING3,U,13)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"Pts 15-19 sexually active",?33,+$P(STRING1,U,12),?44,+$P(STRING2,U,12),?64,+$P(STRING3,U,12)
W !,"females less Exc"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !!,"# w/chlamydia screening",?33,+$P(STRING1,U,11),?38,$J($P(STRING1,U,14),5,1),?44,+$P(STRING2,U,11),?49,$J($P(STRING2,U,14),5,1),?56,$J($FN(PRD21,",+",1),6),?64,+$P(STRING3,U,11),?68,$J($P(STRING3,U,14),5,1),?74,$J($FN(PRN21,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# w/o chlamydia screening",?33,+$P(STRING1,U,17),?38,$J($P(STRING1,U,18),5,1),?44,+$P(STRING2,U,17),?49,$J($P(STRING2,U,18),5,1),?56,$J($FN(PRD24,",+",1),6),?64,+$P(STRING3,U,17),?68,$J($P(STRING3,U,18),5,1),?74,$J($FN(PRN24,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
;
W !!,"Denominator 3"
W !!,"Pts 20-24 sexually active",?33,+$P(STRING1,U,19),?44,+$P(STRING2,U,19),?64,+$P(STRING3,U,19)
W !,"females"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# Excluded (Exc)",?33,+$P(STRING1,U,22),?44,+$P(STRING2,U,22),?64,+$P(STRING3,U,22)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"Pts 20-24 sexually active",?33,+$P(STRING1,U,21),?44,+$P(STRING2,U,21),?64,+$P(STRING3,U,21)
W !,"females less Exc"
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !!,"# w/chlamydia screening",?33,+$P(STRING1,U,20),?38,$J($P(STRING1,U,23),5,1),?44,+$P(STRING2,U,20),?49,$J($P(STRING2,U,23),5,1),?56,$J($FN(PRD31,",+",1),6),?64,+$P(STRING3,U,20),?68,$J($P(STRING3,U,23),5,1),?74,$J($FN(PRN31,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
W !,"# w/o chlamydia screening",?33,+$P(STRING1,U,26),?38,$J($P(STRING1,U,27),5,1),?44,+$P(STRING2,U,26),?49,$J($P(STRING2,U,27),5,1),?56,$J($FN(PRD34,",+",1),6),?64,+$P(STRING3,U,26),?68,$J($P(STRING3,U,27),5,1),?74,$J($FN(PRN34,",+",1),6)
I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
;
I $D(BGPLIST(BGPIC)) D P2
;
Q
;
NUM33(TF) ;Get the numbers for this measure
N ARRAY,DEN,NUM,EXC,NOT,PC1,PC11,PC2,PC14,PC21,PC13,NNUM
S DEN1=+$G(^TMP("BGPMU0033",$J,TF,"DEN",1))
S DEN2=+$G(^TMP("BGPMU0033",$J,TF,"DEN",2))
S DEN3=+$G(^TMP("BGPMU0033",$J,TF,"DEN",3))
S NUM1=+$G(^TMP("BGPMU0033",$J,TF,"NUM",1))
S NUM2=+$G(^TMP("BGPMU0033",$J,TF,"NUM",2))
S NUM3=+$G(^TMP("BGPMU0033",$J,TF,"NUM",3))
S NOT1=+$G(^TMP("BGPMU0033",$J,TF,"NOT",1))
S NOT2=+$G(^TMP("BGPMU0033",$J,TF,"NOT",2))
S NOT3=+$G(^TMP("BGPMU0033",$J,TF,"NOT",3))
S EXC1=+$G(^TMP("BGPMU0033",$J,TF,"EXC",1))
S EXC2=+$G(^TMP("BGPMU0033",$J,TF,"EXC",2))
S EXC3=+$G(^TMP("BGPMU0033",$J,TF,"EXC",3))
;DEN1
S NNUMD1=DEN1-EXC1
I DEN1=0 S (PC1D1,PC11D1,PC13D1,PC14D1)=0
I DEN1>0&(NNUMD1=0) D
.S (PC1D1,PC11D1,PC14D1)=0
.S PC13D1=$$ROUND^BGPMUA01((EXC1/DEN1),3)*100
I DEN1>0&(NNUMD1>0) D
.S PC1D1=$$ROUND^BGPMUA01((NUM1/NNUMD1),3)*100
.S PC11D1=$$ROUND^BGPMUA01((NNUMD1/DEN1),3)*100
.S PC13D1=$$ROUND^BGPMUA01((EXC1/DEN1),3)*100
.S PC14D1=$$ROUND^BGPMUA01((NOT1/NNUMD1),3)*100
;DEN2
S NNUMD2=DEN2-EXC2
I DEN2=0 S (PC1D2,PC11D2,PC13D2,PC14D2)=0
I DEN2>0&(NNUMD2=0) D
.S (PC1D2,PC11D2,PC14D2)=0
.S PC13D2=$$ROUND^BGPMUA01((EXC2/DEN2),3)*100
I DEN2>0&(NNUMD2>0) D
.S PC1D2=$$ROUND^BGPMUA01((NUM2/NNUMD2),3)*100
.S PC11D2=$$ROUND^BGPMUA01((NNUMD2/DEN2),3)*100
.S PC13D2=$$ROUND^BGPMUA01((EXC2/DEN2),3)*100
.S PC14D2=$$ROUND^BGPMUA01((NOT2/NNUMD2),3)*100
;DEN3
S NNUMD3=DEN3-EXC3
I DEN3=0 S (PC1D3,PC11D3,PC13D3,PC14D3)=0
I DEN3>0&(NNUMD3=0) D
.S (PC1D3,PC11D3,PC14D3)=0
.S PC13D3=$$ROUND^BGPMUA01((EXC3/DEN3),3)*100
I DEN3>0&(NNUMD3>0) D
.S PC1D3=$$ROUND^BGPMUA01((NUM3/NNUMD3),3)*100
.S PC11D3=$$ROUND^BGPMUA01((NNUMD3/DEN3),3)*100
.S PC13D3=$$ROUND^BGPMUA01((EXC3/DEN3),3)*100
.S PC14D3=$$ROUND^BGPMUA01((NOT3/NNUMD3),3)*100
; 1 2 3 4 5 6 7 8 9 10 11 12 13
S ARRAY=(+DEN1)_U_+NUM1_U_(+NNUMD1)_U_+EXC1_U_(+PC1D1)_U_PC11D1_U_PC13D1_U_+NOT1_U_+PC14D1
; 10 11 12 13 14 15 16 17 18
S ARRAY=ARRAY_U_(+DEN2)_U_+NUM2_U_(+NNUMD2)_U_+EXC2_U_(+PC1D2)_U_PC11D2_U_PC13D2_U_+NOT2_U_+PC14D2
; 19 20 21 22 23 24 25 26 27
S ARRAY=ARRAY_U_(+DEN3)_U_+NUM3_U_(+NNUMD3)_U_+EXC3_U_(+PC1D3)_U_PC11D3_U_PC13D3_U_+NOT3_U_+PC14D3
Q ARRAY
;
P2 ;Do the Details
N PT,NODE,NAME,VST,BMI,FOL,X,PTCT,BGPARR,LINE
D HEADERL^BGPMUPH
S X="Patients 15-24 years of age with at least 1 encounter with the EP within 1 year" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="of the reporting period end date, who have been identified as sexually active or" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="pregnant on or before the reporting period end date AND who had at least" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="1 chlamydia screening during the reporting period, if any." 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,2,BGPPTYPE)
S X="by patients who do meet the numerator criteria (M:). Excluded patients are" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="listed last." 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="PROC=Procedure Indicative of a Sexually Active Woman" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="LABP=Laboratory Test for Pregnancy" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="PREG=Pregnancy Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="LAB=Laboratory Test Indicative of a Sexually Active Woman" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="DX=Diagnosis Indicative of a Sexually Active Woman" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="MED=Contraceptive Medication" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="IUD=Use of IUD Device" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="ALR=Allergy to IUD Device" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="EDU=Contraceptive Use Education" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="RF=Reproductive Factor" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="EN=Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
S X="CHL=Chlamydia screening" 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
S X="Patients 15-19" D W^BGPMUPP(X,0,1,BGPPTYPE)
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(""BGPMU0033"","_$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
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$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)
I BGPLIST="A" D
.K BGPARR
.D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$J_",""PAT"",""C"",""EXC"",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
S X="" D W^BGPMUPP(X,0,1,BGPPTYPE)
;
S PTCT=0
I $Y>(BGPIOSL-5) D HEADERL^BGPMUPH Q:BGPQUIT
S X="Patients 20-24" D W^BGPMUPP(X,0,1,BGPPTYPE)
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(""BGPMU0033"","_$J_",""PAT"",""C"",""NOT"",3)")
.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(""BGPMU0033"","_$J_",""PAT"",""C"",""NUM"",3)")
.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(""BGPMU0033"","_$J_",""PAT"",""C"",""EXC"",3)")
.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 NUM=$P(NODE,U,3)
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,$P(DEN,";",1),?65,NUM
F BGPI=2:1:$L(DEN,";") D
.W !,?50,$P(DEN,";",BGPI)
Q
SUMMARY1(STRING1,STRING2,STRING3,CT) ;Summmary setup
N DESC,DESC2,LINE
K ^TMP("BGPMU SUMMARY",$J,BGPIC)
S ^TMP("BGPMU SUMMARY",$J,BGPIC)="0033^N/A"
S DESC1="15-24 # w/chlamydia screening"
S DESC2="15-19 # w/chlamydia screening"
S DESC3="20-24 # w/chlamydia screening"
S LINE=""
;
S LINE="MU.EP.0033.1"_U_DESC1_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
;
S LINE="MU.EP.0033.1"_U_DESC2_U_+$P(STRING1,U,13)_U_+$P(STRING1,U,10)_U_+$P(STRING1,U,11)_U_+$P(STRING1,U,14)_U_U_U_U_U
S LINE=LINE_+$P(STRING2,U,13)_U_+$P(STRING2,U,10)_U_+$P(STRING2,U,11)_U_+$P(STRING2,U,14)_U_+$P(STRING3,U,13)_U_+$P(STRING3,U,10)_U_+$P(STRING3,U,11)_U_+$P(STRING3,U,14)
S ^TMP("BGPMU SUMMARY",$J,BGPIC,2)=LINE
;
S LINE="MU.EP.0033.1"_U_DESC3_U_+$P(STRING1,U,22)_U_+$P(STRING1,U,19)_U_+$P(STRING1,U,20)_U_+$P(STRING1,U,23)_U_U_U_U_U
S LINE=LINE_+$P(STRING2,U,22)_U_+$P(STRING2,U,19)_U_+$P(STRING2,U,20)_U_+$P(STRING2,U,23)_U_+$P(STRING3,U,22)_U_+$P(STRING3,U,19)_U_+$P(STRING3,U,20)_U_+$P(STRING3,U,23)
S ^TMP("BGPMU SUMMARY",$J,BGPIC,3)=LINE
Q
XML33 ;Populate the BGPXML array with data for each population/numerator
; BGPXMLOUT(i)=PQRI number^""^Denominator Count^Numerator Count^Exclusion Count
S BGPXML(1)="N/A"_U_""_U_+$G(^TMP("BGPMU0033",$J,"C","DEN",1))_U_+$G(^TMP("BGPMU0033",$J,"C","NUM",1))_U_+$G(^TMP("BGPMU0033",$J,"C","EXC",1))
S BGPXML(2)="N/A"_U_""_U_+$G(^TMP("BGPMU0033",$J,"C","DEN",2))_U_+$G(^TMP("BGPMU0033",$J,"C","NUM",2))_U_+$G(^TMP("BGPMU0033",$J,"C","EXC",2))
S BGPXML(3)="N/A"_U_""_U_+$G(^TMP("BGPMU0033",$J,"C","DEN",3))_U_+$G(^TMP("BGPMU0033",$J,"C","NUM",3))_U_+$G(^TMP("BGPMU0033",$J,"C","EXC",3))
K ^TMP("BGPMU0033",$J)
Q
TEST ;
S U="^"
D PCHL
S BGPIC="A"
S BGPLIST(BGPIC)=1
Q
BGPMUDP5 ; IHS/MSC/SAT - MU EP measures NQF0033 ;29-AUG-2011 11:26;DU
+1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
+2 ;Printed output reports for this measure
PCHL ;EP
+1 DO P1
+2 KILL ^TMP("BGPMU0033",$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=$$NUM33("C")
+6 SET STRING2=$$NUM33("P")
+7 SET STRING3=$$NUM33("B")
+8 DO SUMMARY1(STRING1,STRING2,STRING3)
+9 ;Population
+10 SET PRD11=$PIECE(STRING1,U,5)-$PIECE(STRING2,U,5)
+11 SET PRD14=$PIECE(STRING1,U,9)-$PIECE(STRING2,U,9)
+12 SET PRN11=$PIECE(STRING1,U,5)-$PIECE(STRING3,U,5)
+13 SET PRN14=$PIECE(STRING1,U,9)-$PIECE(STRING3,U,9)
+14 SET PRD21=$PIECE(STRING1,U,14)-$PIECE(STRING2,U,14)
+15 SET PRD24=$PIECE(STRING1,U,18)-$PIECE(STRING2,U,18)
+16 SET PRN21=$PIECE(STRING1,U,14)-$PIECE(STRING3,U,14)
+17 SET PRN24=$PIECE(STRING1,U,18)-$PIECE(STRING3,U,18)
+18 SET PRD31=$PIECE(STRING1,U,23)-$PIECE(STRING2,U,23)
+19 SET PRD34=$PIECE(STRING1,U,27)-$PIECE(STRING2,U,27)
+20 SET PRN31=$PIECE(STRING1,U,23)-$PIECE(STRING3,U,23)
+21 SET PRN34=$PIECE(STRING1,U,27)-$PIECE(STRING3,U,27)
+22 DO HEADER^BGPMUPH
IF BGPQUIT
QUIT
+23 DO HDRBLK^BGPMUPH
+24 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+25 ;
+26 WRITE !,"Denominator 1"
+27 WRITE !!,"Pts 15-24 sexually active",?33,$PIECE(STRING1,U,1),?44,$PIECE(STRING2,U,1),?64,$PIECE(STRING3,U,1)
+28 WRITE !,"females"
+29 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+30 WRITE !,"# Excluded (Exc)",?33,+$PIECE(STRING1,U,4),?44,+$PIECE(STRING2,U,4),?64,+$PIECE(STRING3,U,4)
+31 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+32 WRITE !,"Pts 15-24 sexually active",?33,$PIECE(STRING1,U,3),?44,$PIECE(STRING2,U,3),?64,$PIECE(STRING3,U,3)
+33 WRITE !,"females less Exc"
+34 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+35 WRITE !!,"# w/chlamydia screening",?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(PRD11,",+",1),6),?64,+$PIECE(STRING3,U,2),?68,$JUSTIFY($PIECE(STRING3,U,5),5,1),?74,$JUSTIFY($FNUMBER(PRN11,",+",1),6)
+36 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+37 WRITE !,"# w/o chlamydia screening",?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(PRD14,",+",1),6),?64,+$PIECE(STRING3,U,8),?68,$JUSTIFY($PIECE(STRING3,U,9),5,1),?74,$JUSTIFY($FNUMBER(PRN14,",+",1),6)
+38 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+39 ;
+40 WRITE !!,"Denominator 2"
+41 WRITE !!,"Pts 15-19 sexually active",?33,+$PIECE(STRING1,U,10),?44,+$PIECE(STRING2,U,10),?64,+$PIECE(STRING3,U,10)
+42 WRITE !,"females"
+43 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+44 WRITE !,"# Excluded (Exc)",?33,+$PIECE(STRING1,U,13),?44,+$PIECE(STRING2,U,13),?64,+$PIECE(STRING3,U,13)
+45 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+46 WRITE !,"Pts 15-19 sexually active",?33,+$PIECE(STRING1,U,12),?44,+$PIECE(STRING2,U,12),?64,+$PIECE(STRING3,U,12)
+47 WRITE !,"females less Exc"
+48 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+49 WRITE !!,"# w/chlamydia screening",?33,+$PIECE(STRING1,U,11),?38,$JUSTIFY(...
... $PIECE(STRING1,U,14),5,1),?44,+$PIECE(STRING2,U,11),?49,$JUSTIFY($PIECE(STRING2,U,14),5,1),?56,$JUSTIFY($FNUMBER(PRD21,",+",1),6),?64,+$PIECE(STRING3,U,11),?68,$JUSTIFY($PIECE(STRING3,U,14),5,1),?74,$JUSTIFY($FNUMBER(PRN21,",+",1),6)
+50 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+51 WRITE !,"# w/o chlamydia screening",?33,+$PIECE(STRING1,U,17),?38,$JUSTIFY(...
... $PIECE(STRING1,U,18),5,1),?44,+$PIECE(STRING2,U,17),?49,$JUSTIFY($PIECE(STRING2,U,18),5,1),?56,$JUSTIFY($FNUMBER(PRD24,",+",1),6),?64,+$PIECE(STRING3,U,17),?68,$JUSTIFY($PIECE(STRING3,U,18),5,1),?74,$JUSTIFY($FNUMBER(PRN24,",+",1),6)
+52 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+53 ;
+54 WRITE !!,"Denominator 3"
+55 WRITE !!,"Pts 20-24 sexually active",?33,+$PIECE(STRING1,U,19),?44,+$PIECE(STRING2,U,19),?64,+$PIECE(STRING3,U,19)
+56 WRITE !,"females"
+57 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+58 WRITE !,"# Excluded (Exc)",?33,+$PIECE(STRING1,U,22),?44,+$PIECE(STRING2,U,22),?64,+$PIECE(STRING3,U,22)
+59 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+60 WRITE !,"Pts 20-24 sexually active",?33,+$PIECE(STRING1,U,21),?44,+$PIECE(STRING2,U,21),?64,+$PIECE(STRING3,U,21)
+61 WRITE !,"females less Exc"
+62 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+63 WRITE !!,"# w/chlamydia screening",?33,+$PIECE(STRING1,U,20),?38,$JUSTIFY(...
... $PIECE(STRING1,U,23),5,1),?44,+$PIECE(STRING2,U,20),?49,$JUSTIFY($PIECE(STRING2,U,23),5,1),?56,$JUSTIFY($FNUMBER(PRD31,",+",1),6),?64,+$PIECE(STRING3,U,20),?68,$JUSTIFY($PIECE(STRING3,U,23),5,1),?74,$JUSTIFY($FNUMBER(PRN31,",+",1),6)
+64 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+65 WRITE !,"# w/o chlamydia screening",?33,+$PIECE(STRING1,U,26),?38,$JUSTIFY(...
... $PIECE(STRING1,U,27),5,1),?44,+$PIECE(STRING2,U,26),?49,$JUSTIFY($PIECE(STRING2,U,27),5,1),?56,$JUSTIFY($FNUMBER(PRD34,",+",1),6),?64,+$PIECE(STRING3,U,26),?68,$JUSTIFY($PIECE(STRING3,U,27),5,1),?74,$JUSTIFY($FNUMBER(PRN34,",+",1),6)
+66 IF $Y>(BGPIOSL-3)
DO HEADER^BGPMUPH
DO HDRBLK^BGPMUPH
IF BGPQUIT
QUIT
+67 ;
+68 IF $DATA(BGPLIST(BGPIC))
DO P2
+69 ;
+70 QUIT
+71 ;
NUM33(TF) ;Get the numbers for this measure
+1 NEW ARRAY,DEN,NUM,EXC,NOT,PC1,PC11,PC2,PC14,PC21,PC13,NNUM
+2 SET DEN1=+$GET(^TMP("BGPMU0033",$JOB,TF,"DEN",1))
+3 SET DEN2=+$GET(^TMP("BGPMU0033",$JOB,TF,"DEN",2))
+4 SET DEN3=+$GET(^TMP("BGPMU0033",$JOB,TF,"DEN",3))
+5 SET NUM1=+$GET(^TMP("BGPMU0033",$JOB,TF,"NUM",1))
+6 SET NUM2=+$GET(^TMP("BGPMU0033",$JOB,TF,"NUM",2))
+7 SET NUM3=+$GET(^TMP("BGPMU0033",$JOB,TF,"NUM",3))
+8 SET NOT1=+$GET(^TMP("BGPMU0033",$JOB,TF,"NOT",1))
+9 SET NOT2=+$GET(^TMP("BGPMU0033",$JOB,TF,"NOT",2))
+10 SET NOT3=+$GET(^TMP("BGPMU0033",$JOB,TF,"NOT",3))
+11 SET EXC1=+$GET(^TMP("BGPMU0033",$JOB,TF,"EXC",1))
+12 SET EXC2=+$GET(^TMP("BGPMU0033",$JOB,TF,"EXC",2))
+13 SET EXC3=+$GET(^TMP("BGPMU0033",$JOB,TF,"EXC",3))
+14 ;DEN1
+15 SET NNUMD1=DEN1-EXC1
+16 IF DEN1=0
SET (PC1D1,PC11D1,PC13D1,PC14D1)=0
+17 IF DEN1>0&(NNUMD1=0)
Begin DoDot:1
+18 SET (PC1D1,PC11D1,PC14D1)=0
+19 SET PC13D1=$$ROUND^BGPMUA01((EXC1/DEN1),3)*100
End DoDot:1
+20 IF DEN1>0&(NNUMD1>0)
Begin DoDot:1
+21 SET PC1D1=$$ROUND^BGPMUA01((NUM1/NNUMD1),3)*100
+22 SET PC11D1=$$ROUND^BGPMUA01((NNUMD1/DEN1),3)*100
+23 SET PC13D1=$$ROUND^BGPMUA01((EXC1/DEN1),3)*100
+24 SET PC14D1=$$ROUND^BGPMUA01((NOT1/NNUMD1),3)*100
End DoDot:1
+25 ;DEN2
+26 SET NNUMD2=DEN2-EXC2
+27 IF DEN2=0
SET (PC1D2,PC11D2,PC13D2,PC14D2)=0
+28 IF DEN2>0&(NNUMD2=0)
Begin DoDot:1
+29 SET (PC1D2,PC11D2,PC14D2)=0
+30 SET PC13D2=$$ROUND^BGPMUA01((EXC2/DEN2),3)*100
End DoDot:1
+31 IF DEN2>0&(NNUMD2>0)
Begin DoDot:1
+32 SET PC1D2=$$ROUND^BGPMUA01((NUM2/NNUMD2),3)*100
+33 SET PC11D2=$$ROUND^BGPMUA01((NNUMD2/DEN2),3)*100
+34 SET PC13D2=$$ROUND^BGPMUA01((EXC2/DEN2),3)*100
+35 SET PC14D2=$$ROUND^BGPMUA01((NOT2/NNUMD2),3)*100
End DoDot:1
+36 ;DEN3
+37 SET NNUMD3=DEN3-EXC3
+38 IF DEN3=0
SET (PC1D3,PC11D3,PC13D3,PC14D3)=0
+39 IF DEN3>0&(NNUMD3=0)
Begin DoDot:1
+40 SET (PC1D3,PC11D3,PC14D3)=0
+41 SET PC13D3=$$ROUND^BGPMUA01((EXC3/DEN3),3)*100
End DoDot:1
+42 IF DEN3>0&(NNUMD3>0)
Begin DoDot:1
+43 SET PC1D3=$$ROUND^BGPMUA01((NUM3/NNUMD3),3)*100
+44 SET PC11D3=$$ROUND^BGPMUA01((NNUMD3/DEN3),3)*100
+45 SET PC13D3=$$ROUND^BGPMUA01((EXC3/DEN3),3)*100
+46 SET PC14D3=$$ROUND^BGPMUA01((NOT3/NNUMD3),3)*100
End DoDot:1
+47 ; 1 2 3 4 5 6 7 8 9 10 11 12 13
+48 SET ARRAY=(+DEN1)_U_+NUM1_U_(+NNUMD1)_U_+EXC1_U_(+PC1D1)_U_PC11D1_U_PC13D1_U_+NOT1_U_+PC14D1
+49 ; 10 11 12 13 14 15 16 17 18
+50 SET ARRAY=ARRAY_U_(+DEN2)_U_+NUM2_U_(+NNUMD2)_U_+EXC2_U_(+PC1D2)_U_PC11D2_U_PC13D2_U_+NOT2_U_+PC14D2
+51 ; 19 20 21 22 23 24 25 26 27
+52 SET ARRAY=ARRAY_U_(+DEN3)_U_+NUM3_U_(+NNUMD3)_U_+EXC3_U_(+PC1D3)_U_PC11D3_U_PC13D3_U_+NOT3_U_+PC14D3
+53 QUIT ARRAY
+54 ;
P2 ;Do the Details
+1 NEW PT,NODE,NAME,VST,BMI,FOL,X,PTCT,BGPARR,LINE
+2 DO HEADERL^BGPMUPH
+3 SET X="Patients 15-24 years of age with at least 1 encounter with the EP within 1 year"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+4 SET X="of the reporting period end date, who have been identified as sexually active or"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+5 SET X="pregnant on or before the reporting period end date AND who had at least"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+6 SET X="1 chlamydia screening during the reporting period, if any."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+7 ;
+8 SET X="Patients who do not meet the numerator criteria are listed first (NM:), followed"
DO W^BGPMUPP(X,0,2,BGPPTYPE)
+9 SET X="by patients who do meet the numerator criteria (M:). Excluded patients are"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+10 SET X="listed last."
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+11 ;
+12 SET X="The following are the abbreviations used in the denominator and numerator"
DO W^BGPMUPP(X,0,2,BGPPTYPE)
+13 SET X="columns:"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+14 SET X="PROC=Procedure Indicative of a Sexually Active Woman"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+15 SET X="LABP=Laboratory Test for Pregnancy"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+16 SET X="PREG=Pregnancy Encounter"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+17 SET X="LAB=Laboratory Test Indicative of a Sexually Active Woman"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+18 SET X="DX=Diagnosis Indicative of a Sexually Active Woman"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+19 SET X="MED=Contraceptive Medication"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+20 SET X="IUD=Use of IUD Device"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+21 SET X="ALR=Allergy to IUD Device"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+22 SET X="EDU=Contraceptive Use Education"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+23 SET X="RF=Reproductive Factor"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+24 SET X="EN=Encounter"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+25 SET X="CHL=Chlamydia screening"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+26 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+27 ;
+28 SET PTCT=0
+29 IF $Y>(BGPIOSL-5)
DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+30 SET X="Patients 15-19"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+31 WRITE !!,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
+32 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
+33 IF BGPLIST="D"!(BGPLIST="A")
Begin DoDot:1
+34 KILL BGPARR
+35 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$JOB_",""PAT"",""C"",""NOT"",2)")
+36 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+37 SET PTCT=PTCT+1
+38 SET NODE=$GET(BGPARR(PT))
+39 DO DATA(NODE)
End DoDot:2
End DoDot:1
+40 IF BGPLIST="N"!(BGPLIST="A")
Begin DoDot:1
+41 KILL BGPARR
+42 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$JOB_",""PAT"",""C"",""NUM"",2)")
+43 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+44 SET PTCT=PTCT+1
+45 SET NODE=$GET(BGPARR(PT))
+46 DO DATA(NODE)
End DoDot:2
End DoDot:1
+47 IF BGPLIST="A"
Begin DoDot:1
+48 KILL BGPARR
+49 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$JOB_",""PAT"",""C"",""EXC"",2)")
+50 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+51 SET PTCT=PTCT+1
+52 SET NODE=$GET(BGPARR(PT))
+53 DO DATA(NODE)
End DoDot:2
End DoDot:1
+54 WRITE !!,"Total # of patients on list: "_PTCT
+55 SET X=""
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+56 ;
+57 SET PTCT=0
+58 IF $Y>(BGPIOSL-5)
DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+59 SET X="Patients 20-24"
DO W^BGPMUPP(X,0,1,BGPPTYPE)
+60 WRITE !!,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
+61 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
+62 IF BGPLIST="D"!(BGPLIST="A")
Begin DoDot:1
+63 KILL BGPARR
+64 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$JOB_",""PAT"",""C"",""NOT"",3)")
+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 IF BGPLIST="N"!(BGPLIST="A")
Begin DoDot:1
+70 KILL BGPARR
+71 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$JOB_",""PAT"",""C"",""NUM"",3)")
+72 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+73 SET PTCT=PTCT+1
+74 SET NODE=$GET(BGPARR(PT))
+75 DO DATA(NODE)
End DoDot:2
End DoDot:1
+76 IF BGPLIST="A"
Begin DoDot:1
+77 KILL BGPARR
+78 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0033"","_$JOB_",""PAT"",""C"",""EXC"",3)")
+79 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+80 SET PTCT=PTCT+1
+81 SET NODE=$GET(BGPARR(PT))
+82 DO DATA(NODE)
End DoDot:2
End DoDot:1
+83 WRITE !!,"Total # of patients on list: "_PTCT
+84 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 NUM=$PIECE(NODE,U,3)
+8 SET COMM=$EXTRACT($$GET1^DIQ(9000001,DFN,1118),1,11)
+9 SET SEX=$PIECE(^DPT(DFN,0),U,2)
+10 IF $Y>(BGPIOSL-2)
Begin DoDot:1
+11 DO HEADERL^BGPMUPH
IF BGPQUIT
QUIT
+12 WRITE !,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?65,"NUMERATOR"
+13 SET LINE=""
SET $PIECE(LINE,"-",81)=""
WRITE !,LINE
End DoDot:1
+14 WRITE !,NAME,?23,HRN,?30,COMM,?43,SEX,?46,AGE,?50,$PIECE(DEN,";",1),?65,NUM
+15 FOR BGPI=2:1:$LENGTH(DEN,";")
Begin DoDot:1
+16 WRITE !,?50,$PIECE(DEN,";",BGPI)
End DoDot:1
+17 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)="0033^N/A"
+4 SET DESC1="15-24 # w/chlamydia screening"
+5 SET DESC2="15-19 # w/chlamydia screening"
+6 SET DESC3="20-24 # w/chlamydia screening"
+7 SET LINE=""
+8 ;
+9 SET LINE="MU.EP.0033.1"_U_DESC1_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
+10 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)
+11 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC,1)=LINE
+12 ;
+13 SET LINE="MU.EP.0033.1"_U_DESC2_U_+$PIECE(STRING1,U,13)_U_+$PIECE(STRING1,U,10)_U_+$PIECE(STRING1,U,11)_U_+$PIECE(STRING1,U,14)_U_U_U_U_U
+14 SET LINE=LINE_+$PIECE(STRING2,U,13)_U_+$PIECE(STRING2,U,10)_U_+$PIECE(STRING2,U,11)_U_+$PIECE(STRING2,U,14)_U_+$PIECE(STRING3,U,13)_U_+$PIECE(STRING3,U,10)_U_+$PIECE(STRING3,U,11)_U_+$PIECE(STRING3,U,14)
+15 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC,2)=LINE
+16 ;
+17 SET LINE="MU.EP.0033.1"_U_DESC3_U_+$PIECE(STRING1,U,22)_U_+$PIECE(STRING1,U,19)_U_+$PIECE(STRING1,U,20)_U_+$PIECE(STRING1,U,23)_U_U_U_U_U
+18 SET LINE=LINE_+$PIECE(STRING2,U,22)_U_+$PIECE(STRING2,U,19)_U_+$PIECE(STRING2,U,20)_U_+$PIECE(STRING2,U,23)_U_+$PIECE(STRING3,U,22)_U_+$PIECE(STRING3,U,19)_U_+$PIECE(STRING3,U,20)_U_+$PIECE(STRING3,U,23)
+19 SET ^TMP("BGPMU SUMMARY",$JOB,BGPIC,3)=LINE
+20 QUIT
XML33 ;Populate the BGPXML array with data for each population/numerator
+1 ; BGPXMLOUT(i)=PQRI number^""^Denominator Count^Numerator Count^Exclusion Count
+2 SET BGPXML(1)="N/A"_U_""_U_+$GET(^TMP("BGPMU0033",$JOB,"C","DEN",1))_U_+$GET(^TMP("BGPMU0033",$JOB,"C","NUM",1))_U_+$GET(^TMP("BGPMU0033",$JOB,"C","EXC",1))
+3 SET BGPXML(2)="N/A"_U_""_U_+$GET(^TMP("BGPMU0033",$JOB,"C","DEN",2))_U_+$GET(^TMP("BGPMU0033",$JOB,"C","NUM",2))_U_+$GET(^TMP("BGPMU0033",$JOB,"C","EXC",2))
+4 SET BGPXML(3)="N/A"_U_""_U_+$GET(^TMP("BGPMU0033",$JOB,"C","DEN",3))_U_+$GET(^TMP("BGPMU0033",$JOB,"C","NUM",3))_U_+$GET(^TMP("BGPMU0033",$JOB,"C","EXC",3))
+5 KILL ^TMP("BGPMU0033",$JOB)
+6 QUIT
TEST ;
+1 SET U="^"
+2 DO PCHL
+3 SET BGPIC="A"
+4 SET BGPLIST(BGPIC)=1
+5 QUIT