GMRVXENV ;HIRMFO/RM-ENVIRONMENT CHECK FOR VITALS ;7/18/96
;;4.0;Vitals/Measurements;;Apr 25, 1997
EN1 ; environment check for the vitals package
N GMRV
S GMRV=+$$VERSION^XPDUTL("REGISTRATION") I GMRV<5.3 W !!,"PIMS (MAS) V5.3 OR GREATER IS REQUIRED - INSTALL ABORTED!" S XPDABORT=2 Q
S GMRV=+$$VERSION^XPDUTL("GMRV") I GMRV>0,GMRV<3 W !!,"GEN. MED. REC. - VITALS V3.0 is required",!,"prior to the installation of V4.0 - INSTALL ABORTED!" S XPDABORT=2 Q
I GMRV=3,+$$PATCH^XPDUTL("GMRV*3.0*3")=0 W !!,"GMRV*3*3 is required prior to the installation of v4.0 - Install aborted!" S XPDABORT=2 Q
;
Q:+$$VERSION^XPDUTL("GMRV")'>0 ;quit if virgin install
K GMRVIEN,GMRVERR
; how many V/M entries in Package File (#9.4)
D FIND^DIC(9.4,"","","X","GMRV","","C","","","GMRVIEN","GMRVERR")
; quit if FileMan lookup errors out
I +$G(GMRVERR("DIERR")) D S GMRVSTOP=1 D KILL Q
.K GMRVMSG
.S GMRVMSG(1)="Error trying to lookup Vitals/Measurements in the PACKAGE (#9.4) file."
.S GMRVMSG(2)="Halting."
.D BMES^XPDUTL(.GMRVMSG)
.Q
; delete duplicates
; keep GEN. MED. REC. - VITALS entry
S GMRVSEQ=0
F S GMRVSEQ=$O(GMRVIEN("DILIST",1,GMRVSEQ)) Q:GMRVSEQ'>0 D
. S GMRVNAME=$G(GMRVIEN("DILIST",1,GMRVSEQ)) Q:GMRVNAME=""
. I GMRVNAME="GEN. MED. REC. - VITALS" Q
. S DA=$G(GMRVIEN("DILIST",2,GMRVSEQ))
. I DA S DIK="^DIC(9.4," D ^DIK
. Q
KILL ;
S:$G(GMRVSTOP) XPDABORT=2 ;don't install transport global/leave in ^XTMP
K DA,DIK,GMRVERR,GMRVIEN,GMRVMSG,GMRVNAME,GMRVSEQ,X,Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVXENV 1516 printed Dec 13, 2024@01:57:58 Page 2
GMRVXENV ;HIRMFO/RM-ENVIRONMENT CHECK FOR VITALS ;7/18/96
+1 ;;4.0;Vitals/Measurements;;Apr 25, 1997
EN1 ; environment check for the vitals package
+1 NEW GMRV
+2 SET GMRV=+$$VERSION^XPDUTL("REGISTRATION")
IF GMRV<5.3
WRITE !!,"PIMS (MAS) V5.3 OR GREATER IS REQUIRED - INSTALL ABORTED!"
SET XPDABORT=2
QUIT
+3 SET GMRV=+$$VERSION^XPDUTL("GMRV")
IF GMRV>0
IF GMRV<3
WRITE !!,"GEN. MED. REC. - VITALS V3.0 is required",!,"prior to the installation of V4.0 - INSTALL ABORTED!"
SET XPDABORT=2
QUIT
+4 IF GMRV=3
IF +$$PATCH^XPDUTL("GMRV*3.0*3")=0
WRITE !!,"GMRV*3*3 is required prior to the installation of v4.0 - Install aborted!"
SET XPDABORT=2
QUIT
+5 ;
+6 ;quit if virgin install
if +$$VERSION^XPDUTL("GMRV")'>0
QUIT
+7 KILL GMRVIEN,GMRVERR
+8 ; how many V/M entries in Package File (#9.4)
+9 DO FIND^DIC(9.4,"","","X","GMRV","","C","","","GMRVIEN","GMRVERR")
+10 ; quit if FileMan lookup errors out
+11 IF +$GET(GMRVERR("DIERR"))
Begin DoDot:1
+12 KILL GMRVMSG
+13 SET GMRVMSG(1)="Error trying to lookup Vitals/Measurements in the PACKAGE (#9.4) file."
+14 SET GMRVMSG(2)="Halting."
+15 DO BMES^XPDUTL(.GMRVMSG)
+16 QUIT
End DoDot:1
SET GMRVSTOP=1
DO KILL
QUIT
+17 ; delete duplicates
+18 ; keep GEN. MED. REC. - VITALS entry
+19 SET GMRVSEQ=0
+20 FOR
SET GMRVSEQ=$ORDER(GMRVIEN("DILIST",1,GMRVSEQ))
if GMRVSEQ'>0
QUIT
Begin DoDot:1
+21 SET GMRVNAME=$GET(GMRVIEN("DILIST",1,GMRVSEQ))
if GMRVNAME=""
QUIT
+22 IF GMRVNAME="GEN. MED. REC. - VITALS"
QUIT
+23 SET DA=$GET(GMRVIEN("DILIST",2,GMRVSEQ))
+24 IF DA
SET DIK="^DIC(9.4,"
DO ^DIK
+25 QUIT
End DoDot:1
KILL ;
+1 ;don't install transport global/leave in ^XTMP
if $GET(GMRVSTOP)
SET XPDABORT=2
+2 KILL DA,DIK,GMRVERR,GMRVIEN,GMRVMSG,GMRVNAME,GMRVSEQ,X,Y
+3 QUIT