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

RAIPS135.m

Go to the documentation of this file.
  1. RAIPS135 ;HISC/GJC post-install routine ;28 Mar 2018 1:59 PM
  1. ;;5.0;Radiology/Nuclear Medicine;**135**;Mar 16, 1998;Build 7
  1. ;
  1. ;Routine IA Type
  1. ;-------------------------------------
  1. ; ^%ZTLOAD 10063 (S)
  1. ; $$FIND1^DIC 2051 (S)
  1. ; $$FMADD^XLFDT 10103 (S)
  1. ; $$NOW^XLFDT 10103 (S)
  1. ; $$FMTE^XLFDT 10103 (S)
  1. ; $$NEWCP^XPDUTL 10141 (S)
  1. ; $$PROD^XUPROD 4440 (S)
  1. ; UPDATE^DIE 2053 (S)
  1. ; D EN^DIEZ 10002 (S)
  1. ; $$ROUSIZE^DILF 2649 (S)
  1. ; OPTSTAT^XUTMOPT() 1472 (S)
  1. ; ^DIE("AF", 2022 (C)
  1. ; ^DIC(19.2, schedule 6826 (P)
  1. ; option
  1. ; OPTSTAT^XUTMOPT 1472 (S)
  1. ;
  1. N RACHX1,RACHX2
  1. S RACHX1=$$NEWCP^XPDUTL("POST1","EN1^RAIPS135")
  1. S RACHX2=$$NEWCP^XPDUTL("POST2","EN2^RAIPS135")
  1. S RACHX3=$$NEWCP^XPDUTL("POST3","EN3^RAIPS135")
  1. Q
  1. ;
  1. EN1 ;part 1: recompile 75.1 input templates
  1. ;
  1. ENDIEZ ;run in the foreground as part of the post-install
  1. ; ^DD(75.1,21,0)="DATE DESIRED (Not guaranteed)
  1. ; ^DIE("AF",file,field,template_IEN)=""
  1. N DMAX,RADMAX,RAY,X,Y S RAY=0,RADMAX=$$ROUSIZE^DILF()
  1. F S RAY=$O(^DIE("AF",75.1,21,RAY)) Q:RAY="" D ;Y = IEN of compiled template
  1. .S DMAX=RADMAX
  1. .S X=$P(^DIE(RAY,"ROU"),U,2) ;X = compiled template routine name
  1. .S Y=RAY D:X'="" EN^DIEZ
  1. .Q
  1. ;
  1. ; part 2: re-index of the "BDD" 'DATE DESIRED (not guaranteed)' (tasked)
  1. ;
  1. N RATXT,ZTDESC,ZTDTH,ZTIO,ZTRTN S ZTIO=""
  1. S ZTRTN="EN2^RAUTODC",(ZTDESC,RATXT(1))="RA135: re-index of the 'DATE DESIRED (Not guaranteed)' ""BDD"" xref"
  1. ;
  1. S ZTDTH=$H D ^%ZTLOAD S RATXT(2)="Task: "_$S($G(ZTSK)>0:ZTSK,1:"in error")
  1. D BMES^XPDUTL(.RATXT)
  1. Q
  1. ;
  1. EN2 ;Schedule option RA AUTO DISCONTINUE PROCESS to discontinue pending, hold & scheduled
  1. ; (check Scheduled D/T) from the beginning of time through May 31st 2015@2359.
  1. ; This option will be run once and be deleted from the OPTION SCHEDULING file.
  1. ; A future RIS patch will delete the RA AUTO DISCONTINUE PROCESS option.
  1. ;
  1. ; Note: do not fire bulletins, do not fire notifications (toggle on/off)
  1. ;
  1. ; if "OBSOLETE ORDER-P135 (automated)" has not been added quit...
  1. N RATXT I $$FIND1^DIC(75.2,"","X","OBSOLETE ORDER-P135 (automated)","B")=0 D QUIT
  1. .S RATXT(1)="Error: 'OBSOLETE ORDER-P135 (automated)' could not be found."
  1. .S RATXT(2)="Contact the developers of RA*5.0*135 to address this issue."
  1. .D BMES^XPDUTL(.RATXT)
  1. .Q
  1. ;
  1. N DIFROM,RADEV,RAERR,RAFDA,RAFREQ,RAIEN,RAOPT,RAR,RAUSER,RAWHEN,X,Y
  1. S RAOPT="RA AUTO DISCONTINUE PROCESS" ;xported w/135
  1. ;jobs in production are tasked off for tomorrow @21:00; jobs in mirror run today in an hour
  1. S RAWHEN=$S($$PROD^XUPROD()=1:$$FMADD^XLFDT(DT,1)_".21",1:$$FMADD^XLFDT($E($$NOW^XLFDT(),1,12),0,1,0,0))
  1. S RAUSER="POSTMASTER"
  1. S RAWHEN=$$FMTE^XLFDT(RAWHEN) ;use external
  1. S RAR=$NA(RAFDA(19.2,"?+1,")) ;RAFDA root
  1. ;.01 - option to be scheduled
  1. S @RAR@(.01)=RAOPT
  1. ;field #: 2 - QUEUED TO RUN AT WHAT TIME
  1. S:$D(RAWHEN) @RAR@(2)=RAWHEN
  1. ;field #: 3 - DEVICE FOR QUEUED JOB OUTPUT
  1. S:$D(RADEV) @RAR@(3)=RADEV
  1. ;field #: 6 - RESCHEDULING FREQUENCY
  1. S:$D(RAFREQ) @RAR@(6)=RAFREQ
  1. ;field #: 11 - USER TO RUN TASK
  1. S:$D(RAUSER) @RAR@(11)=RAUSER
  1. D UPDATE^DIE("E","RAFDA","RAIEN","RAERR")
  1. I $D(RAERR) D
  1. .S RATXT(1)="Error: """_RAOPT_""" could not be scheduled."
  1. .S RATXT(2)="Contact the developers of RA*5.0*135 to address this issue."
  1. .D BMES^XPDUTL(.RATXT)
  1. .Q
  1. I $G(RAIEN(1))>0 D
  1. .K RA192,RATXT S RATXT(1)=""
  1. .D OPTSTAT^XUTMOPT(RAOPT,.RA192)
  1. .S RATXT(2)=RAOPT_" Task: "_$P($G(RA192(1)),U) ;task # ^ D/T scheduled
  1. .D BMES^XPDUTL(.RATXT) K RA192,RATXT
  1. .Q
  1. Q
  1. ;
  1. EN3 ;re-index the "AS" cross reference missed in RA*5.0*130
  1. ;
  1. N RATXT,ZTDESC,ZTDTH,ZTIO,ZTRTN S ZTIO="",RATXT(1)=""
  1. S ZTRTN="EN3^RAUTODC",(ZTDESC,RATXT(2))="RA135: re-index of the 'REQUEST STATUS' ""AS"" xref."
  1. ;
  1. S ZTDTH=$H D ^%ZTLOAD S RATXT(3)="Task: "_$S($G(ZTSK)>0:ZTSK,1:"in error")
  1. D BMES^XPDUTL(.RATXT)
  1. Q
  1. ;