BGP7HEP1 ; IHS/CMI/LAB - print ind 1 ;
;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
;
;
IP ;EP
I $Y>(BGPIOSL-13) D HEADER^BGP7DPH Q:BGPQUIT W !!,^BGPHEIA(BGPIC,53,1,0)
D H1^BGP7DPH
S BGPPC1=$P(^BGPHEIA(BGPIC,0),U,6) Q:BGPQUIT D PI
Q
PI ;EP
S BGPDENP=0
S BGPPC3=0 F S BGPPC3=$O(^BGPHEIIA("ABC",BGPPC1,BGPPC3)) Q:BGPPC3="" S BGPPC=$O(^BGPHEIIA("ABC",BGPPC1,BGPPC3,0)),BGPPC2=$P(^BGPHEIIA(BGPPC,12),U,4) D PI1
;S BGPPC2=0 F S BGPPC2=$O(^BGPHEIIA("AB",BGPPC1,BGPPC2)) Q:BGPPC2="" S BGPPC=$O(^BGPHEIIA("AB",BGPPC1,BGPPC2,0)) D PI1
Q
PI1 ;
;I BGPPC2=7.4 S BGPDENP=0
;I BGPPC2=7.7 S BGPDENP=0
I BGPPC1=8 S BGPDENP=0
I BGPPC1=19 S BGPDENP=0
I BGPPC1=9 S BGPDENP=0
I BGPPC1=5 S BGPDENP=0
;I BGPPC2="10.2" S BGPDENP=0
;I BGPPC2="10.3" S BGPDENP=0
I BGPPC1=12 S BGPDENP=0
I BGPPC1=15 S BGPDENP=0
I BGPPC1=22 S BGPDENP=0
;I BGPPC1=13 S BGPDENP=0
I BGPPC2="13.2.1" S BGPDENP=0
I BGPPC2="13.3.1" S BGPDENP=0
I BGPPC1=11 S BGPDENP=0
S BGPDF=$P(^BGPHEIIA(BGPPC,0),U,8)
;get denominator value of measure
S BGPNP=$P(^DD(90531.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(^BGPHEIIA(BGPPC,0),U,4),1,3)="I.B"!($E($P(^BGPHEIIA(BGPPC,0),U,4),1,3)="I.F") Q
.I $P(^BGPHEIIA(BGPPC,0),U,4)="I.A.1" D HEADER^BGP7DPH Q:BGPQUIT W !!,^BGPHEIA(BGPIC,53,1,0) D H1^BGP7DPH
.I $Y>(BGPIOSL-13) D HEADER^BGP7DPH Q:BGPQUIT W !!,^BGPHEIA(BGPIC,53,1,0) D H1^BGP7DPH
.W !!,$P(^BGPHEIIA(BGPPC,0),U,17)
.I $P(^BGPHEIIA(BGPPC,0),U,18)]"" D
..I $P(^BGPHEIIA(BGPPC,0),U,4)="025.I.1" W !,$P(^BGPHEIIA(BGPPC,0),U,18) Q
..I BGPRTYPE'=4,$P(^BGPHEIIA(BGPPC,0),U,18)["GPRA D" Q
..W !,$P(^BGPHEIIA(BGPPC,0),U,18)
.I $P(^BGPHEIIA(BGPPC,0),U,21)]"" D
..I $P(^BGPHEIIA(BGPPC,0),U,4)="025.I.1" W !,$P(^BGPHEIIA(BGPPC,0),U,21) Q
..I BGPRTYPE'=4,$P(^BGPHEIIA(BGPPC,0),U,21)["GPRA D" Q
..W !,$P(^BGPHEIIA(BGPPC,0),U,21)
.W ?20,$$C(BGPCYD,0,8),?35,$$C(BGPPRD,0,8),?58,$$C(BGPBLD,0,8),!
.S BGPDENP=1
I $P(^BGPHEIIA(BGPPC,0),U,4)["I." D
.S BGPDF=$P(^BGPHEIIA(BGPPC,0),U,8)
.;get denominator value of measure
.S BGPNP=$P(^DD(90531.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(^BGPHEIIA(BGPPC,0),U,9)
S BGPNP=$P(^DD(90531.03,BGPNF,0),U,4),N=$P(BGPNP,";"),P=$P(BGPNP,";",2)
D SETN
;write header for 1.A.1
I $E(BGPPC2,1,3)=1.1 W !
I BGPPC2="1.1.7"!(BGPPC2="17.1.5") D HEADER^BGP7DPH Q:BGPQUIT W !!,^BGPHEIA(BGPIC,53,1,0) D H1^BGP7DPH
I BGPPC2=8.3!(BGPPC2=8.4)!(BGPPC2=8.7)!(BGPPC2="8.10") W !
W !,$P(^BGPHEIIA(BGPPC,0),U,15)
I $P(^BGPHEIIA(BGPPC,0),U,16)]"" W !?1,$P(^BGPHEIIA(BGPPC,0),U,16)
I $P(^BGPHEIIA(BGPPC,0),U,19)]"" W !?1,$P(^BGPHEIIA(BGPPC,0),U,19)
D H2^BGP7DPH
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(^BGPHEDCA(R,N)),U,P)
I T=2 Q $P($G(^BGPHEDPA(R,N)),U,P)
I T=3 Q $P($G(^BGPHEDBA(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+$P($G(^BGPHEDCA(X,N)),U,P)
.I T=2 S C=C+$P($G(^BGPHEDPA(X,N)),U,P)
.I T=3 S C=C+$P($G(^BGPHEDBA(X,N)),U,P)
.Q
Q C
C(X,X2,X3) ;
D COMMA^%DTC
Q X
BGP7HEP1 ; IHS/CMI/LAB - print ind 1 ;
+1 ;;7.0;IHS CLINICAL REPORTING;;JAN 24, 2007
+2 ;
+3 ;
IP ;EP
+1 IF $Y>(BGPIOSL-13)
DO HEADER^BGP7DPH
IF BGPQUIT
QUIT
WRITE !!,^BGPHEIA(BGPIC,53,1,0)
+2 DO H1^BGP7DPH
+3 SET BGPPC1=$PIECE(^BGPHEIA(BGPIC,0),U,6)
IF BGPQUIT
QUIT
DO PI
+4 QUIT
PI ;EP
+1 SET BGPDENP=0
+2 SET BGPPC3=0
FOR
SET BGPPC3=$ORDER(^BGPHEIIA("ABC",BGPPC1,BGPPC3))
IF BGPPC3=""
QUIT
SET BGPPC=$ORDER(^BGPHEIIA("ABC",BGPPC1,BGPPC3,0))
SET BGPPC2=$PIECE(^BGPHEIIA(BGPPC,12),U,4)
DO PI1
+3 ;S BGPPC2=0 F S BGPPC2=$O(^BGPHEIIA("AB",BGPPC1,BGPPC2)) Q:BGPPC2="" S BGPPC=$O(^BGPHEIIA("AB",BGPPC1,BGPPC2,0)) D PI1
+4 QUIT
PI1 ;
+1 ;I BGPPC2=7.4 S BGPDENP=0
+2 ;I BGPPC2=7.7 S BGPDENP=0
+3 IF BGPPC1=8
SET BGPDENP=0
+4 IF BGPPC1=19
SET BGPDENP=0
+5 IF BGPPC1=9
SET BGPDENP=0
+6 IF BGPPC1=5
SET BGPDENP=0
+7 ;I BGPPC2="10.2" S BGPDENP=0
+8 ;I BGPPC2="10.3" S BGPDENP=0
+9 IF BGPPC1=12
SET BGPDENP=0
+10 IF BGPPC1=15
SET BGPDENP=0
+11 IF BGPPC1=22
SET BGPDENP=0
+12 ;I BGPPC1=13 S BGPDENP=0
+13 IF BGPPC2="13.2.1"
SET BGPDENP=0
+14 IF BGPPC2="13.3.1"
SET BGPDENP=0
+15 IF BGPPC1=11
SET BGPDENP=0
+16 SET BGPDF=$PIECE(^BGPHEIIA(BGPPC,0),U,8)
+17 ;get denominator value of measure
+18 SET BGPNP=$PIECE(^DD(90531.03,BGPDF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+19 SET BGPCYD=$$V(1,BGPRPT,N,P)
+20 SET BGPPRD=$$V(2,BGPRPT,N,P)
+21 SET BGPBLD=$$V(3,BGPRPT,N,P)
+22 ;write out denominator
+23 IF 'BGPDENP
Begin DoDot:1
+24 IF $EXTRACT($PIECE(^BGPHEIIA(BGPPC,0),U,4),1,3)="I.B"!($EXTRACT($PIECE(^BGPHEIIA(BGPPC,0),U,4),1,3)="I.F")
QUIT
+25 IF $PIECE(^BGPHEIIA(BGPPC,0),U,4)="I.A.1"
DO HEADER^BGP7DPH
IF BGPQUIT
QUIT
WRITE !!,^BGPHEIA(BGPIC,53,1,0)
DO H1^BGP7DPH
+26 IF $Y>(BGPIOSL-13)
DO HEADER^BGP7DPH
IF BGPQUIT
QUIT
WRITE !!,^BGPHEIA(BGPIC,53,1,0)
DO H1^BGP7DPH
+27 WRITE !!,$PIECE(^BGPHEIIA(BGPPC,0),U,17)
+28 IF $PIECE(^BGPHEIIA(BGPPC,0),U,18)]""
Begin DoDot:2
+29 IF $PIECE(^BGPHEIIA(BGPPC,0),U,4)="025.I.1"
WRITE !,$PIECE(^BGPHEIIA(BGPPC,0),U,18)
QUIT
+30 IF BGPRTYPE'=4
IF $PIECE(^BGPHEIIA(BGPPC,0),U,18)["GPRA D"
QUIT
+31 WRITE !,$PIECE(^BGPHEIIA(BGPPC,0),U,18)
End DoDot:2
+32 IF $PIECE(^BGPHEIIA(BGPPC,0),U,21)]""
Begin DoDot:2
+33 IF $PIECE(^BGPHEIIA(BGPPC,0),U,4)="025.I.1"
WRITE !,$PIECE(^BGPHEIIA(BGPPC,0),U,21)
QUIT
+34 IF BGPRTYPE'=4
IF $PIECE(^BGPHEIIA(BGPPC,0),U,21)["GPRA D"
QUIT
+35 WRITE !,$PIECE(^BGPHEIIA(BGPPC,0),U,21)
End DoDot:2
+36 WRITE ?20,$$C(BGPCYD,0,8),?35,$$C(BGPPRD,0,8),?58,$$C(BGPBLD,0,8),!
+37 SET BGPDENP=1
End DoDot:1
+38 IF $PIECE(^BGPHEIIA(BGPPC,0),U,4)["I."
Begin DoDot:1
+39 SET BGPDF=$PIECE(^BGPHEIIA(BGPPC,0),U,8)
+40 ;get denominator value of measure
+41 SET BGPNP=$PIECE(^DD(90531.03,BGPDF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+42 SET BGPCYD=$$V(1,BGPRPT,N,P)
+43 SET BGPPRD=$$V(2,BGPRPT,N,P)
+44 SET BGPBLD=$$V(3,BGPRPT,N,P)
End DoDot:1
+45 SET BGPNF=$PIECE(^BGPHEIIA(BGPPC,0),U,9)
+46 SET BGPNP=$PIECE(^DD(90531.03,BGPNF,0),U,4)
SET N=$PIECE(BGPNP,";")
SET P=$PIECE(BGPNP,";",2)
+47 DO SETN
+48 ;write header for 1.A.1
+49 IF $EXTRACT(BGPPC2,1,3)=1.1
WRITE !
+50 IF BGPPC2="1.1.7"!(BGPPC2="17.1.5")
DO HEADER^BGP7DPH
IF BGPQUIT
QUIT
WRITE !!,^BGPHEIA(BGPIC,53,1,0)
DO H1^BGP7DPH
+51 IF BGPPC2=8.3!(BGPPC2=8.4)!(BGPPC2=8.7)!(BGPPC2="8.10")
WRITE !
+52 WRITE !,$PIECE(^BGPHEIIA(BGPPC,0),U,15)
+53 IF $PIECE(^BGPHEIIA(BGPPC,0),U,16)]""
WRITE !?1,$PIECE(^BGPHEIIA(BGPPC,0),U,16)
+54 IF $PIECE(^BGPHEIIA(BGPPC,0),U,19)]""
WRITE !?1,$PIECE(^BGPHEIIA(BGPPC,0),U,19)
+55 DO H2^BGP7DPH
+56 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(^BGPHEDCA(R,N)),U,P)
+3 IF T=2
QUIT $PIECE($GET(^BGPHEDPA(R,N)),U,P)
+4 IF T=3
QUIT $PIECE($GET(^BGPHEDBA(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(^BGPHEDCA(X,N)),U,P)
+3 IF T=2
SET C=C+$PIECE($GET(^BGPHEDPA(X,N)),U,P)
+4 IF T=3
SET C=C+$PIECE($GET(^BGPHEDBA(X,N)),U,P)
+5 QUIT
End DoDot:1
+6 QUIT C
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X