HMPEQLM1 ;SLC/MJK,ASMR/RRB - HMP Freshness Report;02-JUL-2014
;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**;Sep 01, 2011;Build 63
;Per VA Directive 6402, this routine should not be modified.
;
Q
;
EN(HMPSRV) ; -- main entry point for HMPM EVT QUE FRESHNESS REPORT
D EN^VALM("HMPM EVT QUE FRESHNESS REPORT")
Q
;
HDR ; -- header code
Q
;
INIT ; -- init variables and list array
N IEN,SRVNM,HMPDATA,SEQ,X
;
D KILL
S VALMCNT=0
;
; -- show current server and then the rest
I +$G(HMPSRV) D SRV^HMPEQ("HMPDATA",+HMPSRV),SRV(.HMPDATA)
D SET(" ")
;
; -- loop & sort thru defined HMP servers
K HMPDATA
S HMPDATA=$NA(^TMP("HMP FRESHNESS RPT",$J))
K @HMPDATA
D SRVS^HMPEQ(HMPDATA)
S SEQ=0
F S SEQ=$O(@HMPDATA@("servers",SEQ)) Q:'SEQ d
. M X=@HMPDATA@("servers",SEQ) D SRV(.X)
;
I VALMCNT=0 D NOROWS^HMPEQ("No HMP server information to display")
S VALMBG=1
S VALMSG="* updates waiting"
K @HMPDATA
Q
;
SRV(SRV) ; -- process one server
N X,SEQ
S X=""
S X=$$SETFLD^VALM1($G(SRV("name")),X,"SERVER")
S X=$$SETFLD^VALM1($G(SRV("lastUpdate")),X,"LAST")
S X=$$SETFLD^VALM1($S($G(SRV("repeated")):" x"_$G(SRV("repeated")),1:""),X,"REPEATED")
S X=$$SETFLD^VALM1($G(SRV("queueEnd")),X,"END")
I $G(SRV("lastUpdate")),$G(SRV("lastUpdate"))'=$G(SRV("queueEnd")) S X=$$SETFLD^VALM1("*",X,"BEHIND")
D SET(X)
D FLDCTRL^VALM10(VALMCNT,"SERVER",IOINHI,IOINORM)
;
I '$D(SRV("extracts")) Q
; -- loop thru extracts for this server
D SET($J("Extract Information:",25))
S SEQ=0
F S SEQ=$O(SRV("extracts",SEQ)) Q:'SEQ D
. S X=$J($G(SRV("extracts",SEQ,"domain")),15)
. S X=X_" Task(s): "_$G(SRV("extracts",SEQ,"tasks"))
. D SET(X)
. I $G(SRV("extracts",SEQ,"waiting")) D SET($J("Waiting: ",29)_$G(SRV("extracts",SEQ,"waiting"))_" seconds") Q
. D SET($J("Extracting: "_$G(SRV("extracts",SEQ,"lastCount")),40))
Q
;
SET(X,BOLD) ; -- add line
S VALMCNT=VALMCNT+1
S @VALMAR@(VALMCNT,0)=X
Q
;
KILL ; -- kill off build data
K @VALMAR
; clean up video control data
D KILL^VALM10()
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
Q
;
EXPND ; -- expand code
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHMPEQLM1 2206 printed Dec 13, 2024@01:53:58 Page 2
HMPEQLM1 ;SLC/MJK,ASMR/RRB - HMP Freshness Report;02-JUL-2014
+1 ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**;Sep 01, 2011;Build 63
+2 ;Per VA Directive 6402, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
EN(HMPSRV) ; -- main entry point for HMPM EVT QUE FRESHNESS REPORT
+1 DO EN^VALM("HMPM EVT QUE FRESHNESS REPORT")
+2 QUIT
+3 ;
HDR ; -- header code
+1 QUIT
+2 ;
INIT ; -- init variables and list array
+1 NEW IEN,SRVNM,HMPDATA,SEQ,X
+2 ;
+3 DO KILL
+4 SET VALMCNT=0
+5 ;
+6 ; -- show current server and then the rest
+7 IF +$GET(HMPSRV)
DO SRV^HMPEQ("HMPDATA",+HMPSRV)
DO SRV(.HMPDATA)
+8 DO SET(" ")
+9 ;
+10 ; -- loop & sort thru defined HMP servers
+11 KILL HMPDATA
+12 SET HMPDATA=$NAME(^TMP("HMP FRESHNESS RPT",$JOB))
+13 KILL @HMPDATA
+14 DO SRVS^HMPEQ(HMPDATA)
+15 SET SEQ=0
+16 FOR
SET SEQ=$ORDER(@HMPDATA@("servers",SEQ))
if 'SEQ
QUIT
Begin DoDot:1
+17 MERGE X=@HMPDATA@("servers",SEQ)
DO SRV(.X)
End DoDot:1
+18 ;
+19 IF VALMCNT=0
DO NOROWS^HMPEQ("No HMP server information to display")
+20 SET VALMBG=1
+21 SET VALMSG="* updates waiting"
+22 KILL @HMPDATA
+23 QUIT
+24 ;
SRV(SRV) ; -- process one server
+1 NEW X,SEQ
+2 SET X=""
+3 SET X=$$SETFLD^VALM1($GET(SRV("name")),X,"SERVER")
+4 SET X=$$SETFLD^VALM1($GET(SRV("lastUpdate")),X,"LAST")
+5 SET X=$$SETFLD^VALM1($SELECT($GET(SRV("repeated")):" x"_$GET(SRV("repeated")),1:""),X,"REPEATED")
+6 SET X=$$SETFLD^VALM1($GET(SRV("queueEnd")),X,"END")
+7 IF $GET(SRV("lastUpdate"))
IF $GET(SRV("lastUpdate"))'=$GET(SRV("queueEnd"))
SET X=$$SETFLD^VALM1("*",X,"BEHIND")
+8 DO SET(X)
+9 DO FLDCTRL^VALM10(VALMCNT,"SERVER",IOINHI,IOINORM)
+10 ;
+11 IF '$DATA(SRV("extracts"))
QUIT
+12 ; -- loop thru extracts for this server
+13 DO SET($JUSTIFY("Extract Information:",25))
+14 SET SEQ=0
+15 FOR
SET SEQ=$ORDER(SRV("extracts",SEQ))
if 'SEQ
QUIT
Begin DoDot:1
+16 SET X=$JUSTIFY($GET(SRV("extracts",SEQ,"domain")),15)
+17 SET X=X_" Task(s): "_$GET(SRV("extracts",SEQ,"tasks"))
+18 DO SET(X)
+19 IF $GET(SRV("extracts",SEQ,"waiting"))
DO SET($JUSTIFY("Waiting: ",29)_$GET(SRV("extracts",SEQ,"waiting"))_" seconds")
QUIT
+20 DO SET($JUSTIFY("Extracting: "_$GET(SRV("extracts",SEQ,"lastCount")),40))
End DoDot:1
+21 QUIT
+22 ;
SET(X,BOLD) ; -- add line
+1 SET VALMCNT=VALMCNT+1
+2 SET @VALMAR@(VALMCNT,0)=X
+3 QUIT
+4 ;
KILL ; -- kill off build data
+1 KILL @VALMAR
+2 ; clean up video control data
+3 DO KILL^VALM10()
+4 QUIT
+5 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 QUIT
+2 ;
EXPND ; -- expand code
+1 QUIT
+2 ;