DGRPCB ;ALB/MRL - CONSISTENCY EDIT BULLETIN ; 29 AUG 88@0932
;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
;
; Fire bulletin of inconsistencies
;
EN I '$D(^DGIN(38.5,DFN,0)) Q
S DGD="0^",DGD1=^DGIN(38.5,DFN,0),DGDAY=$P(DGD1,"^",6) I DGDAY]"" S X1=DT,X2=DGDAY D ^%DTC S DGD=+X,Y=DGDAY X ^DD("DD") S $P(DGD,"^",2)=Y
I +DGD!($P(DGD1,"^",6)=DT) W !!,"Last notification message was sent '",$P(DGD,"^",2),"' [",$S($P(DGD1,"^",6)=DT:"TODAY",1:+DGD_" - Day"_$S(+DGD=1:"",1:"s")_" ago"),"]"
I $S($P(DGD1,"^",6)=DT:1,+DGD'>6&(+DGD):1,1:0),'DGCT2 W !!,"No new message sent since it's been less than 7 days since last message",!,"and no new inconsistencies were found..." Q
W !! I 'DGD,'$P(DGD1,"^",6) W "Initial notification"
E W $S('DGCT2:"Reminder",1:"Updated")
W " message sent..." I +DGCT2 W $S(+DGCT2:"'"_+DGCT2_"'",1:"No")," new inconsistenc",$S(+DGCT2=1:"y",1:"ies")," found..."
S XMSUB="INCONSISTENCY EDIT" F I=1:1 S J=$P($T(T+I),";;",2) Q:J="QUIT" S DGTEXT(I,0)=J,DGC=I
D ^DGPATV S DGC=DGC+1,DGTEXT(DGC,0)="",DGC=DGC+1,DGTEXT(DGC,0)="PATIENT NAME: "_DGNAME_" SSN: "_$P(SSN,"^",2),DGC=DGC+1,DGTEXT(DGC,0)=""
S DGC=DGC+1,DGTEXT(DGC,0)="NOTIFICATION STATUS: "_$S('+DGD:"THIS IS THE FIRST NOTIFICATION MESSAGE.",1:"INITIALLY NOTIFIED '"_$P(DGD,"^",2)_" ["_+DGD_" - DAY"_$S(+DGD=1:"",1:"S")_" AGO]"),$P(^DGIN(38.5,DFN,0),"^",6)=DT
S Y=$P(DGD1,"^",2) X:Y]"" ^DD("DD") S Y=$S(Y]"":Y,1:"UNKNOWN DATE"),DGC=DGC+1,DGTEXT(DGC,0)="",DGC=DGC+1,DGTEXT(DGC,0)="INITIALLY IDENTIFIED BY: '"_$S($D(^VA(200,+$P(DGD1,"^",3),0)):$P(^(0),"^",1),1:"UNKNOWN")_"' ON '"_Y_"'."
S DGC=DGC+1,DGTEXT(DGC,0)="" F I=1:1 S J=$P(DGER,",",I) Q:J="" I $D(^DGIN(38.6,J,0)) S DGC=DGC+1,DGTEXT(DGC,0)=$E(J_" ",1,3)_"- "_$P(^(0),"^",2)_$S(DGKEY(+$E(DGEDIT,J)):"*",1:"")
KILL S DGB=6 D ^DGBUL,KILL^DGPATV K DGB,DGC,DGD,DGD1,DGDAY,DGEDIT,I,J,X,X1,X2 Q
T ;
;;The following inconsistencies remain on file for the below named patient.
;;Those inconsistencies followed with a asterisk [*] are verified and editable by
;;only those users who hold the "DG ELIGIBILITY" security key. I may not be a
;;holder of this key and therefore may have not been able to update these data
;;elements. Please use the 'Edit Inconsistent Data' option to clear up these
;;remaining inconsistencies asap. Thank you.
;;QUIT
DGRPCB ;ALB/MRL - CONSISTENCY EDIT BULLETIN ; 29 AUG 88@0932
+1 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
+2 ;
+3 ; Fire bulletin of inconsistencies
+4 ;
EN IF '$DATA(^DGIN(38.5,DFN,0))
QUIT
+1 SET DGD="0^"
SET DGD1=^DGIN(38.5,DFN,0)
SET DGDAY=$PIECE(DGD1,"^",6)
IF DGDAY]""
SET X1=DT
SET X2=DGDAY
DO ^%DTC
SET DGD=+X
SET Y=DGDAY
XECUTE ^DD("DD")
SET $PIECE(DGD,"^",2)=Y
+2 IF +DGD!($PIECE(DGD1,"^",6)=DT)
WRITE !!,"Last notification message was sent '",$PIECE(DGD,"^",2),"' [",$SELECT($PIECE(DGD1,"^",6)=DT:"TODAY",1:+DGD_" - Day"_$SELECT(+DGD=1:"",1:"s")_" ago"),"]"
+3 IF $SELECT($PIECE(DGD1,"^",6)=DT:1,+DGD'>6&(+DGD):1,1:0)
IF 'DGCT2
WRITE !!,"No new message sent since it's been less than 7 days since last message",!,"and no new inconsistencies were found..."
QUIT
+4 WRITE !!
IF 'DGD
IF '$PIECE(DGD1,"^",6)
WRITE "Initial notification"
+5 IF '$TEST
WRITE $SELECT('DGCT2:"Reminder",1:"Updated")
+6 WRITE " message sent..."
IF +DGCT2
WRITE $SELECT(+DGCT2:"'"_+DGCT2_"'",1:"No")," new inconsistenc",$SELECT(+DGCT2=1:"y",1:"ies")," found..."
+7 SET XMSUB="INCONSISTENCY EDIT"
FOR I=1:1
SET J=$PIECE($TEXT(T+I),";;",2)
IF J="QUIT"
QUIT
SET DGTEXT(I,0)=J
SET DGC=I
+8 DO ^DGPATV
SET DGC=DGC+1
SET DGTEXT(DGC,0)=""
SET DGC=DGC+1
SET DGTEXT(DGC,0)="PATIENT NAME: "_DGNAME_" SSN: "_$PIECE(SSN,"^",2)
SET DGC=DGC+1
SET DGTEXT(DGC,0)=""
+9 SET DGC=DGC+1
SET DGTEXT(DGC,0)="NOTIFICATION STATUS: "_$SELECT('+DGD:"THIS IS THE FIRST NOTIFICATION MESSAGE.",1:"INITIALLY NOTIFIED '"_$PIECE(DGD,"^",2)_" ["_+DGD_" - DAY"_$SELECT(+DGD=1:"",1:"S")_" AGO]")
SET $PIECE(^DGIN(38.5,DFN,0),"^",6)=DT
+10 SET Y=$PIECE(DGD1,"^",2)
IF Y]""
XECUTE ^DD("DD")
SET Y=$SELECT(Y]"":Y,1:"UNKNOWN DATE")
SET DGC=DGC+1
SET DGTEXT(DGC,0)=""
SET DGC=DGC+1
SET DGTEXT(DGC,0)="INITIALLY IDENTIFIED BY: '"_$SELECT($DATA(^VA(200,+$PIECE(DGD1,"^",3),0)):$PIECE(^(0),"^",1),1:"UNKNOWN")_"' ON '"_Y_"'."
+11 SET DGC=DGC+1
SET DGTEXT(DGC,0)=""
FOR I=1:1
SET J=$PIECE(DGER,",",I)
IF J=""
QUIT
IF $DATA(^DGIN(38.6,J,0))
SET DGC=DGC+1
SET DGTEXT(DGC,0)=$EXTRACT(J_" ",1,3)_"- "_$PIECE(^(0),"^",2)_$SELECT(DGKEY(+$EXTRACT(DGEDIT,J)):"*",1:"")
KILL SET DGB=6
DO ^DGBUL
DO KILL^DGPATV
KILL DGB,DGC,DGD,DGD1,DGDAY,DGEDIT,I,J,X,X1,X2
QUIT
T ;
+1 ;;The following inconsistencies remain on file for the below named patient.
+2 ;;Those inconsistencies followed with a asterisk [*] are verified and editable by
+3 ;;only those users who hold the "DG ELIGIBILITY" security key. I may not be a
+4 ;;holder of this key and therefore may have not been able to update these data
+5 ;;elements. Please use the 'Edit Inconsistent Data' option to clear up these
+6 ;;remaining inconsistencies asap. Thank you.
+7 ;;QUIT