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

RORP021.m

Go to the documentation of this file.
  1. RORP021 ;ALB/TK ENV CK, PRE and POST INSTALL - PATCH 21 ;09/12/2013
  1. ;;1.5;CLINICAL CASE REGISTRIES;**21**;Feb 17, 2006;Build 45
  1. ;
  1. ;*****************************************************************************
  1. ;*****************************************************************************
  1. ; --- ROUTINE MODIFICATION LOG ---
  1. ;
  1. ;PKG/PATCH DATE DEVELOPER MODIFICATION
  1. ;----------- --------- ----------- ----------------------------------------
  1. ;ROR*1.5*21 NOV 2013 T KOPP Added routine for env check, pre/post
  1. ; install
  1. ;
  1. ;******************************************************************************
  1. ;******************************************************************************
  1. ;
  1. ; SUPPORTED CALLS:
  1. ; RTN^%ZTLOAD #10063
  1. ; STAT^%ZTLOAD #10063
  1. ; BMES^XPDUTL #10141
  1. ; BLD^DIALOG #2050
  1. ;
  1. ENV ; Environment check
  1. S XPDNOQUE=1 ; disable queuing
  1. Q
  1. ;
  1. PRE ; Patch pre-install
  1. N RC,ZTSK,RORBUF
  1. ; Check for ROR INITIALIZE task running
  1. D BMES^XPDUTL(" *** Checking to be sure ROR INITIALIZE task is not already running")
  1. S RC=0
  1. D RTN^%ZTLOAD("RORSET02","RORBUF")
  1. S ZTSK="" F S ZTSK=$O(RORBUF(ZTSK)) Q:ZTSK="" D I $G(ZTSK(1))=2 S RC=-1 Q
  1. . D STAT^%ZTLOAD
  1. ;--- Display error message if option is running
  1. I RC<0 D S XPDABORT=2 Q
  1. . D BMES^XPDUTL($$MSG^RORERR20(RC,,XPDNM))
  1. . D BMES^XPDUTL(" ROR INITIALIZE task is already running. Task # is "_ZTSK)
  1. . D BMES^XPDUTL(" This task must complete or be terminated before the install can continue")
  1. . D BMES^XPDUTL(" Restart this patch install when this task is not running")
  1. . D BMES^XPDUTL(""),BMES^XPDUTL("")
  1. Q
  1. ;
  1. POST ; Patch post-install
  1. N RORKIDS,REGIEN,RORREG,RORERR,DIERR,CT,Z
  1. S RORKIDS=1
  1. ; Set up registries params for initialization
  1. F RORREG="VA APNEA" D
  1. . S REGIEN=$$REGIEN^RORUTL02(RORREG)
  1. . I REGIEN>0 D
  1. .. K RORFDA,RORMSG
  1. .. S RORFDA(798.1,REGIEN_",",1)=2850101
  1. .. S RORFDA(798.1,REGIEN_",",21.05)=""
  1. .. S RORFDA(798.1,REGIEN_",",19.1)=""
  1. .. D UPDATE^DIE(,"RORFDA",,"RORMSG")
  1. .. I $G(DIERR) D
  1. ... D DBS^RORERR("RORMSG",-112,,,798.1,REGIEN)
  1. ... K RORERR
  1. ... S RORERR(1)=" New registry "_RORREG_"(ien #"_REGIEN_") encountered the following error"
  1. ... S RORERR(2)=" and may not initialize correctly. Please report this error to your CCR contact:"
  1. ... S RORERR(3)=""
  1. ... S Z=0,CT=3 F S Z=$O(RORMSG("DIERR",1,"TEXT",Z)) Q:'Z S CT=CT+1,RORERR(CT)=$J("",10)_$G(RORMSG("DIERR",1,"TEXT",1))
  1. ... D MES^XPDUTL(.RORERR)
  1. D ^RORSET02
  1. Q
  1. ;
  1. ; Sets the DIR array from the post-install question #3 (suspension start time)
  1. POSQ3(DIR) ;
  1. K:$G(XPDQUES("POSQ2"))'=1 DIR
  1. Q:'$D(DIR)
  1. D BLD^DIALOG(7980000.011,,,"DIR(""?"")","S")
  1. Q
  1. ;
  1. ; Sets the DIR array from the post-install question #4 (suspension end time)
  1. POSQ4(DIR) ;
  1. K:$G(XPDQUES("POSQ2"))'=1 DIR
  1. Q:'$D(DIR)
  1. S DIR("A")="Suspension end time"
  1. ; Make sure end time entered is later than end time start
  1. S DIR(0)="D^::R^K:(Y#1)'>(XPDQUES(""POSQ3"")#1) X"
  1. D BLD^DIALOG(7980000.012,,,"DIR(""?"")","S")
  1. Q
  1. ;
  1. ; Updates the DIR array from the post-install question #5 (schedule time for ROR INITIALIZE task)
  1. POSQ5(DIR) ;
  1. Q:'$D(DIR)
  1. N ROREDT
  1. ; Set earliest date to schedule to 15 minutes from 'NOW'
  1. S ROREDT=$$FMADD^XLFDT($$NOW^XLFDT(),,,15)
  1. ; Strip seconds
  1. S ROREDT=$P(ROREDT,".",1)_"."_$E($P(ROREDT,".",2),1,4)
  1. ; Make sure future date/time is entered
  1. S $P(DIR(0),U,3)=("K:Y<"_ROREDT_" X")
  1. S DIR("B")=$$FMTE^XLFDT(ROREDT,2)
  1. Q
  1. ;