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

ECXINENV.m

Go to the documentation of this file.
  1. ECXINENV ;ALB/JAP - Environment Check for DSS Install ;Nov 03, 1997
  1. ;;3.0;DSS EXTRACTS;;Dec 22, 1997
  1. EN ;entry point
  1. N Y,J,JJ,DIR,DTOUT,DUOUT,DIRUT,ECX,MSG,MSG1,MSG2,MSG2B,MSG3,FILE,FILENM,TEXT
  1. K XPDQUIT,XPDABORT
  1. F J=1:1:12 S TEXT=$P($T(MSG1+J),";",3),MSG1(J)=TEXT
  1. F J=1:1:4 S TEXT=$P($T(MSG2+J),";",3),MSG2(J)=TEXT
  1. F J=1:1:8 S TEXT=$P($T(MSG2B+J),";",3),MSG2B(J)=TEXT
  1. F J=1:1:8 S TEXT=$P($T(MSG3+J),";",3),MSG3(J)=TEXT
  1. ;is this is not a first time install provide user warning
  1. I $O(^ECX(728,0)) D MES^XPDUTL(.MSG1) D
  1. .W ! S DIR(0)="Y",DIR("A")="Continue with the installation",DIR("B")="NO",DIR("?")="Answer YES to install DSS EXTRACTS v3.0 or NO to stop."
  1. .D ^DIR
  1. .I Y=0!($G(DIRUT)) S XPDQUIT=1 D MES^XPDUTL("Installation aborted...")
  1. .K DIR,DIRUT,DTOUT,DUOUT W !
  1. Q:$G(XPDQUIT)
  1. D MES^XPDUTL(">>> Checking Environment --")
  1. D MES^XPDUTL(" ")
  1. I +$G(DUZ)'>0!($G(DUZ(0))'="@")!($G(U)'="^")!('$D(DT))!('$D(IOSL)) D
  1. .S XPDQUIT=2
  1. .D MES^XPDUTL("You must first initialize Programmer Environment by running ^XUP.")
  1. .D MES^XPDUTL(.MSG2)
  1. .D MES^XPDUTL(" ") S DIR(0)="E" D ^DIR K DIR
  1. Q:$G(XPDQUIT)
  1. ;don't bother checking files if this is first-time install of dss
  1. Q:'$O(^ECX(728,0))
  1. ;if this is a re-install of v3.0, don't insist that data in files be deleted
  1. D FILE^DID(728,,"VERSION","ECX")
  1. ;only do this check if version is 2
  1. ;see if there's any extract data still in files from v2.0t11
  1. I ECX("VERSION")'["3.0" D
  1. .F J=1:1:20 S FILE=$P($T(FILES+J),";",3),FILENM=$P($T(FILES+J),";",4) D
  1. ..S JJ=$O(^ECX(FILE,0)) I +JJ>0 D
  1. ...S MSG=" Data still exists in file "_FILENM_" (#"_FILE_")."
  1. ...D:($Y+3>IOSL) PAUSE
  1. ...D MES^XPDUTL(MSG) S XPDQUIT=2
  1. I $G(XPDQUIT) D Q
  1. .D:($Y+8>IOSL) PAUSE
  1. .D MES^XPDUTL(.MSG2B)
  1. .F J=1:1:20 S FILE=$P($T(FILES+J),";",3),FILENM=$P($T(FILES+J),";",4) D
  1. ..S JJ=$O(^ECX(FILE,0)) I +JJ>0 D
  1. ...S MSG=" "_FILENM_" (#"_FILE_")"
  1. ...D:($Y+3>IOSL) PAUSE
  1. ...D MES^XPDUTL(MSG)
  1. .D:($Y+5>IOSL) PAUSE
  1. .D MES^XPDUTL(.MSG2)
  1. .D:($Y+12>IOSL) PAUSE
  1. .D MES^XPDUTL(.MSG3)
  1. D MES^XPDUTL("Environment check completed... OK.")
  1. Q
  1. ;
  1. PAUSE ;screen pause
  1. N Y,JJ,SS
  1. I $E(IOST)="C" D
  1. .S SS=22-$Y F JJ=1:1:SS W !
  1. .D MES^XPDUTL(" ") S DIR(0)="E" D ^DIR K DIR
  1. W:$Y!($E(IOST)="C") @IOF
  1. Q
  1. ;
  1. CLEAN ;allow site to cleanup old extract records
  1. N FF,J,JJ,JJJ,DIC,DR,DA,DIQ,FILE,EXTRACT,ECX,TYPE,START,PURGE,ABORT,OUT,DATA,CLEAN1,CLEAN2,REM,MSG
  1. F J=1:1:8 S TEXT=$P($T(CLEAN1+J),";",3),CLEAN1(J)=TEXT
  1. F J=1:1:6 S TEXT=$P($T(CLEAN2+J),";",3),CLEAN2(J)=TEXT
  1. W !!
  1. D FILE^DID(728,,"VERSION","ECX")
  1. I ECX("VERSION")["3.0" D Q
  1. .D:($Y+3>IOSL) PAUSE D MES^XPDUTL(.CLEAN1)
  1. ;if v3 not installed then continue
  1. S ABORT=0,DATA=0
  1. F FF=1:1:20 S FILE=$P($T(FILES+FF),";",3),FILENM=$P($T(FILES+FF),";",4),JJ=0 D Q:ABORT=1
  1. .F S JJ=$O(^ECX(FILE,JJ)) Q:+JJ<1 I +JJ>0 D Q:ABORT=1
  1. ..S OUT=0
  1. ..S EXTRACT=$P(^ECX(FILE,JJ,0),"^",3),DIC=727,DR="2;3;9",DIQ(0)="I",DIQ="ECX"
  1. ..K ECX S DA=EXTRACT D EN^DIQ1
  1. ..S TYPE=$G(ECX(727,DA,2,"I")),START=$G(ECX(727,DA,3,"I")),PURGE=$G(ECX(727,DA,9,"I"))
  1. ..;if this extract was not previously purged, don't proceed
  1. ..I PURGE="" D Q
  1. ...S ABORT=1
  1. ...D:($Y+3>IOSL) PAUSE D MES^XPDUTL(.CLEAN2)
  1. ..S REM(1)=" Data will now be deleted from:"
  1. ..S REM(2)=" File #"_FILE_" - Extract #"_EXTRACT
  1. ..S DATA=1
  1. ..D:($Y+3>IOSL) PAUSE D MES^XPDUTL(.REM)
  1. ..S JJJ=JJ-1
  1. ..F S JJJ=$O(^ECX(FILE,JJJ)) Q:+JJJ<1 I +JJJ>0 D Q:OUT=1
  1. ...S EXTRX=$P(^ECX(FILE,JJJ,0),"^",3)
  1. ...I EXTRX'=EXTRACT S OUT=1
  1. ...Q:OUT=1
  1. ...S DIK="^ECX("_FILE_",",DA=JJJ D ^DIK
  1. ...S MSG=" Record #"_JJJ_" in File #"_FILE_" deleted."
  1. ...D:($Y+3>IOSL) PAUSE D MES^XPDUTL(MSG)
  1. ..W !!
  1. I ABORT=0,DATA=1 D
  1. .S MSG=" Clean-up of old extract data complete."
  1. .D:($Y+3>IOSL) PAUSE D MES^XPDUTL(MSG)
  1. I ABORT=0,DATA=0 D
  1. .S MSG=" There are no old extract records which can be deleted."
  1. .D:($Y+3>IOSL) PAUSE D MES^XPDUTL(MSG)
  1. W !!
  1. Q
  1. ;
  1. FILES ;files to be checked for existing data
  1. ;;727.802;ADMISSION EXTRACT
  1. ;;727.803;CLINIC EXTRACT
  1. ;;727.804;CLINIC NOSHOW EXTRACT
  1. ;;727.805;NURSING EXTRACT
  1. ;;727.806;DENTAL EXTRACT
  1. ;;727.808;PHYSICAL MOVEMENT EXTRACT
  1. ;;727.809;UNIT DOSE LOCAL EXTRACT
  1. ;;727.81;PRESCRIPTION EXTRACT
  1. ;;727.811;SURGERY EXTRACT
  1. ;;727.813;LABORATORY EXTRACT
  1. ;;727.814;RADIOLOGY EXTRACT
  1. ;;727.815;EVENT CAPTURE LOCAL EXTRACT
  1. ;;727.817;TREATING SPECIALTY CHANGE EXTRACT
  1. ;;727.819;IV DETAIL EXTRACT
  1. ;;727.82;ADMISSION SETUP EXTRACT
  1. ;;727.821;PHYSICAL MOVEMENT SETUP EXTRACT
  1. ;;727.822;TREATING SPECIALTY CHANGE SETUP EXTRACT
  1. ;;727.823;PAI EXTRACT
  1. ;;727.824;LAB RESULTS EXTRACT
  1. ;;727.825;QUASAR EXTRACT
  1. ;
  1. MSG1 ;
  1. ;;
  1. ;; ********** WARNING **********
  1. ;;
  1. ;;DO NOT INSTALL DSS EXTRACTS V3.0 unless your site has
  1. ;;extracted, transmitted, and received transmission
  1. ;;confirmation from the Austin Automation Center for ALL
  1. ;;FY97 data. Prior approval for this installation should
  1. ;;have been received from the local DSS Site Manager.
  1. ;;
  1. ;; Answer YES to install DSS EXTRACTS v3.0.
  1. ;; Answer NO to stop the installation process now.
  1. ;;
  1. MSG2 ;post abort message
  1. ;;
  1. ;;
  1. ;;Installation aborted...
  1. ;;
  1. MSG2B ;more post abort info if data in files
  1. ;;
  1. ;;Before continuing with this installation, you should verify with
  1. ;;the DSS Site Manager that all FY97 data has been transmitted and
  1. ;;transmission confirmation has been received from the Austin
  1. ;;Automation Center. Then data from the following files should be
  1. ;;purged by the DSS Site Manager using the Purge Data from Extract
  1. ;;Files [ECXPURG] option:
  1. ;;
  1. MSG3 ;;restart info
  1. ;;
  1. ;;When you wish to continue with this installation, simply select
  1. ;;the Install Package(s) [XPD INSTALL BUILD] option from the Kernel
  1. ;;Installation & Distribution System menu. You do not need to
  1. ;;reload the KIDS distribution file. (The package build has not
  1. ;;been deleted from the ^XTMP global.)
  1. ;;
  1. ;;
  1. CLEAN1 ;;can't cleanup global if v3 installed
  1. ;;
  1. ;;DSS EXTRACTS v3.0 has already been installed on this system.
  1. ;;This file clean-up cannot be performed after installation of
  1. ;;the new version.
  1. ;;
  1. ;;If you are having difficulty, please contact the Customer Support
  1. ;;Help Desk.
  1. ;;
  1. CLEAN2 ;;unpurged extract file
  1. ;;
  1. ;;Cannot continue -- an unpurged extract file has been found.
  1. ;;
  1. ;;Please advise the DSS Site Manager to complete purging of all
  1. ;;previously extracted data from files #727.802 through #727.825
  1. ;;by using the DSS option Purge Data from Extract Files [ECXPURG].
  1. ;;