- HMPMONE ;ASMR/BL,JCH, monitor error actions ;Sep 13, 2016 20:03:08
- ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**2,3**;April 14,2016;Build 15
- ;Per VA Directive 6402, this routine should not be modified.
- ;
- Q ; no entry from top
- ;DE6526, DE6644 - routine refactored, 7 September 2016
- ;
- UE ; update error screen
- ; input:
- ; HMPMNTR("server") = # of server record in file HMP Subscription (800000)
- ; output:
- ; report counts
- N ERRCNT,EXIT,STREAM ; freshness stream subscript in ^XTMP
- S EXIT=0,STREAM=$$LASTREAM^HMPMONL ; get last freshness stream
- F Q:EXIT D
- . S HMPMNTR("default")="BM" ; default for this screen
- . D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("eHMP Errors"),! ; header line
- . S ERRCNT("HMPXTEMP ERRORS")=$$EXTMP ; ehmp errors in xtmp error log
- . S ERRCNT("TMP HMPERR")=$$EHMPJB ; ehmp errors in hmperr error log
- . S ERRCNT("HMFERR")=$$EHMPFERR ; ehmp errors in hmpferr error log
- . S ERRCNT("TMP $J HMP ERROR")=$$ETMPJOB ; ehmp errors in hmp error error lo
- . S ERRCNT("TOTAL")=ERRCNT("HMPXTEMP ERRORS")+ERRCNT("TMP HMPERR")+ERRCNT("HMFERR")+ERRCNT("TMP $J HMP ERROR") ;total ehmp errors
- . W !," error log # errors"
- . W !," --------------------- --------"
- . W !," Total: "_ERRCNT("TOTAL"),!
- . W !," ^XTMP('HMPXTEMP ERRORS'): "_ERRCNT("HMPXTEMP ERRORS")
- . W !," ^TMP('HMPERR',$job): "_ERRCNT("TMP HMPERR")
- . W !," ^TMP('HMPFERR',$job,$h): "_ERRCNT("HMFERR")
- . W !," ^TMP($job,'HMP ERROR'): "_ERRCNT("TMP $J HMP ERROR")
- . D PROMPT^HMPMONA(.HMPACT,"ERR") ; select prompts from the ERR group
- . I HMPACT="UE" Q ; update error screen, nothing to do
- . I HMPACT="BM" S EXIT=1 Q ; back to monitor
- . I $D(DUOUT)!$D(DIROUT)!$D(DTOUT) S EXIT=1 Q ; handle '^'
- . S LNTAG=$P(HMPCALLS(HMPACT),";",3)
- . D @LNTAG S EXIT=HMPMNTR("exit") Q:HMPMNTR("exit") ; perform user-selected action, exit if flag set
- . D RTRN2CON^HMPMONL ; return to continue
- Q
- ;
- ;
- ETOTL() ; function, count ehmp errors in all error logs
- ; called by:
- ; SHOWSRVR^HMPMON
- ; output = # ehmp errors in all error logs
- ;
- N ERRCNT
- S ERRCNT("HMPXTEMP ERRORS")=$$EXTMP ; errors in ^XTMP("HMPXTEMP ERRORS")
- S ERRCNT("TMP HMPERR")=$$EHMPJB ; errors in ^TMP("HMPERR",$J)
- S ERRCNT("HMFERR")=$$EHMPFERR ; errors in ^TMP("HMPFERR",$J)
- S ERRCNT("TMP $J HMP ERROR")=$$ETMPJOB ; errors in ^TMP($J,"HMP ERROR","# of Errors")
- ; return total errors
- Q ERRCNT("HMPXTEMP ERRORS")+ERRCNT("TMP HMPERR")+ERRCNT("HMFERR")+ERRCNT("TMP $J HMP ERROR")
- ;
- ;
- EXTMP() ; function, errors in ^XTMP("HMPXTEMP ERRORS")
- ; output = # ehmp errors in xtmp error log
- Q +$O(^XTMP("HMPXTEMP ERRORS",""),-1)
- ;
- EHMPJB() ; function, total errors in ^TMP("HMPERR",$J)
- N CNT,JB S CNT=0,JB=0
- F S JB=$O(^TMP("HMPERR",JB)) Q:'JB S CNT=CNT+$O(^TMP("HMPERR",JB,0))
- Q CNT
- ;
- EHMPFERR() ; function, errors in ^TMP("HMPFERR",$J)
- Q:'$O(^TMP("HMPFERR",0)) 0 ; nothing to count
- N CNT,JB,HTM S CNT=0,JB=0
- 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
- Q CNT ; return total errors
- ;
- ;
- ETMPJOB() ; function, total errors in ^TMP($J,"HMP ERROR","# of Errors")
- N CNT,JB S CNT=0,JB=0
- F S JB=$O(^TMP(JB)) Q:'JB S CNT=CNT+$G(^TMP(JB,"HMP ERROR","# of Errors"))
- Q CNT ; return # errors
- ;
- EX ; display ^XTMP error log, called from ^DIR selection in OPTION^HMPMON
- D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("^XTMP errors"),! ; header line
- W !,"Total Errors in "_$NA(^XTMP("HMPXTEMP ERRORS"))_": "_$$EXTMP Q
- ;
- E3 ; display ^TMP("HMPERR",$J) errors
- D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("^TMP('HMPERR',$J"),! ; header line
- W !,"Total Errors in "_$NA(^XTMP("HMPERR","job#"))_": "_$$EHMPJB Q
- ;
- E4 ; display ^TMP("HMPFERR",$J) errors, set in routine HMPDJFS
- W !,"Total Errors in "_$NA(^XTMP("HMPFERR","job#"))_$$EHMPFERR Q
- ;
- ;
- E5 ; display ^TMP($job,"HMP ERROR") error info, set in routines:
- ; HMPDERRH
- ; HMPDJ
- ; HMPDJ2
- ; HMPDJX
- ; HMPEF
- ; HMPEF1
- D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("^TMP($J,'HMP ERROR'"),! ; header line
- W !!,"Total Errors in "_$NA(^TMP("job#","HMP ERROR"))_": "_$$ETMPJOB Q
- ;
- LOG ; interactive display of HMP EVENT entry
- D FORMFEED^HMPMONL W !,$$HDR^HMPMONL("HMP EVENT log"),! ; header line
- I '$O(^HMPLOG(800003,0)) W !,"The HMP EVENT file (#800003) is *empty*",!! D RTRN2CON^HMPMONL Q
- N DA,DR,DIQ,DIC,X,Y
- S DIC="^HMPLOG(800003,",DIC(0)="AEMQ" D ^DIC
- I '(Y>0) D FORMFEED^HMPMONL Q ; nothing selected
- S DA=+Y W ! D EN^DIQ ; DR is undefined to display all fields
- W !!,"* End of HMP EVENT listing "_$$NOW^HMPMONL_" *",! D RTRN2CON^HMPMONL
- Q
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHMPMONE 4681 printed Mar 13, 2025@20:58:52 Page 2
- 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
- +2 ;Per VA Directive 6402, this routine should not be modified.
- +3 ;
- +4 ; no entry from top
- QUIT
- +5 ;DE6526, DE6644 - routine refactored, 7 September 2016
- +6 ;
- UE ; update error screen
- +1 ; input:
- +2 ; HMPMNTR("server") = # of server record in file HMP Subscription (800000)
- +3 ; output:
- +4 ; report counts
- +5 ; freshness stream subscript in ^XTMP
- NEW ERRCNT,EXIT,STREAM
- +6 ; get last freshness stream
- SET EXIT=0
- SET STREAM=$$LASTREAM^HMPMONL
- +7 FOR
- if EXIT
- QUIT
- Begin DoDot:1
- +8 ; default for this screen
- SET HMPMNTR("default")="BM"
- +9 ; header line
- DO FORMFEED^HMPMONL
- WRITE !,$$HDR^HMPMONL("eHMP Errors"),!
- +10 ; ehmp errors in xtmp error log
- SET ERRCNT("HMPXTEMP ERRORS")=$$EXTMP
- +11 ; ehmp errors in hmperr error log
- SET ERRCNT("TMP HMPERR")=$$EHMPJB
- +12 ; ehmp errors in hmpferr error log
- SET ERRCNT("HMFERR")=$$EHMPFERR
- +13 ; ehmp errors in hmp error error lo
- SET ERRCNT("TMP $J HMP ERROR")=$$ETMPJOB
- +14 ;total ehmp errors
- SET ERRCNT("TOTAL")=ERRCNT("HMPXTEMP ERRORS")+ERRCNT("TMP HMPERR")+ERRCNT("HMFERR")+ERRCNT("TMP $J HMP ERROR")
- +15 WRITE !," error log # errors"
- +16 WRITE !," --------------------- --------"
- +17 WRITE !," Total: "_ERRCNT("TOTAL"),!
- +18 WRITE !," ^XTMP('HMPXTEMP ERRORS'): "_ERRCNT("HMPXTEMP ERRORS")
- +19 WRITE !," ^TMP('HMPERR',$job): "_ERRCNT("TMP HMPERR")
- +20 WRITE !," ^TMP('HMPFERR',$job,$h): "_ERRCNT("HMFERR")
- +21 WRITE !," ^TMP($job,'HMP ERROR'): "_ERRCNT("TMP $J HMP ERROR")
- +22 ; select prompts from the ERR group
- DO PROMPT^HMPMONA(.HMPACT,"ERR")
- +23 ; update error screen, nothing to do
- IF HMPACT="UE"
- QUIT
- +24 ; back to monitor
- IF HMPACT="BM"
- SET EXIT=1
- QUIT
- +25 ; handle '^'
- IF $DATA(DUOUT)!$DATA(DIROUT)!$DATA(DTOUT)
- SET EXIT=1
- QUIT
- +26 SET LNTAG=$PIECE(HMPCALLS(HMPACT),";",3)
- +27 ; perform user-selected action, exit if flag set
- DO @LNTAG
- SET EXIT=HMPMNTR("exit")
- if HMPMNTR("exit")
- QUIT
- +28 ; return to continue
- DO RTRN2CON^HMPMONL
- End DoDot:1
- +29 QUIT
- +30 ;
- +31 ;
- ETOTL() ; function, count ehmp errors in all error logs
- +1 ; called by:
- +2 ; SHOWSRVR^HMPMON
- +3 ; output = # ehmp errors in all error logs
- +4 ;
- +5 NEW ERRCNT
- +6 ; errors in ^XTMP("HMPXTEMP ERRORS")
- SET ERRCNT("HMPXTEMP ERRORS")=$$EXTMP
- +7 ; errors in ^TMP("HMPERR",$J)
- SET ERRCNT("TMP HMPERR")=$$EHMPJB
- +8 ; errors in ^TMP("HMPFERR",$J)
- SET ERRCNT("HMFERR")=$$EHMPFERR
- +9 ; errors in ^TMP($J,"HMP ERROR","# of Errors")
- SET ERRCNT("TMP $J HMP ERROR")=$$ETMPJOB
- +10 ; return total errors
- +11 QUIT ERRCNT("HMPXTEMP ERRORS")+ERRCNT("TMP HMPERR")+ERRCNT("HMFERR")+ERRCNT("TMP $J HMP ERROR")
- +12 ;
- +13 ;
- EXTMP() ; function, errors in ^XTMP("HMPXTEMP ERRORS")
- +1 ; output = # ehmp errors in xtmp error log
- +2 QUIT +$ORDER(^XTMP("HMPXTEMP ERRORS",""),-1)
- +3 ;
- EHMPJB() ; function, total errors in ^TMP("HMPERR",$J)
- +1 NEW CNT,JB
- SET CNT=0
- SET JB=0
- +2 FOR
- SET JB=$ORDER(^TMP("HMPERR",JB))
- if 'JB
- QUIT
- SET CNT=CNT+$ORDER(^TMP("HMPERR",JB,0))
- +3 QUIT CNT
- +4 ;
- EHMPFERR() ; function, errors in ^TMP("HMPFERR",$J)
- +1 ; nothing to count
- if '$ORDER(^TMP("HMPFERR",0))
- QUIT 0
- +2 NEW CNT,JB,HTM
- SET CNT=0
- SET JB=0
- +3 FOR
- SET JB=$ORDER(^TMP("HMPFERR",JB))
- if 'JB
- QUIT
- SET HTM=0
- FOR
- SET HTM=$ORDER(^TMP("HMPFERR",JB,HTM))
- if 'HTM
- QUIT
- SET CNT=CNT+1
- +4 ; return total errors
- QUIT CNT
- +5 ;
- +6 ;
- ETMPJOB() ; function, total errors in ^TMP($J,"HMP ERROR","# of Errors")
- +1 NEW CNT,JB
- SET CNT=0
- SET JB=0
- +2 FOR
- SET JB=$ORDER(^TMP(JB))
- if 'JB
- QUIT
- SET CNT=CNT+$GET(^TMP(JB,"HMP ERROR","# of Errors"))
- +3 ; return # errors
- QUIT CNT
- +4 ;
- EX ; display ^XTMP error log, called from ^DIR selection in OPTION^HMPMON
- +1 ; header line
- DO FORMFEED^HMPMONL
- WRITE !,$$HDR^HMPMONL("^XTMP errors"),!
- +2 WRITE !,"Total Errors in "_$NAME(^XTMP("HMPXTEMP ERRORS"))_": "_$$EXTMP
- QUIT
- +3 ;
- E3 ; display ^TMP("HMPERR",$J) errors
- +1 ; header line
- DO FORMFEED^HMPMONL
- WRITE !,$$HDR^HMPMONL("^TMP('HMPERR',$J"),!
- +2 WRITE !,"Total Errors in "_$NAME(^XTMP("HMPERR","job#"))_": "_$$EHMPJB
- QUIT
- +3 ;
- E4 ; display ^TMP("HMPFERR",$J) errors, set in routine HMPDJFS
- +1 WRITE !,"Total Errors in "_$NAME(^XTMP("HMPFERR","job#"))_$$EHMPFERR
- QUIT
- +2 ;
- +3 ;
- E5 ; display ^TMP($job,"HMP ERROR") error info, set in routines:
- +1 ; HMPDERRH
- +2 ; HMPDJ
- +3 ; HMPDJ2
- +4 ; HMPDJX
- +5 ; HMPEF
- +6 ; HMPEF1
- +7 ; header line
- DO FORMFEED^HMPMONL
- WRITE !,$$HDR^HMPMONL("^TMP($J,'HMP ERROR'"),!
- +8 WRITE !!,"Total Errors in "_$NAME(^TMP("job#","HMP ERROR"))_": "_$$ETMPJOB
- QUIT
- +9 ;
- LOG ; interactive display of HMP EVENT entry
- +1 ; header line
- DO FORMFEED^HMPMONL
- WRITE !,$$HDR^HMPMONL("HMP EVENT log"),!
- +2 IF '$ORDER(^HMPLOG(800003,0))
- WRITE !,"The HMP EVENT file (#800003) is *empty*",!!
- DO RTRN2CON^HMPMONL
- QUIT
- +3 NEW DA,DR,DIQ,DIC,X,Y
- +4 SET DIC="^HMPLOG(800003,"
- SET DIC(0)="AEMQ"
- DO ^DIC
- +5 ; nothing selected
- IF '(Y>0)
- DO FORMFEED^HMPMONL
- QUIT
- +6 ; DR is undefined to display all fields
- SET DA=+Y
- WRITE !
- DO EN^DIQ
- +7 WRITE !!,"* End of HMP EVENT listing "_$$NOW^HMPMONL_" *",!
- DO RTRN2CON^HMPMONL
- +8 QUIT
- +9 ;