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

HLOQUE.m

Go to the documentation of this file.
  1. HLOQUE ;ALB/CJM- HL7 QUEUE MANAGEMENT - 10/4/94 1pm
  1. ;;1.6;HEALTH LEVEL SEVEN;**126**;Oct 13, 1995
  1. ;
  1. INQUE(FROM,QNAME,IEN778,ACTION,PURGE) ;
  1. ;Will place the message=IEN778 on the IN queue, incoming
  1. ;Input:
  1. ; FROM - sending facility from message header.
  1. ; For actions other than incoming messages, its the specified link.
  1. ; QNAME - queue named by the application
  1. ; IEN778 = ien of the message in file 778
  1. ; ACTION - <tag^routine> that should be executed for the application
  1. ; PURGE (optional) - PURGE=1 indicates that the purge dt/tm needs to be set by the infiler
  1. ; If PURGE("ACKTOIEN") is set, it indicates that the purge dt/tm of
  1. ; the original message to this application ack also needs to be set.
  1. ;Output: none
  1. ;
  1. I $G(FROM)="" S FROM="UNKNOWN"
  1. I '$L($G(QNAME)) S QNAME="DEFAULT"
  1. S ^HLB("QUEUE","IN",FROM,QNAME,IEN778)=ACTION_"^"_$G(PURGE)_"^"_$G(PURGE("ACKTOIEN"))
  1. I $$INC^HLOSITE($NA(^HLC("QUEUECOUNT","IN",FROM,QNAME)))
  1. Q
  1. ;
  1. OUTQUE(LINKNAME,PORT,QNAME,IEN778) ;
  1. ;Will place the message=IEN778 on the out-going queue
  1. ;Input:
  1. ; LINKNAME = name of (.01) the logical link
  1. ; PORT (optional) the port to connect to
  1. ; QNAME - queue named by the application
  1. ; IEN778 = ien of the message in file 778
  1. ;Output: none
  1. ;
  1. N SUB
  1. S SUB=LINKNAME
  1. I PORT S SUB=SUB_":"_PORT
  1. I '$L($G(QNAME)) S QNAME="DEFAULT"
  1. S ^HLB("QUEUE","OUT",SUB,QNAME,IEN778)=""
  1. I $$INC^HLOSITE($NA(^HLC("QUEUECOUNT","OUT",SUB,QNAME)))
  1. Q
  1. ;
  1. DEQUE(FROMORTO,QNAME,DIR,IEN778) ;
  1. ;This routine will remove the message=IEN778 from its queue
  1. ;Input:
  1. ; DIR = "IN" or "OUT", denoting the direction that the message is going in
  1. ; FROMORTO = for outgoing: the .01 field of the logical link
  1. ; for incoming: sending facility
  1. ; IEN778 = ien of the message in file 778
  1. ;Output: none
  1. ;
  1. Q:(FROMORTO="")
  1. I ($G(QNAME)="") S QNAME="DEFAULT"
  1. D
  1. .I $E(DIR)="I" S DIR="IN" Q
  1. .I $E(DIR)="O" S DIR="OUT" Q
  1. I DIR'="IN",DIR'="OUT" Q
  1. Q:'$G(IEN778)
  1. I $D(^HLB("QUEUE",DIR,FROMORTO,QNAME,IEN778)) K ^HLB("QUEUE",DIR,FROMORTO,QNAME,IEN778) I $$INC^HLOSITE($NA(^HLC("QUEUECOUNT",DIR,FROMORTO,QNAME)),-1)
  1. Q
  1. ;
  1. STOPQUE(DIR,QUEUE) ;
  1. ;This API is used to set a stop flag on a named queue.
  1. ;DIR=<"IN" or "OUT">
  1. ;QUEUE - the name of the queue to be stopped
  1. ;
  1. Q:$G(DIR)=""
  1. Q:$G(QUEUE)=""
  1. S ^HLTMP("STOPPED QUEUES",DIR,QUEUE)=1
  1. Q
  1. STARTQUE(DIR,QUEUE) ;
  1. ;This API is used to REMOVE the stop flag on a named queue.
  1. ;DIR=<"IN" or "OUT">
  1. ;QUEUE - the name of the queue to be stopped
  1. ;
  1. Q:$G(DIR)=""
  1. Q:$G(QUEUE)=""
  1. K ^HLTMP("STOPPED QUEUES",DIR,QUEUE)
  1. Q
  1. STOPPED(DIR,QUEUE) ;
  1. ;This API is used to DETERMINE if the stop flag on a named queue is set.
  1. ;Input:
  1. ; DIR=<"IN" or "OUT">
  1. ; QUEUE - the name of the queue to be checked
  1. ;Output:
  1. ; Function returns 1 if the queue is stopped, 0 otherwise
  1. Q:$G(DIR)="" 0
  1. Q:$G(QUEUE)="" 0
  1. I $G(^HLTMP("STOPPED QUEUES",DIR,QUEUE)) Q 1
  1. Q 0