VBECENV ;HOIFO/SAE - VBECS ENVIRONMENT CHECKER; 10/1/2005 ; 10/27/05 10:31am
;;2.0;VBEC;;Jun 05, 2015;Build 4
;
; Note: This routine supports data exchange with an FDA registered
; medical device. As such, it may not be changed in any way without
; prior written approval from the medical device manufacturer.
;
; Integration Agreements:
; References to routine XPDUTL supported by IA 10141
;
CHKENV ; Main entry point for environment checker
;Input : All variables set by KIDS
;Output: Variables required by KIDS to denote success or failure
; of environment check (XPDQUIT and XPDABORT)
D HDR ; message to user that environment check is starting
D PACKAGE ; check for existence of required packages
D PATCH ; check for existence of required patches
D ROUTINE ; check for existence of required routines
D FINALMSG ; inform user of success or failure of environment check.
Q
;
HDR D BMES^XPDUTL("Environment Check beginning...")
Q
PACKAGE ; check for existence of required packages for install
Q:$D(XPDABORT)
N LINE,VBPKG,VBVERREQ,VBVER
;
I $P($T(PKTXT+1),";",3)]"" D
. D MES^XPDUTL(" Checking for required packages...")
;
F LINE=1:1:9 D Q:VBPKG']""!$D(XPDABORT)
. S VBPKG=$P($T(PKTXT+LINE),";",3)
. S VBVERREQ=$P($T(PKTXT+LINE),";",4)
. Q:VBPKG']""!(VBVERREQ']"")
. S VBVER=+$$VERSION^XPDUTL(VBPKG)
. I (VBVER=VBVERREQ)!(VBVER>VBVERREQ) D Q
.. D MES^XPDUTL(" You have "_VBPKG_" version "_VBVER_" installed.")
. I (VBVER<VBVERREQ) S XPDABORT=2 D
.. D MES^XPDUTL(" You do not have "_VBPKG_" version "_VBVERREQ_" installed!")
Q
PKTXT ;;Package Name;Version;
;;;;
Q
;
PATCH ; check for existence of required patches for install
Q:$D(XPDABORT)
N LINE,VBPATCH
;
I $P($T(PTXT+1),";",3)]"" D
. D MES^XPDUTL(" Checking for required patches...")
;
F LINE=1:1:9 D Q:VBPATCH']""!$D(XPDABORT)
. S VBPATCH=$P($T(PTXT+LINE),";",3)
. Q:VBPATCH']""
. I $$PATCH^XPDUTL(VBPATCH) D Q
.. D MES^XPDUTL(" You have patch "_VBPATCH_" installed.")
. S XPDABORT=2
. D MES^XPDUTL(" You do not have patch "_VBPATCH_" installed!")
Q
PTXT ;;Patch designation e.g. OR*3.0*215;
;;;
Q
ROUTINE ; check for existence of required routines for install
Q:$D(XPDABORT)
N LINE,VBRTN
;
I $P($T(RTNTXT+1),";",3)]"" D
. D MES^XPDUTL(" Checking for required routines...")
;
F LINE=1:1:9 D Q:VBRTN']""!$D(XPDABORT)
. S VBRTN=$P($T(RTNTXT+LINE),";",3) Q:VBRTN']""
. S X=VBRTN X ^%ZOSF("TEST") I $T D Q
.. D MES^XPDUTL(" You have routine "_VBRTN_" installed.")
. S XPDABORT=2
. D MES^XPDUTL(" You do not have routine "_VBRTN_" installed!")
Q
RTNTXT ;;Routine Name;
;;XOBVSKT;
;;XOBUM;
Q
FINALMSG ;
I '$G(XPDABORT) D
. D MES^XPDUTL("Environment check successful. Installation will proceed.")
I +$G(XPDABORT) D
. D MES^XPDUTL("Required element missing!")
. D MES^XPDUTL("**** Environment check failed. Installation will be aborted. ****")
D MES^XPDUTL("") ; pad one blank line
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVBECENV 3066 printed Nov 22, 2024@17:54:09 Page 2
VBECENV ;HOIFO/SAE - VBECS ENVIRONMENT CHECKER; 10/1/2005 ; 10/27/05 10:31am
+1 ;;2.0;VBEC;;Jun 05, 2015;Build 4
+2 ;
+3 ; Note: This routine supports data exchange with an FDA registered
+4 ; medical device. As such, it may not be changed in any way without
+5 ; prior written approval from the medical device manufacturer.
+6 ;
+7 ; Integration Agreements:
+8 ; References to routine XPDUTL supported by IA 10141
+9 ;
CHKENV ; Main entry point for environment checker
+1 ;Input : All variables set by KIDS
+2 ;Output: Variables required by KIDS to denote success or failure
+3 ; of environment check (XPDQUIT and XPDABORT)
+4 ; message to user that environment check is starting
DO HDR
+5 ; check for existence of required packages
DO PACKAGE
+6 ; check for existence of required patches
DO PATCH
+7 ; check for existence of required routines
DO ROUTINE
+8 ; inform user of success or failure of environment check.
DO FINALMSG
+9 QUIT
+10 ;
HDR DO BMES^XPDUTL("Environment Check beginning...")
+1 QUIT
PACKAGE ; check for existence of required packages for install
+1 if $DATA(XPDABORT)
QUIT
+2 NEW LINE,VBPKG,VBVERREQ,VBVER
+3 ;
+4 IF $PIECE($TEXT(PKTXT+1),";",3)]""
Begin DoDot:1
+5 DO MES^XPDUTL(" Checking for required packages...")
End DoDot:1
+6 ;
+7 FOR LINE=1:1:9
Begin DoDot:1
+8 SET VBPKG=$PIECE($TEXT(PKTXT+LINE),";",3)
+9 SET VBVERREQ=$PIECE($TEXT(PKTXT+LINE),";",4)
+10 if VBPKG']""!(VBVERREQ']"")
QUIT
+11 SET VBVER=+$$VERSION^XPDUTL(VBPKG)
+12 IF (VBVER=VBVERREQ)!(VBVER>VBVERREQ)
Begin DoDot:2
+13 DO MES^XPDUTL(" You have "_VBPKG_" version "_VBVER_" installed.")
End DoDot:2
QUIT
+14 IF (VBVER<VBVERREQ)
SET XPDABORT=2
Begin DoDot:2
+15 DO MES^XPDUTL(" You do not have "_VBPKG_" version "_VBVERREQ_" installed!")
End DoDot:2
End DoDot:1
if VBPKG']""!$DATA(XPDABORT)
QUIT
+16 QUIT
PKTXT ;;Package Name;Version;
+1 ;;;;
+2 QUIT
+3 ;
PATCH ; check for existence of required patches for install
+1 if $DATA(XPDABORT)
QUIT
+2 NEW LINE,VBPATCH
+3 ;
+4 IF $PIECE($TEXT(PTXT+1),";",3)]""
Begin DoDot:1
+5 DO MES^XPDUTL(" Checking for required patches...")
End DoDot:1
+6 ;
+7 FOR LINE=1:1:9
Begin DoDot:1
+8 SET VBPATCH=$PIECE($TEXT(PTXT+LINE),";",3)
+9 if VBPATCH']""
QUIT
+10 IF $$PATCH^XPDUTL(VBPATCH)
Begin DoDot:2
+11 DO MES^XPDUTL(" You have patch "_VBPATCH_" installed.")
End DoDot:2
QUIT
+12 SET XPDABORT=2
+13 DO MES^XPDUTL(" You do not have patch "_VBPATCH_" installed!")
End DoDot:1
if VBPATCH']""!$DATA(XPDABORT)
QUIT
+14 QUIT
PTXT ;;Patch designation e.g. OR*3.0*215;
+1 ;;;
+2 QUIT
ROUTINE ; check for existence of required routines for install
+1 if $DATA(XPDABORT)
QUIT
+2 NEW LINE,VBRTN
+3 ;
+4 IF $PIECE($TEXT(RTNTXT+1),";",3)]""
Begin DoDot:1
+5 DO MES^XPDUTL(" Checking for required routines...")
End DoDot:1
+6 ;
+7 FOR LINE=1:1:9
Begin DoDot:1
+8 SET VBRTN=$PIECE($TEXT(RTNTXT+LINE),";",3)
if VBRTN']""
QUIT
+9 SET X=VBRTN
XECUTE ^%ZOSF("TEST")
IF $TEST
Begin DoDot:2
+10 DO MES^XPDUTL(" You have routine "_VBRTN_" installed.")
End DoDot:2
QUIT
+11 SET XPDABORT=2
+12 DO MES^XPDUTL(" You do not have routine "_VBRTN_" installed!")
End DoDot:1
if VBRTN']""!$DATA(XPDABORT)
QUIT
+13 QUIT
RTNTXT ;;Routine Name;
+1 ;;XOBVSKT;
+2 ;;XOBUM;
+3 QUIT
FINALMSG ;
+1 IF '$GET(XPDABORT)
Begin DoDot:1
+2 DO MES^XPDUTL("Environment check successful. Installation will proceed.")
End DoDot:1
+3 IF +$GET(XPDABORT)
Begin DoDot:1
+4 DO MES^XPDUTL("Required element missing!")
+5 DO MES^XPDUTL("**** Environment check failed. Installation will be aborted. ****")
End DoDot:1
+6 ; pad one blank line
DO MES^XPDUTL("")
+7 QUIT