Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORCENV

ORCENV.m

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