ORCENV ;SLC/MLI - Environment check routine ; 18 March 97
;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
;
; This is an environment check routine to check for
; existence of all packages and patches required by
; CPRS.
;
EN ; check environment
N ABORT,Y
S ABORT=0
S Y=$$VARIABLE() I Y S ABORT=1 G ENQ
S Y=$$CMOPCHK() I Y S ABORT=1
S Y=$$PATCHCHK() I Y S ABORT=1 G ENQ
ENQ I ABORT S XPDABORT=2 ; aborts all transport globals in distribution
Q
;
;
VARIABLE() ; check for crucial variables
N ABORT,I
D BMES^XPDUTL("Checking for key variables...")
S ABORT=0
F I="DUZ","DT","DTIME" I '($D(@I)#10) D
. S ABORT=1
. D MES^XPDUTL(" Missing key variable "_I)
I $G(DUZ(0))'="@" D
. S ABORT=1
. D MES^XPDUTL(" DUZ(0) must equal @ to install")
I ABORT D MES^XPDUTL(" These variables must be set before installing.")
I 'ABORT D MES^XPDUTL(" Key variables are defined properly.")
Q ABORT
;
;
PATCHCHK() ; check for packages and patches
N ABORT,CURRENT,I,J,NMSP,OPTIONAL,PACKAGE,PATCH,VERSION,VIRGIN,X
S ABORT=0
D BMES^XPDUTL("Checking status of packages and patches...")
F I=1:1 S X=$P($T(LIST+I),";;",2) Q:X="QUIT" D
. N PATCHES,OK
. S OK=1,PACKAGE=$P(X,"^",1),NMSP=$P(X,"^",2)
. S VERSION=$P($P(X,"^",3),"*",1)
. S VIRGIN=($P(X,"^",2)["*"),OPTIONAL=(X["OPTIONAL")
. S PATCHES=$$NUMBERS($P(X,"^",4))
. D BMES^XPDUTL(" Checking "_PACKAGE_" v"_VERSION_"...")
. I VIRGIN,(+$$VERSION^XPDUTL(NMSP)=0) D Q
. . D MES^XPDUTL(" "_PACKAGE_" will be installed.")
. S CURRENT=+$$VERSION^XPDUTL(NMSP)
. I CURRENT<VERSION D Q
. . I 'CURRENT,OPTIONAL D Q
. . . D MES^XPDUTL(" optional "_PACKAGE_" is not on system...ok")
. . S ABORT=1
. . D MES^XPDUTL(" "_PACKAGE_" is not up to version "_VERSION)
. I CURRENT>VERSION D Q
. . D MES^XPDUTL(" "_PACKAGE_" is up to version "_CURRENT_"...OK")
. I PATCHES D Q
. . F J=1:1 S X=$P(PATCHES,",",J) Q:X="" D
. . . S PATCH=NMSP_"*"_VERSION_"*"_X
. . . I $$PATCH^XPDUTL(PATCH) Q
. . . S ABORT=1,OK=0
. . . D MES^XPDUTL(" Patch "_PATCH_" has not been installed")
. . I OK D MES^XPDUTL(" "_PACKAGE_" v"_VERSION_" is up to date")
. D MES^XPDUTL(" "_PACKAGE_" v"_VERSION_" is up to date")
Q ABORT
;
;
LIST ; list of packages and patches to check
;;Adverse Reaction Tracking^GMRA^4.0^4,6
;;Consult/Request Tracking^GMRC^2.5*^14
;;CMOP^PSX^2.0*^3^^^^OPTIONAL
;;Dietetics^FH^5.0^
;;Vitals^GMRV^3.0^3-5
;;Health Level Seven^HL^1.6^8-9,17-18,21
;;Health Summary^GMTS^2.7^3,7-9,12-13
;;Kernel^XU^8.0^49,59
;;Laboratory^LR^5.2^121^
;;OE/RR^OR^2.5*^46,49
;;Patient Care Encounter^PX^1.0^1-5,7-9,15
;;Outpatient Pharmacy^PSO^6*
;;Inpatient Pharmacy^PSJ^4.5*^42
;;Radiology^RA^4.5^3-6,8-11
;;Registration^DG^5.3^57,73,77-80,82,84-85,87-90,92-101,103-105,107,109-112,121,124
;;Scheduling (including PCMM)^SD^5.3^27,39,41,42,44-49,53-61,63-65,67-75,78,79,84-88,93
;;RPC Broker^XWB^1.1
;;Text Integration Utility^TIU^1.0^1,3,4,7
;;VA FileMan^DI^21.0^8,12,15,18-20,24-25,27,31,33,36
;;Visit Tracking^VSIT^2.0^1
;;QUIT
;
;
NUMBERS(STRING) ; get list of numbers from string by parsing
N I,J,LIST,X
S LIST=""
F I=1:1 S X=$P(STRING,",",I) Q:X="" D
. I X["-" F J=$P(X,"-",1):1:$P(X,"-",2) S LIST=LIST_J_","
. E S LIST=LIST_X_","
Q LIST
;
;
CMOPCHK() ; check to see if CMOP processing is inactivated
N Y
S Y=$D(^PSX(550,"C"))
D BMES^XPDUTL("Checking for active CMOP transmissions...")
I Y D
. D MES^XPDUTL(" CMOP Currently Activated!!!")
. D MES^XPDUTL(" You must inactivate CMOP before installing CPRS!")
E D
. D MES^XPDUTL(" CMOP is inactivated...ok to continue")
Q Y
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORCENV 3725 printed Nov 22, 2024@17:38:16 Page 2
ORCENV ;SLC/MLI - Environment check routine ; 18 March 97
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
+2 ;
+3 ; This is an environment check routine to check for
+4 ; existence of all packages and patches required by
+5 ; CPRS.
+6 ;
EN ; check environment
+1 NEW ABORT,Y
+2 SET ABORT=0
+3 SET Y=$$VARIABLE()
IF Y
SET ABORT=1
GOTO ENQ
+4 SET Y=$$CMOPCHK()
IF Y
SET ABORT=1
+5 SET Y=$$PATCHCHK()
IF Y
SET ABORT=1
GOTO ENQ
ENQ ; aborts all transport globals in distribution
IF ABORT
SET XPDABORT=2
+1 QUIT
+2 ;
+3 ;
VARIABLE() ; check for crucial variables
+1 NEW ABORT,I
+2 DO BMES^XPDUTL("Checking for key variables...")
+3 SET ABORT=0
+4 FOR I="DUZ","DT","DTIME"
IF '($DATA(@I)#10)
Begin DoDot:1
+5 SET ABORT=1
+6 DO MES^XPDUTL(" Missing key variable "_I)
End DoDot:1
+7 IF $GET(DUZ(0))'="@"
Begin DoDot:1
+8 SET ABORT=1
+9 DO MES^XPDUTL(" DUZ(0) must equal @ to install")
End DoDot:1
+10 IF ABORT
DO MES^XPDUTL(" These variables must be set before installing.")
+11 IF 'ABORT
DO MES^XPDUTL(" Key variables are defined properly.")
+12 QUIT ABORT
+13 ;
+14 ;
PATCHCHK() ; check for packages and patches
+1 NEW ABORT,CURRENT,I,J,NMSP,OPTIONAL,PACKAGE,PATCH,VERSION,VIRGIN,X
+2 SET ABORT=0
+3 DO BMES^XPDUTL("Checking status of packages and patches...")
+4 FOR I=1:1
SET X=$PIECE($TEXT(LIST+I),";;",2)
if X="QUIT"
QUIT
Begin DoDot:1
+5 NEW PATCHES,OK
+6 SET OK=1
SET PACKAGE=$PIECE(X,"^",1)
SET NMSP=$PIECE(X,"^",2)
+7 SET VERSION=$PIECE($PIECE(X,"^",3),"*",1)
+8 SET VIRGIN=($PIECE(X,"^",2)["*")
SET OPTIONAL=(X["OPTIONAL")
+9 SET PATCHES=$$NUMBERS($PIECE(X,"^",4))
+10 DO BMES^XPDUTL(" Checking "_PACKAGE_" v"_VERSION_"...")
+11 IF VIRGIN
IF (+$$VERSION^XPDUTL(NMSP)=0)
Begin DoDot:2
+12 DO MES^XPDUTL(" "_PACKAGE_" will be installed.")
End DoDot:2
QUIT
+13 SET CURRENT=+$$VERSION^XPDUTL(NMSP)
+14 IF CURRENT<VERSION
Begin DoDot:2
+15 IF 'CURRENT
IF OPTIONAL
Begin DoDot:3
+16 DO MES^XPDUTL(" optional "_PACKAGE_" is not on system...ok")
End DoDot:3
QUIT
+17 SET ABORT=1
+18 DO MES^XPDUTL(" "_PACKAGE_" is not up to version "_VERSION)
End DoDot:2
QUIT
+19 IF CURRENT>VERSION
Begin DoDot:2
+20 DO MES^XPDUTL(" "_PACKAGE_" is up to version "_CURRENT_"...OK")
End DoDot:2
QUIT
+21 IF PATCHES
Begin DoDot:2
+22 FOR J=1:1
SET X=$PIECE(PATCHES,",",J)
if X=""
QUIT
Begin DoDot:3
+23 SET PATCH=NMSP_"*"_VERSION_"*"_X
+24 IF $$PATCH^XPDUTL(PATCH)
QUIT
+25 SET ABORT=1
SET OK=0
+26 DO MES^XPDUTL(" Patch "_PATCH_" has not been installed")
End DoDot:3
+27 IF OK
DO MES^XPDUTL(" "_PACKAGE_" v"_VERSION_" is up to date")
End DoDot:2
QUIT
+28 DO MES^XPDUTL(" "_PACKAGE_" v"_VERSION_" is up to date")
End DoDot:1
+29 QUIT ABORT
+30 ;
+31 ;
LIST ; list of packages and patches to check
+1 ;;Adverse Reaction Tracking^GMRA^4.0^4,6
+2 ;;Consult/Request Tracking^GMRC^2.5*^14
+3 ;;CMOP^PSX^2.0*^3^^^^OPTIONAL
+4 ;;Dietetics^FH^5.0^
+5 ;;Vitals^GMRV^3.0^3-5
+6 ;;Health Level Seven^HL^1.6^8-9,17-18,21
+7 ;;Health Summary^GMTS^2.7^3,7-9,12-13
+8 ;;Kernel^XU^8.0^49,59
+9 ;;Laboratory^LR^5.2^121^
+10 ;;OE/RR^OR^2.5*^46,49
+11 ;;Patient Care Encounter^PX^1.0^1-5,7-9,15
+12 ;;Outpatient Pharmacy^PSO^6*
+13 ;;Inpatient Pharmacy^PSJ^4.5*^42
+14 ;;Radiology^RA^4.5^3-6,8-11
+15 ;;Registration^DG^5.3^57,73,77-80,82,84-85,87-90,92-101,103-105,107,109-112,121,124
+16 ;;Scheduling (including PCMM)^SD^5.3^27,39,41,42,44-49,53-61,63-65,67-75,78,79,84-88,93
+17 ;;RPC Broker^XWB^1.1
+18 ;;Text Integration Utility^TIU^1.0^1,3,4,7
+19 ;;VA FileMan^DI^21.0^8,12,15,18-20,24-25,27,31,33,36
+20 ;;Visit Tracking^VSIT^2.0^1
+21 ;;QUIT
+22 ;
+23 ;
NUMBERS(STRING) ; get list of numbers from string by parsing
+1 NEW I,J,LIST,X
+2 SET LIST=""
+3 FOR I=1:1
SET X=$PIECE(STRING,",",I)
if X=""
QUIT
Begin DoDot:1
+4 IF X["-"
FOR J=$PIECE(X,"-",1):1:$PIECE(X,"-",2)
SET LIST=LIST_J_","
+5 IF '$TEST
SET LIST=LIST_X_","
End DoDot:1
+6 QUIT LIST
+7 ;
+8 ;
CMOPCHK() ; check to see if CMOP processing is inactivated
+1 NEW Y
+2 SET Y=$DATA(^PSX(550,"C"))
+3 DO BMES^XPDUTL("Checking for active CMOP transmissions...")
+4 IF Y
Begin DoDot:1
+5 DO MES^XPDUTL(" CMOP Currently Activated!!!")
+6 DO MES^XPDUTL(" You must inactivate CMOP before installing CPRS!")
End DoDot:1
+7 IF '$TEST
Begin DoDot:1
+8 DO MES^XPDUTL(" CMOP is inactivated...ok to continue")
End DoDot:1
+9 QUIT Y