BGP8DPE3 ; IHS/CMI/LAB - patient ed report ;
;;18.1;IHS CLINICAL REPORTING;;MAY 25, 2018;Build 66
;
;
SET73 ;EP
I BGPTIME=2 D SET73P Q
I BGPTIME=3 D SET73B Q
I '$D(^BGPPEDCR(BGPRPT,18,0)) S ^BGPPEDCR(BGPRPT,18,0)="^90560.1218A^0^0"
S Z=$O(^BGPPEDCR(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDCR(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDCR(BGPRPT,18,Z,0),U,3)+BGPC
S Z=$P(^BGPPEDCR(BGPRPT,18,0),U,3)+BGPC,$P(^BGPPEDCR(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDCR(BGPRPT,18,0),U,4)=Z
S ^BGPPEDCR(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
S ^BGPPEDCR(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73P ;
I '$D(^BGPPEDPR(BGPRPT,18,0)) S ^BGPPEDPR(BGPRPT,18,0)="^90560.1318A^0^0"
S Z=$O(^BGPPEDPR(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDPR(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDPR(BGPRPT,18,Z,0),U,3)+1
S Z=$P(^BGPPEDPR(BGPRPT,18,0),U,3)+1,$P(^BGPPEDPR(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDPR(BGPRPT,18,0),U,4)=Z
S ^BGPPEDPR(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDPR(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73B ;
I '$D(^BGPPEDBR(BGPRPT,18,0)) S ^BGPPEDBR(BGPRPT,18,0)="^90560.1418A^0^0"
S Z=$O(^BGPPEDBR(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBR(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDBR(BGPRPT,18,Z,0),U,3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PT_U_1
S ^BGPPEDPR(BGPRPT,21,"B",BGPT,Z)=""
Q
SET75B ;
I '$D(^BGPPEDBR(BGPRPT,21,0)) S ^BGPPEDBR(BGPRPT,21,0)="^90560.1421A^0^0"
S Z=$O(^BGPPEDBR(BGPRPT,21,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBR(BGPRPT,21,Z,0),U,3)=$P(^BGPPEDBR(BGPRPT,21,Z,0),U,3)+1
S Z=$P(^BGPPEDBR(BGPRPT,21,0),U,3)+1,$P(^BGPPEDBR(BGPRPT,21,0),U,3)=Z,$P(^BGPPEDBR(BGPRPT,21,0),U,4)=Z
S ^BGPPEDBR(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDBR(BGPRPT,21,"B",BGPT,Z)=""
Q
BGP8DPE3 ; IHS/CMI/LAB - patient ed report ;
+1 ;;18.1;IHS CLINICAL REPORTING;;MAY 25, 2018;Build 66
+2 ;
+3 ;
SET73 ;EP
+1 IF BGPTIME=2
DO SET73P
QUIT
+2 IF BGPTIME=3
DO SET73B
QUIT
+3 IF '$DATA(^BGPPEDCR(BGPRPT,18,0))
SET ^BGPPEDCR(BGPRPT,18,0)="^90560.1218A^0^0"
+4 SET Z=$ORDER(^BGPPEDCR(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCR(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDCR(BGPRPT,18,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCR(BGPRPT,18,0),U,3)+BGPC
SET $PIECE(^BGPPEDCR(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDCR(BGPRPT,18,0),U,4)=Z
+7 SET ^BGPPEDCR(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCR(BGPRPT,18,"B",BGPT,Z)=""
+9 QUIT
SET73P ;
+1 IF '$DATA(^BGPPEDPR(BGPRPT,18,0))
SET ^BGPPEDPR(BGPRPT,18,0)="^90560.1318A^0^0"
+2 SET Z=$ORDER(^BGPPEDPR(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPR(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDPR(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPR(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDPR(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDPR(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDPR(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPR(BGPRPT,18,"B",BGPT,Z)=""
+7 QUIT
SET73B ;
+1 IF '$DATA(^BGPPEDBR(BGPRPT,18,0))
SET ^BGPPEDBR(BGPRPT,18,0)="^90560.1418A^0^0"
+2 SET Z=$ORDER(^BGPPEDBR(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBR(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDBR(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBR(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDBR(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDBR(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDBR(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBR(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(^BGPPEDCR(BGPRPT,19,0))
SET ^BGPPEDCR(BGPRPT,19,0)="^90560.1219A^0^0"
+4 SET Z=$ORDER(^BGPPEDCR(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCR(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDCR(BGPRPT,19,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCR(BGPRPT,19,0),U,3)+BGPC
SET $PIECE(^BGPPEDCR(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDCR(BGPRPT,19,0),U,4)=Z
+7 SET ^BGPPEDCR(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCR(BGPRPT,19,"B",BGPT,Z)=""
+9 QUIT
SET74P ;
+1 IF '$DATA(^BGPPEDPR(BGPRPT,19,0))
SET ^BGPPEDPR(BGPRPT,19,0)="^90560.1319A^0^0"
+2 SET Z=$ORDER(^BGPPEDPR(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPR(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDPR(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPR(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDPR(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDPR(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDPR(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPR(BGPRPT,19,"B",BGPT,Z)=""
+7 QUIT
SET74B ;
+1 IF '$DATA(^BGPPEDBR(BGPRPT,19,0))
SET ^BGPPEDBR(BGPRPT,19,0)="^90560.1419A^0^0"
+2 SET Z=$ORDER(^BGPPEDBR(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBR(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDBR(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBR(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDBR(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDBR(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDBR(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBR(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(^BGPPEDCR(BGPRPT,21,0))
SET ^BGPPEDCR(BGPRPT,21,0)="^90560.1221A^0^0"
+4 SET Z=$ORDER(^BGPPEDCR(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCR(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDCR(BGPRPT,21,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCR(BGPRPT,21,0),U,3)+BGPC
SET $PIECE(^BGPPEDCR(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDCR(BGPRPT,21,0),U,4)=Z
+7 SET ^BGPPEDCR(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCR(BGPRPT,21,"B",BGPT,Z)=""
+9 QUIT
SET75P ;
+1 IF '$DATA(^BGPPEDPR(BGPRPT,21,0))
SET ^BGPPEDPR(BGPRPT,21,0)="^90560.1321A^0^0"
+2 SET Z=$ORDER(^BGPPEDPR(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPR(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDPR(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPR(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDPR(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDPR(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDPR(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPR(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT
SET75B ;
+1 IF '$DATA(^BGPPEDBR(BGPRPT,21,0))
SET ^BGPPEDBR(BGPRPT,21,0)="^90560.1421A^0^0"
+2 SET Z=$ORDER(^BGPPEDBR(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBR(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDBR(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBR(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDBR(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDBR(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDBR(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBR(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT