MCENV00 ;WISC/DAD-ENVIRONMENT CHECK ROUTINE ;9/9/96 07:38
;;2.3;Medicine;;09/13/1996
;
S ^XTMP("MC",0)=$$FMADD^XLFDT(DT,30)_U_DT_U_"Medicine 2.3 Installation"
S XPDNOQUE=1 ; *** Prevent user from queing the installation ***
D GETVER
D FILCHK
D PCHCHK
I $G(XPDENV)=1 D
. D ASKDEL
. D ASKDEV
. Q
Q
;
GETVER ; Get version of Medicine package installed
N VERSION
W !!,"Checking for previous version of the medicine package."
S VERSION=$P($T(MCARE+1^MCARE),";",3)
I VERSION["VERSION" S VERSION=$P(VERSION,"VERSION ",2)
S ^XTMP("MC","VER")=VERSION
I VERSION]"" D
. W !!,"Found Medicine package version ",VERSION,"."
. I VERSION<2 D
.. W !!,"You are running a version of the Medicine package less"
.. W !,"than 2.0. Medicine 2.3 can only install over top of"
.. W !,"version 2.0, 2.2, or in a virgin account."
.. Q
. Q
E D
. W !!,"Medicine package not found."
. Q
Q
;
ASKDEL ; Ask about deletion of Medicine if version is < 2.0
N VERSION
S VERSION=^XTMP("MC","VER"),^XTMP("MC","DEL")=0
I VERSION]"",VERSION<2 D
. N DIR
. S DIR(0)="Y"
. S DIR("A",1)="Cannot install over version "_VERSION_"."
. S DIR("A")="Delete old Medicine files and data"
. S DIR("B")="No"
. S DIR("?")="Please answer YES or NO"
. S DIR("?",1)="You are running a version of the Medicine package less"
. S DIR("?",2)="than 2.0. Medicine 2.3 can only install over top of"
. S DIR("?",3)="version 2.0, 2.2, or in a virgin account. If you"
. S DIR("?",4)="answer YES to this question, ALL MEDICINE FILES AND"
. S DIR("?",5)="DATA WILL BE DELETED. If you answer NO, the"
. S DIR("?",6)="installation will abort."
. W ! D ^DIR I Y'=1 S XPDABORT=2 Q
. K DIR
. S DIR(0)="Y"
. S DIR("A",1)="All Medicine files and data will be deleted!"
. S DIR("A")="Are you sure"
. S DIR("B")="No"
. S DIR("?")="Please answer YES or NO"
. S DIR("?",1)="Answering YES to this question will cause the deletion"
. S DIR("?",2)="of all Medicine files and data."
. S DIR("?",3)=""
. W ! D ^DIR I Y'=1 S XPDABORT=2 Q
. S ^XTMP("MC","DEL")=1
. Q
Q
;
FILCHK ; Check to see if required files are present
N CHECK,FILENAME,FILENUM,INSVER,LOOP,PACKAGE,REQVER,ABORT
W !!,"Checking for minimum required package versions." S ABORT=0
F LOOP=1:1 S CHECK=$P($T(REQFILE+LOOP),";;",2) Q:CHECK="" D
. S FILENUM=$P(CHECK,U,1),FILENAME=$$GET1^DID(FILENUM,"","","NAME")
. S PACKAGE=$P(CHECK,U,2),REQVER=$P(CHECK,U,3)
. S INSVER=0 ;IHS/PLS 09/10/2001 +$$GET1^DID(FILENUM,"","","VERSION")
. I INSVER'>0 S INSVER=$$VERSION^XPDUTL($P(CHECK,U,4))
. I ($$VFILE^DILFD(FILENUM)=0)!(INSVER<REQVER) D
.. S ABORT=1
.. W !!,"The Medicine Package requires the "_FILENAME
.. W !,"file (#"_FILENUM_") from the "_PACKAGE
.. W !,"package, minimum version "_REQVER_"."
.. Q
. Q
I ABORT D
. S XPDABORT=2
. W !!,"Missing or insufficient version of"
. W "file(s), aborting installation."
. Q
E D
. W !!,"All required files found."
. Q
Q
;
PCHCHK ; Check for patch DI*21*25
Q
W !!,"Checking for patch DI*21*25."
I $$PATCH^XPDUTL("DI*21.0*25")'>0 D
. W !,"Patch not found, aborting installation."
. S XPDABORT=2
. Q
E D
. W !,"Patch found."
. Q
Q
;
ASKDEV ; Ask device to print conversion reports to
N VERSION
S VERSION=+^XTMP("MC","VER"),^XTMP("MC","DEV")=""
I VERSION'=2 Q
N %ZIS,IOP,MC,POP
F MC=1:1:2 D Q:'POP
. K %ZIS,IOP,POP
. S %ZIS="NQ",%ZIS("A")="Device for conversion reports (required): "
. S %ZIS("B")=""
. S %ZIS("S")="I $$GET1^DIQ(3.2,+$P($G(^%ZIS(1,+Y,""SUBTYPE"")),U),.01)?1""P-"".E"
. W ! D ^%ZIS
. I POP,MC=1 W !!,"You must enter a device name!"
. Q
I POP D
. S XPDABORT=2
. W !!,"No device selected, aborting installation."
. Q
E D
. S ^XTMP("MC","DEV")="Q;"_ION_";"_IOST_";"_IOM_";"_IOSL
. Q
Q
;
REQFILE ; File# ^ Package_Name ^ Minimum_Required_Version
;;2^PIMS^5.3^DPT
;;50^OUTPATIENT PHARMACY^2.2^PSO
;;55^OUTPATIENT PHARMACY^2.2^PSO
;;61^LAB SERVICE^5.1^LA
;;61.1^LAB SERVICE^5.1^LA
;;61.3^LAB SERVICE^5.1^LA
;;61.5^LAB SERVICE^5.1^LA
;;80^DRG GROUPER^5.3^ICD
;;100^ORDER ENTRY/RESULTS REPORTING^2.5^OR
;;101^ORDER ENTRY/RESULTS REPORTING^2.5^OR
;;120.8^ADVERSE REACTION TRACKING^2.2^GMRA
;;123^CONSULT/REQUEST TRACKING^2.5^GMRC
;;
MCENV00 ;WISC/DAD-ENVIRONMENT CHECK ROUTINE ;9/9/96 07:38
+1 ;;2.3;Medicine;;09/13/1996
+2 ;
+3 SET ^XTMP("MC",0)=$$FMADD^XLFDT(DT,30)_U_DT_U_"Medicine 2.3 Installation"
+4 ; *** Prevent user from queing the installation ***
SET XPDNOQUE=1
+5 DO GETVER
+6 DO FILCHK
+7 DO PCHCHK
+8 IF $GET(XPDENV)=1
Begin DoDot:1
+9 DO ASKDEL
+10 DO ASKDEV
+11 QUIT
End DoDot:1
+12 QUIT
+13 ;
GETVER ; Get version of Medicine package installed
+1 NEW VERSION
+2 WRITE !!,"Checking for previous version of the medicine package."
+3 SET VERSION=$PIECE($TEXT(MCARE+1^MCARE),";",3)
+4 IF VERSION["VERSION"
SET VERSION=$PIECE(VERSION,"VERSION ",2)
+5 SET ^XTMP("MC","VER")=VERSION
+6 IF VERSION]""
Begin DoDot:1
+7 WRITE !!,"Found Medicine package version ",VERSION,"."
+8 IF VERSION<2
Begin DoDot:2
+9 WRITE !!,"You are running a version of the Medicine package less"
+10 WRITE !,"than 2.0. Medicine 2.3 can only install over top of"
+11 WRITE !,"version 2.0, 2.2, or in a virgin account."
+12 QUIT
End DoDot:2
+13 QUIT
End DoDot:1
+14 IF '$TEST
Begin DoDot:1
+15 WRITE !!,"Medicine package not found."
+16 QUIT
End DoDot:1
+17 QUIT
+18 ;
ASKDEL ; Ask about deletion of Medicine if version is < 2.0
+1 NEW VERSION
+2 SET VERSION=^XTMP("MC","VER")
SET ^XTMP("MC","DEL")=0
+3 IF VERSION]""
IF VERSION<2
Begin DoDot:1
+4 NEW DIR
+5 SET DIR(0)="Y"
+6 SET DIR("A",1)="Cannot install over version "_VERSION_"."
+7 SET DIR("A")="Delete old Medicine files and data"
+8 SET DIR("B")="No"
+9 SET DIR("?")="Please answer YES or NO"
+10 SET DIR("?",1)="You are running a version of the Medicine package less"
+11 SET DIR("?",2)="than 2.0. Medicine 2.3 can only install over top of"
+12 SET DIR("?",3)="version 2.0, 2.2, or in a virgin account. If you"
+13 SET DIR("?",4)="answer YES to this question, ALL MEDICINE FILES AND"
+14 SET DIR("?",5)="DATA WILL BE DELETED. If you answer NO, the"
+15 SET DIR("?",6)="installation will abort."
+16 WRITE !
DO ^DIR
IF Y'=1
SET XPDABORT=2
QUIT
+17 KILL DIR
+18 SET DIR(0)="Y"
+19 SET DIR("A",1)="All Medicine files and data will be deleted!"
+20 SET DIR("A")="Are you sure"
+21 SET DIR("B")="No"
+22 SET DIR("?")="Please answer YES or NO"
+23 SET DIR("?",1)="Answering YES to this question will cause the deletion"
+24 SET DIR("?",2)="of all Medicine files and data."
+25 SET DIR("?",3)=""
+26 WRITE !
DO ^DIR
IF Y'=1
SET XPDABORT=2
QUIT
+27 SET ^XTMP("MC","DEL")=1
+28 QUIT
End DoDot:1
+29 QUIT
+30 ;
FILCHK ; Check to see if required files are present
+1 NEW CHECK,FILENAME,FILENUM,INSVER,LOOP,PACKAGE,REQVER,ABORT
+2 WRITE !!,"Checking for minimum required package versions."
SET ABORT=0
+3 FOR LOOP=1:1
SET CHECK=$PIECE($TEXT(REQFILE+LOOP),";;",2)
IF CHECK=""
QUIT
Begin DoDot:1
+4 SET FILENUM=$PIECE(CHECK,U,1)
SET FILENAME=$$GET1^DID(FILENUM,"","","NAME")
+5 SET PACKAGE=$PIECE(CHECK,U,2)
SET REQVER=$PIECE(CHECK,U,3)
+6 ;IHS/PLS 09/10/2001 +$$GET1^DID(FILENUM,"","","VERSION")
SET INSVER=0
+7 IF INSVER'>0
SET INSVER=$$VERSION^XPDUTL($PIECE(CHECK,U,4))
+8 IF ($$VFILE^DILFD(FILENUM)=0)!(INSVER<REQVER)
Begin DoDot:2
+9 SET ABORT=1
+10 WRITE !!,"The Medicine Package requires the "_FILENAME
+11 WRITE !,"file (#"_FILENUM_") from the "_PACKAGE
+12 WRITE !,"package, minimum version "_REQVER_"."
+13 QUIT
End DoDot:2
+14 QUIT
End DoDot:1
+15 IF ABORT
Begin DoDot:1
+16 SET XPDABORT=2
+17 WRITE !!,"Missing or insufficient version of"
+18 WRITE "file(s), aborting installation."
+19 QUIT
End DoDot:1
+20 IF '$TEST
Begin DoDot:1
+21 WRITE !!,"All required files found."
+22 QUIT
End DoDot:1
+23 QUIT
+24 ;
PCHCHK ; Check for patch DI*21*25
+1 QUIT
+2 WRITE !!,"Checking for patch DI*21*25."
+3 IF $$PATCH^XPDUTL("DI*21.0*25")'>0
Begin DoDot:1
+4 WRITE !,"Patch not found, aborting installation."
+5 SET XPDABORT=2
+6 QUIT
End DoDot:1
+7 IF '$TEST
Begin DoDot:1
+8 WRITE !,"Patch found."
+9 QUIT
End DoDot:1
+10 QUIT
+11 ;
ASKDEV ; Ask device to print conversion reports to
+1 NEW VERSION
+2 SET VERSION=+^XTMP("MC","VER")
SET ^XTMP("MC","DEV")=""
+3 IF VERSION'=2
QUIT
+4 NEW %ZIS,IOP,MC,POP
+5 FOR MC=1:1:2
Begin DoDot:1
+6 KILL %ZIS,IOP,POP
+7 SET %ZIS="NQ"
SET %ZIS("A")="Device for conversion reports (required): "
+8 SET %ZIS("B")=""
+9 SET %ZIS("S")="I $$GET1^DIQ(3.2,+$P($G(^%ZIS(1,+Y,""SUBTYPE"")),U),.01)?1""P-"".E"
+10 WRITE !
DO ^%ZIS
+11 IF POP
IF MC=1
WRITE !!,"You must enter a device name!"
+12 QUIT
End DoDot:1
IF 'POP
QUIT
+13 IF POP
Begin DoDot:1
+14 SET XPDABORT=2
+15 WRITE !!,"No device selected, aborting installation."
+16 QUIT
End DoDot:1
+17 IF '$TEST
Begin DoDot:1
+18 SET ^XTMP("MC","DEV")="Q;"_ION_";"_IOST_";"_IOM_";"_IOSL
+19 QUIT
End DoDot:1
+20 QUIT
+21 ;
REQFILE ; File# ^ Package_Name ^ Minimum_Required_Version
+1 ;;2^PIMS^5.3^DPT
+2 ;;50^OUTPATIENT PHARMACY^2.2^PSO
+3 ;;55^OUTPATIENT PHARMACY^2.2^PSO
+4 ;;61^LAB SERVICE^5.1^LA
+5 ;;61.1^LAB SERVICE^5.1^LA
+6 ;;61.3^LAB SERVICE^5.1^LA
+7 ;;61.5^LAB SERVICE^5.1^LA
+8 ;;80^DRG GROUPER^5.3^ICD
+9 ;;100^ORDER ENTRY/RESULTS REPORTING^2.5^OR
+10 ;;101^ORDER ENTRY/RESULTS REPORTING^2.5^OR
+11 ;;120.8^ADVERSE REACTION TRACKING^2.2^GMRA
+12 ;;123^CONSULT/REQUEST TRACKING^2.5^GMRC
+13 ;;