BGP4HEP1 ; IHS/CMI/LAB - print ind 1 ;
;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
;
;
I1 ;EP ;
D H1^BGP4DPH ;column headers
F BGPPC1="1" Q:BGPQUIT D PI
Q
I2 ;EP
I $Y>(IOSL-13) D HEADER^BGP4DPH Q:BGPQUIT W !!,^BGPHEIF(BGPIC,53,1,0)
D H1^BGP4DPH
F BGPPC1="2" Q:BGPQUIT D PI
Q
I3 ;EP
I $Y>(IOSL-13) D HEADER^BGP4DPH Q:BGPQUIT W !!,^BGPHEIF(BGPIC,53,1,0)
D H1^BGP4DPH
F BGPPC1="3" Q:BGPQUIT D PI
Q
I4 ;EP
I $Y>(IOSL-13) D HEADER^BGP4DPH Q:BGPQUIT W !!,^BGPHEIF(BGPIC,53,1,0)
D H1^BGP4DPH
F BGPPC1="4" Q:BGPQUIT D PI
Q
I5 ;EP
I $Y>(IOSL-13) D HEADER^BGP4DPH Q:BGPQUIT W !!,^BGPHEIF(BGPIC,53,1,0)
D H1^BGP4DPH
F BGPPC1="5" Q:BGPQUIT D PI
Q
I6 ;EP
I $Y>(IOSL-13) D HEADER^BGP4DPH Q:BGPQUIT W !!,^BGPHEIF(BGPIC,53,1,0)
D H1^BGP4DPH
F BGPPC1="6" Q:BGPQUIT D PI
Q
I7 ;EP
D H1^BGP4DPH
F BGPPC1="7" Q:BGPQUIT D PI
Q
I8 ;
D H1^BGP4DPH
F BGPPC1="8" Q:BGPQUIT D PI
Q
I9 ;EP
D H1^BGP4DPH
F BGPPC1="9" Q:BGPQUIT D PI
Q
I10 ;EP
D H1^BGP4DPH
F BGPPC1="10" Q:BGPQUIT D PI
Q
I11 ;EP
D H1^BGP4DPH
F BGPPC1="11" Q:BGPQUIT D PI
Q
I12 ;EP
D H1^BGP4DPH
F BGPPC1="12" Q:BGPQUIT W ! D PI
Q
I13 ;EP
D H1^BGP4DPH
F BGPPC1="13" Q:BGPQUIT D PI
Q
PI ;EP
S BGPDENP=0
S BGPPC2=0 F S BGPPC2=$O(^BGPHEIIF("AB",BGPPC1,BGPPC2)) Q:BGPPC2="" S BGPPC=$O(^BGPHEIIF("AB",BGPPC1,BGPPC2,0)) D PI1
Q
PI1 ;
S BGPDF=$P(^BGPHEIIF(BGPPC,0),U,8)
;get denominator value of indicator
S BGPNP=$P(^DD(90370.03,BGPDF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
S BGPCYD=$$V(1,BGPRPT,N,P)
S BGPPRD=$$V(2,BGPRPT,N,P)
S BGPBLD=$$V(3,BGPRPT,N,P)
;write out denominator
I 'BGPDENP D
.I $E($P(^BGPHEIIF(BGPPC,0),U,4),1,3)="I.B"!($E($P(^BGPHEIIF(BGPPC,0),U,4),1,3)="I.F") Q
.I $P(^BGPHEIIF(BGPPC,0),U,4)="I.A.1" D HEADER^BGP4DPH Q:BGPQUIT W !!,^BGPHEIF(BGPIC,53,1,0) D H1^BGP4DPH
.I $Y>(IOSL-13) D HEADER^BGP4DPH Q:BGPQUIT W !!,^BGPHEIF(BGPIC,53,1,0) D H1^BGP4DPH
.W !!,$P(^BGPHEIIF(BGPPC,0),U,17)
.I $P(^BGPHEIIF(BGPPC,0),U,18)]"" D
..I $P(^BGPHEIIF(BGPPC,0),U,4)="025.I.1" W !,$P(^BGPHEIIF(BGPPC,0),U,18) Q
..I BGPRTYPE'=4,$P(^BGPHEIIF(BGPPC,0),U,18)["GPRA D" Q
..W !,$P(^BGPHEIIF(BGPPC,0),U,18)
.I $P(^BGPHEIIF(BGPPC,0),U,21)]"" D
..I $P(^BGPHEIIF(BGPPC,0),U,4)="025.I.1" W !,$P(^BGPHEIIF(BGPPC,0),U,21) Q
..I BGPRTYPE'=4,$P(^BGPHEIIF(BGPPC,0),U,21)["GPRA D" Q
..W !,$P(^BGPHEIIF(BGPPC,0),U,21)
.W ?20,$$C(BGPCYD,0,8),?35,$$C(BGPPRD,0,8),?58,$$C(BGPBLD,0,8),!
.I BGPPC2'=12.1 S BGPDENP=1
I $P(^BGPHEIIF(BGPPC,0),U,4)["031"!($P(^BGPHEIIF(BGPPC,0),U,4)["I.") D
.S BGPDF=$P(^BGPHEIIF(BGPPC,0),U,8)
.;get denominator value of indicator
.S BGPNP=$P(^DD(90370.03,BGPDF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
.S BGPCYD=$$V(1,BGPRPT,N,P)
.S BGPPRD=$$V(2,BGPRPT,N,P)
.S BGPBLD=$$V(3,BGPRPT,N,P)
S BGPNF=$P(^BGPHEIIF(BGPPC,0),U,9)
S BGPNP=$P(^DD(90370.03,BGPNF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
D SETN
;write header for 1.A.1
I BGPPC2=7.3!(BGPPC2=7.4)!(BGPPC2=7.7)!(BGPPC2=7.8) W !
W !,$P(^BGPHEIIF(BGPPC,0),U,15)
I $P(^BGPHEIIF(BGPPC,0),U,16)]"" W !?1,$P(^BGPHEIIF(BGPPC,0),U,16)
I $P(^BGPHEIIF(BGPPC,0),U,19)]"" W !?1,$P(^BGPHEIIF(BGPPC,0),U,19)
D H2^BGP4DPH
Q
SETN ;set numerator fields
S BGPCYN=$$V(1,BGPRPT,N,P)
S BGPPRN=$$V(2,BGPRPT,N,P)
S BGPBLN=$$V(3,BGPRPT,N,P)
S BGPCYP=$S(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
S BGPPRP=$S(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
S BGPBLP=$S(BGPBLD:((BGPBLN/BGPBLD)*100),1:"")
Q
SL(V) ;
I V="" S V=0
Q $$STRIP^XLFSTR($J(V,5,1)," ")
V(T,R,N,P) ;EP
I $G(BGPAREAA) G VA
I T=1 Q $P($G(^BGPHEDCF(R,N)),U,P)
I T=2 Q $P($G(^BGPHEDPF(R,N)),U,P)
I T=3 Q $P($G(^BGPHEDBF(R,N)),U,P)
Q ""
VA ;
NEW X,V,C S X=0,C="" F S X=$O(BGPSUL(X)) Q:X'=+X D
.I T=1 S C=C+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 DO H1^BGP4DPH
+2 FOR BGPPC1="7"
IF BGPQUIT
QUIT
DO PI
+3 QUIT
I8 ;
+1 DO H1^BGP4DPH
+2 FOR BGPPC1="8"
IF BGPQUIT
QUIT
DO PI
+3 QUIT
I9 ;EP
+1 DO H1^BGP4DPH
+2 FOR BGPPC1="9"
IF BGPQUIT
QUIT
DO PI
+3 QUIT
I10 ;EP
+1 DO H1^BGP4DPH
+2 FOR BGPPC1="10"
IF BGPQUIT
QUIT
DO PI
+3 QUIT
I11 ;EP
+1 DO H1^BGP4DPH
+2 FOR BGPPC1="11"
IF BGPQUIT
QUIT
DO PI
+3 QUIT
I12 ;EP
+1 DO H1^BGP4DPH
+2 FOR BGPPC1="12"
IF BGPQUIT
QUIT
WRITE !
DO PI
+3 QUIT
I13 ;EP
+1 DO H1^BGP4DPH
+2 FOR BGPPC1="13"
IF BGPQUIT
QUIT
DO PI
+3 QUIT
PI ;EP
+1 SET BGPDENP=0
+2 SET BGPPC2=0
FOR
SET BGPPC2=$ORDER(^BGPHEIIF("AB",BGPPC1,BGPPC2))
IF BGPPC2=""
QUIT
SET BGPPC=$ORDER(^BGPHEIIF("AB",BGPPC1,BGPPC2,0))
DO PI1
+3 QUIT
PI1 ;
+1 SET BGPDF=$PIECE(^BGPHEIIF(BGPPC,0),U,8)
+2 ;get denominator value of indicator
+3 SET BGPNP=$PIECE(^DD(90370.03,BGPDF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+4 SET BGPCYD=$$V(1,BGPRPT,N,P)
+5 SET BGPPRD=$$V(2,BGPRPT,N,P)
+6 SET BGPBLD=$$V(3,BGPRPT,N,P)
+7 ;write out denominator
+8 IF 'BGPDENP
Begin DoDot:1
+9 IF $EXTRACT($PIECE(^BGPHEIIF(BGPPC,0),U,4),1,3)="I.B"!($EXTRACT($PIECE(^BGPHEIIF(BGPPC,0),U,4),1,3)="I.F")
QUIT
+10 IF $PIECE(^BGPHEIIF(BGPPC,0),U,4)="I.A.1"
DO HEADER^BGP4DPH
IF BGPQUIT
QUIT
WRITE !!,^BGPHEIF(BGPIC,53,1,0)
DO H1^BGP4DPH
+11 IF $Y>(IOSL-13)
DO HEADER^BGP4DPH
IF BGPQUIT
QUIT
WRITE !!,^BGPHEIF(BGPIC,53,1,0)
DO H1^BGP4DPH
+12 WRITE !!,$PIECE(^BGPHEIIF(BGPPC,0),U,17)
+13 IF $PIECE(^BGPHEIIF(BGPPC,0),U,18)]""
Begin DoDot:2
+14 IF $PIECE(^BGPHEIIF(BGPPC,0),U,4)="025.I.1"
WRITE !,$PIECE(^BGPHEIIF(BGPPC,0),U,18)
QUIT
+15 IF BGPRTYPE'=4
IF $PIECE(^BGPHEIIF(BGPPC,0),U,18)["GPRA D"
QUIT
+16 WRITE !,$PIECE(^BGPHEIIF(BGPPC,0),U,18)
End DoDot:2
+17 IF $PIECE(^BGPHEIIF(BGPPC,0),U,21)]""
Begin DoDot:2
+18 IF $PIECE(^BGPHEIIF(BGPPC,0),U,4)="025.I.1"
WRITE !,$PIECE(^BGPHEIIF(BGPPC,0),U,21)
QUIT
+19 IF BGPRTYPE'=4
IF $PIECE(^BGPHEIIF(BGPPC,0),U,21)["GPRA D"
QUIT
+20 WRITE !,$PIECE(^BGPHEIIF(BGPPC,0),U,21)
End DoDot:2
+21 WRITE ?20,$$C(BGPCYD,0,8),?35,$$C(BGPPRD,0,8),?58,$$C(BGPBLD,0,8),!
+22 IF BGPPC2'=12.1
SET BGPDENP=1
End DoDot:1
+23 IF $PIECE(^BGPHEIIF(BGPPC,0),U,4)["031"!($PIECE(^BGPHEIIF(BGPPC,0),U,4)["I.")
Begin DoDot:1
+24 SET BGPDF=$PIECE(^BGPHEIIF(BGPPC,0),U,8)
+25 ;get denominator value of indicator
+26 SET BGPNP=$PIECE(^DD(90370.03,BGPDF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+27 SET BGPCYD=$$V(1,BGPRPT,N,P)
+28 SET BGPPRD=$$V(2,BGPRPT,N,P)
+29 SET BGPBLD=$$V(3,BGPRPT,N,P)
End DoDot:1
+30 SET BGPNF=$PIECE(^BGPHEIIF(BGPPC,0),U,9)
+31 SET BGPNP=$PIECE(^DD(90370.03,BGPNF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+32 DO SETN
+33 ;write header for 1.A.1
+34 IF BGPPC2=7.3!(BGPPC2=7.4)!(BGPPC2=7.7)!(BGPPC2=7.8)
WRITE !
+35 WRITE !,$PIECE(^BGPHEIIF(BGPPC,0),U,15)
+36 IF $PIECE(^BGPHEIIF(BGPPC,0),U,16)]""
WRITE !?1,$PIECE(^BGPHEIIF(BGPPC,0),U,16)
+37 IF $PIECE(^BGPHEIIF(BGPPC,0),U,19)]""
WRITE !?1,$PIECE(^BGPHEIIF(BGPPC,0),U,19)
+38 DO H2^BGP4DPH
+39 QUIT
SETN ;set numerator fields
+1 SET BGPCYN=$$V(1,BGPRPT,N,P)
+2 SET BGPPRN=$$V(2,BGPRPT,N,P)
+3 SET BGPBLN=$$V(3,BGPRPT,N,P)
+4 SET BGPCYP=$SELECT(BGPCYD:((BGPCYN/BGPCYD)*100),1:"")
+5 SET BGPPRP=$SELECT(BGPPRD:((BGPPRN/BGPPRD)*100),1:"")
+6 SET BGPBLP=$SELECT(BGPBLD:((BGPBLN/BGPBLD)*100),1:"")
+7 QUIT
SL(V) ;
+1 IF V=""
SET V=0
+2 QUIT $$STRIP^XLFSTR($JUSTIFY(V,5,1)," ")
V(T,R,N,P) ;EP
+1 IF $GET(BGPAREAA)
GOTO VA
+2 IF T=1
QUIT $PIECE($GET(^BGPHEDCF(R,N)),U,P)
+3 IF T=2
QUIT $PIECE($GET(^BGPHEDPF(R,N)),U,P)
+4 IF T=3
QUIT $PIECE($GET(^BGPHEDBF(R,N)),U,P)
+5 QUIT ""
VA ;
+1 NEW X,V,C
SET X=0
SET C=""
FOR
SET X=$ORDER(BGPSUL(X))
IF X'=+X
QUIT
Begin DoDot:1
+2 IF T=1
SET C=C+$PIECE($GET(^BGPHEDCF(X,N)),U,P)
+3 IF T=2
SET C=C+$PIECE($GET(^BGPHEDPF(X,N)),U,P)
+4 IF T=3
SET C=C+$PIECE($GET(^BGPHEDBF(X,N)),U,P)
+5 QUIT
End DoDot:1
+6 QUIT C
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X