GMRAVFY ;HIRMFO/WAA,PWC-VERIFY AND SIGN OFF AN AGENT ; 5/23/07 10:32am
;;4.0;Adverse Reaction Tracking;**2,33**;Mar 29, 1996;Build 5
EN1 ;This is the main entry point for the verifier option.
S GMRAVER=0,GMRADRUG=0
I $P(GMRAPA(0),U,20)'["D" S GMRAFLAG=0 G VERIFY
S GMRAFLAG=1,GMRADRUG=1
I $P(GMRAPA(0),U,6)'="o" G VERIFY
I '$D(GMRASITE) D SITE^GMRAUTL S GMRASITE(0)=$G(^GMRD(120.84,GMRASITE,0))
I $P(^GMRD(120.84,+GMRASITE,0),U,7)'="y" G VERIFY
I $D(^GMR(120.85,"C",GMRAPA)) G VERIFY
W !,"Since this Causative Agent is an observed drug reaction and"
W !,"FDA Data is required you must enter the Observer information"
W !,"prior to verification."
G EXIT
VERIFY ;Verify an agent
W !!,"Currently you have verifier access."
F W !,"Would you like to verify this Causative Agent now" S %=1 D YN^DICN Q:%'=0 W !?4,"ANSWER YES IF YOU WOULD LIKE TO VERIFY THIS DATA, ELSE ANSWER NO."
S:%=-1 GMRAOUT=1 G EXIT:%'=1 S GMRAVFY=1 W @IOF,! D SITE^GMRAUTL,EN2^GMRAPEV0 K GMRAVFY G:GMRAOUT EXIT
I GMRAVER S GMRANAME=$P($G(^DPT(+GMRAPA(0),0)),U),GMRALLER=$P(GMRAPA(0),U,2) K:GMRANAME]""&(GMRALLER]"") ^TMP($J,"GMRADSP",GMRANAME,GMRALLER,GMRAPA) K ^TMP("GMRA",$J)
I 'GMRAVER!GMRAOUT G EXIT
S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0)) Q:GMRAPA(0)=""
I '$P(GMRAPA(0),U,12) S DA=GMRAPA,DIE="^GMR(120.8,",DR="15////1" D ^DIE D ; Execute the event point for this reaction
.Q:'$D(GMRAPA) S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0)) Q:GMRAPA(0)=""
.N OROLD,DFN,GMRACNT S DFN=$P(GMRAPA(0),U)
.D INP^VADPT S X=$O(^ORD(101,"B","GMRA SIGN-OFF ON DATA",0))_";ORD(101," D EN^XQOR:X K VAIN,X
.Q
S GMRAPA(0)=$G(^GMR(120.8,GMRAPA,0)),GMRATYPE=$P(GMRAPA(0),U,20)
S DA=GMRAPA,DIE="^GMR(120.8,",DR="19////1;20///N;21////"_DUZ D ^DIE D:'GMRAVER EN1^GMRAVAB S GMRAPA(0)=$S($D(^GMR(120.8,GMRAPA,0)):^(0),1:"")
I $G(GMRANEW) D ;send NOTIFICATION bulletin if this is new -- GMRA*4*33
. I $P(GMRAPA(0),U,6)="o",GMRATYPE["D" D PTBUL^GMRAROBS
I GMRAVER D EN1^GMRAPET0($P(GMRAPA(0),U),GMRAPA,"V",.GMRAOUT) I GMRAOUT S GMRAOUT=0
Q1 D UNLOCK^GMRAUTL(120.8,GMRAPA)
EXIT K GMRAFLAG,DA,DIE,DR,GMRADRUG Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRAVFY 2104 printed Oct 16, 2024@17:41:35 Page 2
GMRAVFY ;HIRMFO/WAA,PWC-VERIFY AND SIGN OFF AN AGENT ; 5/23/07 10:32am
+1 ;;4.0;Adverse Reaction Tracking;**2,33**;Mar 29, 1996;Build 5
EN1 ;This is the main entry point for the verifier option.
+1 SET GMRAVER=0
SET GMRADRUG=0
+2 IF $PIECE(GMRAPA(0),U,20)'["D"
SET GMRAFLAG=0
GOTO VERIFY
+3 SET GMRAFLAG=1
SET GMRADRUG=1
+4 IF $PIECE(GMRAPA(0),U,6)'="o"
GOTO VERIFY
+5 IF '$DATA(GMRASITE)
DO SITE^GMRAUTL
SET GMRASITE(0)=$GET(^GMRD(120.84,GMRASITE,0))
+6 IF $PIECE(^GMRD(120.84,+GMRASITE,0),U,7)'="y"
GOTO VERIFY
+7 IF $DATA(^GMR(120.85,"C",GMRAPA))
GOTO VERIFY
+8 WRITE !,"Since this Causative Agent is an observed drug reaction and"
+9 WRITE !,"FDA Data is required you must enter the Observer information"
+10 WRITE !,"prior to verification."
+11 GOTO EXIT
VERIFY ;Verify an agent
+1 WRITE !!,"Currently you have verifier access."
+2 FOR
WRITE !,"Would you like to verify this Causative Agent now"
SET %=1
DO YN^DICN
if %'=0
QUIT
WRITE !?4,"ANSWER YES IF YOU WOULD LIKE TO VERIFY THIS DATA, ELSE ANSWER NO."
+3 if %=-1
SET GMRAOUT=1
if %'=1
GOTO EXIT
SET GMRAVFY=1
WRITE @IOF,!
DO SITE^GMRAUTL
DO EN2^GMRAPEV0
KILL GMRAVFY
if GMRAOUT
GOTO EXIT
+4 IF GMRAVER
SET GMRANAME=$PIECE($GET(^DPT(+GMRAPA(0),0)),U)
SET GMRALLER=$PIECE(GMRAPA(0),U,2)
if GMRANAME]""&(GMRALLER]"")
KILL ^TMP($JOB,"GMRADSP",GMRANAME,GMRALLER,GMRAPA)
KILL ^TMP("GMRA",$JOB)
+5 IF 'GMRAVER!GMRAOUT
GOTO EXIT
+6 SET GMRAPA(0)=$GET(^GMR(120.8,GMRAPA,0))
if GMRAPA(0)=""
QUIT
+7 ; Execute the event point for this reaction
IF '$PIECE(GMRAPA(0),U,12)
SET DA=GMRAPA
SET DIE="^GMR(120.8,"
SET DR="15////1"
DO ^DIE
Begin DoDot:1
+8 if '$DATA(GMRAPA)
QUIT
SET GMRAPA(0)=$GET(^GMR(120.8,GMRAPA,0))
if GMRAPA(0)=""
QUIT
+9 NEW OROLD,DFN,GMRACNT
SET DFN=$PIECE(GMRAPA(0),U)
+10 DO INP^VADPT
SET X=$ORDER(^ORD(101,"B","GMRA SIGN-OFF ON DATA",0))_";ORD(101,"
if X
DO EN^XQOR
KILL VAIN,X
+11 QUIT
End DoDot:1
+12 SET GMRAPA(0)=$GET(^GMR(120.8,GMRAPA,0))
SET GMRATYPE=$PIECE(GMRAPA(0),U,20)
+13 SET DA=GMRAPA
SET DIE="^GMR(120.8,"
SET DR="19////1;20///N;21////"_DUZ
DO ^DIE
if 'GMRAVER
DO EN1^GMRAVAB
SET GMRAPA(0)=$SELECT($DATA(^GMR(120.8,GMRAPA,0)):^(0),1:"")
+14 ;send NOTIFICATION bulletin if this is new -- GMRA*4*33
IF $GET(GMRANEW)
Begin DoDot:1
+15 IF $PIECE(GMRAPA(0),U,6)="o"
IF GMRATYPE["D"
DO PTBUL^GMRAROBS
End DoDot:1
+16 IF GMRAVER
DO EN1^GMRAPET0($PIECE(GMRAPA(0),U),GMRAPA,"V",.GMRAOUT)
IF GMRAOUT
SET GMRAOUT=0
Q1 DO UNLOCK^GMRAUTL(120.8,GMRAPA)
EXIT KILL GMRAFLAG,DA,DIE,DR,GMRADRUG
QUIT