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

BCCD1E00.m

Go to the documentation of this file.
  1. BCCD1E00 ;GDIT/HS/GCD-Pre-Install Environment Check; 18 Apr 2013 12:51 PM
  1. ;;1.0;CCDA;;Feb 21, 2014
  1. ;
  1. ; Run pre-install checks
  1. N VERSION,EXEC,ROLES,OK,BMWDT,BMWRV
  1. ;
  1. ; Verify that BMW classes exist and we have the correct version.
  1. S BMWRV="01/02/2014" ; Required version
  1. S BMWDT=$G(^BMW("fm2class","GenDate"))
  1. I BMWDT="" D BMES^XPDUTL("Cannot retrieve BMW version") S XPDQUIT=2 I 1
  1. E I '$$DTCMP(BMWDT,BMWRV) D BMES^XPDUTL("BMW version "_BMWRV_" or higher required. Current version: "_BMWDT) S XPDQUIT=2
  1. ;
  1. ; Add code to check for Ensemble version greater or equal to 2012
  1. S VERSION=$$VERSION^%ZOSV
  1. I VERSION<2012.2 D BMES^XPDUTL("Ensemble 2012.2 or later is required!") S XPDQUIT=2
  1. ;
  1. ; Check for EHR 1.1 patch 13 by checking for one of its constituent patches
  1. I '$$PATCH^XPDUTL("BEHO*1.1*001010") D BMES^XPDUTL("EHR patch 13 is required.") S XPDQUIT=2
  1. ;
  1. ; Check for C32 1.0 patch 4 iff C32 is installed
  1. I $$VERSION^XPDUTL("BJMD")="1.0",'$$PATCH^XPDUTL("BJMD*1.0*4") D BMES^XPDUTL("C32 patch 4 is required.") S XPDQUIT=2
  1. ;
  1. ; Verify that installer has proper roles
  1. S EXEC="S ROLES=$roles" X EXEC
  1. S ROLES=","_ROLES_",",U="^"
  1. I ROLES'[",%All," D BMES^XPDUTL("Your Ensemble account MUST have ""%All"" role to proceed") S XPDQUIT=2
  1. ;
  1. ; Verify the presence of the following two packages
  1. I '$D(^DD(52.0113)) D BMES^XPDUTL("The package that added Medication Instructions to Prescriptions") D BMES^XPDUTL("file is not installed") S XPDQUIT=2
  1. I '$D(^DD(50,9999999.145)) D BMES^XPDUTL("The package that added DISPENSE UNIT NCPDP CODE field to Drug") D BMES^XPDUTL("file is not installed") S XPDQUIT=2
  1. ;
  1. ; Verify that installation has Long Strings enabled
  1. S EXEC="S OK=($SYSTEM.SYS.MaxLocalLength()>3600000)" X EXEC
  1. I 'OK D BMES^XPDUTL("Long Strings are not enabled. Ensemble is not configured correctly.") S XPDQUIT=2
  1. ;
  1. Q ;
  1. Q
  1. ;
  1. ; Compare two dates in MM/DD/YYYY format. Return 1 if DT1 is equal to or later than DT2.
  1. ; The second space piece (i.e., the time) for each date is ignored.
  1. DTCMP(DT1,DT2) ;
  1. I $G(DT1)=""!($G(DT2)="") Q ""
  1. N DATE1,DATE2
  1. S DATE1=$P(DT1," "),DATE2=$P(DT2," ")
  1. ; Parse dates
  1. S DATE1("Y")=$P(DATE1,"/",3),DATE1("M")=$P(DATE1,"/"),DATE1("D")=$P(DATE1,"/",2)
  1. S DATE2("Y")=$P(DATE2,"/",3),DATE2("M")=$P(DATE2,"/"),DATE2("D")=$P(DATE2,"/",2)
  1. ; Compare years
  1. I DATE1("Y")<DATE2("Y") Q 0
  1. I DATE1("Y")>DATE2("Y") Q 1
  1. ; Years are equal, so compare months
  1. I DATE1("M")<DATE2("M") Q 0
  1. I DATE1("M")>DATE2("M") Q 1
  1. ; Years and months are equal, so compare days
  1. I DATE1("D")<DATE2("D") Q 0
  1. Q 1