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

HMPMONE.m

Go to the documentation of this file.
  1. HMPMONE ;ASMR/BL,JCH, monitor error actions ;Sep 13, 2016 20:03:08
  1. ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**2,3**;April 14,2016;Build 15
  1. ;Per VA Directive 6402, this routine should not be modified.
  1. ;
  1. Q ; no entry from top
  1. ;DE6526, DE6644 - routine refactored, 7 September 2016
  1. ;
  1. UE ; update error screen
  1. ; input:
  1. ; HMPMNTR("server") = # of server record in file HMP Subscription (800000)
  1. ; output:
  1. ; report counts
  1. N ERRCNT,EXIT,STREAM ; freshness stream subscript in ^XTMP
  1. S EXIT=0,STREAM=$$LASTREAM^HMPMONL ; get last freshness stream
  1. F Q:EXIT D
  1. . S HMPMNTR("default")="BM" ; default for this screen
  1. . D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("eHMP Errors"),! ; header line
  1. . S ERRCNT("HMPXTEMP ERRORS")=$$EXTMP ; ehmp errors in xtmp error log
  1. . S ERRCNT("TMP HMPERR")=$$EHMPJB ; ehmp errors in hmperr error log
  1. . S ERRCNT("HMFERR")=$$EHMPFERR ; ehmp errors in hmpferr error log
  1. . S ERRCNT("TMP $J HMP ERROR")=$$ETMPJOB ; ehmp errors in hmp error error lo
  1. . S ERRCNT("TOTAL")=ERRCNT("HMPXTEMP ERRORS")+ERRCNT("TMP HMPERR")+ERRCNT("HMFERR")+ERRCNT("TMP $J HMP ERROR") ;total ehmp errors
  1. . W !," error log # errors"
  1. . W !," --------------------- --------"
  1. . W !," Total: "_ERRCNT("TOTAL"),!
  1. . W !," ^XTMP('HMPXTEMP ERRORS'): "_ERRCNT("HMPXTEMP ERRORS")
  1. . W !," ^TMP('HMPERR',$job): "_ERRCNT("TMP HMPERR")
  1. . W !," ^TMP('HMPFERR',$job,$h): "_ERRCNT("HMFERR")
  1. . W !," ^TMP($job,'HMP ERROR'): "_ERRCNT("TMP $J HMP ERROR")
  1. . D PROMPT^HMPMONA(.HMPACT,"ERR") ; select prompts from the ERR group
  1. . I HMPACT="UE" Q ; update error screen, nothing to do
  1. . I HMPACT="BM" S EXIT=1 Q ; back to monitor
  1. . I $D(DUOUT)!$D(DIROUT)!$D(DTOUT) S EXIT=1 Q ; handle '^'
  1. . S LNTAG=$P(HMPCALLS(HMPACT),";",3)
  1. . D @LNTAG S EXIT=HMPMNTR("exit") Q:HMPMNTR("exit") ; perform user-selected action, exit if flag set
  1. . D RTRN2CON^HMPMONL ; return to continue
  1. Q
  1. ;
  1. ;
  1. ETOTL() ; function, count ehmp errors in all error logs
  1. ; called by:
  1. ; SHOWSRVR^HMPMON
  1. ; output = # ehmp errors in all error logs
  1. ;
  1. N ERRCNT
  1. S ERRCNT("HMPXTEMP ERRORS")=$$EXTMP ; errors in ^XTMP("HMPXTEMP ERRORS")
  1. S ERRCNT("TMP HMPERR")=$$EHMPJB ; errors in ^TMP("HMPERR",$J)
  1. S ERRCNT("HMFERR")=$$EHMPFERR ; errors in ^TMP("HMPFERR",$J)
  1. S ERRCNT("TMP $J HMP ERROR")=$$ETMPJOB ; errors in ^TMP($J,"HMP ERROR","# of Errors")
  1. ; return total errors
  1. Q ERRCNT("HMPXTEMP ERRORS")+ERRCNT("TMP HMPERR")+ERRCNT("HMFERR")+ERRCNT("TMP $J HMP ERROR")
  1. ;
  1. ;
  1. EXTMP() ; function, errors in ^XTMP("HMPXTEMP ERRORS")
  1. ; output = # ehmp errors in xtmp error log
  1. Q +$O(^XTMP("HMPXTEMP ERRORS",""),-1)
  1. ;
  1. EHMPJB() ; function, total errors in ^TMP("HMPERR",$J)
  1. N CNT,JB S CNT=0,JB=0
  1. F S JB=$O(^TMP("HMPERR",JB)) Q:'JB S CNT=CNT+$O(^TMP("HMPERR",JB,0))
  1. Q CNT
  1. ;
  1. EHMPFERR() ; function, errors in ^TMP("HMPFERR",$J)
  1. Q:'$O(^TMP("HMPFERR",0)) 0 ; nothing to count
  1. N CNT,JB,HTM S CNT=0,JB=0
  1. F S JB=$O(^TMP("HMPFERR",JB)) Q:'JB S HTM=0 F S HTM=$O(^TMP("HMPFERR",JB,HTM)) Q:'HTM S CNT=CNT+1
  1. Q CNT ; return total errors
  1. ;
  1. ;
  1. ETMPJOB() ; function, total errors in ^TMP($J,"HMP ERROR","# of Errors")
  1. N CNT,JB S CNT=0,JB=0
  1. F S JB=$O(^TMP(JB)) Q:'JB S CNT=CNT+$G(^TMP(JB,"HMP ERROR","# of Errors"))
  1. Q CNT ; return # errors
  1. ;
  1. EX ; display ^XTMP error log, called from ^DIR selection in OPTION^HMPMON
  1. D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("^XTMP errors"),! ; header line
  1. W !,"Total Errors in "_$NA(^XTMP("HMPXTEMP ERRORS"))_": "_$$EXTMP Q
  1. ;
  1. E3 ; display ^TMP("HMPERR",$J) errors
  1. D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("^TMP('HMPERR',$J"),! ; header line
  1. W !,"Total Errors in "_$NA(^XTMP("HMPERR","job#"))_": "_$$EHMPJB Q
  1. ;
  1. E4 ; display ^TMP("HMPFERR",$J) errors, set in routine HMPDJFS
  1. W !,"Total Errors in "_$NA(^XTMP("HMPFERR","job#"))_$$EHMPFERR Q
  1. ;
  1. ;
  1. E5 ; display ^TMP($job,"HMP ERROR") error info, set in routines:
  1. ; HMPDERRH
  1. ; HMPDJ
  1. ; HMPDJ2
  1. ; HMPDJX
  1. ; HMPEF
  1. ; HMPEF1
  1. D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("^TMP($J,'HMP ERROR'"),! ; header line
  1. W !!,"Total Errors in "_$NA(^TMP("job#","HMP ERROR"))_": "_$$ETMPJOB Q
  1. ;
  1. LOG ; interactive display of HMP EVENT entry
  1. D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("HMP EVENT log"),! ; header line
  1. I '$O(^HMPLOG(800003,0)) W !,"The HMP EVENT file (#800003) is *empty*",!! D RTRN2CON^HMPMONL Q
  1. N DA,DR,DIQ,DIC,X,Y
  1. S DIC="^HMPLOG(800003,",DIC(0)="AEMQ" D ^DIC
  1. I '(Y>0) D FORMFEED^HMPMONL Q ; nothing selected
  1. S DA=+Y W ! D EN^DIQ ; DR is undefined to display all fields
  1. W !!,"* End of HMP EVENT listing "_$$NOW^HMPMONL_" *",! D RTRN2CON^HMPMONL
  1. Q
  1. ;