BGP4DP1F ; IHS/CMI/LAB - print ind 1 21 Mar 2010 12:55 PM 01 Jul 2010 11:40 AM ;
;;14.1;IHS CLINICAL REPORTING;;MAY 29, 2014;Build 114
ONN4 ;EP
I $G(BGPAREAA),$G(BGPEXCEL) D
.Q:$P($G(^BGPINDJC(BGPPC,21)),U,9)=""
.;set each numerator and percent,then set BGPONN4
.NEW X S X=0 F S X=$O(BGPSUL(X)) Q:X'=+X D
..S $P(BGPEXCT(X,1),U,1)=$P($G(^BGPGPDCJ(X,N)),U,P),$P(BGPEXCT(X,1),U,3)=$S($P(BGPEXCT(X,1),U,2):(($P(BGPEXCT(X,1),U,1)/$P(BGPEXCT(X,1),U,2))*100),1:"")
..S $P(BGPEXCT(X,2),U,1)=$P($G(^BGPGPDPJ(X,N)),U,P),$P(BGPEXCT(X,2),U,3)=$S($P(BGPEXCT(X,2),U,2):(($P(BGPEXCT(X,2),U,1)/$P(BGPEXCT(X,2),U,2))*100),1:"")
..S $P(BGPEXCT(X,3),U,1)=$P($G(^BGPGPDBJ(X,N)),U,P),$P(BGPEXCT(X,3),U,3)=$S($P(BGPEXCT(X,3),U,2):(($P(BGPEXCT(X,3),U,1)/$P(BGPEXCT(X,3),U,2))*100),1:"")
.S X=0 F S X=$O(BGPEXCT(X)) Q:X'=+X D
..S A=$P(BGPEXCT(X,1),U,1),B=$P(BGPEXCT(X,1),U,2),C=$P(BGPEXCT(X,1),U,3)
..S D=$P(BGPEXCT(X,2),U,1),E=$P(BGPEXCT(X,2),U,2),F=$P(BGPEXCT(X,2),U,3)
..S G=$P(BGPEXCT(X,3),U,1),H=$P(BGPEXCT(X,3),U,2),I=$P(BGPEXCT(X,3),U,3)
..I $P($P(^BGPINDJC(BGPPC,0),U,4),".")="023" S Y=$P(^BGPINDJC(BGPPC,21),U,9),$P(BGPONN4(X),U,Y)=$S(B:B,1:0),$P(BGPONN4(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN4(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P($P(^BGPINDJC(BGPPC,0),U,4),".",1,2)="014.A" S Y=$P(^BGPINDJC(BGPPC,21),U,9),$P(BGPONN4(X),U,Y)=$S(B:B,1:0),$P(BGPONN4(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN4(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P(^BGPINDJC(BGPPC,0),U,4)="016.A.1" S Y=$P(^BGPINDJC(BGPPC,21),U,9),$P(BGPONN4(X),U,Y)=$S(B:B,1:0),$P(BGPONN4(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN4(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P($G(^BGPINDJC(BGPPC,19)),U,13) S Y=$P(^BGPINDJC(BGPPC,21),U,1),$P(BGPONN4(X),U,Y)=$S(B:B,1:0),$P(BGPONN4(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN4(X),U,(Y+6))=$S(H:H,1:0) Q
..S Y=$P(^BGPINDJC(BGPPC,21),U,9)
..S $P(BGPONN4(X),U,$P(^BGPINDJC(BGPPC,21),U,9))=$S(A:A,1:0),$P(BGPONN4(X),U,(Y+1))=$S(B:B,1:0),$P(BGPONN4(X),U,(Y+2))=$$SL(C)
..S $P(BGPONN4(X),U,(Y+3))=$S(D:D,1:0),$P(BGPONN4(X),U,(Y+4))=$S(E:E,1:0),$P(BGPONN4(X),U,(Y+5))=$$SL(F),$P(BGPONN4(X),U,(Y+6))=$S(G:G,1:0),$P(BGPONN4(X),U,(Y+7))=$S(H:H,1:0),$P(BGPONN4(X),U,(Y+8))=$$SL(I)
;Q ;NO ONM5 FOR V11.0
ONN5 ;
I $G(BGPAREAA),$G(BGPEXCEL) D
.Q:$P($G(^BGPINDJC(BGPPC,21)),U,10)=""
.;set each numerator and percent,then set BGPONN5
.NEW X S X=0 F S X=$O(BGPSUL(X)) Q:X'=+X D
..S $P(BGPEXCT(X,1),U,1)=$P($G(^BGPGPDCJ(X,N)),U,P),$P(BGPEXCT(X,1),U,3)=$S($P(BGPEXCT(X,1),U,2):(($P(BGPEXCT(X,1),U,1)/$P(BGPEXCT(X,1),U,2))*100),1:"")
..S $P(BGPEXCT(X,2),U,1)=$P($G(^BGPGPDPJ(X,N)),U,P),$P(BGPEXCT(X,2),U,3)=$S($P(BGPEXCT(X,2),U,2):(($P(BGPEXCT(X,2),U,1)/$P(BGPEXCT(X,2),U,2))*100),1:"")
..S $P(BGPEXCT(X,3),U,1)=$P($G(^BGPGPDBJ(X,N)),U,P),$P(BGPEXCT(X,3),U,3)=$S($P(BGPEXCT(X,3),U,2):(($P(BGPEXCT(X,3),U,1)/$P(BGPEXCT(X,3),U,2))*100),1:"")
.S X=0 F S X=$O(BGPEXCT(X)) Q:X'=+X D
..S A=$P(BGPEXCT(X,1),U,1),B=$P(BGPEXCT(X,1),U,2),C=$P(BGPEXCT(X,1),U,3)
..S D=$P(BGPEXCT(X,2),U,1),E=$P(BGPEXCT(X,2),U,2),F=$P(BGPEXCT(X,2),U,3)
..S G=$P(BGPEXCT(X,3),U,1),H=$P(BGPEXCT(X,3),U,2),I=$P(BGPEXCT(X,3),U,3)
..I $P($P(^BGPINDJC(BGPPC,0),U,4),".")="023" S Y=$P(^BGPINDJC(BGPPC,21),U,10),$P(BGPONN5(X),U,Y)=$S(B:B,1:0),$P(BGPONN5(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN5(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P($P(^BGPINDJC(BGPPC,0),U,4),".",1,2)="014.A" S Y=$P(^BGPINDJC(BGPPC,21),U,10),$P(BGPONN5(X),U,Y)=$S(B:B,1:0),$P(BGPONN5(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN5(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P(^BGPINDJC(BGPPC,0),U,4)="016.A.1" S Y=$P(^BGPINDJC(BGPPC,21),U,10),$P(BGPONN5(X),U,Y)=$S(B:B,1:0),$P(BGPONN5(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN5(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P(^BGPINDJC(BGPPC,0),U,4)="STI.AA.1A" S Y=$P(^BGPINDJC(BGPPC,21),U,10),$P(BGPONN5(X),U,Y)=$S(B:B,1:0),$P(BGPONN5(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN5(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P(^BGPINDJC(BGPPC,0),U,4)="STI.AB.4A" S Y=$P(^BGPINDJC(BGPPC,21),U,10),$P(BGPONN5(X),U,Y)=$S(B:B,1:0),$P(BGPONN5(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN5(X),U,(Y+6))=$S(H:H,1:0) Q
..I $P($G(^BGPINDJC(BGPPC,19)),U,13) S Y=$P(^BGPINDJC(BGPPC,21),U,1),$P(BGPONN5(X),U,Y)=$S(B:B,1:0),$P(BGPONN5(X),U,(Y+3))=$S(E:E,1:0),$P(BGPONN5(X),U,(Y+6))=$S(H:H,1:0) Q
..S Y=$P(^BGPINDJC(BGPPC,21),U,10)
..S $P(BGPONN5(X),U,$P(^BGPINDJC(BGPPC,21),U,10))=$S(A:A,1:0),$P(BGPONN5(X),U,(Y+1))=$S(B:B,1:0),$P(BGPONN5(X),U,(Y+2))=$$SL(C)
..S $P(BGPONN5(X),U,(Y+3))=$S(D:D,1:0),$P(BGPONN5(X),U,(Y+4))=$S(E:E,1:0),$P(BGPONN5(X),U,(Y+5))=$$SL(F),$P(BGPONN5(X),U,(Y+6))=$S(G:G,1:0),$P(BGPONN5(X),U,(Y+7))=$S(H:H,1:0),$P(BGPONN5(X),U,(Y+8))=$$SL(I)
Q
SL(V) ;
I V="" S V=0
Q $$STRIP^XLFSTR($J(V,5,1)," ")
BGP4DP1F ; IHS/CMI/LAB - print ind 1 21 Mar 2010 12:55 PM 01 Jul 2010 11:40 AM ;
+1 ;;14.1;IHS CLINICAL REPORTING;;MAY 29, 2014;Build 114
ONN4 ;EP
+1 IF $GET(BGPAREAA)
IF $GET(BGPEXCEL)
Begin DoDot:1
+2 IF $PIECE($GET(^BGPINDJC(BGPPC,21)),U,9)=""
QUIT
+3 ;set each numerator and percent,then set BGPONN4
+4 NEW X
SET X=0
FOR
SET X=$ORDER(BGPSUL(X))
IF X'=+X
QUIT
Begin DoDot:2
+5 SET $PIECE(BGPEXCT(X,1),U,1)=$PIECE($GET(^BGPGPDCJ(X,N)),U,P)
SET $PIECE(BGPEXCT(X,1),U,3)=$SELECT($PIECE(BGPEXCT(X,1),U,2):(($PIECE(BGPEXCT(X,1),U,1)/$PIECE(BGPEXCT(X,1),U,2))*100),1:"")
+6 SET $PIECE(BGPEXCT(X,2),U,1)=$PIECE($GET(^BGPGPDPJ(X,N)),U,P)
SET $PIECE(BGPEXCT(X,2),U,3)=$SELECT($PIECE(BGPEXCT(X,2),U,2):(($PIECE(BGPEXCT(X,2),U,1)/$PIECE(BGPEXCT(X,2),U,2))*100),1:"")
+7 SET $PIECE(BGPEXCT(X,3),U,1)=$PIECE($GET(^BGPGPDBJ(X,N)),U,P)
SET $PIECE(BGPEXCT(X,3),U,3)=$SELECT($PIECE(BGPEXCT(X,3),U,2):(($PIECE(BGPEXCT(X,3),U,1)/$PIECE(BGPEXCT(X,3),U,2))*100),1:"")
End DoDot:2
+8 SET X=0
FOR
SET X=$ORDER(BGPEXCT(X))
IF X'=+X
QUIT
Begin DoDot:2
+9 SET A=$PIECE(BGPEXCT(X,1),U,1)
SET B=$PIECE(BGPEXCT(X,1),U,2)
SET C=$PIECE(BGPEXCT(X,1),U,3)
+10 SET D=$PIECE(BGPEXCT(X,2),U,1)
SET E=$PIECE(BGPEXCT(X,2),U,2)
SET F=$PIECE(BGPEXCT(X,2),U,3)
+11 SET G=$PIECE(BGPEXCT(X,3),U,1)
SET H=$PIECE(BGPEXCT(X,3),U,2)
SET I=$PIECE(BGPEXCT(X,3),U,3)
+12 IF $PIECE($PIECE(^BGPINDJC(BGPPC,0),U,4),".")="023"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,9)
SET $PIECE(BGPONN4(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN4(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN4(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+13 IF $PIECE($PIECE(^BGPINDJC(BGPPC,0),U,4),".",1,2)="014.A"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,9)
SET $PIECE(BGPONN4(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN4(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN4(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+14 IF $PIECE(^BGPINDJC(BGPPC,0),U,4)="016.A.1"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,9)
SET $PIECE(BGPONN4(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN4(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN4(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+15 IF $PIECE($GET(^BGPINDJC(BGPPC,19)),U,13)
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,1)
SET $PIECE(BGPONN4(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN4(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN4(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+16 SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,9)
+17 SET $PIECE(BGPONN4(X),U,$PIECE(^BGPINDJC(BGPPC,21),U,9))=$SELECT(A:A,1:0)
SET $PIECE(BGPONN4(X),U,(Y+1))=$SELECT(B:B,1:0)
SET $PIECE(BGPONN4(X),U,(Y+2))=$$SL(C)
+18 SET $PIECE(BGPONN4(X),U,(Y+3))=$SELECT(D:D,1:0)
SET $PIECE(BGPONN4(X),U,(Y+4))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN4(X),U,(Y+5))=$$SL(F)
SET $PIECE(BGPONN4(X),U,(Y+6))=$SELECT(G:G,1:0)
SET $PIECE(BGPONN4(X),U,(Y+7))=$SELECT(H:H,1:0)
SET $PIECE(BGPONN4(X),U,(Y+8))=$$SL(I)
End DoDot:2
End DoDot:1
+19 ;Q ;NO ONM5 FOR V11.0
ONN5 ;
+1 IF $GET(BGPAREAA)
IF $GET(BGPEXCEL)
Begin DoDot:1
+2 IF $PIECE($GET(^BGPINDJC(BGPPC,21)),U,10)=""
QUIT
+3 ;set each numerator and percent,then set BGPONN5
+4 NEW X
SET X=0
FOR
SET X=$ORDER(BGPSUL(X))
IF X'=+X
QUIT
Begin DoDot:2
+5 SET $PIECE(BGPEXCT(X,1),U,1)=$PIECE($GET(^BGPGPDCJ(X,N)),U,P)
SET $PIECE(BGPEXCT(X,1),U,3)=$SELECT($PIECE(BGPEXCT(X,1),U,2):(($PIECE(BGPEXCT(X,1),U,1)/$PIECE(BGPEXCT(X,1),U,2))*100),1:"")
+6 SET $PIECE(BGPEXCT(X,2),U,1)=$PIECE($GET(^BGPGPDPJ(X,N)),U,P)
SET $PIECE(BGPEXCT(X,2),U,3)=$SELECT($PIECE(BGPEXCT(X,2),U,2):(($PIECE(BGPEXCT(X,2),U,1)/$PIECE(BGPEXCT(X,2),U,2))*100),1:"")
+7 SET $PIECE(BGPEXCT(X,3),U,1)=$PIECE($GET(^BGPGPDBJ(X,N)),U,P)
SET $PIECE(BGPEXCT(X,3),U,3)=$SELECT($PIECE(BGPEXCT(X,3),U,2):(($PIECE(BGPEXCT(X,3),U,1)/$PIECE(BGPEXCT(X,3),U,2))*100),1:"")
End DoDot:2
+8 SET X=0
FOR
SET X=$ORDER(BGPEXCT(X))
IF X'=+X
QUIT
Begin DoDot:2
+9 SET A=$PIECE(BGPEXCT(X,1),U,1)
SET B=$PIECE(BGPEXCT(X,1),U,2)
SET C=$PIECE(BGPEXCT(X,1),U,3)
+10 SET D=$PIECE(BGPEXCT(X,2),U,1)
SET E=$PIECE(BGPEXCT(X,2),U,2)
SET F=$PIECE(BGPEXCT(X,2),U,3)
+11 SET G=$PIECE(BGPEXCT(X,3),U,1)
SET H=$PIECE(BGPEXCT(X,3),U,2)
SET I=$PIECE(BGPEXCT(X,3),U,3)
+12 IF $PIECE($PIECE(^BGPINDJC(BGPPC,0),U,4),".")="023"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,10)
SET $PIECE(BGPONN5(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN5(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN5(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+13 IF $PIECE($PIECE(^BGPINDJC(BGPPC,0),U,4),".",1,2)="014.A"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,10)
SET $PIECE(BGPONN5(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN5(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN5(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+14 IF $PIECE(^BGPINDJC(BGPPC,0),U,4)="016.A.1"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,10)
SET $PIECE(BGPONN5(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN5(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN5(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+15 IF $PIECE(^BGPINDJC(BGPPC,0),U,4)="STI.AA.1A"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,10)
SET $PIECE(BGPONN5(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN5(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN5(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+16 IF $PIECE(^BGPINDJC(BGPPC,0),U,4)="STI.AB.4A"
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,10)
SET $PIECE(BGPONN5(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN5(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN5(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+17 IF $PIECE($GET(^BGPINDJC(BGPPC,19)),U,13)
SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,1)
SET $PIECE(BGPONN5(X),U,Y)=$SELECT(B:B,1:0)
SET $PIECE(BGPONN5(X),U,(Y+3))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN5(X),U,(Y+6))=$SELECT(H:H,1:0)
QUIT
+18 SET Y=$PIECE(^BGPINDJC(BGPPC,21),U,10)
+19 SET $PIECE(BGPONN5(X),U,$PIECE(^BGPINDJC(BGPPC,21),U,10))=$SELECT(A:A,1:0)
SET $PIECE(BGPONN5(X),U,(Y+1))=$SELECT(B:B,1:0)
SET $PIECE(BGPONN5(X),U,(Y+2))=$$SL(C)
+20 SET $PIECE(BGPONN5(X),U,(Y+3))=$SELECT(D:D,1:0)
SET $PIECE(BGPONN5(X),U,(Y+4))=$SELECT(E:E,1:0)
SET $PIECE(BGPONN5(X),U,(Y+5))=$$SL(F)
SET $PIECE(BGPONN5(X),U,(Y+6))=$SELECT(G:G,1:0)
SET $PIECE(BGPONN5(X),U,(Y+7))=$SELECT(H:H,1:0)
SET $PIECE(BGPONN5(X),U,(Y+8))=$$SL(I)
End DoDot:2
End DoDot:1
+21 QUIT
SL(V) ;
+1 IF V=""
SET V=0
+2 QUIT $$STRIP^XLFSTR($JUSTIFY(V,5,1)," ")