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

HMPMONA.m

Go to the documentation of this file.
  1. HMPMONA ;ASMR/BL, eHMP monitor action prompts ;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, 25 August 2016
  1. ; this routine contains Action to support the calls to ^DIR
  1. PROMPT(HMPACT,HMPROMPT) ; issues the action prompts throughout the eHMP Monitor
  1. ; Invoked by OPTION^HMPMON
  1. ; input:
  1. ; HMPROMPT = MNTR or ERR or HIST or SYNC, default to MNTR
  1. ; output:
  1. ; HMPACT - user-selected prompt, passed by reference
  1. ;
  1. S HMPROMPT=$G(HMPROMPT,"MNTR") ; default to monitor
  1. I $$PROMPTS^HMPMONR'[(U_HMPROMPT_U) D Q ; can't issue undefined prompt
  1. . W !!,"Invalid prompt default detected, cannot continue.",!
  1. . D RTRN2CON^HMPMONL
  1. ;
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
  1. S DIR(0)=$$CODES(HMPROMPT) ; set-of-codes
  1. S DIR("A")=$P(HMPCALLS(U,"DIR","text",HMPROMPT),";",2) ; prompt text
  1. S X=$G(HMPMNTR("default")) S:$L(X) DIR("B")=X ; prompt default
  1. S X=$G(HMPCALLS(U,"DIR","?",HMPROMPT)) ; extended ?? help specification
  1. S:$L(X) DIR("?")=X ; only if help set up
  1. S DIR("T")=HMPRATE ; set timeout to control auto-refresh rate
  1. W ! ; skip a line for readability
  1. D ^DIR
  1. ;
  1. S:$D(DTOUT) Y=DIR("B") ; for action prompts, timeout = default, creates auto-update
  1. I $D(DUOUT)!$D(DIROUT) Q ; timeout or '^', exit
  1. S HMPACT=Y ; action selected by user returned
  1. ;
  1. Q
  1. ;
  1. CODES(HMPROMPT) ; prompt's set of codes to be used in ^DIR
  1. ; called by:
  1. ; PROMPT
  1. ; calls:
  1. ; $$PROMPTS^HMPMON = Monitor's main prompts
  1. ; $T(@(HMPROMPT_"CODE")^HMPMON) ; prompt record's header line
  1. ; $$CODE = code definition
  1. ; input:
  1. ; HMPROMPT = MNTR or ERR or HIST or SYNC, default to MNTR
  1. ; output = set-of-codes definition for prompt
  1. ; examples:
  1. ; $$CODES = "SB^U:Update;V:View HMP Nodes;S:Sync Processes;E:E..."
  1. ; $$CODES("HIST") = "SB^UH:Update History;EH:Examine History;M..."
  1. ; $$CODES("NONSENSE") = ""
  1. ;
  1. N C,CODES,X,Y
  1. S HMPROMPT=$G(HMPROMPT,"MNTR") ; default to monitor
  1. Q:$$PROMPTS^HMPMONR'[(U_HMPROMPT_U) "" ; undefined prompt return null
  1. ; go through list of ^DIR calls and set it up for this monitor screen
  1. S CODES="",C=0,X="" F S X=$O(HMPCALLS(U,"DIR",HMPROMPT,X)) Q:X="" D
  1. . S:$G(HMPCALLS(U,"DIR",HMPROMPT,X,"default")) HMPMNTR("default")=X
  1. . S Y=$G(HMPCALLS(X)) S:$L(Y) C=C+1,$P(CODES,";",C)=X_":"_$P(Y,";")
  1. ; S - is set of codes, B indicates horizontal list of prompts
  1. Q "SB^"_CODES
  1. ;