GMRAXENV ;HIRMFO/RM-ENVIRONMENT CHECK ROUTINE ; 12/6/95
;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
I '$G(DUZ)!'$D(DUZ(0)) D S XPDQUIT=2 Q
. W !?5,"DUZ and DUZ(0) must be defined as an active user to initialize"
. W !?5,"the ADVERSE REACTION TRACKING v",$P($T(+2),";",3)," software."
. W $C(7)
. Q
I DUZ(0)'="@" D S XPDQUIT=2 Q
. W !?5,"You must have programmer access, i.e., DUZ(0)=@ to continue."
. W $C(7)
. Q
I +$$VERSION^XPDUTL("GMRP")>0,$T(PN^GMRPART)']"" D
. W !?5,"You have the Progress Notes package installed, but you are"
. W !?5,"missing the GMRPART routine. Please make certain that"
. W !?5,"GMRP*2.5*32 is installed."
. Q
I +$$VERSION^XPDUTL("DG")<5.3 D S XPDQUIT=2 Q
. W !?5,"You need MAS/PIMS v5.3 or greater to install ADVERSE REACTION"
. W !?5,"TRACKING v",$P($T(+2),";",3),$C(7)
. Q
I +$$VERSION^XPDUTL("PSN")<2 D S XPDQUIT=2 Q
. W !?5,"You need NATIONAL DRUG FILE v2.0 or greater to install ADVERSE"
. W !?5,"REACTION TRACKING v",$P($T(+2),";",3),$C(7)
. Q
N GMRAVER S GMRAVER=+$$VERSION^XPDUTL("GMRA")
I 'GMRAVER,$D(^GMRD(120.84)) D S XPDQUIT=2 Q
. W !?5,"Bad entry in VERSION node of Package file, call your IRM"
. W !?5,"Field Office for assistance."
. Q
Q:'GMRAVER ; quit if this is a virgin install
I GMRAVER<3 D Q:$G(XPDQUIT)=2
. Q:$T(GMRARAD1^GMRARAD1)]""
. W !?5,"You must have installed ALLERGY TRACKING SYSTEM v3.0 prior to"
. W !?5,"installing ADVERSE REACTION TRACKING v",$P($T(+2),";",3),$C(7)
. S XPDQUIT=2
. Q
I $T(GMRARAD1^GMRARAD1)']"" D S XPDQUIT=2 Q
. W !?5,"You must install patch GMRA*3*13 prior to installing"
. W !?5,"ADVERSE REACTION TRACKING v",$P($T(+2),";",3),$C(7)
. Q
D FIND^DIC(9.4,,,"X","GMRA",,"C",,,"GMRAIEN","GMRAERR")
I +$G(GMRAERR("DIERR")) D S XPDQUIT=2 Q
. W !?5,"Error trying to find ADVERSE REACTION TRACKING Package file"
. W !?5,"entry, notify your IRM Field Office.",$C(7)
. Q
S (DA,SEQ)=0 F S SEQ=$O(GMRAIEN("DILIST",1,SEQ)) Q:SEQ'>0 D Q:DA<0
. S NAME=$G(GMRAIEN("DILIST",1,SEQ)) Q:NAME=""
. I NAME="ADVERSE REACTION TRACKING" S DA=-1 Q
. I NAME="GEN. MED. REC. - ALLERGIES" S DA=$G(GMRAIEN("DILIST",2,SEQ)) Q
. I 'DA S DA=$G(GMRAIEN("DILIST",2,SEQ))
. Q
I DA>0 D
.S GMRAHLD=DA
.S DIE="^DIC(9.4,"
.S DR=".01////ADVERSE REACTION TRACKING"
.S DR=DR_";2///Adverse Reaction Tracking package"
.D ^DIE K DA,DIE,DR
.S DIE="^DIC(9.4,"
.S DA=GMRAHLD
.S DR="3///This package permits clinical users to track and report patient allergies and adverse reactions. The intended users are physicians, nurses, other clinicians and clerks."
.D ^DIE K DA,DIE,DR
.Q
K GMRAIEN,GMRAERR,NAME,SEQ
Q:'$D(GMRAHLD)
D FIND^DIC(9.4,,,"X","GMRA",,"C",,,"GMRAIEN","GMRAERR")
I +$G(GMRAERR("DIERR")) K GMRAIEN,GMRAERR Q
S (DA,SEQ)=0
F S SEQ=$O(GMRAIEN("DILIST",1,SEQ)) Q:SEQ'>0 D
. S NAME=$G(GMRAIEN("DILIST",1,SEQ)) Q:NAME=""
. I NAME="ADVERSE REACTION TRACKING" Q
. S DA=$G(GMRAIEN("DILIST",2,SEQ))
. I DA S DIK="^DIC(9.4," D ^DIK
. Q
K DA,DIK,GMRAERR,GMRAIEN,GMRAHLD,NAME,SEQ
Q
GMRAXENV ;HIRMFO/RM-ENVIRONMENT CHECK ROUTINE ; 12/6/95
+1 ;;4.0;Adverse Reaction Tracking;;Mar 29, 1996
+2 IF '$GET(DUZ)!'$DATA(DUZ(0))
Begin DoDot:1
+3 WRITE !?5,"DUZ and DUZ(0) must be defined as an active user to initialize"
+4 WRITE !?5,"the ADVERSE REACTION TRACKING v",$PIECE($TEXT(+2),";",3)," software."
+5 WRITE $CHAR(7)
+6 QUIT
End DoDot:1
SET XPDQUIT=2
QUIT
+7 IF DUZ(0)'="@"
Begin DoDot:1
+8 WRITE !?5,"You must have programmer access, i.e., DUZ(0)=@ to continue."
+9 WRITE $CHAR(7)
+10 QUIT
End DoDot:1
SET XPDQUIT=2
QUIT
+11 IF +$$VERSION^XPDUTL("GMRP")>0
IF $TEXT(PN^GMRPART)']""
Begin DoDot:1
+12 WRITE !?5,"You have the Progress Notes package installed, but you are"
+13 WRITE !?5,"missing the GMRPART routine. Please make certain that"
+14 WRITE !?5,"GMRP*2.5*32 is installed."
+15 QUIT
End DoDot:1
+16 IF +$$VERSION^XPDUTL("DG")<5.3
Begin DoDot:1
+17 WRITE !?5,"You need MAS/PIMS v5.3 or greater to install ADVERSE REACTION"
+18 WRITE !?5,"TRACKING v",$PIECE($TEXT(+2),";",3),$CHAR(7)
+19 QUIT
End DoDot:1
SET XPDQUIT=2
QUIT
+20 IF +$$VERSION^XPDUTL("PSN")<2
Begin DoDot:1
+21 WRITE !?5,"You need NATIONAL DRUG FILE v2.0 or greater to install ADVERSE"
+22 WRITE !?5,"REACTION TRACKING v",$PIECE($TEXT(+2),";",3),$CHAR(7)
+23 QUIT
End DoDot:1
SET XPDQUIT=2
QUIT
+24 NEW GMRAVER
SET GMRAVER=+$$VERSION^XPDUTL("GMRA")
+25 IF 'GMRAVER
IF $DATA(^GMRD(120.84))
Begin DoDot:1
+26 WRITE !?5,"Bad entry in VERSION node of Package file, call your IRM"
+27 WRITE !?5,"Field Office for assistance."
+28 QUIT
End DoDot:1
SET XPDQUIT=2
QUIT
+29 ; quit if this is a virgin install
IF 'GMRAVER
QUIT
+30 IF GMRAVER<3
Begin DoDot:1
+31 IF $TEXT(GMRARAD1^GMRARAD1)]""
QUIT
+32 WRITE !?5,"You must have installed ALLERGY TRACKING SYSTEM v3.0 prior to"
+33 WRITE !?5,"installing ADVERSE REACTION TRACKING v",$PIECE($TEXT(+2),";",3),$CHAR(7)
+34 SET XPDQUIT=2
+35 QUIT
End DoDot:1
IF $GET(XPDQUIT)=2
QUIT
+36 IF $TEXT(GMRARAD1^GMRARAD1)']""
Begin DoDot:1
+37 WRITE !?5,"You must install patch GMRA*3*13 prior to installing"
+38 WRITE !?5,"ADVERSE REACTION TRACKING v",$PIECE($TEXT(+2),";",3),$CHAR(7)
+39 QUIT
End DoDot:1
SET XPDQUIT=2
QUIT
+40 DO FIND^DIC(9.4,,,"X","GMRA",,"C",,,"GMRAIEN","GMRAERR")
+41 IF +$GET(GMRAERR("DIERR"))
Begin DoDot:1
+42 WRITE !?5,"Error trying to find ADVERSE REACTION TRACKING Package file"
+43 WRITE !?5,"entry, notify your IRM Field Office.",$CHAR(7)
+44 QUIT
End DoDot:1
SET XPDQUIT=2
QUIT
+45 SET (DA,SEQ)=0
FOR
SET SEQ=$ORDER(GMRAIEN("DILIST",1,SEQ))
IF SEQ'>0
QUIT
Begin DoDot:1
+46 SET NAME=$GET(GMRAIEN("DILIST",1,SEQ))
IF NAME=""
QUIT
+47 IF NAME="ADVERSE REACTION TRACKING"
SET DA=-1
QUIT
+48 IF NAME="GEN. MED. REC. - ALLERGIES"
SET DA=$GET(GMRAIEN("DILIST",2,SEQ))
QUIT
+49 IF 'DA
SET DA=$GET(GMRAIEN("DILIST",2,SEQ))
+50 QUIT
End DoDot:1
IF DA<0
QUIT
+51 IF DA>0
Begin DoDot:1
+52 SET GMRAHLD=DA
+53 SET DIE="^DIC(9.4,"
+54 SET DR=".01////ADVERSE REACTION TRACKING"
+55 SET DR=DR_";2///Adverse Reaction Tracking package"
+56 DO ^DIE
KILL DA,DIE,DR
+57 SET DIE="^DIC(9.4,"
+58 SET DA=GMRAHLD
+59 SET DR="3///This package permits clinical users to track and report patient allergies and adverse reactions. The intended users are physicians, nurses, other clinicians and clerks."
+60 DO ^DIE
KILL DA,DIE,DR
+61 QUIT
End DoDot:1
+62 KILL GMRAIEN,GMRAERR,NAME,SEQ
+63 IF '$DATA(GMRAHLD)
QUIT
+64 DO FIND^DIC(9.4,,,"X","GMRA",,"C",,,"GMRAIEN","GMRAERR")
+65 IF +$GET(GMRAERR("DIERR"))
KILL GMRAIEN,GMRAERR
QUIT
+66 SET (DA,SEQ)=0
+67 FOR
SET SEQ=$ORDER(GMRAIEN("DILIST",1,SEQ))
IF SEQ'>0
QUIT
Begin DoDot:1
+68 SET NAME=$GET(GMRAIEN("DILIST",1,SEQ))
IF NAME=""
QUIT
+69 IF NAME="ADVERSE REACTION TRACKING"
QUIT
+70 SET DA=$GET(GMRAIEN("DILIST",2,SEQ))
+71 IF DA
SET DIK="^DIC(9.4,"
DO ^DIK
+72 QUIT
End DoDot:1
+73 KILL DA,DIK,GMRAERR,GMRAIEN,GMRAHLD,NAME,SEQ
+74 QUIT