Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BGPMUWP1

BGPMUWP1.m

Go to the documentation of this file.
BGPMUWP1 ; IHS/MSC/AJF - MU EP  measures NQF0024 ;22-Mar-2011 10:27;DU
 ;;11.0;IHS CLINICAL REPORTING;**4**;JAN 06, 2011;Build 84
 ;This rouine does the printed output for EP measures 0024;;;;;Build 33
ENT ;
 D P1
 Q
P1 ;Write individual measure
 N X,Y,Z,LIST1,LIST2,LIST3,NONUM1,NONUM2,NONUM3
 N DEN1,NUM1,DEN2,NUM2,PC1,PC2,EXC1,EXC2,STRING1,STRING2,STRING3,PRD1,PRD2,PRB1,PRB2
 N X1,X2,X3,Y1,Y2,Y3,Z1,Z2,Z3,DIFF1,DIFF2,DIFF3
 S STRING1=$$D24("C")
 S STRING2=$$D24("P")
 S STRING3=$$D24("B")
 D SUMMARY^BGPMUWD1(STRING1,STRING2,STRING3)
 D HEADER^BGPMUPH Q:BGPQUIT
 D HDRBLK^BGPMUPH
 W !,"Denominator 1"
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"Pts 2-16",?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 !!,"Numerator 1"
 S Z1=$P(STRING1,U,6)-$P(STRING2,U,6)
 S Z2=$P(STRING1,U,6)-$P(STRING3,U,6)
 S X1=$P(STRING1,U,25),X2=$P(STRING2,U,25),X3=$P(STRING3,U,25)
 S DIFF1=$P(STRING1,U,1)-$P(STRING1,U,2),DIFF2=$P(STRING2,U,1)-$P(STRING2,U,2)
 S DIFF3=$P(STRING3,U,1)-$P(STRING3,U,2)
 S Y1=X1-X2
 S Y2=X1-X3
 W !,"# w/BMI Percentile",?33,$P(STRING1,U,2),?38,$J($P(STRING1,U,6),5,1),?44,$P(STRING2,U,2)
 W ?49,$J($P(STRING2,U,6),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,2),?68,$J($P(STRING3,U,6),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o BMI Percentile",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 2"
 S Z1=$P(STRING1,U,7)-$P(STRING2,U,7)
 S Z2=$P(STRING1,U,7)-$P(STRING3,U,7)
 S X1=$P(STRING1,U,26),X2=$P(STRING2,U,26),X3=$P(STRING3,U,26)
 S DIFF1=$P(STRING1,U,1)-$P(STRING1,U,3),DIFF2=$P(STRING2,U,1)-$P(STRING2,U,3)
 S DIFF3=$P(STRING3,U,1)-$P(STRING3,U,3)
 S Y1=X1-X2
 S Y2=X1-X3
 W !,"# w/Nutrition edu",?33,$P(STRING1,U,3),?38,$J($P(STRING1,U,7),5,1),?44,$P(STRING2,U,3)
 W ?49,$J($P(STRING2,U,7),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,3),?68,$J($P(STRING3,U,7),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o Nutrition edu",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 3"
 S Z1=$P(STRING1,U,8)-$P(STRING2,U,8)
 S Z2=$P(STRING1,U,8)-$P(STRING3,U,8)
 S X1=$P(STRING1,U,27),X2=$P(STRING2,U,27),X3=$P(STRING3,U,27)
 S DIFF1=$P(STRING1,U,1)-$P(STRING1,U,4),DIFF2=$P(STRING2,U,1)-$P(STRING2,U,4)
 S DIFF3=$P(STRING3,U,1)-$P(STRING3,U,4)
 S Y1=X1-X2
 S Y2=X1-X3
 W !,"# w/Activity edu",?33,$P(STRING1,U,4),?38,$J($P(STRING1,U,8),5,1),?44,$P(STRING2,U,4)
 W ?49,$J($P(STRING2,U,8),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,4),?68,$J($P(STRING3,U,8),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o Activity edu",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !!,"Denominator 2"
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"Pts 2-10",?33,$P(STRING1,U,9),?44,$P(STRING2,U,9),?64,$P(STRING3,U,9)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 1"
 S Z1=$P(STRING1,U,14)-$P(STRING2,U,14)
 S Z2=$P(STRING1,U,14)-$P(STRING3,U,14)
 S X1=$P(STRING1,U,28),X2=$P(STRING2,U,28),X3=$P(STRING3,U,28)
 S DIFF1=$P(STRING1,U,9)-$P(STRING1,U,10),DIFF2=$P(STRING2,U,9)-$P(STRING2,U,10)
 S DIFF3=$P(STRING3,U,9)-$P(STRING3,U,10)
 S Y1=X1-X2
 S Y2=X1-X3
 W !,"# w/BMI Percentile",?33,$P(STRING1,U,10),?38,$J($P(STRING1,U,14),5,1),?44,$P(STRING2,U,10)
 W ?49,$J($P(STRING2,U,14),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,10),?68,$J($P(STRING3,U,14),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o BMI Percentile",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 2"
 S Z1=$P(STRING1,U,15)-$P(STRING2,U,15)
 S Z2=$P(STRING1,U,15)-$P(STRING3,U,15)
 S X1=$P(STRING1,U,29),X2=$P(STRING2,U,29),X3=$P(STRING3,U,29)
 S DIFF1=$P(STRING1,U,9)-$P(STRING1,U,11),DIFF2=$P(STRING2,U,9)-$P(STRING2,U,11)
 S DIFF3=$P(STRING3,U,9)-$P(STRING3,U,11)
 S Y1=X1-X2
 S Y2=X1-X3
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/Nutrition edu",?33,$P(STRING1,U,11),?38,$J($P(STRING1,U,15),5,1),?44,$P(STRING2,U,11)
 W ?49,$J($P(STRING2,U,15),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,11),?68,$J($P(STRING3,U,15),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o Nutrition edu",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 3"
 S Z1=$P(STRING1,U,16)-$P(STRING2,U,16)
 S Z2=$P(STRING1,U,16)-$P(STRING3,U,16)
 S X1=$P(STRING1,U,30),X2=$P(STRING2,U,30),X3=$P(STRING3,U,30)
 S DIFF1=$P(STRING1,U,9)-$P(STRING1,U,12),DIFF2=$P(STRING2,U,9)-$P(STRING2,U,12)
 S DIFF3=$P(STRING3,U,9)-$P(STRING3,U,12)
 S Y1=X1-X2
 S Y2=X1-X3
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/Activity edu",?33,$P(STRING1,U,12),?38,$J($P(STRING1,U,16),5,1),?44,$P(STRING2,U,12)
 W ?49,$J($P(STRING2,U,16),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,12),?68,$J($P(STRING3,U,16),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o Activity edu",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !!,"Denominator 3"
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"Pts 11-16",?33,$P(STRING1,U,17),?44,$P(STRING2,U,17),?64,$P(STRING3,U,17)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 1"
 S Z1=$P(STRING1,U,22)-$P(STRING2,U,22)
 S Z2=$P(STRING1,U,22)-$P(STRING3,U,22)
 S X1=$P(STRING1,U,31),X2=$P(STRING2,U,31),X3=$P(STRING3,U,31)
 S DIFF1=$P(STRING1,U,17)-$P(STRING1,U,18),DIFF2=$P(STRING2,U,17)-$P(STRING2,U,18)
 S DIFF3=$P(STRING3,U,17)-$P(STRING3,U,18)
 S Y1=X1-X2
 S Y2=X1-X3
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/BMI Percentile",?33,$P(STRING1,U,18),?38,$J($P(STRING1,U,22),5,1),?44,$P(STRING2,U,18)
 W ?49,$J($P(STRING2,U,22),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,18),?68,$J($P(STRING3,U,22),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o BMI Percentile",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 2"
 S Z1=$P(STRING1,U,23)-$P(STRING2,U,23)
 S Z2=$P(STRING1,U,23)-$P(STRING3,U,23)
 S X1=$P(STRING1,U,32),X2=$P(STRING2,U,32),X3=$P(STRING3,U,32)
 S DIFF1=$P(STRING1,U,17)-$P(STRING1,U,19),DIFF2=$P(STRING2,U,17)-$P(STRING2,U,19)
 S DIFF3=$P(STRING3,U,17)-$P(STRING3,U,19)
 S Y1=X1-X2
 S Y2=X1-X3
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/Nutrition edu",?33,$P(STRING1,U,19),?38,$J($P(STRING1,U,23),5,1),?44,$P(STRING2,U,19)
 W ?49,$J($P(STRING2,U,23),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,19),?68,$J($P(STRING3,U,23),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o Nutrition edu",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH Q:BGPQUIT
 W !!,"Numerator 3"
 S Z1=$P(STRING1,U,24)-$P(STRING2,U,24)
 S Z2=$P(STRING1,U,24)-$P(STRING3,U,24)
 S X1=$P(STRING1,U,33),X2=$P(STRING2,U,33),X3=$P(STRING3,U,33)
 S DIFF1=$P(STRING1,U,17)-$P(STRING1,U,20),DIFF2=$P(STRING2,U,17)-$P(STRING2,U,20)
 S DIFF3=$P(STRING3,U,17)-$P(STRING3,U,20)
 S Y1=X1-X2
 S Y2=X1-X3
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/Activity edu",?33,$P(STRING1,U,20),?38,$J($P(STRING1,U,24),5,1),?44,$P(STRING2,U,20)
 W ?49,$J($P(STRING2,U,24),5,1),?56,$J($FN(Z1,",+",1),6),?64,$P(STRING3,U,20),?68,$J($P(STRING3,U,24),5,1),?74,$J($FN(Z2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 W !,"# w/o Activity edu",?33,DIFF1,?38,$J(X1,5,1),?44,DIFF2,?49,$J(X2,5,1),?56,$J($FN(Y1,",+",1),6),?64,DIFF3,?68,$J(X3,5,1),?74,$J($FN(Y2,",+",1),6)
 I $Y>(BGPIOSL-3) D HEADER^BGPMUPH,HDRBLK^BGPMUPH Q:BGPQUIT
 ;Output the individual data
 I $D(BGPLIST(BGPIC)) D P2
P1Q K ^TMP("BGPMU 2-10",$J)
 K ^TMP("BGPMU 11-16",$J)
 K ^TMP("BGPMU 2-16",$J)
 K ^TMP("BGPMU0024",$J)
 Q
D24(TF) ;Get the numbers for this measure
 N ARRAY,AG1,AG2,AG3,NUM1,NUM2,NUM3,NUM4,NUM5,NUM6,NUM7,NUM8,NUM9
 N PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,DEN1,DEN2,DEN3
 N NC1,NC2,NC3,NC4,NC5,NC6,NC7,NC8,NC9
 S AG1=$G(^TMP("BGPMU 2-16",$J,TF,"POPULATION"))
 S AG2=$G(^TMP("BGPMU 2-10",$J,TF,"POPULATION"))
 S AG3=$G(^TMP("BGPMU 11-16",$J,TF,"POPULATION"))
 ;2-16 DATA
 S NUM1=+$P(AG1,U,1),NUM2=+$P(AG1,U,2),NUM3=+$P(AG1,U,3),DEN1=+$P(AG1,U,4),NONUM1=+$P(AG1,U,5)
 ; 2-10 DATA"
 S NUM4=+$P(AG2,U,1),NUM5=+$P(AG2,U,2),NUM6=+$P(AG2,U,3),DEN2=+$P(AG2,U,4),NONUM2=+$P(AG2,U,5)
 ; 11-16 DATA"
 S NUM7=+$P(AG3,U,1),NUM8=+$P(AG3,U,2),NUM9=+$P(AG3,U,3),DEN3=+$P(AG3,U,4),NONUM3=+$P(AG3,U,5)
 I DEN1=0 S (PC1,PC2,PC3,NC1,NC2,NC3)=0
 I DEN1>0 D
 .S PC1=$$ROUND^BGPMUA01((NUM1/DEN1),3)*100
 .S PC2=$$ROUND^BGPMUA01((NUM2/DEN1),3)*100
 .S PC3=$$ROUND^BGPMUA01((NUM3/DEN1),3)*100
 .S NC1=$$ROUND^BGPMUA01(((DEN1-NUM1)/DEN1),3)*100
 .S NC2=$$ROUND^BGPMUA01(((DEN1-NUM2)/DEN1),3)*100
 .S NC3=$$ROUND^BGPMUA01(((DEN1-NUM3)/DEN1),3)*100
 I DEN2=0 S (PC4,PC5,PC6,NC4,NC5,NC6)=0
 I DEN2>0 D
 .S PC4=$$ROUND^BGPMUA01((NUM4/DEN2),3)*100
 .S PC5=$$ROUND^BGPMUA01((NUM5/DEN2),3)*100
 .S PC6=$$ROUND^BGPMUA01((NUM6/DEN2),3)*100
 .S NC4=$$ROUND^BGPMUA01(((DEN2-NUM4)/DEN2),3)*100
 .S NC5=$$ROUND^BGPMUA01(((DEN2-NUM5)/DEN2),3)*100
 .S NC6=$$ROUND^BGPMUA01(((DEN2-NUM6)/DEN2),3)*100
 I DEN3=0 S (PC7,PC8,PC9,NC7,NC8,NC9)=0
 I DEN3>0 D
 .S PC7=$$ROUND^BGPMUA01((NUM7/DEN3),3)*100
 .S PC8=$$ROUND^BGPMUA01((NUM8/DEN3),3)*100
 .S PC9=$$ROUND^BGPMUA01((NUM9/DEN3),3)*100
 .S NC7=$$ROUND^BGPMUA01(((DEN3-NUM7)/DEN3),3)*100
 .S NC8=$$ROUND^BGPMUA01(((DEN3-NUM8)/DEN3),3)*100
 .S NC9=$$ROUND^BGPMUA01(((DEN3-NUM9)/DEN3),3)*100
 S ARRAY=DEN1_U_NUM1_U_NUM2_U_NUM3_U_NONUM1_U_$G(PC1)_U_$G(PC2)_U_$G(PC3)
 S ARRAY=ARRAY_U_DEN2_U_NUM4_U_NUM5_U_NUM6_U_NONUM2_U_$G(PC4)_U_$G(PC5)_U_$G(PC6)
 S ARRAY=ARRAY_U_DEN3_U_NUM7_U_NUM8_U_NUM9_U_NONUM3_U_$G(PC7)_U_$G(PC8)_U_$G(PC9)
 S ARRAY=ARRAY_U_$G(NC1)_U_$G(NC2)_U_$G(NC3)_U_$G(NC4)_U_$G(NC5)_U_$G(NC6)_U_$G(NC7)_U_$G(NC8)_U_$G(NC9)
 K AG1,AG2,AG3,NUM1,NUM2,NUM3,NUM4,NUM5,NUM6,NUM7,NUM8,NUM9
 K PC1,PC2,PC3,PC4,PC5,PC6,PC7,PC8,PC9,DEN1,DEN2,DEN3
 K NC1,NC2,NC3,NC4,NC5,NC6,NC7,NC8,NC9
 Q ARRAY
XML ;
 N STRING
 S STRING=$$D24("C")
 S BGPXML(1)="239"_U_U_+$P(STRING,U,1)_U_+$P(STRING,U,2)
 K ^TMP("BGPMU0024",$J)
 K ^TMP("BGPMU 2-10",$J)
 K ^TMP("BGPMU 11-16",$J)
 K ^TMP("BGPMU 2-16",$J)
 Q
P2 ;Do the details
 N PT,PTCT,NODE,NAME,VST,X,BGPARR,LINE
 S PTCT=0
 D HEADERL^BGPMUPH
 S X="Patients 2-16 who had at least 1 outpatient encounter with the EP" D W^BGPMUPP(X,0,1,BGPPTYPE)
 S X="during the reporting period, with documented BMI and counseling, if any." D W^BGPMUPP(X,0,1,BGPPTYPE)
 W ! S X="Patients who do 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:)." D W^BGPMUPP(X,0,1,BGPPTYPE)
 W ! S X="The following are the abbreviations used in the denominator column:" D W^BGPMUPP(X,0,1,BGPPTYPE)
 S X="EN=Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
 F NUM=1:1:3 D
 .S PTCT=0
 .I $Y>(BGPIOSL-7) D HEADERL^BGPMUPH Q:BGPQUIT
 .S X=$P($T(NUMHDR+NUM),";;",2) D W^BGPMUPP(X,0,2,BGPPTYPE)
 .W !!,"PATIENT NAME",?23,"HRN",?30,"COMMUNITY",?42,"SEX",?46,"AGE",?50,"DENOMINATOR",?63,"NUMERATOR"
 .S LINE="",$P(LINE,"-",81)="" W !,LINE
 .I BGPLIST="D"!(BGPLIST="A") D
 ..K BGPARR
 ..D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0024"","_$J_",""PAT"",""C"",""NOT"","_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="N"!(BGPLIST="A") D
 ..K BGPARR
 ..D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0024"","_$J_",""PAT"",""C"",""NUM"","_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)
 .W !!,"Total # of patients on list: "_PTCT
 Q
NUMHDR ;Headers for indiv numerator lists
 ;;Numerator 1 BMI Percentile:
 ;;Numerator 2 Nutrition Education:
 ;;Numerator 3 Physical Activity Education: 
DATA(NODE) ;GET DATA
 N NAME,HRN,DEN,NUM,AGE,DFN,SEX,COMM,NUM1,NUM2,NUM3,DEN1,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),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",?63,"NUMERATOR"
 .S LINE="",$P(LINE,"-",81)="" W !,LINE
 S (NUM1,NUM2,NUM3)=""
 S NUM1=$P(NUM,";",1),NUM2=$P(NUM,";",2),NUM3=$P(NUM,";",3)
 W !,NAME,?23,HRN,?30,COMM,?42,SEX,?46,AGE,?50,DEN,?63,NUM1
 I NUM2'="" D
 .W !,?65,NUM2
 I NUM3'="" D
 .W !,?65,NUM3
 Q