BCQMENCK ;GDIT/IHS/FS - MAGIC MAPPER - ENVIRONMENT CHECKER ;05/07/18 07:49;FS
;;1.0;IHS CODE MAPPING;;MAY 07, 2018;Build 21
;
;
I '$G(DUZ) W !,"DUZ UNDEFINED OR 0." D SORRY(2) Q
;
I '$L($G(DUZ(0))) W !,"DUZ(0) UNDEFINED OR NULL." D SORRY(2) Q
;
S X=$P(^VA(200,DUZ,0),U)
W !!,$$CJ^XLFSTR("Hello, "_$P(X,",",2)_" "_$P(X,","),IOM)
W !!,$$CJ^XLFSTR("Checking Environment for "_$P($T(+2),";",4)_" V "_$P($T(+2),";",3)_" Patch 4"_".",IOM),!
;
S XPDQUIT=0
I '$$VCHK("XU","8.0",2) S XPDQUIT=2
;
I XPDQUIT D SORRY(XPDQUIT) Q
;
W !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
;
I '$$DIR^XBDIR("E","","","","","",1) D SORRY(2) Q
Q
;
SORRY(X) ;
KILL DIFQ
S XPDQUIT=X
W:'$D(ZTQUEUED) *7,!,$$CJ^XLFSTR("Sorry....",IOM),$$DIR^XBDIR("E","Press RETURN")
Q
;
VCHK(PRE,VER,QUIT) ; Check versions needed.
;
N V
S V=$$VERSION^XPDUTL(PRE)
W !,$$CJ^XLFSTR("Need at least "_PRE_" v "_VER_"....."_PRE_" v "_V_" Present",IOM)
I V<VER W *7,!,$$CJ^XLFSTR("^^^^**NEEDS FIXED**^^^^",IOM) Q 0
Q 1
;
BCQMENCK ;GDIT/IHS/FS - MAGIC MAPPER - ENVIRONMENT CHECKER ;05/07/18 07:49;FS
+1 ;;1.0;IHS CODE MAPPING;;MAY 07, 2018;Build 21
+2 ;
+3 ;
+4 IF '$GET(DUZ)
WRITE !,"DUZ UNDEFINED OR 0."
DO SORRY(2)
QUIT
+5 ;
+6 IF '$LENGTH($GET(DUZ(0)))
WRITE !,"DUZ(0) UNDEFINED OR NULL."
DO SORRY(2)
QUIT
+7 ;
+8 SET X=$PIECE(^VA(200,DUZ,0),U)
+9 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","),IOM)
+10 WRITE !!,$$CJ^XLFSTR("Checking Environment for "_$PIECE($TEXT(+2),";",4)_" V "_$PIECE($TEXT(+2),";",3)_" Patch 4"_".",IOM),!
+11 ;
+12 SET XPDQUIT=0
+13 IF '$$VCHK("XU","8.0",2)
SET XPDQUIT=2
+14 ;
+15 IF XPDQUIT
DO SORRY(XPDQUIT)
QUIT
+16 ;
+17 WRITE !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
+18 ;
+19 IF '$$DIR^XBDIR("E","","","","","",1)
DO SORRY(2)
QUIT
+20 QUIT
+21 ;
SORRY(X) ;
+1 KILL DIFQ
+2 SET XPDQUIT=X
+3 IF '$DATA(ZTQUEUED)
WRITE *7,!,$$CJ^XLFSTR("Sorry....",IOM),$$DIR^XBDIR("E","Press RETURN")
+4 QUIT
+5 ;
VCHK(PRE,VER,QUIT) ; Check versions needed.
+1 ;
+2 NEW V
+3 SET V=$$VERSION^XPDUTL(PRE)
+4 WRITE !,$$CJ^XLFSTR("Need at least "_PRE_" v "_VER_"....."_PRE_" v "_V_" Present",IOM)
+5 IF V<VER
WRITE *7,!,$$CJ^XLFSTR("^^^^**NEEDS FIXED**^^^^",IOM)
QUIT 0
+6 QUIT 1
+7 ;