BIENVCHK ;IHS/CMI/MWR - ENVIRONMENTAL CHECK FOR KIDS; DEC 15, 2010
;;8.5;IMMUNIZATION;**16**;MAR 01,2018
;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
;; ENVIRONMENTAL CHECK ROUTINE FOR KIDS INSTALLATION.
;; PATCH 16: Check environment for Imm v8.5 Patch 15. START+63
;;
;
;
;----------
START ;EP
;
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
;
N X,Z
S X=$P(^VA(200,DUZ,0),U)
W !!,$$CJ^XLFSTR("Hello, "_$P(X,",",2)_" "_$P(X,","),IOM)
S X="Checking Environment for "_$P($T(+2),";",4)_" v"_$P($T(+2),";",3)
S Z=$P($P($T(+2),";",5),"**",2)
S:Z X=X_", Patch "_Z_"."
W !!,$$CJ^XLFSTR(X,IOM),!
;
S XPDQUIT=0
;
;---> REQUIREMENTS
;
;---> Kernel v8.
I '$$VCHK("XU","8.0",2) S XPDQUIT=2
;
;
;---> Fileman v22.
I '$$VCHK("DI","22",2) S XPDQUIT=2
;
;
;I '$$VCHK("AUT","98.1",2) S XPDQUIT=2
;S X=$$LAST("IHS DICTIONARIES (POINTERS)","98.1")
;I $P(X,U,1)'=14&($P(X,U,1)'>14) D S XPDQUIT=2
;.W !,$$CJ^XLFSTR("AUT v98.1 Patch 14 NOT INSTALLED",IOM)
;
;---> XB/ZIB v3.0 patch 11.
;I '$$VCHK("XB","3.0",2) S XPDQUIT=2
;S X=$$LAST("IHS/VA UTILITIES","3.0")
;I $P(X,U)'=11&($P(X,U)'>11) D S XPDQUIT=2
;.W !,$$CJ^XLFSTR("XB/ZIB v3.0 patch 11 NOT INSTALLED",IOM)
;
;---> IHS PCC REPORTS v3.0 patch 29.
;I '$$VCHK("APCL","3.0",2) S XPDQUIT=2
;S X=$$LAST("IHS PCC REPORTS","3.0")
;I $P(X,U)'=29&($P(X,U)'>29) D S XPDQUIT=2
;.W !,$$CJ^XLFSTR("IHS PCC REPORTS v3.0 patch 29 NOT INSTALLED",IOM)
;
;---> PCC Suite v2.0 patch 2.
;I '$$VCHK("BJPC","2.0",2) S XPDQUIT=2
;S X=$$LAST("IHS PCC SUITE","2.0")
;I $P(X,U)'=2&($P(X,U)'>2) D S XPDQUIT=2
;.W !,$$CJ^XLFSTR("BJPC v2.0 Patch 2 NOT INSTALLED",IOM)
;
;
;---> IHS Clinical Reporting System v9.0 patch 1.
;I '$$VCHK("BGP","9.0",2) S XPDQUIT=2
;S X=$$LAST("IHS CLINICAL REPORTING","9.0")
;I $P(X,U)'=1&($P(X,U)'>1) D S XPDQUIT=2
;.W !,$$CJ^XLFSTR("BGP v9.0 Patch 1 NOT INSTALLED",IOM)
;
;
;********** PATCH 15, v8.5, SEP 30,2017, IHS/CMI/MWR
;
;---> Check environment for previous load of Taxonomy v5.1.
;I '$$VCHK("ATX","5.1",2) S XPDQUIT=2
;
;---> Check Patch Level of Taxonomy.
;---> Check for ATX v5.1, required patch.
;D
;.S X=$$LAST("TAXONOMY","5.1")
;.;---> Patch 20.
;.I $P(X,U)'=20&($P(X,U)'>20) D S XPDQUIT=2
;..W !,$$CJ^XLFSTR("ATX v5.1 Patch 20 NOT INSTALLED",IOM)
;.;
;.I XPDQUIT'=2 D
;..W !,$$CJ^XLFSTR("Checking for Patch 20 of ATX v5.1...Patch 20 Present",IOM)
;
;
;---> Check environment for previous load of Imm v8.5.
I '$$VCHK("BI","8.5",2) S XPDQUIT=2
;
;---> Check Patch Level of Imm.
;---> Check for Imm v8.5, required patch.
D
.S X=$$LAST("IMMUNIZATION","8.5")
.;---> Patch 15.
.I $P(X,U)'=15&($P(X,U)'>15) D S XPDQUIT=2
..W !,$$CJ^XLFSTR("BI v8.5 Patch 15 NOT INSTALLED",IOM)
.;
.I XPDQUIT'=2 D
..W !,$$CJ^XLFSTR("Checking for Patch 15 of BI v8.5...Patch 15 Present",IOM)
;**********
;
;---> Check for multiple BI entries in the Package File.
N DA,DIC
S X="BI",DIC="^DIC(9.4,",DIC(0)="",D="C"
D IX^DIC
I Y<0,$D(^DIC(9.4,"C","BI")) D S XPDQUIT=2
.W !!,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM)
.W !,$$CJ^XLFSTR("PACKAGE File with a ""BI"" prefix.",IOM)
.W !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
.W !,$$CJ^XLFSTR("Please do this before Proceeding.",IOM),!!
.Q
;
;---> Do not allow KIDS installation to be queued (at DEVICE: prompt).
S XPDNOQUE=1
;---> Do not ask "DISABLE Options...etc.?" question.
S XPDDIQ("XPZ1")=0
;---> Do not ask "MOVE routines to other CPUs?" question.
S XPDDIQ("XPZ2")=0
;
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) !,$$CJ^XLFSTR("Sorry...",IOM),$$DIR^XBDIR("E","Press RETURN")
Q
;
VCHK(ABMPRE,ABMVER,ABMQUIT) ; Check versions needed.
;
NEW ABMV
S ABMV=$$VERSION^XPDUTL(ABMPRE)
W !,$$CJ^XLFSTR("Need at least "_ABMPRE_" v"_ABMVER_"..."_ABMPRE_" v"_ABMV_" Present",IOM)
I ABMV<ABMVER W !,$$CJ^XLFSTR("^^^^**NEEDS TO BE INSTALLED**^^^^",IOM) Q 0
Q 1
;
LAST(PKG,VER) ;EP - returns last patch applied for a Package, PATCH^DATE
; Patch includes Seq # if Released
N PKGIEN,VERIEN,LATEST,PATCH,SUBIEN
I $G(VER)="" S VER=$$VERSION^XPDUTL(PKG) Q:'VER -1
S PKGIEN=$O(^DIC(9.4,"B",PKG,"")) Q:'PKGIEN -1
S VERIEN=$O(^DIC(9.4,PKGIEN,22,"B",VER,"")) Q:'VERIEN -1
S LATEST=-1,PATCH=-1,SUBIEN=0
F S SUBIEN=$O(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN)) Q:SUBIEN'>0 D
. I $P(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN,0),U,2)>LATEST S LATEST=$P(^(0),U,2),PATCH=$P(^(0),U)
. I $P(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN,0),U,2)=LATEST,$P(^(0),U)>PATCH S PATCH=$P(^(0),U)
Q PATCH_U_LATEST
BIENVCHK ;IHS/CMI/MWR - ENVIRONMENTAL CHECK FOR KIDS; DEC 15, 2010
+1 ;;8.5;IMMUNIZATION;**16**;MAR 01,2018
+2 ;;* MICHAEL REMILLARD, DDS * CIMARRON MEDICAL INFORMATICS, FOR IHS *
+3 ;; ENVIRONMENTAL CHECK ROUTINE FOR KIDS INSTALLATION.
+4 ;; PATCH 16: Check environment for Imm v8.5 Patch 15. START+63
+5 ;;
+6 ;
+7 ;
+8 ;----------
START ;EP
+1 ;
+2 IF '$GET(DUZ)
WRITE !,"DUZ UNDEFINED OR 0."
DO SORRY(2)
QUIT
+3 ;
+4 IF '$LENGTH($GET(DUZ(0)))
WRITE !,"DUZ(0) UNDEFINED OR NULL."
DO SORRY(2)
QUIT
+5 ;
+6 NEW X,Z
+7 SET X=$PIECE(^VA(200,DUZ,0),U)
+8 WRITE !!,$$CJ^XLFSTR("Hello, "_$PIECE(X,",",2)_" "_$PIECE(X,","),IOM)
+9 SET X="Checking Environment for "_$PIECE($TEXT(+2),";",4)_" v"_$PIECE($TEXT(+2),";",3)
+10 SET Z=$PIECE($PIECE($TEXT(+2),";",5),"**",2)
+11 IF Z
SET X=X_", Patch "_Z_"."
+12 WRITE !!,$$CJ^XLFSTR(X,IOM),!
+13 ;
+14 SET XPDQUIT=0
+15 ;
+16 ;---> REQUIREMENTS
+17 ;
+18 ;---> Kernel v8.
+19 IF '$$VCHK("XU","8.0",2)
SET XPDQUIT=2
+20 ;
+21 ;
+22 ;---> Fileman v22.
+23 IF '$$VCHK("DI","22",2)
SET XPDQUIT=2
+24 ;
+25 ;
+26 ;I '$$VCHK("AUT","98.1",2) S XPDQUIT=2
+27 ;S X=$$LAST("IHS DICTIONARIES (POINTERS)","98.1")
+28 ;I $P(X,U,1)'=14&($P(X,U,1)'>14) D S XPDQUIT=2
+29 ;.W !,$$CJ^XLFSTR("AUT v98.1 Patch 14 NOT INSTALLED",IOM)
+30 ;
+31 ;---> XB/ZIB v3.0 patch 11.
+32 ;I '$$VCHK("XB","3.0",2) S XPDQUIT=2
+33 ;S X=$$LAST("IHS/VA UTILITIES","3.0")
+34 ;I $P(X,U)'=11&($P(X,U)'>11) D S XPDQUIT=2
+35 ;.W !,$$CJ^XLFSTR("XB/ZIB v3.0 patch 11 NOT INSTALLED",IOM)
+36 ;
+37 ;---> IHS PCC REPORTS v3.0 patch 29.
+38 ;I '$$VCHK("APCL","3.0",2) S XPDQUIT=2
+39 ;S X=$$LAST("IHS PCC REPORTS","3.0")
+40 ;I $P(X,U)'=29&($P(X,U)'>29) D S XPDQUIT=2
+41 ;.W !,$$CJ^XLFSTR("IHS PCC REPORTS v3.0 patch 29 NOT INSTALLED",IOM)
+42 ;
+43 ;---> PCC Suite v2.0 patch 2.
+44 ;I '$$VCHK("BJPC","2.0",2) S XPDQUIT=2
+45 ;S X=$$LAST("IHS PCC SUITE","2.0")
+46 ;I $P(X,U)'=2&($P(X,U)'>2) D S XPDQUIT=2
+47 ;.W !,$$CJ^XLFSTR("BJPC v2.0 Patch 2 NOT INSTALLED",IOM)
+48 ;
+49 ;
+50 ;---> IHS Clinical Reporting System v9.0 patch 1.
+51 ;I '$$VCHK("BGP","9.0",2) S XPDQUIT=2
+52 ;S X=$$LAST("IHS CLINICAL REPORTING","9.0")
+53 ;I $P(X,U)'=1&($P(X,U)'>1) D S XPDQUIT=2
+54 ;.W !,$$CJ^XLFSTR("BGP v9.0 Patch 1 NOT INSTALLED",IOM)
+55 ;
+56 ;
+57 ;********** PATCH 15, v8.5, SEP 30,2017, IHS/CMI/MWR
+58 ;
+59 ;---> Check environment for previous load of Taxonomy v5.1.
+60 ;I '$$VCHK("ATX","5.1",2) S XPDQUIT=2
+61 ;
+62 ;---> Check Patch Level of Taxonomy.
+63 ;---> Check for ATX v5.1, required patch.
+64 ;D
+65 ;.S X=$$LAST("TAXONOMY","5.1")
+66 ;.;---> Patch 20.
+67 ;.I $P(X,U)'=20&($P(X,U)'>20) D S XPDQUIT=2
+68 ;..W !,$$CJ^XLFSTR("ATX v5.1 Patch 20 NOT INSTALLED",IOM)
+69 ;.;
+70 ;.I XPDQUIT'=2 D
+71 ;..W !,$$CJ^XLFSTR("Checking for Patch 20 of ATX v5.1...Patch 20 Present",IOM)
+72 ;
+73 ;
+74 ;---> Check environment for previous load of Imm v8.5.
+75 IF '$$VCHK("BI","8.5",2)
SET XPDQUIT=2
+76 ;
+77 ;---> Check Patch Level of Imm.
+78 ;---> Check for Imm v8.5, required patch.
+79 Begin DoDot:1
+80 SET X=$$LAST("IMMUNIZATION","8.5")
+81 ;---> Patch 15.
+82 IF $PIECE(X,U)'=15&($PIECE(X,U)'>15)
Begin DoDot:2
+83 WRITE !,$$CJ^XLFSTR("BI v8.5 Patch 15 NOT INSTALLED",IOM)
End DoDot:2
SET XPDQUIT=2
+84 ;
+85 IF XPDQUIT'=2
Begin DoDot:2
+86 WRITE !,$$CJ^XLFSTR("Checking for Patch 15 of BI v8.5...Patch 15 Present",IOM)
End DoDot:2
End DoDot:1
+87 ;**********
+88 ;
+89 ;---> Check for multiple BI entries in the Package File.
+90 NEW DA,DIC
+91 SET X="BI"
SET DIC="^DIC(9.4,"
SET DIC(0)=""
SET D="C"
+92 DO IX^DIC
+93 IF Y<0
IF $DATA(^DIC(9.4,"C","BI"))
Begin DoDot:1
+94 WRITE !!,$$CJ^XLFSTR("You Have More Than One Entry In The",IOM)
+95 WRITE !,$$CJ^XLFSTR("PACKAGE File with a ""BI"" prefix.",IOM)
+96 WRITE !,$$CJ^XLFSTR("One entry needs to be deleted.",IOM)
+97 WRITE !,$$CJ^XLFSTR("Please do this before Proceeding.",IOM),!!
+98 QUIT
End DoDot:1
SET XPDQUIT=2
+99 ;
+100 ;---> Do not allow KIDS installation to be queued (at DEVICE: prompt).
+101 SET XPDNOQUE=1
+102 ;---> Do not ask "DISABLE Options...etc.?" question.
+103 SET XPDDIQ("XPZ1")=0
+104 ;---> Do not ask "MOVE routines to other CPUs?" question.
+105 SET XPDDIQ("XPZ2")=0
+106 ;
+107 IF XPDQUIT
DO SORRY(XPDQUIT)
QUIT
+108 ;
+109 WRITE !!,$$CJ^XLFSTR("ENVIRONMENT OK.",IOM)
+110 ;
+111 IF '$$DIR^XBDIR("E","","","","","",1)
DO SORRY(2)
QUIT
+112 QUIT
+113 ;
SORRY(X) ;
+1 KILL DIFQ
+2 SET XPDQUIT=X
+3 IF '$DATA(ZTQUEUED)
WRITE !,$$CJ^XLFSTR("Sorry...",IOM),$$DIR^XBDIR("E","Press RETURN")
+4 QUIT
+5 ;
VCHK(ABMPRE,ABMVER,ABMQUIT) ; Check versions needed.
+1 ;
+2 NEW ABMV
+3 SET ABMV=$$VERSION^XPDUTL(ABMPRE)
+4 WRITE !,$$CJ^XLFSTR("Need at least "_ABMPRE_" v"_ABMVER_"..."_ABMPRE_" v"_ABMV_" Present",IOM)
+5 IF ABMV<ABMVER
WRITE !,$$CJ^XLFSTR("^^^^**NEEDS TO BE INSTALLED**^^^^",IOM)
QUIT 0
+6 QUIT 1
+7 ;
LAST(PKG,VER) ;EP - returns last patch applied for a Package, PATCH^DATE
+1 ; Patch includes Seq # if Released
+2 NEW PKGIEN,VERIEN,LATEST,PATCH,SUBIEN
+3 IF $GET(VER)=""
SET VER=$$VERSION^XPDUTL(PKG)
IF 'VER
QUIT -1
+4 SET PKGIEN=$ORDER(^DIC(9.4,"B",PKG,""))
IF 'PKGIEN
QUIT -1
+5 SET VERIEN=$ORDER(^DIC(9.4,PKGIEN,22,"B",VER,""))
IF 'VERIEN
QUIT -1
+6 SET LATEST=-1
SET PATCH=-1
SET SUBIEN=0
+7 FOR
SET SUBIEN=$ORDER(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN))
IF SUBIEN'>0
QUIT
Begin DoDot:1
+8 IF $PIECE(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN,0),U,2)>LATEST
SET LATEST=$PIECE(^(0),U,2)
SET PATCH=$PIECE(^(0),U)
+9 IF $PIECE(^DIC(9.4,PKGIEN,22,VERIEN,"PAH",SUBIEN,0),U,2)=LATEST
IF $PIECE(^(0),U)>PATCH
SET PATCH=$PIECE(^(0),U)
End DoDot:1
+10 QUIT PATCH_U_LATEST