BGP3DPE3 ;IHS/CMI/LAB - patient ed report;
;;13.0;IHS CLINICAL REPORTING;;NOV 20, 2012;Build 81
;
;
SET73 ;EP
I BGPTIME=2 D SET73P Q
I BGPTIME=3 D SET73B Q
I '$D(^BGPPEDCH(BGPRPT,18,0)) S ^BGPPEDCH(BGPRPT,18,0)="^90550.1218A^0^0"
S Z=$O(^BGPPEDCH(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDCH(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDCH(BGPRPT,18,Z,0),U,3)+BGPC
S Z=$P(^BGPPEDCH(BGPRPT,18,0),U,3)+BGPC,$P(^BGPPEDCH(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDCH(BGPRPT,18,0),U,4)=Z
S ^BGPPEDCH(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
S ^BGPPEDCH(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73P ;
I '$D(^BGPPEDPH(BGPRPT,18,0)) S ^BGPPEDPH(BGPRPT,18,0)="^90550.1318A^0^0"
S Z=$O(^BGPPEDPH(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDPH(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDPH(BGPRPT,18,Z,0),U,3)+1
S Z=$P(^BGPPEDPH(BGPRPT,18,0),U,3)+1,$P(^BGPPEDPH(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDPH(BGPRPT,18,0),U,4)=Z
S ^BGPPEDPH(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDPH(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73B ;
I '$D(^BGPPEDBH(BGPRPT,18,0)) S ^BGPPEDBH(BGPRPT,18,0)="^90550.1418A^0^0"
S Z=$O(^BGPPEDBH(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBH(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDBH(BGPRPT,18,Z,0),U,3)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T_U_1
S ^BGPPEDPH(BGPRPT,21,"B",BGPT,Z)=""
Q
SET75B ;
I '$D(^BGPPEDBH(BGPRPT,21,0)) S ^BGPPEDBH(BGPRPT,21,0)="^90550.1421A^0^0"
S Z=$O(^BGPPEDBH(BGPRPT,21,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBH(BGPRPT,21,Z,0),U,3)=$P(^BGPPEDBH(BGPRPT,21,Z,0),U,3)+1
S Z=$P(^BGPPEDBH(BGPRPT,21,0),U,3)+1,$P(^BGPPEDBH(BGPRPT,21,0),U,3)=Z,$P(^BGPPEDBH(BGPRPT,21,0),U,4)=Z
S ^BGPPEDBH(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDBH(BGPRPT,21,"B",BGPT,Z)=""
Q
BGP3DPE3 ;IHS/CMI/LAB - patient ed report;
+1 ;;13.0;IHS CLINICAL REPORTING;;NOV 20, 2012;Build 81
+2 ;
+3 ;
SET73 ;EP
+1 IF BGPTIME=2
DO SET73P
QUIT
+2 IF BGPTIME=3
DO SET73B
QUIT
+3 IF '$DATA(^BGPPEDCH(BGPRPT,18,0))
SET ^BGPPEDCH(BGPRPT,18,0)="^90550.1218A^0^0"
+4 SET Z=$ORDER(^BGPPEDCH(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCH(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDCH(BGPRPT,18,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCH(BGPRPT,18,0),U,3)+BGPC
SET $PIECE(^BGPPEDCH(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDCH(BGPRPT,18,0),U,4)=Z
+7 SET ^BGPPEDCH(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCH(BGPRPT,18,"B",BGPT,Z)=""
+9 QUIT
SET73P ;
+1 IF '$DATA(^BGPPEDPH(BGPRPT,18,0))
SET ^BGPPEDPH(BGPRPT,18,0)="^90550.1318A^0^0"
+2 SET Z=$ORDER(^BGPPEDPH(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPH(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDPH(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPH(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDPH(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDPH(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDPH(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPH(BGPRPT,18,"B",BGPT,Z)=""
+7 QUIT
SET73B ;
+1 IF '$DATA(^BGPPEDBH(BGPRPT,18,0))
SET ^BGPPEDBH(BGPRPT,18,0)="^90550.1418A^0^0"
+2 SET Z=$ORDER(^BGPPEDBH(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBH(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDBH(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBH(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDBH(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDBH(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDBH(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBH(BGPRPT,18,"B",BGPT,Z)=""
+7 QUIT
SET74 ;EP
+1 IF BGPTIME=2
DO SET74P
QUIT
+2 IF BGPTIME=3
DO SET74B
QUIT
+3 IF '$DATA(^BGPPEDCH(BGPRPT,19,0))
SET ^BGPPEDCH(BGPRPT,19,0)="^90550.1219A^0^0"
+4 SET Z=$ORDER(^BGPPEDCH(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCH(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDCH(BGPRPT,19,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCH(BGPRPT,19,0),U,3)+BGPC
SET $PIECE(^BGPPEDCH(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDCH(BGPRPT,19,0),U,4)=Z
+7 SET ^BGPPEDCH(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCH(BGPRPT,19,"B",BGPT,Z)=""
+9 QUIT
SET74P ;
+1 IF '$DATA(^BGPPEDPH(BGPRPT,19,0))
SET ^BGPPEDPH(BGPRPT,19,0)="^90550.1319A^0^0"
+2 SET Z=$ORDER(^BGPPEDPH(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPH(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDPH(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPH(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDPH(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDPH(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDPH(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPH(BGPRPT,19,"B",BGPT,Z)=""
+7 QUIT
SET74B ;
+1 IF '$DATA(^BGPPEDBH(BGPRPT,19,0))
SET ^BGPPEDBH(BGPRPT,19,0)="^90550.1419A^0^0"
+2 SET Z=$ORDER(^BGPPEDBH(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBH(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDBH(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBH(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDBH(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDBH(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDBH(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBH(BGPRPT,19,"B",BGPT,Z)=""
+7 QUIT
SET75 ;EP
+1 IF BGPTIME=2
DO SET75P
QUIT
+2 IF BGPTIME=3
DO SET75B
QUIT
+3 IF '$DATA(^BGPPEDCH(BGPRPT,21,0))
SET ^BGPPEDCH(BGPRPT,21,0)="^90550.1221A^0^0"
+4 SET Z=$ORDER(^BGPPEDCH(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCH(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDCH(BGPRPT,21,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCH(BGPRPT,21,0),U,3)+BGPC
SET $PIECE(^BGPPEDCH(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDCH(BGPRPT,21,0),U,4)=Z
+7 SET ^BGPPEDCH(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCH(BGPRPT,21,"B",BGPT,Z)=""
+9 QUIT
SET75P ;
+1 IF '$DATA(^BGPPEDPH(BGPRPT,21,0))
SET ^BGPPEDPH(BGPRPT,21,0)="^90550.1321A^0^0"
+2 SET Z=$ORDER(^BGPPEDPH(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPH(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDPH(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPH(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDPH(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDPH(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDPH(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPH(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT
SET75B ;
+1 IF '$DATA(^BGPPEDBH(BGPRPT,21,0))
SET ^BGPPEDBH(BGPRPT,21,0)="^90550.1421A^0^0"
+2 SET Z=$ORDER(^BGPPEDBH(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBH(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDBH(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBH(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDBH(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDBH(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDBH(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBH(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT