BGP5PDL1 ; IHS/CMI/LAB - print ind 1 01 Jul 2010 8:03 PM ;
;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
;
;
I1 ;EP
D:'$G(BGPSUMON) H1
I1A1 ;001.A, 001.B, 001.C
I BGPINDK'="E" F BGPPC1="1.1","1.2","1.3" D PI
I BGPINDK="E" S BGPPC1="1.4" D PI
D I1AGE^BGP5PDL9
Q
IREG ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:$P(^BGPINDK(BGPIC,0),U,13) S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
WASS ;
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:6 S BGPPC1=BGPORDP_"."_BGPORDP1 Q:BGPQUIT D PI
D ^BGP5DP1S
;D:'$G(BGPSUMON) H1
;S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=6,8 S BGPPC1=BGPORDP_"."_BGPORDP1 Q:BGPQUIT D PI
Q
IASCRN ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:4 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D ^BGP5PDLL
Q
IHIV ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:4,8,9,10 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D ^BGP5DP1H
Q
I8 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:1 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I9 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1,3,4 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
S BGPNODEN=1
F BGPPC1=$P(^BGPINDK(BGPIC,12),U,6)_".5" D PI^BGP5PDL2 Q:BGPQUIT
D ^BGP5PD19
Q
I12 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:7 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I13 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:3 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D I1AGE^BGP5PD19
Q
I14 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:3 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I007 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:7 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I008 ;
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:5 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IB ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:6 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IH ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:6 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D I1AGE^BGP5PDLA
Q
I91 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:3 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D I1AGE^BGP5PDLB
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=7 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
PHYACT ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:$P(^BGPINDK(BGPIC,0),U,13) S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D I1AGE^BGP5PDPA
Q
IG ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IEDA ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:3,6:1:8 S BGPPC1=BGPORDP_"."_BGPORDP1 Q:BGPQUIT D PI
D I1AGE^BGP5PDPB
Q
IF ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:3 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IA ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:18 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
ICRSAMM ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,0),U,2) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I031A ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:14 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
ID ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:9 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I0302 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:9 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I0303 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:3 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I0302A ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:4 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IHEDBBH ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:6 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IHEDPBH ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:6 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IHEDCHM ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:6 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IE2 ;
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:1 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IE1 ;
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:1 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IK ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:6 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IOMW ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IRAO ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
II ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IL ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IAS ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:$P(^BGPINDK(BGPIC,0),U,13) S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IAA ;
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:$P(^BGPINDK(BGPIC,0),U,13) S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D ^BGP5DP1L
Q
IMTA ;
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1,2,4 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
D ^BGP5DP1M
D ^BGP5DP1N
Q
IMS ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IC2 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IAST1 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:12 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IRAA ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IRAR ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IHEDCWP ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
IHEDURI ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
I28 ;EP
D:'$G(BGPSUMON) H1
S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=1:1:2 S BGPPC1=BGPORDP_"."_BGPORDP1 D PI
Q
PI ;EP
S BGPDENP=0
S BGPPC2=0 F S BGPPC2=$O(^BGPINDKC("ABC",BGPPC1,BGPPC2)) Q:BGPPC2="" S BGPPC=$O(^BGPINDKC("ABC",BGPPC1,BGPPC2,0)) D PI1
Q
PI1 ;EP
K BGPEXCT,BGPSDP,BGPSDPN,BGPSDPO,BGPYSDPD
Q:'$$CHECK^BGP5DP1E(BGPPC)
I $P(^BGPINDKC(BGPPC,0),U,4)="E-2.B.3" S X=" " D S(X,1,1) D PI1^BGP5PDL2 Q ;count only
S BGPDF=$P(^BGPINDKC(BGPPC,0),U,8)
;get denominator value of measure
S BGPNP=$P(^DD(90554.03,BGPDF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
S BGPCYD=$$V^BGP5DP1C(1,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(1,N,P)
S BGPPRD=$$V^BGP5DP1C(2,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(2,N,P)
S BGPBLD=$$V^BGP5DP1C(3,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(3,N,P)
;write out denominator
;write out denom
I BGPRTYPE=1,$P(^BGPINDKC(BGPPC,0),U,4)="MS.A.9" S BGPDENP=0
I BGPRTYPE=1,$P(^BGPINDKC(BGPPC,0),U,4)="DM.2.1" S BGPDENP=0
I BGPRTYPE=1,$P(^BGPINDKC(BGPPC,0),U,4)="E-2.A.1" S BGPDENP=0
I BGPRTYPE=9,$P(^BGPINDKC(BGPPC,0),U,4)="027.C.36" S BGPDENP=0
I BGPRTYPE=7,$P(^BGPINDKC(BGPPC,0),U,4)="028.C.4" S BGPDENP=0
I 'BGPDENP D
.S Y=" " D:$E($P($G(^BGPINDKC(BGPPC,12)),U,4),1,4)'=48.2!($P($G(^BGPINDKC(BGPPC,12)),U,4)="48.2.1")!($P($G(^BGPINDKC(BGPPC,12)),U,4)="43.22.1") S(Y,1,1) D
.I $P($G(^BGPINDKC(BGPPC,12)),U,14) Q
.I BGPRTYPE=1,$P($G(^BGPINDKC(BGPPC,20)),U,4)]"" S Y=$P(^BGPINDKC(BGPPC,20),U,4)_" "_$P(^BGPINDKC(BGPPC,20),U,5)_" "_$P(^BGPINDKC(BGPPC,20),U,6) D S(Y,1,1) I 1
.E D
..I $G(BGPSEAT) D S($P(^DIBT(BGPSEAT,0),U)_" Population",1,1)
..S Y=$P(^BGPINDKC(BGPPC,0),U,17)_" "_$P(^BGPINDKC(BGPPC,0),U,18)_" "_$P(^BGPINDKC(BGPPC,0),U,21) D S(Y,1,1)
.S Y=BGPCYD_"^^"_BGPPRD_"^^^"_BGPBLD D S(Y,,2)
.S BGPDENP=1
;get numerator value of measure and calc %
I $E($P(^BGPINDKC(BGPPC,0),U,4),1,2)="I." D
.S BGPDF=$P(^BGPINDKC(BGPPC,0),U,8)
.;get denominator value of measure
.S BGPNP=$P(^DD(90554.03,BGPDF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
.S BGPCYD=$$V^BGP5DP1C(1,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(1,N,P)
.S BGPPRD=$$V^BGP5DP1C(2,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(2,N,P)
.S BGPBLD=$$V^BGP5DP1C(3,BGPRPT,N,P,1) I $G(BGPAREAA) D SETEXA^BGP5DP1C(3,N,P)
S BGPNF=$P(^BGPINDKC(BGPPC,0),U,9)
S BGPNP=$P(^DD(90554.03,BGPNF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
D SETN
I BGPRTYPE=1,$P($G(^BGPINDKC(BGPPC,20)),U)]"" S X=$P(^BGPINDKC(BGPPC,20),U,1)_" "_$P(^BGPINDKC(BGPPC,20),U,2)_" "_$P(^BGPINDKC(BGPPC,20),U,3) D S(X,1,1) I 1
E D
.I $P(^BGPINDKC(BGPPC,0),U,22) D S(" ",1,1)
.S X=$P(^BGPINDKC(BGPPC,0),U,15)_" "_$P(^BGPINDKC(BGPPC,0),U,16)_" "_$P(^BGPINDKC(BGPPC,0),U,19) D S(X,1,1)
D H2
Q
SETN ;EP - set numerator fields
S BGPIIDEL=1
D SETN^BGP5DP1C
Q
C(X,X2,X3) ;
D COMMA^%DTC
Q X
S(Y,F,P) ;set up array
I '$G(F) S F=0
S %=$P(^TMP($J,"BGPDEL",0),U)+F,$P(^TMP($J,"BGPDEL",0),U)=%
I '$D(^TMP($J,"BGPDEL",%)) S ^TMP($J,"BGPDEL",%)=""
S $P(^TMP($J,"BGPDEL",%),U,P)=Y
Q
CALC(N,O) ;
NEW Z
S Z=N-O,Z=$FN(Z,"+,",1)
Q Z
H3 ;EP
S X="Age Distribution" D S(X,1,1) S X=" " D S(X,1,1)
S Y="<15" D S(Y,1,2)
S Y="15-19" D S(Y,,3)
S Y="20-24" D S(Y,,4)
S Y="25-34" D S(Y,,5)
S Y="35-44" D S(Y,,6)
S Y="45-54" D S(Y,,7)
S Y="55-64" D S(Y,,8)
S Y=">64 yrs" D S(Y,,9)
Q
SB(X) ;EP - Strip leading and trailing blanks from X.
NEW %
X ^DD("FUNC",$O(^DD("FUNC","B","STRIPBLANKS",0)),1)
Q X
H2 ;EP
S BGPX="",BGPX=BGPCYN,$P(BGPX,U,2)=$$SB($J(BGPCYP,5,1)),$P(BGPX,U,3)=BGPPRN,$P(BGPX,U,4)=$$SB($J(BGPPRP,5,1)),$P(BGPX,U,5)=$$SB($J($$CALC(BGPCYP,BGPPRP),6)),$P(BGPX,U,6)=BGPBLN,$P(BGPX,U,7)=$$SB($J(BGPBLP,5,1))
S $P(BGPX,U,8)=$$SB($J($$CALC(BGPCYP,BGPBLP),6))
D S(BGPX,,2)
Q
H1 ;EP
;I BGPFONE=1 D S(" ",1,1) S Y=$P(^BGPINDK(BGPIC,0),U,3) D S(Y,1,1) S BGPFONE=0
S Y="" D S(Y,1,1)
S Y="REPORT" D S(Y,1,2)
S Y="%" D S(Y,,3)
S Y="PREV YR" D S(Y,,4)
S Y="%" D S(Y,,5)
S Y="CHG from" D S(Y,,6)
S Y="BASE" D S(Y,,7)
S Y="%" D S(Y,,8)
S Y="CHG from" D S(Y,,9)
S Y="PERIOD" D S(Y,1,2)
S Y="PERIOD" D S(Y,,4)
S Y="PREV YR %" D S(Y,,6)
S Y="PERIOD" D S(Y,,7)
S Y="BASE %" D S(Y,,9)
Q
BGP5PDL1 ; IHS/CMI/LAB - print ind 1 01 Jul 2010 8:03 PM ;
+1 ;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
+2 ;
+3 ;
I1 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
I1A1 ;001.A, 001.B, 001.C
+1 IF BGPINDK'="E"
FOR BGPPC1="1.1","1.2","1.3"
DO PI
+2 IF BGPINDK="E"
SET BGPPC1="1.4"
DO PI
+3 DO I1AGE^BGP5PDL9
+4 QUIT
IREG ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:$PIECE(^BGPINDK(BGPIC,0),U,13)
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
WASS ;
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:6
SET BGPPC1=BGPORDP_"."_BGPORDP1
IF BGPQUIT
QUIT
DO PI
+3 DO ^BGP5DP1S
+4 ;D:'$G(BGPSUMON) H1
+5 ;S BGPORDP=$P(^BGPINDK(BGPIC,12),U,6) F BGPORDP1=6,8 S BGPPC1=BGPORDP_"."_BGPORDP1 Q:BGPQUIT D PI
+6 QUIT
IASCRN ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:4
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO ^BGP5PDLL
+4 QUIT
IHIV ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:4,8,9,10
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO ^BGP5DP1H
+4 QUIT
I8 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:1
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I9 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1,3,4
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 SET BGPNODEN=1
+4 FOR BGPPC1=$PIECE(^BGPINDK(BGPIC,12),U,6)_".5"
DO PI^BGP5PDL2
IF BGPQUIT
QUIT
+5 DO ^BGP5PD19
+6 QUIT
I12 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:7
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I13 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:3
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO I1AGE^BGP5PD19
+4 QUIT
I14 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:3
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I007 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:7
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I008 ;
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:5
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IB ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:6
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IH ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:6
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO I1AGE^BGP5PDLA
+4 QUIT
I91 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:3
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO I1AGE^BGP5PDLB
+4 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=7
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+5 QUIT
PHYACT ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:$PIECE(^BGPINDK(BGPIC,0),U,13)
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO I1AGE^BGP5PDPA
+4 QUIT
IG ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IEDA ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:3,6:1:8
SET BGPPC1=BGPORDP_"."_BGPORDP1
IF BGPQUIT
QUIT
DO PI
+3 DO I1AGE^BGP5PDPB
+4 QUIT
IF ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:3
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IA ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:18
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
ICRSAMM ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,0),U,2)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I031A ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:14
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
ID ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:9
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I0302 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:9
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I0303 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:3
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I0302A ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:4
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IHEDBBH ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:6
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IHEDPBH ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:6
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IHEDCHM ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:6
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IE2 ;
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:1
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IE1 ;
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:1
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IK ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:6
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IOMW ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IRAO ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
II ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IL ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IAS ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:$PIECE(^BGPINDK(BGPIC,0),U,13)
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IAA ;
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:$PIECE(^BGPINDK(BGPIC,0),U,13)
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO ^BGP5DP1L
+4 QUIT
IMTA ;
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1,2,4
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 DO ^BGP5DP1M
+4 DO ^BGP5DP1N
+5 QUIT
IMS ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IC2 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IAST1 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:12
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IRAA ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IRAR ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IHEDCWP ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
IHEDURI ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
I28 ;EP
+1 IF '$GET(BGPSUMON)
DO H1
+2 SET BGPORDP=$PIECE(^BGPINDK(BGPIC,12),U,6)
FOR BGPORDP1=1:1:2
SET BGPPC1=BGPORDP_"."_BGPORDP1
DO PI
+3 QUIT
PI ;EP
+1 SET BGPDENP=0
+2 SET BGPPC2=0
FOR
SET BGPPC2=$ORDER(^BGPINDKC("ABC",BGPPC1,BGPPC2))
IF BGPPC2=""
QUIT
SET BGPPC=$ORDER(^BGPINDKC("ABC",BGPPC1,BGPPC2,0))
DO PI1
+3 QUIT
PI1 ;EP
+1 KILL BGPEXCT,BGPSDP,BGPSDPN,BGPSDPO,BGPYSDPD
+2 IF '$$CHECK^BGP5DP1E(BGPPC)
QUIT
+3 ;count only
IF $PIECE(^BGPINDKC(BGPPC,0),U,4)="E-2.B.3"
SET X=" "
DO S(X,1,1)
DO PI1^BGP5PDL2
QUIT
+4 SET BGPDF=$PIECE(^BGPINDKC(BGPPC,0),U,8)
+5 ;get denominator value of measure
+6 SET BGPNP=$PIECE(^DD(90554.03,BGPDF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+7 SET BGPCYD=$$V^BGP5DP1C(1,BGPRPT,N,P,1)
IF $GET(BGPAREAA)
DO SETEXA^BGP5DP1C(1,N,P)
+8 SET BGPPRD=$$V^BGP5DP1C(2,BGPRPT,N,P,1)
IF $GET(BGPAREAA)
DO SETEXA^BGP5DP1C(2,N,P)
+9 SET BGPBLD=$$V^BGP5DP1C(3,BGPRPT,N,P,1)
IF $GET(BGPAREAA)
DO SETEXA^BGP5DP1C(3,N,P)
+10 ;write out denominator
+11 ;write out denom
+12 IF BGPRTYPE=1
IF $PIECE(^BGPINDKC(BGPPC,0),U,4)="MS.A.9"
SET BGPDENP=0
+13 IF BGPRTYPE=1
IF $PIECE(^BGPINDKC(BGPPC,0),U,4)="DM.2.1"
SET BGPDENP=0
+14 IF BGPRTYPE=1
IF $PIECE(^BGPINDKC(BGPPC,0),U,4)="E-2.A.1"
SET BGPDENP=0
+15 IF BGPRTYPE=9
IF $PIECE(^BGPINDKC(BGPPC,0),U,4)="027.C.36"
SET BGPDENP=0
+16 IF BGPRTYPE=7
IF $PIECE(^BGPINDKC(BGPPC,0),U,4)="028.C.4"
SET BGPDENP=0
+17 IF 'BGPDENP
Begin DoDot:1
+18 SET Y=" "
IF $EXTRACT($PIECE($GET(^BGPINDKC(BGPPC,12)),U,4),1,4)'=48.2!($PIECE($GET(^BGPINDKC(BGPPC,12)),U,4)="48.2.1")!($PIECE($GET(^BGPINDKC(BGPPC,12)),U,4)="43.22.1")
DO S(Y,1,1)
Begin DoDot:2
End DoDot:2
+19 IF $PIECE($GET(^BGPINDKC(BGPPC,12)),U,14)
QUIT
+20 IF BGPRTYPE=1
IF $PIECE($GET(^BGPINDKC(BGPPC,20)),U,4)]""
SET Y=$PIECE(^BGPINDKC(BGPPC,20),U,4)_" "_$PIECE(^BGPINDKC(BGPPC,20),U,5)_" "_$PIECE(^BGPINDKC(BGPPC,20),U,6)
DO S(Y,1,1)
IF 1
+21 IF '$TEST
Begin DoDot:2
+22 IF $GET(BGPSEAT)
DO S($PIECE(^DIBT(BGPSEAT,0),U)_" Population",1,1)
+23 SET Y=$PIECE(^BGPINDKC(BGPPC,0),U,17)_" "_$PIECE(^BGPINDKC(BGPPC,0),U,18)_" "_$PIECE(^BGPINDKC(BGPPC,0),U,21)
DO S(Y,1,1)
End DoDot:2
+24 SET Y=BGPCYD_"^^"_BGPPRD_"^^^"_BGPBLD
DO S(Y,,2)
+25 SET BGPDENP=1
End DoDot:1
+26 ;get numerator value of measure and calc %
+27 IF $EXTRACT($PIECE(^BGPINDKC(BGPPC,0),U,4),1,2)="I."
Begin DoDot:1
+28 SET BGPDF=$PIECE(^BGPINDKC(BGPPC,0),U,8)
+29 ;get denominator value of measure
+30 SET BGPNP=$PIECE(^DD(90554.03,BGPDF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+31 SET BGPCYD=$$V^BGP5DP1C(1,BGPRPT,N,P,1)
IF $GET(BGPAREAA)
DO SETEXA^BGP5DP1C(1,N,P)
+32 SET BGPPRD=$$V^BGP5DP1C(2,BGPRPT,N,P,1)
IF $GET(BGPAREAA)
DO SETEXA^BGP5DP1C(2,N,P)
+33 SET BGPBLD=$$V^BGP5DP1C(3,BGPRPT,N,P,1)
IF $GET(BGPAREAA)
DO SETEXA^BGP5DP1C(3,N,P)
End DoDot:1
+34 SET BGPNF=$PIECE(^BGPINDKC(BGPPC,0),U,9)
+35 SET BGPNP=$PIECE(^DD(90554.03,BGPNF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+36 DO SETN
+37 IF BGPRTYPE=1
IF $PIECE($GET(^BGPINDKC(BGPPC,20)),U)]""
SET X=$PIECE(^BGPINDKC(BGPPC,20),U,1)_" "_$PIECE(^BGPINDKC(BGPPC,20),U,2)_" "_$PIECE(^BGPINDKC(BGPPC,20),U,3)
DO S(X,1,1)
IF 1
+38 IF '$TEST
Begin DoDot:1
+39 IF $PIECE(^BGPINDKC(BGPPC,0),U,22)
DO S(" ",1,1)
+40 SET X=$PIECE(^BGPINDKC(BGPPC,0),U,15)_" "_$PIECE(^BGPINDKC(BGPPC,0),U,16)_" "_$PIECE(^BGPINDKC(BGPPC,0),U,19)
DO S(X,1,1)
End DoDot:1
+41 DO H2
+42 QUIT
SETN ;EP - set numerator fields
+1 SET BGPIIDEL=1
+2 DO SETN^BGP5DP1C
+3 QUIT
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X
S(Y,F,P) ;set up array
+1 IF '$GET(F)
SET F=0
+2 SET %=$PIECE(^TMP($JOB,"BGPDEL",0),U)+F
SET $PIECE(^TMP($JOB,"BGPDEL",0),U)=%
+3 IF '$DATA(^TMP($JOB,"BGPDEL",%))
SET ^TMP($JOB,"BGPDEL",%)=""
+4 SET $PIECE(^TMP($JOB,"BGPDEL",%),U,P)=Y
+5 QUIT
CALC(N,O) ;
+1 NEW Z
+2 SET Z=N-O
SET Z=$FNUMBER(Z,"+,",1)
+3 QUIT Z
H3 ;EP
+1 SET X="Age Distribution"
DO S(X,1,1)
SET X=" "
DO S(X,1,1)
+2 SET Y="<15"
DO S(Y,1,2)
+3 SET Y="15-19"
DO S(Y,,3)
+4 SET Y="20-24"
DO S(Y,,4)
+5 SET Y="25-34"
DO S(Y,,5)
+6 SET Y="35-44"
DO S(Y,,6)
+7 SET Y="45-54"
DO S(Y,,7)
+8 SET Y="55-64"
DO S(Y,,8)
+9 SET Y=">64 yrs"
DO S(Y,,9)
+10 QUIT
SB(X) ;EP - Strip leading and trailing blanks from X.
+1 NEW %
+2 XECUTE ^DD("FUNC",$ORDER(^DD("FUNC","B","STRIPBLANKS",0)),1)
+3 QUIT X
H2 ;EP
+1 SET BGPX=""
SET BGPX=BGPCYN
SET $PIECE(BGPX,U,2)=$$SB($JUSTIFY(BGPCYP,5,1))
SET $PIECE(BGPX,U,3)=BGPPRN
SET $PIECE(BGPX,U,4)=$$SB($JUSTIFY(BGPPRP,5,1))
SET $PIECE(BGPX,U,5)=$$SB($JUSTIFY($$CALC(BGPCYP,BGPPRP),6))
SET $PIECE(BGPX,U,6)=BGPBLN
SET $PIECE(BGPX,U,7)=$$SB($JUSTIFY(BGPBLP,5,1))
+2 SET $PIECE(BGPX,U,8)=$$SB($JUSTIFY($$CALC(BGPCYP,BGPBLP),6))
+3 DO S(BGPX,,2)
+4 QUIT
H1 ;EP
+1 ;I BGPFONE=1 D S(" ",1,1) S Y=$P(^BGPINDK(BGPIC,0),U,3) D S(Y,1,1) S BGPFONE=0
+2 SET Y=""
DO S(Y,1,1)
+3 SET Y="REPORT"
DO S(Y,1,2)
+4 SET Y="%"
DO S(Y,,3)
+5 SET Y="PREV YR"
DO S(Y,,4)
+6 SET Y="%"
DO S(Y,,5)
+7 SET Y="CHG from"
DO S(Y,,6)
+8 SET Y="BASE"
DO S(Y,,7)
+9 SET Y="%"
DO S(Y,,8)
+10 SET Y="CHG from"
DO S(Y,,9)
+11 SET Y="PERIOD"
DO S(Y,1,2)
+12 SET Y="PERIOD"
DO S(Y,,4)
+13 SET Y="PREV YR %"
DO S(Y,,6)
+14 SET Y="PERIOD"
DO S(Y,,7)
+15 SET Y="BASE %"
DO S(Y,,9)
+16 QUIT