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

XPDIJ1.m

Go to the documentation of this file.
  1. XPDIJ1 ;SFISC/RSD - Cont. of Install Job ;05/11/2001 09:07
  1. ;;8.0;KERNEL;**41,68,108,200,559**;Jul 10, 1995;Build 4
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. IN ;install XPDA
  1. ;XPDA=ien of file 9.7, XPDNM=package name
  1. Q:'$D(^XTMP("XPDI",XPDA))!'$D(^XPD(9.7,XPDA,0))
  1. ;check if already installed
  1. I $P($G(^XPD(9.7,XPDA,1)),U,3) D BMES^XPDUTL(" "_XPDNM_" Already Installed ") Q
  1. N DIFROM,XPD,XPD0,XPDBLD,XPDCHECK,XPDCP,XPDI,XPDGREF,XPDIST,XPDIDTOT,XPDIDCNT,XPDIDMOD,XPDRTN
  1. ;XPDBLD subscript for build entry i.e. ^XTMP("XPDI",XPDA,"BLD",XPDBLD
  1. S DIFROM=$$VER^XPDUTL(XPDNM),XPDBLD=$O(^XTMP("XPDI",XPDA,"BLD",0)),XPDGREF="^XTMP(""XPDI"","_XPDA_",""TEMP"")"
  1. D TITLE^XPDID(XPDNM)
  1. ;^XTMP("XPDI",XPDA,"BLD",XPDBLD,6) is set when the msg is loaded. Forum adds this as the last line of the msg.
  1. ;add Package file entry if sent, set TEST # & SEQ #
  1. S Y=$$PKGADD^XPDIP,XPD0=^XTMP("XPDI",XPDA,"BLD",XPDBLD,0),Y=$G(^(6)),XPDNM("TST")=$P(Y,U),XPDNM("SEQ")=$P(Y,U,2)
  1. I '$$CHK(11) D
  1. .D BMES^XPDUTL(" Install Started for "_XPDNM_" : "),STMP(11)
  1. .;update status, installed by fields and distribution date
  1. .S XPD(9.7,XPDA_",",.02)=2,XPD(9.7,XPDA_",",9)=DUZ,XPD(9.7,XPDA_",",51)=$P(XPD0,U,4)
  1. .D FILE^DIE("","XPD")
  1. E D BMES^XPDUTL(" Install Restarted for "_XPDNM_" at "_$$HTE^XLFDT($H))
  1. D BMES^XPDUTL("Build Distribution Date: "_$$FMTE^XLFDT($P(XPD0,U,4)))
  1. D RTN Q:$D(XPDABORT)
  1. D PRE Q:$D(XPDABORT)
  1. D FMDATA Q:$D(XPDABORT)
  1. D COMP Q:$D(XPDABORT)
  1. D POST:$G(XPDT("MASTER"))'=XPDA
  1. Q ;Finshed
  1. ;
  1. RTN I '$$CHK(12) D
  1. .D BMES^XPDUTL(" Installing Routines:"),SETTOT^XPDID(9.8),RTN^XPDIJ(XPDA),STMP(12)
  1. E D BMES^XPDUTL(" Routines already installed.")
  1. Q
  1. ;
  1. PRE S XPDCP="INI"
  1. ;check if pre-install has completed
  1. I '$$VERCP^XPDUTL("XPD PREINSTALL COMPLETED") D Q:$D(XPDABORT)
  1. .;setup XPDQUES array with pre-install questions/answers
  1. .D QUES^XPDIQ("PRE")
  1. .;XPDCHECK=ien of current checkpoint, (0)=name of checkpoint
  1. .;XPDCP="INI"-pre install or "INIT"-post install
  1. .;loop thru check points starting with INSTALL STARTED
  1. .S XPDCHECK=1
  1. .F S XPDCHECK=$O(^XPD(9.7,XPDA,"INI",XPDCHECK)) Q:'XPDCHECK S XPD=^(XPDCHECK,0) D Q:$D(XPDABORT)
  1. ..;if there is no call back, quit
  1. ..Q:$G(^XPD(9.7,XPDA,"INI",XPDCHECK,1))="" S XPDRTN=^(1)
  1. ..;check if checkpoint has been completed
  1. ..Q:$P(XPD,U,2)
  1. ..I XPDCHECK=2 D BMES^XPDUTL(" Running Pre-Install Routine: "_XPDRTN)
  1. ..;zero the progress bar
  1. ..I $D(XPDIDVT) S XPDIDTOT=0 D UPDATE^XPDID(0)
  1. ..D @XPDRTN
  1. ..;write message and abort if developer wants
  1. ..I $D(XPDABORT) D BMES^XPDUTL("Install ** ABORTED ** in Pre-Install program") Q
  1. ..S %=$$COMCP^XPDUTL(XPDCHECK)
  1. .Q:$D(XPDABORT)
  1. .;complete pre-init check point
  1. .S %=$$COMCP^XPDUTL("XPD PREINSTALL COMPLETED")
  1. E D BMES^XPDUTL(" Pre-Install already finished.")
  1. Q
  1. ;
  1. FMDATA ;build XPDQUES arrays for all of the FM Files
  1. D QUES^XPDIQ("XPF")
  1. ;check the last file and see if it's already installed
  1. S XPD=$G(^(+$O(^XPD(9.7,XPDA,4,"A"),-1),0))
  1. I '$P(XPD,U,2) D:$D(^XTMP("XPDI",XPDA,"FIA"))
  1. .D BMES^XPDUTL(" Installing Data Dictionaries: "),SETTOT^XPDID(4),FIA^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
  1. E D BMES^XPDUTL(" Data Dictionaries already installed.")
  1. S %=+$O(^XTMP("XPDI",XPDA,"DATA",""),-1),XPD=$G(^XPD(9.7,XPDA,4,%,0))
  1. I '$P(XPD,U,3) D:%
  1. .D BMES^XPDUTL(" Installing Data: "),DAT^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
  1. E D BMES^XPDUTL(" Data already installed.")
  1. Q
  1. ;
  1. COMP S (%,XPD)=""
  1. F S %=+$O(^XPD(9.7,XPDA,"KRN",%)) Q:'% S XPD=$G(^(%,0)) Q:'$P(XPD,U,2)
  1. I '$P(XPD,U,2) D:$D(^XTMP("XPDI",XPDA,"KRN"))
  1. .D BMES^XPDUTL(" Installing PACKAGE COMPONENTS: "),KRN^XPDIK,MES^XPDUTL(" "_$$HTE^XLFDT($H))
  1. E D BMES^XPDUTL(" PACKAGE COMPONENTS already installed.")
  1. Q
  1. ;
  1. POST S XPDCP="INIT"
  1. ;check if post-install has completed
  1. I '$$VERCP^XPDUTL("XPD POSTINSTALL COMPLETED") D Q:$D(XPDABORT)
  1. .;setup XPDQUES array with post-install questions/answers
  1. .D QUES^XPDIQ("POS")
  1. .;loop thru check points starting with INSTALL STARTED
  1. .S XPDCHECK=1
  1. .F S XPDCHECK=$O(^XPD(9.7,XPDA,"INIT",XPDCHECK)) Q:'XPDCHECK S XPD=^(XPDCHECK,0) D Q:$D(XPDABORT)
  1. ..;if there is no call back, quit
  1. ..Q:$G(^XPD(9.7,XPDA,"INIT",XPDCHECK,1))="" S XPDRTN=^(1)
  1. ..;quit if checkpoint has completed time
  1. ..Q:$P(XPD,U,2)
  1. ..I XPDCHECK=2 D BMES^XPDUTL(" Running Post-Install Routine: "_XPDRTN)
  1. ..;zero the progress bar
  1. ..I $D(XPDIDVT) S XPDIDTOT=0 D UPDATE^XPDID(0)
  1. ..D @XPDRTN
  1. ..;write message and abort if developer wants
  1. ..I $D(XPDABORT) D BMES^XPDUTL("Install ** ABORTED ** in Post-Install program") Q
  1. ..S %=$$COMCP^XPDUTL(XPDCHECK)
  1. .Q:$D(XPDABORT)
  1. .;complete post-init check point
  1. .S %=$$COMCP^XPDUTL("XPD POSTINSTALL COMPLETED")
  1. E D BMES^XPDUTL(" Post-Install already finished.")
  1. ;move routines to install file & Routine file
  1. D BMES^XPDUTL(" Updating Routine file..."),SETTOT^XPDID(9.8),RTN^XPDIP
  1. ;XPDIST is flag for site tracking^A/B install message, it is set in PKG^XPDIP
  1. ;install Package file, OERR parameter multiple, and Build file
  1. S XPDIST="" D BMES^XPDUTL(" Updating KIDS files..."),PKG^XPDIP
  1. D BMES^XPDUTL(" "_XPDNM_" Installed. "),STMP(17)
  1. ;sends install messages local/forum
  1. S %=$$EN^XPDIST(XPDA,XPDIST) D BMES^XPDUTL(" "_$P("NO ",U,'$P(%,"#",2))_"Install Message sent "_%)
  1. Q
  1. CHK(X) ;check checkpoints in file 9.7, X=field #, returns 1=completed, 0=not completed
  1. Q $$GET1^DIQ(9.7,XPDA_",",X,"I")]""
  1. ;
  1. STMP(X) ;timestamp checkpoints in file 9.7, X=field #
  1. N XPD,%
  1. S %=$$NOW^XLFDT,XPD(9.7,XPDA_",",X)=%
  1. D MES^XPDUTL(" "_$$FMTE^XLFDT(%)),FILE^DIE("","XPD")
  1. Q
  1. ;
  1. INHIBIT(SET) ;Set/Clear the Inhibit logon field.
  1. N VOL,IEN
  1. F IEN=0:0 S IEN=$O(^%ZIS(14.5,IEN)) Q:IEN'>0 D
  1. . I $P(^%ZIS(14.5,IEN,0),U,11)=1 S VOL(14.5,IEN_",",1)=SET
  1. . Q
  1. D FILE^DIE("","VOL")
  1. Q