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

MCENV00.m

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