BGP6DPE3 ; IHS/CMI/LAB - patient ed report ;
;;16.1;IHS CLINICAL REPORTING;;MAR 22, 2016;Build 170
;
;
SET73 ;EP
I BGPTIME=2 D SET73P Q
I BGPTIME=3 D SET73B Q
I '$D(^BGPPEDCM(BGPRPT,18,0)) S ^BGPPEDCM(BGPRPT,18,0)="^90556.1218A^0^0"
S Z=$O(^BGPPEDCM(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDCM(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDCM(BGPRPT,18,Z,0),U,3)+BGPC
S Z=$P(^BGPPEDCM(BGPRPT,18,0),U,3)+BGPC,$P(^BGPPEDCM(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDCM(BGPRPT,18,0),U,4)=Z
S ^BGPPEDCM(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
S ^BGPPEDCM(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73P ;
I '$D(^BGPPEDPM(BGPRPT,18,0)) S ^BGPPEDPM(BGPRPT,18,0)="^90556.1318A^0^0"
S Z=$O(^BGPPEDPM(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDPM(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDPM(BGPRPT,18,Z,0),U,3)+1
S Z=$P(^BGPPEDPM(BGPRPT,18,0),U,3)+1,$P(^BGPPEDPM(BGPRPT,18,0),U,3)=Z,$P(^BGPPEDPM(BGPRPT,18,0),U,4)=Z
S ^BGPPEDPM(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDPM(BGPRPT,18,"B",BGPT,Z)=""
Q
SET73B ;
I '$D(^BGPPEDBM(BGPRPT,18,0)) S ^BGPPEDBM(BGPRPT,18,0)="^90556.1418A^0^0"
S Z=$O(^BGPPEDBM(BGPRPT,18,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBM(BGPRPT,18,Z,0),U,3)=$P(^BGPPEDBM(BGPRPT,18,Z,0),U,3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PT_U_1
S ^BGPPEDPM(BGPRPT,21,"B",BGPT,Z)=""
Q
SET75B ;
I '$D(^BGPPEDBM(BGPRPT,21,0)) S ^BGPPEDBM(BGPRPT,21,0)="^90556.1421A^0^0"
S Z=$O(^BGPPEDBM(BGPRPT,21,"B",BGPT,0)) I Z D Q
.S $P(^BGPPEDBM(BGPRPT,21,Z,0),U,3)=$P(^BGPPEDBM(BGPRPT,21,Z,0),U,3)+1
S Z=$P(^BGPPEDBM(BGPRPT,21,0),U,3)+1,$P(^BGPPEDBM(BGPRPT,21,0),U,3)=Z,$P(^BGPPEDBM(BGPRPT,21,0),U,4)=Z
S ^BGPPEDBM(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
S ^BGPPEDBM(BGPRPT,21,"B",BGPT,Z)=""
Q
BGP6DPE3 ; IHS/CMI/LAB - patient ed report ;
+1 ;;16.1;IHS CLINICAL REPORTING;;MAR 22, 2016;Build 170
+2 ;
+3 ;
SET73 ;EP
+1 IF BGPTIME=2
DO SET73P
QUIT
+2 IF BGPTIME=3
DO SET73B
QUIT
+3 IF '$DATA(^BGPPEDCM(BGPRPT,18,0))
SET ^BGPPEDCM(BGPRPT,18,0)="^90556.1218A^0^0"
+4 SET Z=$ORDER(^BGPPEDCM(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCM(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDCM(BGPRPT,18,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCM(BGPRPT,18,0),U,3)+BGPC
SET $PIECE(^BGPPEDCM(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDCM(BGPRPT,18,0),U,4)=Z
+7 SET ^BGPPEDCM(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCM(BGPRPT,18,"B",BGPT,Z)=""
+9 QUIT
SET73P ;
+1 IF '$DATA(^BGPPEDPM(BGPRPT,18,0))
SET ^BGPPEDPM(BGPRPT,18,0)="^90556.1318A^0^0"
+2 SET Z=$ORDER(^BGPPEDPM(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPM(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDPM(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPM(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDPM(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDPM(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDPM(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPM(BGPRPT,18,"B",BGPT,Z)=""
+7 QUIT
SET73B ;
+1 IF '$DATA(^BGPPEDBM(BGPRPT,18,0))
SET ^BGPPEDBM(BGPRPT,18,0)="^90556.1418A^0^0"
+2 SET Z=$ORDER(^BGPPEDBM(BGPRPT,18,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBM(BGPRPT,18,Z,0),U,3)=$PIECE(^BGPPEDBM(BGPRPT,18,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBM(BGPRPT,18,0),U,3)+1
SET $PIECE(^BGPPEDBM(BGPRPT,18,0),U,3)=Z
SET $PIECE(^BGPPEDBM(BGPRPT,18,0),U,4)=Z
+5 SET ^BGPPEDBM(BGPRPT,18,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBM(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(^BGPPEDCM(BGPRPT,19,0))
SET ^BGPPEDCM(BGPRPT,19,0)="^90556.1219A^0^0"
+4 SET Z=$ORDER(^BGPPEDCM(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCM(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDCM(BGPRPT,19,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCM(BGPRPT,19,0),U,3)+BGPC
SET $PIECE(^BGPPEDCM(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDCM(BGPRPT,19,0),U,4)=Z
+7 SET ^BGPPEDCM(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCM(BGPRPT,19,"B",BGPT,Z)=""
+9 QUIT
SET74P ;
+1 IF '$DATA(^BGPPEDPM(BGPRPT,19,0))
SET ^BGPPEDPM(BGPRPT,19,0)="^90556.1319A^0^0"
+2 SET Z=$ORDER(^BGPPEDPM(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPM(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDPM(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPM(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDPM(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDPM(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDPM(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPM(BGPRPT,19,"B",BGPT,Z)=""
+7 QUIT
SET74B ;
+1 IF '$DATA(^BGPPEDBM(BGPRPT,19,0))
SET ^BGPPEDBM(BGPRPT,19,0)="^90556.1419A^0^0"
+2 SET Z=$ORDER(^BGPPEDBM(BGPRPT,19,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBM(BGPRPT,19,Z,0),U,3)=$PIECE(^BGPPEDBM(BGPRPT,19,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBM(BGPRPT,19,0),U,3)+1
SET $PIECE(^BGPPEDBM(BGPRPT,19,0),U,3)=Z
SET $PIECE(^BGPPEDBM(BGPRPT,19,0),U,4)=Z
+5 SET ^BGPPEDBM(BGPRPT,19,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBM(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(^BGPPEDCM(BGPRPT,21,0))
SET ^BGPPEDCM(BGPRPT,21,0)="^90556.1221A^0^0"
+4 SET Z=$ORDER(^BGPPEDCM(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+5 SET $PIECE(^BGPPEDCM(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDCM(BGPRPT,21,Z,0),U,3)+BGPC
End DoDot:1
QUIT
+6 SET Z=$PIECE(^BGPPEDCM(BGPRPT,21,0),U,3)+BGPC
SET $PIECE(^BGPPEDCM(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDCM(BGPRPT,21,0),U,4)=Z
+7 SET ^BGPPEDCM(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_BGPC
+8 SET ^BGPPEDCM(BGPRPT,21,"B",BGPT,Z)=""
+9 QUIT
SET75P ;
+1 IF '$DATA(^BGPPEDPM(BGPRPT,21,0))
SET ^BGPPEDPM(BGPRPT,21,0)="^90556.1321A^0^0"
+2 SET Z=$ORDER(^BGPPEDPM(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDPM(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDPM(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDPM(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDPM(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDPM(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDPM(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDPM(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT
SET75B ;
+1 IF '$DATA(^BGPPEDBM(BGPRPT,21,0))
SET ^BGPPEDBM(BGPRPT,21,0)="^90556.1421A^0^0"
+2 SET Z=$ORDER(^BGPPEDBM(BGPRPT,21,"B",BGPT,0))
IF Z
Begin DoDot:1
+3 SET $PIECE(^BGPPEDBM(BGPRPT,21,Z,0),U,3)=$PIECE(^BGPPEDBM(BGPRPT,21,Z,0),U,3)+1
End DoDot:1
QUIT
+4 SET Z=$PIECE(^BGPPEDBM(BGPRPT,21,0),U,3)+1
SET $PIECE(^BGPPEDBM(BGPRPT,21,0),U,3)=Z
SET $PIECE(^BGPPEDBM(BGPRPT,21,0),U,4)=Z
+5 SET ^BGPPEDBM(BGPRPT,21,Z,0)=BGPT_U_BGPT_U_1
+6 SET ^BGPPEDBM(BGPRPT,21,"B",BGPT,Z)=""
+7 QUIT