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