- BGPMUDP4 ; IHS/MSC/SAT - MU EH measure output routines;12-JUL-2011 16:30;DU
- ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
- ;
- ;This routine does the printed output of 0014 Prenatal Anti-D Immune Globulin (BGPMUD05)
- P27ENT ;EP output routine for 0027 Prenatal Anti-D Immune Globulin
- D P27
- K ^TMP("BGPMU0027",$J)
- Q
- P27 ;Write individual measure
- N X,Y,Z,LIST1,LIST2,LIST3
- N DEN,NUM1,EXC1,PC1,PC11,PC13,NONUM,STRING1,STRING2,STRING3,PRD1,PRD2,PRD3,PRD4,PRD5,PRD6,X
- S STRING1=$$027("C")
- S STRING2=$$027("P")
- S STRING3=$$027("B")
- ;S PRD11=$P(STRING1,U,1)-$P(STRING2,U,1) ;change from prev year (line 1)
- S PRD12=$P(STRING1,U,5)-$P(STRING2,U,5) ;% change from prev year
- S PRD13=$P(STRING1,U,5)-$P(STRING3,U,5) ;% change from base year
- S PRD14=$P(STRING1,U,6)-$P(STRING2,U,6) ;% change from prev year
- S PRD15=$P(STRING1,U,6)-$P(STRING3,U,6) ;% change from prev year
- ;S PRD21=$P(STRING1,U,1)-$P(STRING2,U,1) ;change from prev year (line 1)
- S PRD22=$P(STRING1,U,11)-$P(STRING2,U,11) ;% change from prev year
- S PRD23=$P(STRING1,U,11)-$P(STRING3,U,11) ;% change from base year
- S PRD24=$P(STRING1,U,12)-$P(STRING2,U,12) ;% change from prev year
- S PRD25=$P(STRING1,U,12)-$P(STRING3,U,12) ;% change from prev year
- D HEADER^BGPMUPH Q:BGPQUIT
- ;W !
- D HDRBLK^BGPMUPH
- W !!,"Pts 18+",?33,$P(STRING1,U,1),?44,$P(STRING2,U,1),?64,$P(STRING3,U,1)
- I $Y>(BGPIOSL-3) D HEADER^BGPMUPH Q:BGPQUIT
- W !
- W !,"Numerator 1"
- W !,"# w/tobacco use",?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(PRD12,",+",1),6),?64,$P(STRING3,U,2),?68,$J($P(STRING3,U,5),5,1),?74,$J($FN(PRD13,",+",1),6)
- W !,"# w/o tobacco use",?33,$P(STRING1,U,3),?38,$J($P(STRING1,U,6),5,1),?44,$P(STRING2,U,3),?49,$J($P(STRING2,U,6),5,1),?56,$J($FN(PRD14,",+",1),6),?64,$P(STRING3,U,3),?68,$J($P(STRING3,U,6),5,1),?74,$J($FN(PRD15,",+",1),6)
- I $Y>(BGPIOSL-3) D HEADER^BGPMUPH Q:BGPQUIT
- W !
- W !,"Numerator 2"
- W !,"# w/tobacco use and",?33,$P(STRING1,U,8),?38,$J($P(STRING1,U,11),5,1),?44,$P(STRING2,U,8),?49,$J($P(STRING2,U,11),5,1),?56,$J($FN(PRD22,",+",1),6),?64,$P(STRING3,U,8),?68,$J($P(STRING3,U,11),5,1),?74,$J($FN(PRD23,",+",1),6)
- W !,"cessation counseling"
- W !,"# w/o tobacco use or",?33,$P(STRING1,U,9),?38,$J($P(STRING1,U,12),5,1),?44,$P(STRING2,U,9),?49,$J($P(STRING2,U,12),5,1),?56,$J($FN(PRD24,",+",1),6),?64,$P(STRING3,U,9),?68,$J($P(STRING3,U,12),5,1),?74,$J($FN(PRD25,",+",1),6)
- W !,"w/tobacco use and no"
- W !,"cessation counseling"
- I $D(BGPLIST(BGPIC)) D P27D
- D SUM027^BGPMUDD4
- Q
- 027(BGPMUTF) ;Get the numbers for this measure
- N ARRAY
- S DEN=+$G(^TMP("BGPMU0027",$J,BGPMUTF,"DEN",1))
- S NUM1=+$G(^TMP("BGPMU0027",$J,BGPMUTF,"NUM",1))
- S NONUM1=+$G(^TMP("BGPMU0027",$J,BGPMUTF,"NOT",1))
- S NUM2=+$G(^TMP("BGPMU0027",$J,BGPMUTF,"NUM",2))
- S NONUM2=+$G(^TMP("BGPMU0027",$J,BGPMUTF,"NOT",2))
- I DEN=0 S (PC1,PC11)=0,(PC2,PC21)=0
- I DEN>0 D
- .I DEN=0 S (PC1,PC11)=0,(PC2,PC21)=0
- .E D
- ..S PC1=$$ROUND^BGPMUA01((NUM1/DEN),3)*100
- ..S PC11=$$ROUND^BGPMUA01((NONUM1/DEN),3)*100
- ..S PC2=$$ROUND^BGPMUA01((NUM2/DEN),3)*100
- ..S PC21=$$ROUND^BGPMUA01((NONUM2/DEN),3)*100
- ; 1 2 3 4 5 6 7 8 9 10 11 12 13
- S ARRAY=DEN_U_NUM1_U_NONUM1_U_""_U_PC1_U_PC11_U_0_U_NUM2_U_NONUM2_U_""_U_PC2_U_PC21_U_0
- Q ARRAY
- P27D ;Do the Details
- N PT,PTCNT,NODE,NAME,VST,BMI,FOL,X
- N BGPARR
- D HEADERL^BGPMUPH Q:BGPQUIT
- S X="Patients 18 years of age and older with at least 1 encounter with the EP within" D W^BGPMUPP(X,0,1,BGPPTYPE)
- S X="2 years of the reporting period end date, who have been identified as tobacco" D W^BGPMUPP(X,0,1,BGPPTYPE)
- S X="users within 1 year before or during the reporting period and who received" D W^BGPMUPP(X,0,1,BGPPTYPE)
- S X="advice to quit smoking or tobacco use or whose EP recommended or discussed" D W^BGPMUPP(X,0,1,BGPPTYPE)
- S X="smoking or tobacco use cessation medications, methods or strategies within" D W^BGPMUPP(X,0,1,BGPPTYPE)
- S X="1 year of the reporting period end date, 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:)." 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="EN=Encounter" D W^BGPMUPP(X,0,1,BGPPTYPE)
- S X="HF=Tobacco User Health Factor" D W^BGPMUPP(X,0,1,BGPPTYPE)
- ;
- I $Y>(BGPIOSL-2) D HEADERL^BGPMUPH Q:BGPQUIT
- W !!,"Numerator 1: Tobacco users"
- W !!,"PATIENT NAME",?23,"HRN",?31,"COMMUNITY",?41,"SEX",?45,"AGE",?50,"DENOMINATOR",?63,"NUMERATOR"
- S LINE="",$P(LINE,"-",81)="" W !,LINE
- S PTCT=0
- I (BGPLIST="A")!(BGPLIST="D")&$D(^TMP("BGPMU0027",$J,"PAT","C","NOT",1)) D
- .K BGPARR
- .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$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 D027(NODE)
- I (BGPLIST="A")!(BGPLIST="N")&($D(^TMP("BGPMU0027",$J,"PAT","C","NUM",1))) D
- .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$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 D027(NODE)
- S X="Total # of patients on list: "_PTCT D W^BGPMUPP(X,0,2,BGPPTYPE)
- W !!,"Numerator 2: Tobacco users who received tobacco use cessation counseling"
- W !!,"PATIENT NAME",?23,"HRN",?31,"COMMUNITY",?41,"SEX",?45,"AGE",?50,"DENOMINATOR",?63,"NUMERATOR"
- S LINE="",$P(LINE,"-",81)="" W !,LINE
- S PTCT=0
- I (BGPLIST="A")!(BGPLIST="D")&$D(^TMP("BGPMU0027",$J,"PAT","C","NOT",2)) D
- .K BGPARR
- .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$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 D027(NODE)
- I (BGPLIST="A")!(BGPLIST="N")&($D(^TMP("BGPMU0027",$J,"PAT","C","NUM",2))) D
- .D PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$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 D027(NODE)
- S X="Total # of patients on list: "_PTCT D W^BGPMUPP(X,0,2,BGPPTYPE)
- Q
- ;
- D027(NODE) ;GET DATA
- N BGPI,DATA,NAME,HRN,DEN,NUM,AGE,DFN
- S DFN=$P(NODE,U,1)
- S NAME=$E($$GET1^DIQ(2,$P(NODE,U,1),.01),1,21)
- S HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
- S AGE=$$AGE^AUPNPAT(DFN,BGPED)
- S SEX=$$SEX^AUPNPAT(DFN)
- S COMM=$E($$GET1^DIQ(9000001,DFN,1118),1,10)
- S DEN=$P(NODE,U,2)
- S NUM=$P(NODE,U,3)
- I $Y>(BGPIOSL-2) D
- .D HEADERL^BGPMUPH Q:BGPQUIT
- .W !,"PATIENT NAME",?23,"HRN",?31,"COMMUNITY",?41,"SEX",?45,"AGE",?50,"DENOMINATOR",?63,"NUMERATOR"
- .S LINE="",$P(LINE,"-",81)="" W !,LINE
- W !,NAME,?23,HRN,?31,COMM,?41,SEX,?45,AGE,?50,$P(DEN,";",1),?63,$P(NUM,";",1)
- I ($P(DEN,";",2)'="")!($P(NUM,";",2)'="") W !,?50,$S($P(DEN,";",2)'="":$P(DEN,";",2),1:""),?63,$S($P(NUM,";",2)'="":$P(NUM,";",2),1:"")
- I ($P(DEN,";",3)'="")!($P(NUM,";",3)'="") W !,?50,$S($P(DEN,";",3)'="":$P(DEN,";",3),1:""),?63,$S($P(NUM,";",3)'="":$P(NUM,";",3),1:"")
- Q
- ;
- XML027 ;Populate the BGPXML array with data for each population/numerator
- ; BGPXMLOUT(i)=Population Number^Numerator Number^Denominator Count^Numerator Count^Exclusion Count
- S BGPXML(1)="115"_U_""_U_+$G(^TMP("BGPMU0027",$J,"C","DEN",1))_U_+$G(^TMP("BGPMU0027",$J,"C","NUM",1))
- S BGPXML(2)="115"_U_""_U_+$G(^TMP("BGPMU0027",$J,"C","DEN",1))_U_+$G(^TMP("BGPMU0027",$J,"C","NUM",2))
- K ^TMP("BGPMU0027",$J)
- Q
- ;
- ;*********************
- ;
- BGPMUDP4 ; IHS/MSC/SAT - MU EH measure output routines;12-JUL-2011 16:30;DU
- +1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
- +2 ;
- +3 ;This routine does the printed output of 0014 Prenatal Anti-D Immune Globulin (BGPMUD05)
- P27ENT ;EP output routine for 0027 Prenatal Anti-D Immune Globulin
- +1 DO P27
- +2 KILL ^TMP("BGPMU0027",$JOB)
- +3 QUIT
- P27 ;Write individual measure
- +1 NEW X,Y,Z,LIST1,LIST2,LIST3
- +2 NEW DEN,NUM1,EXC1,PC1,PC11,PC13,NONUM,STRING1,STRING2,STRING3,PRD1,PRD2,PRD3,PRD4,PRD5,PRD6,X
- +3 SET STRING1=$$027("C")
- +4 SET STRING2=$$027("P")
- +5 SET STRING3=$$027("B")
- +6 ;S PRD11=$P(STRING1,U,1)-$P(STRING2,U,1) ;change from prev year (line 1)
- +7 ;% change from prev year
- SET PRD12=$PIECE(STRING1,U,5)-$PIECE(STRING2,U,5)
- +8 ;% change from base year
- SET PRD13=$PIECE(STRING1,U,5)-$PIECE(STRING3,U,5)
- +9 ;% change from prev year
- SET PRD14=$PIECE(STRING1,U,6)-$PIECE(STRING2,U,6)
- +10 ;% change from prev year
- SET PRD15=$PIECE(STRING1,U,6)-$PIECE(STRING3,U,6)
- +11 ;S PRD21=$P(STRING1,U,1)-$P(STRING2,U,1) ;change from prev year (line 1)
- +12 ;% change from prev year
- SET PRD22=$PIECE(STRING1,U,11)-$PIECE(STRING2,U,11)
- +13 ;% change from base year
- SET PRD23=$PIECE(STRING1,U,11)-$PIECE(STRING3,U,11)
- +14 ;% change from prev year
- SET PRD24=$PIECE(STRING1,U,12)-$PIECE(STRING2,U,12)
- +15 ;% change from prev year
- SET PRD25=$PIECE(STRING1,U,12)-$PIECE(STRING3,U,12)
- +16 DO HEADER^BGPMUPH
- IF BGPQUIT
- QUIT
- +17 ;W !
- +18 DO HDRBLK^BGPMUPH
- +19 WRITE !!,"Pts 18+",?33,$PIECE(STRING1,U,1),?44,$PIECE(STRING2,U,1),?64,$PIECE(STRING3,U,1)
- +20 IF $Y>(BGPIOSL-3)
- DO HEADER^BGPMUPH
- IF BGPQUIT
- QUIT
- +21 WRITE !
- +22 WRITE !,"Numerator 1"
- +23 WRITE !,"# w/tobacco use",?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(PRD12,",+",1),6),?64,$PIECE(STRING3,U,2),?68,$JUSTIFY($PIECE(STRING3,U,5),5,1),?74,$JUSTIFY($FNUMBER(PRD13,",+",1),6)
- +24 WRITE !,"# w/o tobacco use",?33,$PIECE(STRING1,U,3),?38,$JUSTIFY($PIECE(STRING1,U,6),5,1),?44,$PIECE(STRING2,U,3),?49,$JUSTIFY($PIECE(STRING2,U,6),5,1),?56,...
- ... $JUSTIFY($FNUMBER(PRD14,",+",1),6),?64,$PIECE(STRING3,U,3),?68,$JUSTIFY($PIECE(STRING3,U,6),5,1),?74,$JUSTIFY($FNUMBER(PRD15,",+",1),6)
- +25 IF $Y>(BGPIOSL-3)
- DO HEADER^BGPMUPH
- IF BGPQUIT
- QUIT
- +26 WRITE !
- +27 WRITE !,"Numerator 2"
- +28 WRITE !,"# w/tobacco use and",?33,$PIECE(STRING1,U,8),?38,$JUSTIFY($PIECE(STRING1,U,11),5,1),?44,$PIECE(STRING2,U,8),?49,$JUSTIFY(...
- ... $PIECE(STRING2,U,11),5,1),?56,$JUSTIFY($FNUMBER(PRD22,",+",1),6),?64,$PIECE(STRING3,U,8),?68,$JUSTIFY($PIECE(STRING3,U,11),5,1),?74,$JUSTIFY($FNUMBER(PRD23,",+",1),6)
- +29 WRITE !,"cessation counseling"
- +30 WRITE !,"# w/o tobacco use or",?33,$PIECE(STRING1,U,9),?38,$JUSTIFY($PIECE(STRING1,U,12),5,1),?44,$PIECE(STRING2,U,9),?49,$JUSTIFY(...
- ... $PIECE(STRING2,U,12),5,1),?56,$JUSTIFY($FNUMBER(PRD24,",+",1),6),?64,$PIECE(STRING3,U,9),?68,$JUSTIFY($PIECE(STRING3,U,12),5,1),?74,$JUSTIFY($FNUMBER(PRD25,",+",1),6)
- +31 WRITE !,"w/tobacco use and no"
- +32 WRITE !,"cessation counseling"
- +33 IF $DATA(BGPLIST(BGPIC))
- DO P27D
- +34 DO SUM027^BGPMUDD4
- +35 QUIT
- 027(BGPMUTF) ;Get the numbers for this measure
- +1 NEW ARRAY
- +2 SET DEN=+$GET(^TMP("BGPMU0027",$JOB,BGPMUTF,"DEN",1))
- +3 SET NUM1=+$GET(^TMP("BGPMU0027",$JOB,BGPMUTF,"NUM",1))
- +4 SET NONUM1=+$GET(^TMP("BGPMU0027",$JOB,BGPMUTF,"NOT",1))
- +5 SET NUM2=+$GET(^TMP("BGPMU0027",$JOB,BGPMUTF,"NUM",2))
- +6 SET NONUM2=+$GET(^TMP("BGPMU0027",$JOB,BGPMUTF,"NOT",2))
- +7 IF DEN=0
- SET (PC1,PC11)=0
- SET (PC2,PC21)=0
- +8 IF DEN>0
- Begin DoDot:1
- +9 IF DEN=0
- SET (PC1,PC11)=0
- SET (PC2,PC21)=0
- +10 IF '$TEST
- Begin DoDot:2
- +11 SET PC1=$$ROUND^BGPMUA01((NUM1/DEN),3)*100
- +12 SET PC11=$$ROUND^BGPMUA01((NONUM1/DEN),3)*100
- +13 SET PC2=$$ROUND^BGPMUA01((NUM2/DEN),3)*100
- +14 SET PC21=$$ROUND^BGPMUA01((NONUM2/DEN),3)*100
- End DoDot:2
- End DoDot:1
- +15 ; 1 2 3 4 5 6 7 8 9 10 11 12 13
- +16 SET ARRAY=DEN_U_NUM1_U_NONUM1_U_""_U_PC1_U_PC11_U_0_U_NUM2_U_NONUM2_U_""_U_PC2_U_PC21_U_0
- +17 QUIT ARRAY
- P27D ;Do the Details
- +1 NEW PT,PTCNT,NODE,NAME,VST,BMI,FOL,X
- +2 NEW BGPARR
- +3 DO HEADERL^BGPMUPH
- IF BGPQUIT
- QUIT
- +4 SET X="Patients 18 years of age and older with at least 1 encounter with the EP within"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +5 SET X="2 years of the reporting period end date, who have been identified as tobacco"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +6 SET X="users within 1 year before or during the reporting period and who received"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +7 SET X="advice to quit smoking or tobacco use or whose EP recommended or discussed"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +8 SET X="smoking or tobacco use cessation medications, methods or strategies within"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +9 SET X="1 year of the reporting period end date, if any."
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +10 SET X="Patients who do not meet the numerator criteria are listed first (NM:), followed"
- DO W^BGPMUPP(X,0,2,BGPPTYPE)
- +11 SET X="by patients who do meet the numerator criteria (M:)."
- 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,2,BGPPTYPE)
- +13 SET X="columns:"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +14 SET X="EN=Encounter"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +15 SET X="HF=Tobacco User Health Factor"
- DO W^BGPMUPP(X,0,1,BGPPTYPE)
- +16 ;
- +17 IF $Y>(BGPIOSL-2)
- DO HEADERL^BGPMUPH
- IF BGPQUIT
- QUIT
- +18 WRITE !!,"Numerator 1: Tobacco users"
- +19 WRITE !!,"PATIENT NAME",?23,"HRN",?31,"COMMUNITY",?41,"SEX",?45,"AGE",?50,"DENOMINATOR",?63,"NUMERATOR"
- +20 SET LINE=""
- SET $PIECE(LINE,"-",81)=""
- WRITE !,LINE
- +21 SET PTCT=0
- +22 IF (BGPLIST="A")!(BGPLIST="D")&$DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NOT",1))
- Begin DoDot:1
- +23 KILL BGPARR
- +24 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NOT"",1)")
- +25 SET PT=0
- FOR
- SET PT=$ORDER(BGPARR(PT))
- IF PT=""
- QUIT
- Begin DoDot:2
- +26 SET PTCT=PTCT+1
- +27 SET NODE=$GET(BGPARR(PT))
- +28 DO D027(NODE)
- End DoDot:2
- End DoDot:1
- +29 IF (BGPLIST="A")!(BGPLIST="N")&($DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NUM",1)))
- Begin DoDot:1
- +30 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NUM"",1)")
- +31 SET PT=0
- FOR
- SET PT=$ORDER(BGPARR(PT))
- IF PT=""
- QUIT
- Begin DoDot:2
- +32 SET PTCT=PTCT+1
- +33 SET NODE=$GET(BGPARR(PT))
- +34 DO D027(NODE)
- End DoDot:2
- End DoDot:1
- +35 SET X="Total # of patients on list: "_PTCT
- DO W^BGPMUPP(X,0,2,BGPPTYPE)
- +36 WRITE !!,"Numerator 2: Tobacco users who received tobacco use cessation counseling"
- +37 WRITE !!,"PATIENT NAME",?23,"HRN",?31,"COMMUNITY",?41,"SEX",?45,"AGE",?50,"DENOMINATOR",?63,"NUMERATOR"
- +38 SET LINE=""
- SET $PIECE(LINE,"-",81)=""
- WRITE !,LINE
- +39 SET PTCT=0
- +40 IF (BGPLIST="A")!(BGPLIST="D")&$DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NOT",2))
- Begin DoDot:1
- +41 KILL BGPARR
- +42 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NOT"",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 D027(NODE)
- End DoDot:2
- End DoDot:1
- +47 IF (BGPLIST="A")!(BGPLIST="N")&($DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NUM",2)))
- Begin DoDot:1
- +48 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NUM"",2)")
- +49 SET PT=0
- FOR
- SET PT=$ORDER(BGPARR(PT))
- IF PT=""
- QUIT
- Begin DoDot:2
- +50 SET PTCT=PTCT+1
- +51 SET NODE=$GET(BGPARR(PT))
- +52 DO D027(NODE)
- End DoDot:2
- End DoDot:1
- +53 SET X="Total # of patients on list: "_PTCT
- DO W^BGPMUPP(X,0,2,BGPPTYPE)
- +54 QUIT
- +55 ;
- D027(NODE) ;GET DATA
- +1 NEW BGPI,DATA,NAME,HRN,DEN,NUM,AGE,DFN
- +2 SET DFN=$PIECE(NODE,U,1)
- +3 SET NAME=$EXTRACT($$GET1^DIQ(2,$PIECE(NODE,U,1),.01),1,21)
- +4 SET HRN=$$HRN^AUPNPAT(DFN,DUZ(2))
- +5 SET AGE=$$AGE^AUPNPAT(DFN,BGPED)
- +6 SET SEX=$$SEX^AUPNPAT(DFN)
- +7 SET COMM=$EXTRACT($$GET1^DIQ(9000001,DFN,1118),1,10)
- +8 SET DEN=$PIECE(NODE,U,2)
- +9 SET NUM=$PIECE(NODE,U,3)
- +10 IF $Y>(BGPIOSL-2)
- Begin DoDot:1
- +11 DO HEADERL^BGPMUPH
- IF BGPQUIT
- QUIT
- +12 WRITE !,"PATIENT NAME",?23,"HRN",?31,"COMMUNITY",?41,"SEX",?45,"AGE",?50,"DENOMINATOR",?63,"NUMERATOR"
- +13 SET LINE=""
- SET $PIECE(LINE,"-",81)=""
- WRITE !,LINE
- End DoDot:1
- +14 WRITE !,NAME,?23,HRN,?31,COMM,?41,SEX,?45,AGE,?50,$PIECE(DEN,";",1),?63,$PIECE(NUM,";",1)
- +15 IF ($PIECE(DEN,";",2)'="")!($PIECE(NUM,";",2)'="")
- WRITE !,?50,$SELECT($PIECE(DEN,";",2)'="":$PIECE(DEN,";",2),1:""),?63,$SELECT($PIECE(NUM,";",2)'="":$PIECE(NUM,";",2),1:"")
- +16 IF ($PIECE(DEN,";",3)'="")!($PIECE(NUM,";",3)'="")
- WRITE !,?50,$SELECT($PIECE(DEN,";",3)'="":$PIECE(DEN,";",3),1:""),?63,$SELECT($PIECE(NUM,";",3)'="":$PIECE(NUM,";",3),1:"")
- +17 QUIT
- +18 ;
- XML027 ;Populate the BGPXML array with data for each population/numerator
- +1 ; BGPXMLOUT(i)=Population Number^Numerator Number^Denominator Count^Numerator Count^Exclusion Count
- +2 SET BGPXML(1)="115"_U_""_U_+$GET(^TMP("BGPMU0027",$JOB,"C","DEN",1))_U_+$GET(^TMP("BGPMU0027",$JOB,"C","NUM",1))
- +3 SET BGPXML(2)="115"_U_""_U_+$GET(^TMP("BGPMU0027",$JOB,"C","DEN",1))_U_+$GET(^TMP("BGPMU0027",$JOB,"C","NUM",2))
- +4 KILL ^TMP("BGPMU0027",$JOB)
- +5 QUIT
- +6 ;
- +7 ;*********************
- +8 ;