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

MHVRQI.m

Go to the documentation of this file.
  1. MHVRQI ;WAS/GPM - Request Manager Immediate Mode ; 7/28/05 11:49pm [12/14/06 11:38am]
  1. ;;1.0;My HealtheVet;**2**;Aug 23, 2005;Build 22
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ;
  1. REALTIME(REQ,XMT,HL) ; Manage immediate mode / real time requests
  1. ;
  1. ; Triage, execute/extract and respond to real time requests and
  1. ; queries. If the request is rejected (blocked, or doesn't support
  1. ; real time access), send a negative acknowledgement, otherwise call
  1. ; the execute/extraction routine. If there are no errors transmit
  1. ; the results, send a negative acknowledgement if there are errors.
  1. ;
  1. ; Input:
  1. ; REQ - Parsed query and query parameters
  1. ; XMT - Transmission parameters
  1. ; HL - HL7 package array variable
  1. ;
  1. ; Output:
  1. ; Extract information and respond to query
  1. ;
  1. N ERR,DATAROOT,MHVDATA
  1. S DATAROOT="^TMP(""MHVEXTRACT"","_$J_","_REQ("TYPE")_")"
  1. S ERR=""
  1. ;
  1. D LOG^MHVUL2("REQUEST MGR - IMMEDIATE","BEGIN","S","TRACE")
  1. ;
  1. I $$REJECT(.REQ,.ERR) D Q
  1. . D LOG^MHVUL2("REQUEST CHECK","REJECT^"_ERR,"S","ERROR")
  1. . D XMIT^MHV7T(.REQ,.XMT,ERR,"",.HL)
  1. D LOG^MHVUL2("REQUEST CHECK","PROCESS","S","TRACE")
  1. ;
  1. I '$$EXECUTE(.REQ,.ERR,.DATAROOT) D Q
  1. . D LOG^MHVUL2("REQUEST EXECUTE","ERROR^"_ERR,"S","ERROR")
  1. . D XMIT^MHV7T(.REQ,.XMT,ERR,DATAROOT,.HL)
  1. D LOG^MHVUL2("REQUEST EXECUTE","COMPLETE","S","TRACE")
  1. ;
  1. D XMIT^MHV7T(.REQ,.XMT,ERR,DATAROOT,.HL)
  1. K @DATAROOT
  1. ;
  1. D LOG^MHVUL2("REQUEST MGR - IMMEDIATE","END","S","TRACE")
  1. ;
  1. Q
  1. ;
  1. REJECT(REQ,ERR) ;Check to see if request can be processed
  1. S ERR=""
  1. I REQ("BLOCKED") D Q 1
  1. . S ERR="^207^AR^Request Type Blocked by Site"
  1. . I $D(REQ("QPD")) S ERR="QPD^1^4"_ERR Q ;QBP query flag the QPD
  1. . I $D(REQ("QRD")) S ERR="QRD^1^10"_ERR Q ;old style query flag QRD
  1. . S ERR="MSH^1^9"_ERR ;not a query flag MSH
  1. . Q
  1. I 'REQ("REALTIME") D Q 1
  1. . S ERR="^207^AR^Real Time Calls Not Supported By Request Type"
  1. . I $D(REQ("QPD")) S ERR="RCP^1^1"_ERR Q ;QBP query flag RCP
  1. . I $D(REQ("QRD")) S ERR="QRD^1^3"_ERR Q ;old style query flag QRD
  1. . S ERR="MSH^1^9"_ERR ;not a query flag MSH
  1. . Q
  1. Q 0
  1. ;
  1. EXECUTE(REQ,ERR,DATAROOT) ;Execute action or extraction
  1. ;Calls the execute routine for this request type
  1. ;For queries this is the extraction routine
  1. ;Parameters can be passed on REQ
  1. ;Errors are passed on ERR
  1. ;
  1. ; DATAROOT is passed by reference because extractors are permitted
  1. ; to change the root referenced. This allows on the fly use of
  1. ; local variables and globals produced by calls to other packages.
  1. ; Care must be given when using locals because they cannot be NEWed.
  1. ; MHVDATA is NEWed above, and can be safely used.
  1. ; The KILL in the main loop above will clean up.
  1. ;
  1. S ERR=""
  1. D @(REQ("EXECUTE")_"(.REQ,.ERR,.DATAROOT)")
  1. I ERR D Q 0
  1. . S ERR="^207^AR^"_$P(ERR,"^",2)
  1. . I $D(REQ("QPD")) S ERR="QPD^1^4"_ERR Q ;QBP query flag the QPD
  1. . I $D(REQ("QRD")) S ERR="QRD^1^10"_ERR Q ;old style query flag QRD
  1. . S ERR="MSH^1^9"_ERR ;not a query flag MSH
  1. . Q
  1. Q 1
  1. ;