BGP5DPE3 ;IHS/CMI/LAB - patient ed report;
;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
;
;
SET73 ;EP
I BGPTIME=2 D SET73P Q
I BGPTIME=3 D SET73B Q
I '$D(^BGPPEDCK(BGPRPT,18,0)) S ^BGPPEDCK(BGPRPT,18,0)="^90554.1218A^0^0"
S Z=$O(^BGPPEDCK(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDCK(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDCK(BGPRPT,18,Z,0),U,3)+BGPC
S Z=$P(^BGPPEDCK(BGPRPT,18,0),U,3)+BGPC,$P(^BGPPEDCK(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDCK(BGPRPT,18,0),U,4)=Z
S ^BGPPEDCK(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
S ^BGPPEDCK(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73P ;
I '$D(^BGPPEDPK(BGPRPT,18,0)) S ^BGPPEDPK(BGPRPT,18,0)="^90554.1318A^0^0"
S Z=$O(^BGPPEDPK(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDPK(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDPK(BGPRPT,18,Z,0),U,3)+1
S Z=$P(^BGPPEDPK(BGPRPT,18,0),U,3)+1,$P(^BGPPEDPK(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDPK(BGPRPT,18,0),U,4)=Z
S ^BGPPEDPK(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDPK(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73B ;
I '$D(^BGPPEDBK(BGPRPT,18,0)) S ^BGPPEDBK(BGPRPT,18,0)="^90554.1418A^0^0"
S Z=$O(^BGPPEDBK(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBK(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDBK(BGPRPT,18,Z,0),U,3)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T_U_1
S ^BGPPEDPK(BGPRPT,21,"B",BGPT,Z)=""
Q
SET75B ;
I '$D(^BGPPEDBK(BGPRPT,21,0)) S ^BGPPEDBK(BGPRPT,21,0)="^90554.1421A^0^0"
S Z=$O(^BGPPEDBK(BGPRPT,21,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBK(BGPRPT,21,Z,0),U,3)=$P(^BGPPEDBK(BGPRPT,21,Z,0),U,3)+1
S Z=$P(^BGPPEDBK(BGPRPT,21,0),U,3)+1,$P(^BGPPEDBK(BGPRPT,21,0),U,3)=Z,$P(^BGPPEDBK(BGPRPT,21,0),U,4)=Z
S ^BGPPEDBK(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDBK(BGPRPT,21,"B",BGPT,Z)=""
Q
BGP5DPE3 ;IHS/CMI/LAB - patient ed report;
+1 ;;15.1;IHS CLINICAL REPORTING;;MAY 06, 2015;Build 143
+2 ;
+3 ;
SET73 ;EP
+1 IF BGPTIME=2
DO SET73P
QUIT
+2 IF BGPTIME=3
DO SET73B
QUIT
+3 IF '$DATA(^BGPPEDCK(BGPRPT,18,0))
SET ^BGPPEDCK(BGPRPT,18,0)="^90554.1218A^0^0"
+4 SET Z=$ORDER(^BGPPEDCK(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCK(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDCK(BGPRPT,18,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCK(BGPRPT,18,0),U,3)+BGPC
SET $PIECE(^BGPPEDCK(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDCK(BGPRPT,18,0),U,4)=Z
+7 SET ^BGPPEDCK(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCK(BGPRPT,18,"B",BGPT,Z)=""
+9 QUIT
SET73P ;
+1 IF '$DATA(^BGPPEDPK(BGPRPT,18,0))
SET ^BGPPEDPK(BGPRPT,18,0)="^90554.1318A^0^0"
+2 SET Z=$ORDER(^BGPPEDPK(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPK(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDPK(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPK(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDPK(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDPK(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDPK(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPK(BGPRPT,18,"B",BGPT,Z)=""
+7 QUIT
SET73B ;
+1 IF '$DATA(^BGPPEDBK(BGPRPT,18,0))
SET ^BGPPEDBK(BGPRPT,18,0)="^90554.1418A^0^0"
+2 SET Z=$ORDER(^BGPPEDBK(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBK(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDBK(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBK(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDBK(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDBK(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDBK(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBK(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(^BGPPEDCK(BGPRPT,19,0))
SET ^BGPPEDCK(BGPRPT,19,0)="^90554.1219A^0^0"
+4 SET Z=$ORDER(^BGPPEDCK(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCK(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDCK(BGPRPT,19,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCK(BGPRPT,19,0),U,3)+BGPC
SET $PIECE(^BGPPEDCK(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDCK(BGPRPT,19,0),U,4)=Z
+7 SET ^BGPPEDCK(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCK(BGPRPT,19,"B",BGPT,Z)=""
+9 QUIT
SET74P ;
+1 IF '$DATA(^BGPPEDPK(BGPRPT,19,0))
SET ^BGPPEDPK(BGPRPT,19,0)="^90554.1319A^0^0"
+2 SET Z=$ORDER(^BGPPEDPK(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPK(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDPK(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPK(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDPK(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDPK(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDPK(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPK(BGPRPT,19,"B",BGPT,Z)=""
+7 QUIT
SET74B ;
+1 IF '$DATA(^BGPPEDBK(BGPRPT,19,0))
SET ^BGPPEDBK(BGPRPT,19,0)="^90554.1419A^0^0"
+2 SET Z=$ORDER(^BGPPEDBK(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBK(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDBK(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBK(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDBK(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDBK(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDBK(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBK(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(^BGPPEDCK(BGPRPT,21,0))
SET ^BGPPEDCK(BGPRPT,21,0)="^90554.1221A^0^0"
+4 SET Z=$ORDER(^BGPPEDCK(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCK(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDCK(BGPRPT,21,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCK(BGPRPT,21,0),U,3)+BGPC
SET $PIECE(^BGPPEDCK(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDCK(BGPRPT,21,0),U,4)=Z
+7 SET ^BGPPEDCK(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCK(BGPRPT,21,"B",BGPT,Z)=""
+9 QUIT
SET75P ;
+1 IF '$DATA(^BGPPEDPK(BGPRPT,21,0))
SET ^BGPPEDPK(BGPRPT,21,0)="^90554.1321A^0^0"
+2 SET Z=$ORDER(^BGPPEDPK(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPK(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDPK(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPK(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDPK(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDPK(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDPK(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPK(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT
SET75B ;
+1 IF '$DATA(^BGPPEDBK(BGPRPT,21,0))
SET ^BGPPEDBK(BGPRPT,21,0)="^90554.1421A^0^0"
+2 SET Z=$ORDER(^BGPPEDBK(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBK(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDBK(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBK(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDBK(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDBK(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDBK(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBK(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT