GMRAUIX1 ;HIRMFO/RM-XREF UTILITY FOR "ASGN" AND "AVER" XREFS ; 11/6/91
;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
EN1 ; ENTRY FROM EITHER FIELD .01 (AVER1), 19 (AVER0) OR 22 (AVER2) XREFS
; OF FILE 120.8.
; FOR FURTHER INFO ON THESE XREFS SEE INTERNAL RELATIONS SECTION
; OF THE ALLERGY TRACKING SYSTEM TECHNICAL MANUAL.
S GMRA(0)=$G(^GMR(120.8,DA,0)),GMRA("ER")=$S(+GMRA=22:X,1:+$G(^GMR(120.8,DA,"ER"))),GMRA("VER")=$S(+GMRA=19:X,1:$P(GMRA(0),"^",16)),GMRA("DFN")=$S(+GMRA=.01:X,1:$P(GMRA(0),"^"))
I $P(GMRA,"^",2),GMRA("DFN") S:'GMRA("ER")&(GMRA("VER")=0) ^GMR(120.8,"AVER",GMRA("DFN"),DA)="" K:GMRA("ER")!(GMRA("VER")'=0) ^GMR(120.8,"AVER",GMRA("DFN"),DA)
I '$P(GMRA,"^",2),GMRA("DFN") S:+GMRA=22&(GMRA("VER")=0) ^GMR(120.8,"AVER",GMRA("DFN"),DA)="" K:+GMRA'=22!(GMRA("VER")'=0) ^GMR(120.8,"AVER",GMRA("DFN"),DA)
K GMRA
Q
EN2 ; ENTRY FROM EITHER FIELD 15 (ASGN) OR 22 (ASGN1) XREFS OF FILE 120.8.
; FOR FURTHER INFO ON THESE XREFS SEE INTERNAL RELATIONS SECTION
; OF THE ALLERGY TRACKING SYSTEM TECHNICAL MANUAL.
S GMRA("ER")=$S(+GMRA=22:X,1:+$G(^GMR(120.8,DA,"ER"))),GMRA("SGN")=$S(+GMRA=15:X,1:$P($G(^GMR(120.8,DA,0)),"^",12))
I $P(GMRA,"^",2) S:'GMRA("ER")&(GMRA("SGN")=0) ^GMR(120.8,"ASGN",DA)="" K:GMRA("ER")!(GMRA("SGN")'=0) ^GMR(120.8,"ASGN",DA)
I '$P(GMRA,"^",2) S:+GMRA=22&(GMRA("SGN")=0) ^GMR(120.8,"ASGN",DA)="" K:+GMRA'=22!(GMRA("SGN")'=0) ^GMR(120.8,"ASGN",DA)
K GMRA
Q
GMRAUIX1 ;HIRMFO/RM-XREF UTILITY FOR "ASGN" AND "AVER" XREFS ; 11/6/91
+1 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
EN1 ; ENTRY FROM EITHER FIELD .01 (AVER1), 19 (AVER0) OR 22 (AVER2) XREFS
+1 ; OF FILE 120.8.
+2 ; FOR FURTHER INFO ON THESE XREFS SEE INTERNAL RELATIONS SECTION
+3 ; OF THE ALLERGY TRACKING SYSTEM TECHNICAL MANUAL.
+4 SET GMRA(0)=$GET(^GMR(120.8,DA,0))
SET GMRA("ER")=$SELECT(+GMRA=22:X,1:+$GET(^GMR(120.8,DA,"ER")))
SET GMRA("VER")=$SELECT(+GMRA=19:X,1:$PIECE(GMRA(0),"^",16))
SET GMRA("DFN")=$SELECT(+GMRA=.01:X,1:$PIECE(GMRA(0),"^"))
+5 IF $PIECE(GMRA,"^",2)
IF GMRA("DFN")
IF 'GMRA("ER")&(GMRA("VER")=0)
SET ^GMR(120.8,"AVER",GMRA("DFN"),DA)=""
IF GMRA("ER")!(GMRA("VER")'=0)
KILL ^GMR(120.8,"AVER",GMRA("DFN"),DA)
+6 IF '$PIECE(GMRA,"^",2)
IF GMRA("DFN")
IF +GMRA=22&(GMRA("VER")=0)
SET ^GMR(120.8,"AVER",GMRA("DFN"),DA)=""
IF +GMRA'=22!(GMRA("VER")'=0)
KILL ^GMR(120.8,"AVER",GMRA("DFN"),DA)
+7 KILL GMRA
+8 QUIT
EN2 ; ENTRY FROM EITHER FIELD 15 (ASGN) OR 22 (ASGN1) XREFS OF FILE 120.8.
+1 ; FOR FURTHER INFO ON THESE XREFS SEE INTERNAL RELATIONS SECTION
+2 ; OF THE ALLERGY TRACKING SYSTEM TECHNICAL MANUAL.
+3 SET GMRA("ER")=$SELECT(+GMRA=22:X,1:+$GET(^GMR(120.8,DA,"ER")))
SET GMRA("SGN")=$SELECT(+GMRA=15:X,1:$PIECE($GET(^GMR(120.8,DA,0)),"^",12))
+4 IF $PIECE(GMRA,"^",2)
IF 'GMRA("ER")&(GMRA("SGN")=0)
SET ^GMR(120.8,"ASGN",DA)=""
IF GMRA("ER")!(GMRA("SGN")'=0)
KILL ^GMR(120.8,"ASGN",DA)
+5 IF '$PIECE(GMRA,"^",2)
IF +GMRA=22&(GMRA("SGN")=0)
SET ^GMR(120.8,"ASGN",DA)=""
IF +GMRA'=22!(GMRA("SGN")'=0)
KILL ^GMR(120.8,"ASGN",DA)
+6 KILL GMRA
+7 QUIT