GMRCIBKM ;SLC/JFR - MONITOR IFC BKG PARAMS ; 2/14/02 21:22
;;3.0;CONSULT/REQUEST TRACKING;**22**;DEC 27, 1997
EN ; -- main entry point for GMRC IFC MONITOR BKG JOB
D REFRESH
D EN^VALM("GMRC IF MONITOR BKG JOB")
Q
;
HDR ; -- header code
S VALMHDR(1)="Inter-facility Consults background job parameter display"
Q
;
BLD ; Build list for LM display
N GMRCBST,GMRCNOW,GMRCBFI,CNT,GMRCBSTE,GMRCBFIE,TXT
K ^TMP("GMRCBK",$J)
S GMRCNOW=$$NOW^XLFDT
S GMRCBST=$$GET^XPAR("SYS","GMRC IFC BACKGROUND START",1)
S GMRCBSTE=$S($G(GMRCBST):$$FMTE^XLFDT(GMRCBST),1:"Unknown")
S GMRCBFI=$$GET^XPAR("SYS","GMRC IFC BACKGROUND FINISH",1)
S GMRCBFIE=$S($G(GMRCBFI):$$FMTE^XLFDT(GMRCBFI),1:"Unknown")
S ^TMP("GMRCBK",$J,1,0)=""
I GMRCBST>GMRCNOW S TXT(2)="The IFC background job is delayed until: "
I '$D(TXT(2)) S TXT(2)="The IFC background job last started: "
S ^TMP("GMRCBK",$J,2,0)=TXT(2)_GMRCBSTE
S TXT(3)="The IFC background job last finished: "
S ^TMP("GMRCBK",$J,3,0)=TXT(3)_GMRCBFIE
S ^TMP("GMRCBK",$J,4,0)=""
I GMRCBST>GMRCNOW D Q
. S ^TMP("GMRCBK",$J,5,0)="The start parameter for this job has been "
. S ^TMP("GMRCBK",$J,6,0)="intentionally set to a future date/time."
. S ^TMP("GMRCBK",$J,7,0)=""
. S ^TMP("GMRCBK",$J,8,0)="The background job will not start until the "
. S ^TMP("GMRCBK",$J,9,0)="date/time indicated in this parameter"
I $$FMDIFF^XLFDT(GMRCBST,GMRCBFI,2)>4500 D Q
. S ^TMP("GMRCBK",$J,5,0)="The background job is overdue."
. S ^TMP("GMRCBK",$J,6,0)="IRMS should review the system for errors"
. S ^TMP("GMRCBK",$J,7,0)="related to the IFC background job."
. S ^TMP("GMRCBK",$J,8,0)=" "
. S ^TMP("GMRCBK",$J,9,0)="If errors can not be resolved, contact NVS"
. S ^TMP("GMRCBK",$J,10,0)="for assistance."
I GMRCNOW>GMRCBST,$$FMDIFF^XLFDT(GMRCNOW,GMRCBST,2)>4500 D Q
. S ^TMP("GMRCBK",$J,5,0)="The background job is overdue."
. S ^TMP("GMRCBK",$J,6,0)="IRMS should review the system for errors"
. S ^TMP("GMRCBK",$J,7,0)="related to the IFC background job."
. S ^TMP("GMRCBK",$J,8,0)=" "
. S ^TMP("GMRCBK",$J,9,0)="If errors can not be resolved, contact NVS"
. S ^TMP("GMRCBK",$J,10,0)="for assistance."
D ; all is well
. S ^TMP("GMRCBK",$J,5,0)="The IFC background job is on schedule or is"
. S ^TMP("GMRCBK",$J,6,0)="running. "
. S ^TMP("GMRCBK",$J,7,0)=""
. S ^TMP("GMRCBK",$J,8,0)="It may be delayed by editing the start time"
. S ^TMP("GMRCBK",$J,9,0)="to a future date/time using the Edit start "
. S ^TMP("GMRCBK",$J,10,0)="time action."
Q
;
EDSTRT ; edit the start parameter
;
N DIR,X,Y,DIRUT,DTOUT,DUOUT,DIROUT,GMRCLATE,GMRCSTRT
D FULL^VALM1
S GMRCLATE=$$FMADD^XLFDT($$NOW^XLFDT,4)
S GMRCSTRT=$$GET^XPAR("SYS","GMRC IFC BACKGROUND START",1)
S DIR(0)="D0A^"_DT_":"_GMRCLATE_":ETSR"
S DIR("A",1)=""
S DIR("A")="Next date/time the IFC background job should run: "
S DIR("B")=$$FMTE^XLFDT(GMRCSTRT)
D ^DIR
I '+Y S VALMBCK="R" Q
D EN^XPAR("SYS","GMRC IFC BACKGROUND START",1,Y)
D REFRESH
Q
;
REFRESH ; rebuild list
D BLD
S VALMBCK="R",VALMCNT=$O(^TMP("GMRCBK",$J," "),-1)
S VALMBG=1
Q
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
K ^TMP("GMRCBK",$J)
S VALMBCK="Q"
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRCIBKM 3273 printed Dec 13, 2024@01:45:58 Page 2
GMRCIBKM ;SLC/JFR - MONITOR IFC BKG PARAMS ; 2/14/02 21:22
+1 ;;3.0;CONSULT/REQUEST TRACKING;**22**;DEC 27, 1997
EN ; -- main entry point for GMRC IFC MONITOR BKG JOB
+1 DO REFRESH
+2 DO EN^VALM("GMRC IF MONITOR BKG JOB")
+3 QUIT
+4 ;
HDR ; -- header code
+1 SET VALMHDR(1)="Inter-facility Consults background job parameter display"
+2 QUIT
+3 ;
BLD ; Build list for LM display
+1 NEW GMRCBST,GMRCNOW,GMRCBFI,CNT,GMRCBSTE,GMRCBFIE,TXT
+2 KILL ^TMP("GMRCBK",$JOB)
+3 SET GMRCNOW=$$NOW^XLFDT
+4 SET GMRCBST=$$GET^XPAR("SYS","GMRC IFC BACKGROUND START",1)
+5 SET GMRCBSTE=$SELECT($GET(GMRCBST):$$FMTE^XLFDT(GMRCBST),1:"Unknown")
+6 SET GMRCBFI=$$GET^XPAR("SYS","GMRC IFC BACKGROUND FINISH",1)
+7 SET GMRCBFIE=$SELECT($GET(GMRCBFI):$$FMTE^XLFDT(GMRCBFI),1:"Unknown")
+8 SET ^TMP("GMRCBK",$JOB,1,0)=""
+9 IF GMRCBST>GMRCNOW
SET TXT(2)="The IFC background job is delayed until: "
+10 IF '$DATA(TXT(2))
SET TXT(2)="The IFC background job last started: "
+11 SET ^TMP("GMRCBK",$JOB,2,0)=TXT(2)_GMRCBSTE
+12 SET TXT(3)="The IFC background job last finished: "
+13 SET ^TMP("GMRCBK",$JOB,3,0)=TXT(3)_GMRCBFIE
+14 SET ^TMP("GMRCBK",$JOB,4,0)=""
+15 IF GMRCBST>GMRCNOW
Begin DoDot:1
+16 SET ^TMP("GMRCBK",$JOB,5,0)="The start parameter for this job has been "
+17 SET ^TMP("GMRCBK",$JOB,6,0)="intentionally set to a future date/time."
+18 SET ^TMP("GMRCBK",$JOB,7,0)=""
+19 SET ^TMP("GMRCBK",$JOB,8,0)="The background job will not start until the "
+20 SET ^TMP("GMRCBK",$JOB,9,0)="date/time indicated in this parameter"
End DoDot:1
QUIT
+21 IF $$FMDIFF^XLFDT(GMRCBST,GMRCBFI,2)>4500
Begin DoDot:1
+22 SET ^TMP("GMRCBK",$JOB,5,0)="The background job is overdue."
+23 SET ^TMP("GMRCBK",$JOB,6,0)="IRMS should review the system for errors"
+24 SET ^TMP("GMRCBK",$JOB,7,0)="related to the IFC background job."
+25 SET ^TMP("GMRCBK",$JOB,8,0)=" "
+26 SET ^TMP("GMRCBK",$JOB,9,0)="If errors can not be resolved, contact NVS"
+27 SET ^TMP("GMRCBK",$JOB,10,0)="for assistance."
End DoDot:1
QUIT
+28 IF GMRCNOW>GMRCBST
IF $$FMDIFF^XLFDT(GMRCNOW,GMRCBST,2)>4500
Begin DoDot:1
+29 SET ^TMP("GMRCBK",$JOB,5,0)="The background job is overdue."
+30 SET ^TMP("GMRCBK",$JOB,6,0)="IRMS should review the system for errors"
+31 SET ^TMP("GMRCBK",$JOB,7,0)="related to the IFC background job."
+32 SET ^TMP("GMRCBK",$JOB,8,0)=" "
+33 SET ^TMP("GMRCBK",$JOB,9,0)="If errors can not be resolved, contact NVS"
+34 SET ^TMP("GMRCBK",$JOB,10,0)="for assistance."
End DoDot:1
QUIT
+35 ; all is well
Begin DoDot:1
+36 SET ^TMP("GMRCBK",$JOB,5,0)="The IFC background job is on schedule or is"
+37 SET ^TMP("GMRCBK",$JOB,6,0)="running. "
+38 SET ^TMP("GMRCBK",$JOB,7,0)=""
+39 SET ^TMP("GMRCBK",$JOB,8,0)="It may be delayed by editing the start time"
+40 SET ^TMP("GMRCBK",$JOB,9,0)="to a future date/time using the Edit start "
+41 SET ^TMP("GMRCBK",$JOB,10,0)="time action."
End DoDot:1
+42 QUIT
+43 ;
EDSTRT ; edit the start parameter
+1 ;
+2 NEW DIR,X,Y,DIRUT,DTOUT,DUOUT,DIROUT,GMRCLATE,GMRCSTRT
+3 DO FULL^VALM1
+4 SET GMRCLATE=$$FMADD^XLFDT($$NOW^XLFDT,4)
+5 SET GMRCSTRT=$$GET^XPAR("SYS","GMRC IFC BACKGROUND START",1)
+6 SET DIR(0)="D0A^"_DT_":"_GMRCLATE_":ETSR"
+7 SET DIR("A",1)=""
+8 SET DIR("A")="Next date/time the IFC background job should run: "
+9 SET DIR("B")=$$FMTE^XLFDT(GMRCSTRT)
+10 DO ^DIR
+11 IF '+Y
SET VALMBCK="R"
QUIT
+12 DO EN^XPAR("SYS","GMRC IFC BACKGROUND START",1,Y)
+13 DO REFRESH
+14 QUIT
+15 ;
REFRESH ; rebuild list
+1 DO BLD
+2 SET VALMBCK="R"
SET VALMCNT=$ORDER(^TMP("GMRCBK",$JOB," "),-1)
+3 SET VALMBG=1
+4 QUIT
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 KILL ^TMP("GMRCBK",$JOB)
+2 SET VALMBCK="Q"
+3 QUIT
+4 ;