BGPMUDD4 ; IHS/MSC/SAT - Delimited MU measure NQF0027 ;27-Apr-2011 13:15;DU
;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
;Delimited output for Prenatal HIV Screening 0027 (BGPMUD07)
D27ENT ;EP
D P27B
K ^TMP("BGPMU0027",$J)
Q
P27B ;Write individual measure
N BGPPTYPE,X,Y,Z,DEN,NUM,PC,STRING1,STRING2,PRD,PRN,PRD1,PRN1
S BGPPTYPE="D"
S STRING1=$$027^BGPMUDP4("C")
S STRING2=$$027^BGPMUDP4("P")
S STRING3=$$027^BGPMUDP4("B")
D SUM027
;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
S X=U_"REPORT PERIOD"_U_"%"_U_"PREV YR PERIOD"_U_"%"_U_"CHG FROM PREV YR"_U_"BASE YR"_U_"%"_U_"CHG FROM BASE %"
D S^BGPMUDEL(X,1,1)
S X="Pts 18+"_U_$P(STRING1,U,1)_U_$P(STRING2,U,1)_U_$P(STRING3,U,1)
D S^BGPMUDEL(X,1,1)
S X="Numerator 1"
D S^BGPMUDEL(X,2,1)
S X="# w/tobacco use"_U_$P(STRING1,U,2)_U_$J($P(STRING1,U,5),5,1)_U_$P(STRING2,U,2)_U_$J($P(STRING2,U,5),5,1)_U_$J($FN(PRD12,",+",1),6)_U_$P(STRING3,U,2)_U_$J($P(STRING3,U,5),5,1)_U_$J($FN(PRD13,",+",1),6)
D S^BGPMUDEL(X,1,1)
S X="# w/o tobacco use"_U_$P(STRING1,U,3)_U_$J($P(STRING1,U,6),5,1)_U_$P(STRING2,U,3)_U_$J($P(STRING2,U,6),5,1)_U_$J($FN(PRD14,",+",1),6)_U_$P(STRING3,U,3)_U_$J($P(STRING3,U,6),5,1)_U_$J($FN(PRD15,",+",1),6)
D S^BGPMUDEL(X,1,1)
S X="Numerator 2"
D S^BGPMUDEL(X,2,1)
S X="# w/tobacco use and cessation counseling"_U_$P(STRING1,U,8)_U_$J($P(STRING1,U,11),5,1)_U_$P(STRING2,U,8)_U_$J($P(STRING2,U,11),5,1)
S X=X_U_$J($FN(PRD22,",+",1),6)_U_$P(STRING3,U,8)_U_$J($P(STRING3,U,11),5,1)_U_$J($FN(PRD23,",+",1),6)
D S^BGPMUDEL(X,1,1)
S X="# w/o tobacco use or w/tobacco use and no cessation counseling"_U_$P(STRING1,U,9)_U_$J($P(STRING1,U,12),5,1)_U_$P(STRING2,U,9)
S X=X_U_$J($P(STRING2,U,12),5,1)_U_$J($FN(PRD24,",+",1),6)_U_$P(STRING3,U,9)_U_$J($P(STRING3,U,12),5,1)_U_$J($FN(PRD25,",+",1),6)
D S^BGPMUDEL(X,1,1)
I $D(BGPLIST(BGPIC)) D TC27
Q
TC27 ;Do the Details
N PT,NODE,NAME,BP
S X="**** CONFIDENTIAL PATIENT INFORMATION COVERED BY PRIVACY ACT ****" D S^BGPMUDEL(X,2,1)
S X="Patients 18 years of age and older with at least 1 encounter with the EP within" D S^BGPMUDEL(X,2,1)
S X="2 years of the reporting period end date, who have been identified as tobacco" D S^BGPMUDEL(X,1,1)
S X="users within 1 year before or during the reporting period and who received" D S^BGPMUDEL(X,1,1)
S X="advice to quit smoking or tobacco use or whose EP recommended or discussed" D S^BGPMUDEL(X,1,1)
S X="smoking or tobacco use cessation medications, methods or strategies within" D S^BGPMUDEL(X,1,1)
S X="1 year of the reporting period end date, if any." D S^BGPMUDEL(X,1,1)
S X="Patients who do not meet the numerator criteria are listed first (NM:), followed" D S^BGPMUDEL(X,2,1)
S X="by patients who do meet the numerator criteria (M:)." D S^BGPMUDEL(X,1,1)
S X="The following are the abbreviations used in the denominator and numerator" D S^BGPMUDEL(X,2,1)
S X="columns:" D S^BGPMUDEL(X,1,1)
S X="EN=Encounter" D S^BGPMUDEL(X,1,1)
S X="HF=Tobacco User Health Factor" D S^BGPMUDEL(X,1,1)
;
S X="Numerator 1: Tobacco users"
D S^BGPMUDEL(X,2,1)
S X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR"
D S^BGPMUDEL(X,2,1)
S LINE="",$P(LINE,"-",81)="" S X=LINE
D S^BGPMUDEL(X,1,1)
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 S^BGPMUDEL(X,2,1)
S X="Numerator 2: Tobacco users who received tobacco use cessation counseling"
D S^BGPMUDEL(X,2,1)
S X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR"
D S^BGPMUDEL(X,2,1)
S LINE="",$P(LINE,"-",81)="" S X=LINE
D S^BGPMUDEL(X,1,1)
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 S^BGPMUDEL(X,2,1)
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,23)
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)
S X=NAME_U_HRN_U_COMM_U_SEX_U_AGE_U_DEN_U_NUM
D S^BGPMUDEL(X,1,1)
Q
;
SUM027 ;Populate "BGPMU SUMMARY" for Measure 0027
;Initialize iCare/summary global
N BGPDNCNT,BGPSSTR,J,N
S J=$J
S BGPDNCNT=0
K ^TMP("BGPMU SUMMARY",J,BGPIC)
S ^TMP("BGPMU SUMMARY",J,BGPIC)="0027"_U_"115"
F N=1:1:2 D
.;Setup summary page/iCare ^TMP global
.S CDEN(N)=+$G(^TMP("BGPMU0027",J,"C","DEN",1)) ;current
.S CNUM(N)=+$G(^TMP("BGPMU0027",J,"C","NUM",N))
.S CMP(N)=$S(CDEN(N)>0:$$ROUND^BGPMUA01(CNUM(N)/CDEN(N),3)*100,1:0)
.S PDEN(N)=+$G(^TMP("BGPMU0027",J,"P","DEN",1)) ;previous
.S PNUM(N)=+$G(^TMP("BGPMU0027",J,"P","NUM",N))
.S PMP(N)=$S(PDEN(N)>0:$$ROUND^BGPMUA01(PNUM(N)/PDEN(N),3)*100,1:0)
.S BDEN(N)=+$G(^TMP("BGPMU0027",J,"B","DEN",1)) ;baseline
.S BNUM(N)=+$G(^TMP("BGPMU0027",J,"B","NUM",N))
.S BMP(N)=$S(BDEN(N)>0:$$ROUND^BGPMUA01(BNUM(N)/BDEN(N),3)*100,1:0)
;
S BGPDNCNT=BGPDNCNT+1
F N=1:1:2 D
.S BGPSSTR="MU.EP.0027."_N_U_$S(N=1:"18+ # w/tobacco use",N=2:"18+ # w/tobacco use and counseling",1:"")_U_0_U_CDEN(N)_U_CNUM(N)_U_CMP(N)_U_U_U_U
.; 11 12 13 14
.S BGPSSTR=BGPSSTR_U_0_U_PDEN(N)_U_PNUM(N)_U_PMP(N)
.; 15 16 17 18
.S BGPSSTR=BGPSSTR_U_0_U_BDEN(N)_U_BNUM(N)_U_BMP(N)
.S ^TMP("BGPMU SUMMARY",J,BGPIC,N)=BGPSSTR
;
Q
BGPMUDD4 ; IHS/MSC/SAT - Delimited MU measure NQF0027 ;27-Apr-2011 13:15;DU
+1 ;;14.1;IHS CLINICAL REPORTING;**1**;MAY 29, 2014;Build 2
+2 ;Delimited output for Prenatal HIV Screening 0027 (BGPMUD07)
D27ENT ;EP
+1 DO P27B
+2 KILL ^TMP("BGPMU0027",$JOB)
+3 QUIT
P27B ;Write individual measure
+1 NEW BGPPTYPE,X,Y,Z,DEN,NUM,PC,STRING1,STRING2,PRD,PRN,PRD1,PRN1
+2 SET BGPPTYPE="D"
+3 SET STRING1=$$027^BGPMUDP4("C")
+4 SET STRING2=$$027^BGPMUDP4("P")
+5 SET STRING3=$$027^BGPMUDP4("B")
+6 DO SUM027
+7 ;S PRD11=$P(STRING1,U,1)-$P(STRING2,U,1) ;change from prev year (line 1)
+8 ;% change from prev year
SET PRD12=$PIECE(STRING1,U,5)-$PIECE(STRING2,U,5)
+9 ;% change from base year
SET PRD13=$PIECE(STRING1,U,5)-$PIECE(STRING3,U,5)
+10 ;% change from prev year
SET PRD14=$PIECE(STRING1,U,6)-$PIECE(STRING2,U,6)
+11 ;% change from prev year
SET PRD15=$PIECE(STRING1,U,6)-$PIECE(STRING3,U,6)
+12 ;S PRD21=$P(STRING1,U,1)-$P(STRING2,U,1) ;change from prev year (line 1)
+13 ;% change from prev year
SET PRD22=$PIECE(STRING1,U,11)-$PIECE(STRING2,U,11)
+14 ;% change from base year
SET PRD23=$PIECE(STRING1,U,11)-$PIECE(STRING3,U,11)
+15 ;% change from prev year
SET PRD24=$PIECE(STRING1,U,12)-$PIECE(STRING2,U,12)
+16 ;% change from prev year
SET PRD25=$PIECE(STRING1,U,12)-$PIECE(STRING3,U,12)
+17 SET X=U_"REPORT PERIOD"_U_"%"_U_"PREV YR PERIOD"_U_"%"_U_"CHG FROM PREV YR"_U_"BASE YR"_U_"%"_U_"CHG FROM BASE %"
+18 DO S^BGPMUDEL(X,1,1)
+19 SET X="Pts 18+"_U_$PIECE(STRING1,U,1)_U_$PIECE(STRING2,U,1)_U_$PIECE(STRING3,U,1)
+20 DO S^BGPMUDEL(X,1,1)
+21 SET X="Numerator 1"
+22 DO S^BGPMUDEL(X,2,1)
+23 SET X="# w/tobacco use"_U_$PIECE(STRING1,U,2)_U_$JUSTIFY($PIECE(STRING1,U,5),5,1)_U_$PIECE(STRING2,U,2)_U_$JUSTIFY($PIECE(STRING2,U,5),5,1)_U_$JUSTIFY($FNUMBER(PRD12,",+",1),6)_U_$PIECE(STRING3,U,2)_U_...
... $JUSTIFY($PIECE(STRING3,U,5),5,1)_U_$JUSTIFY($FNUMBER(PRD13,",+",1),6)
+24 DO S^BGPMUDEL(X,1,1)
+25 SET X="# w/o tobacco use"_U_$PIECE(STRING1,U,3)_U_$JUSTIFY($PIECE(STRING1,U,6),5,1)_U_$PIECE(STRING2,U,3)_U_$JUSTIFY($PIECE(STRING2,U,6),5,1)_U_$JUSTIFY($FNUMBER(PRD14,",+",1),6)_U_$PIECE(STRING3,U,3)_U_...
... $JUSTIFY($PIECE(STRING3,U,6),5,1)_U_$JUSTIFY($FNUMBER(PRD15,",+",1),6)
+26 DO S^BGPMUDEL(X,1,1)
+27 SET X="Numerator 2"
+28 DO S^BGPMUDEL(X,2,1)
+29 SET X="# w/tobacco use and cessation counseling"_U_$PIECE(STRING1,U,8)_U_$JUSTIFY($PIECE(STRING1,U,11),5,1)_U_$PIECE(STRING2,U,8)_U_$JUSTIFY($PIECE(STRING2,U,11),5,1)
+30 SET X=X_U_$JUSTIFY($FNUMBER(PRD22,",+",1),6)_U_$PIECE(STRING3,U,8)_U_$JUSTIFY($PIECE(STRING3,U,11),5,1)_U_$JUSTIFY($FNUMBER(PRD23,",+",1),6)
+31 DO S^BGPMUDEL(X,1,1)
+32 SET X="# w/o tobacco use or w/tobacco use and no cessation counseling"_U_$PIECE(STRING1,U,9)_U_$JUSTIFY($PIECE(STRING1,U,12),5,1)_U_$PIECE(STRING2,U,9)
+33 SET X=X_U_$JUSTIFY($PIECE(STRING2,U,12),5,1)_U_$JUSTIFY($FNUMBER(PRD24,",+",1),6)_U_$PIECE(STRING3,U,9)_U_$JUSTIFY($PIECE(STRING3,U,12),5,1)_U_$JUSTIFY($FNUMBER(PRD25,",+",1),6)
+34 DO S^BGPMUDEL(X,1,1)
+35 IF $DATA(BGPLIST(BGPIC))
DO TC27
+36 QUIT
TC27 ;Do the Details
+1 NEW PT,NODE,NAME,BP
+2 SET X="**** CONFIDENTIAL PATIENT INFORMATION COVERED BY PRIVACY ACT ****"
DO S^BGPMUDEL(X,2,1)
+3 SET X="Patients 18 years of age and older with at least 1 encounter with the EP within"
DO S^BGPMUDEL(X,2,1)
+4 SET X="2 years of the reporting period end date, who have been identified as tobacco"
DO S^BGPMUDEL(X,1,1)
+5 SET X="users within 1 year before or during the reporting period and who received"
DO S^BGPMUDEL(X,1,1)
+6 SET X="advice to quit smoking or tobacco use or whose EP recommended or discussed"
DO S^BGPMUDEL(X,1,1)
+7 SET X="smoking or tobacco use cessation medications, methods or strategies within"
DO S^BGPMUDEL(X,1,1)
+8 SET X="1 year of the reporting period end date, if any."
DO S^BGPMUDEL(X,1,1)
+9 SET X="Patients who do not meet the numerator criteria are listed first (NM:), followed"
DO S^BGPMUDEL(X,2,1)
+10 SET X="by patients who do meet the numerator criteria (M:)."
DO S^BGPMUDEL(X,1,1)
+11 SET X="The following are the abbreviations used in the denominator and numerator"
DO S^BGPMUDEL(X,2,1)
+12 SET X="columns:"
DO S^BGPMUDEL(X,1,1)
+13 SET X="EN=Encounter"
DO S^BGPMUDEL(X,1,1)
+14 SET X="HF=Tobacco User Health Factor"
DO S^BGPMUDEL(X,1,1)
+15 ;
+16 SET X="Numerator 1: Tobacco users"
+17 DO S^BGPMUDEL(X,2,1)
+18 SET X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR"
+19 DO S^BGPMUDEL(X,2,1)
+20 SET LINE=""
SET $PIECE(LINE,"-",81)=""
SET X=LINE
+21 DO S^BGPMUDEL(X,1,1)
+22 SET PTCT=0
+23 IF (BGPLIST="A")!(BGPLIST="D")&$DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NOT",1))
Begin DoDot:1
+24 KILL BGPARR
+25 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NOT"",1)")
+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 D027(NODE)
End DoDot:2
End DoDot:1
+30 IF (BGPLIST="A")!(BGPLIST="N")&($DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NUM",1)))
Begin DoDot:1
+31 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NUM"",1)")
+32 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+33 SET PTCT=PTCT+1
+34 SET NODE=$GET(BGPARR(PT))
+35 DO D027(NODE)
End DoDot:2
End DoDot:1
+36 SET X="Total # of patients on list: "_PTCT
DO S^BGPMUDEL(X,2,1)
+37 SET X="Numerator 2: Tobacco users who received tobacco use cessation counseling"
+38 DO S^BGPMUDEL(X,2,1)
+39 SET X="PATIENT NAME"_U_"HRN"_U_"COMMUNITY"_U_"SEX"_U_"AGE"_U_"DENOMINATOR"_U_"NUMERATOR"
+40 DO S^BGPMUDEL(X,2,1)
+41 SET LINE=""
SET $PIECE(LINE,"-",81)=""
SET X=LINE
+42 DO S^BGPMUDEL(X,1,1)
+43 SET PTCT=0
+44 IF (BGPLIST="A")!(BGPLIST="D")&$DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NOT",2))
Begin DoDot:1
+45 KILL BGPARR
+46 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NOT"",2)")
+47 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+48 SET PTCT=PTCT+1
+49 SET NODE=$GET(BGPARR(PT))
+50 DO D027(NODE)
End DoDot:2
End DoDot:1
+51 IF (BGPLIST="A")!(BGPLIST="N")&($DATA(^TMP("BGPMU0027",$JOB,"PAT","C","NUM",2)))
Begin DoDot:1
+52 DO PTLSORT^BGPMUUTL(.BGPARR,"^TMP(""BGPMU0027"","_$JOB_",""PAT"",""C"",""NUM"",2)")
+53 SET PT=0
FOR
SET PT=$ORDER(BGPARR(PT))
IF PT=""
QUIT
Begin DoDot:2
+54 SET PTCT=PTCT+1
+55 SET NODE=$GET(BGPARR(PT))
+56 DO D027(NODE)
End DoDot:2
End DoDot:1
+57 SET X="Total # of patients on list: "_PTCT
DO S^BGPMUDEL(X,2,1)
+58 QUIT
+59 ;
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,23)
+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 SET X=NAME_U_HRN_U_COMM_U_SEX_U_AGE_U_DEN_U_NUM
+11 DO S^BGPMUDEL(X,1,1)
+12 QUIT
+13 ;
SUM027 ;Populate "BGPMU SUMMARY" for Measure 0027
+1 ;Initialize iCare/summary global
+2 NEW BGPDNCNT,BGPSSTR,J,N
+3 SET J=$JOB
+4 SET BGPDNCNT=0
+5 KILL ^TMP("BGPMU SUMMARY",J,BGPIC)
+6 SET ^TMP("BGPMU SUMMARY",J,BGPIC)="0027"_U_"115"
+7 FOR N=1:1:2
Begin DoDot:1
+8 ;Setup summary page/iCare ^TMP global
+9 ;current
SET CDEN(N)=+$GET(^TMP("BGPMU0027",J,"C","DEN",1))
+10 SET CNUM(N)=+$GET(^TMP("BGPMU0027",J,"C","NUM",N))
+11 SET CMP(N)=$SELECT(CDEN(N)>0:$$ROUND^BGPMUA01(CNUM(N)/CDEN(N),3)*100,1:0)
+12 ;previous
SET PDEN(N)=+$GET(^TMP("BGPMU0027",J,"P","DEN",1))
+13 SET PNUM(N)=+$GET(^TMP("BGPMU0027",J,"P","NUM",N))
+14 SET PMP(N)=$SELECT(PDEN(N)>0:$$ROUND^BGPMUA01(PNUM(N)/PDEN(N),3)*100,1:0)
+15 ;baseline
SET BDEN(N)=+$GET(^TMP("BGPMU0027",J,"B","DEN",1))
+16 SET BNUM(N)=+$GET(^TMP("BGPMU0027",J,"B","NUM",N))
+17 SET BMP(N)=$SELECT(BDEN(N)>0:$$ROUND^BGPMUA01(BNUM(N)/BDEN(N),3)*100,1:0)
End DoDot:1
+18 ;
+19 SET BGPDNCNT=BGPDNCNT+1
+20 FOR N=1:1:2
Begin DoDot:1
+21 SET BGPSSTR="MU.EP.0027."_N_U_$SELECT(N=1:"18+ # w/tobacco use",N=2:"18+ # w/tobacco use and counseling",1:"")_U_0_U_CDEN(N)_U_CNUM(N)_U_CMP(N)_U_U_U_U
+22 ; 11 12 13 14
+23 SET BGPSSTR=BGPSSTR_U_0_U_PDEN(N)_U_PNUM(N)_U_PMP(N)
+24 ; 15 16 17 18
+25 SET BGPSSTR=BGPSSTR_U_0_U_BDEN(N)_U_BNUM(N)_U_BMP(N)
+26 SET ^TMP("BGPMU SUMMARY",J,BGPIC,N)=BGPSSTR
End DoDot:1
+27 ;
+28 QUIT