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

HLEMT.m

Go to the documentation of this file.
  1. HLEMT ;ALB/CJM-HL7 - APIs for Monitor Event Types ;02/04/2004
  1. ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
  1. ;
  1. FIND(CODE,PACKAGE) ;
  1. ;Description: Finds an event type.
  1. ;Input:
  1. ; CODE - the string value of the code
  1. ; PACKAGE - the name (.01 field) of a package in the Package file representing the application that dessigned/created the code.
  1. ;Output:
  1. ; Function returns 0 on failue, ien of event type if successful
  1. ;
  1. Q:('$L($G(CODE))) 0
  1. Q:'$L($G(PACKAGE)) 0
  1. Q $O(^HLEV(776.3,"C",CODE,PACKAGE,0))
  1. ;
  1. GET(IEN,ETYPE) ;
  1. ;Description - given the ien, it returns an array containing the event type
  1. ;Input:
  1. ; IEN - ien of event type
  1. ; ETYPE - pass by reference, the return array
  1. ;Output:
  1. ; function returns 0 on failure, 1 on success
  1. ; ETYPE(
  1. ; "ACTION" - <tag>^<routine> - the routine that should be executed when events of this type occur
  1. ; "BRIEF" - brief description
  1. ; "CODE" - the event type code
  1. ; "CATEGORY" - category of event type, set of codes
  1. ; "CONGLOMERATE" - 1=events of this type are conglomerated, 0 is no
  1. ; "CONGLOMERATE","HOURS" - #of hours to conglomerate
  1. ; "DAYS" - # of days to keep events of this type before purge
  1. ; "IEN" -the ien
  1. ; "PACKAGE" - ien of the package that assigned the code
  1. ; "REVIEW" - 0=not required, 1=required, 2=only if action fails
  1. ; "SITES",<IEN of DOMAIN>=<screen if defined> - list of domains to send server messages
  1. ; "URGENT" - 0=NO,1=YES,2=IF ACTIONFAILS
  1. ;
  1. Q:'$G(IEN) 0
  1. N NODE,I,DOMAIN
  1. K ETYPE
  1. S ETYPE("IEN")=IEN
  1. S NODE=$G(^HLEV(776.3,IEN,0))
  1. Q:'$L(NODE) 0
  1. S ETYPE("CODE")=$P(NODE,"^")
  1. S ETYPE("PACKAGE")=$P(NODE,"^",2)
  1. S ETYPE("CATEGORY")=$P(NODE,"^",3)
  1. S ETYPE("URGENT")=$P(NODE,"^",4)
  1. S ETYPE("CONGLOMERATE")=$P(NODE,"^",5)
  1. S ETYPE("CONGLOMERATE","HOURS")=$P(NODE,"^",6)
  1. S ETYPE("REVIEW")=$P(NODE,"^",7)
  1. S ETYPE("DAYS")=$P(NODE,"^",9)
  1. S ETYPE("ACTIVE")=$P(NODE,"^",10)
  1. S ETYPE("ACTION")=$E($G(^HLEV(776.3,IEN,1)),1,20)
  1. S I=0 F S I=$O(^HLEV(776.3,IEN,2,I)) Q:'I S DOMAIN=+$G(^HLEV(776.3,IEN,2,I,0)) S:DOMAIN ETYPE("DOMAIN",DOMAIN)=$G(^HLEV(776.3,IEN,2,I,1))
  1. S ETYPE("BRIEF")=$P($G(^HLEV(776.3,IEN,4)),"^")
  1. Q 1
  1. ;
  1. CODE(EVENT) ;
  1. ;Given the event type ien, returns the code
  1. Q:'$G(EVENT) ""
  1. Q $P($G(^HLEV(776.3,EVENT,0)),"^")
  1. BRIEF(EVENT) ;
  1. ;Given the event type ien, returns the brief desciption
  1. Q:'$G(EVENT) ""
  1. Q $P($G(^HLEV(776.3,EVENT,4)),"^")
  1. ;
  1. CONG(TYPE) ;
  1. ;Input:
  1. ; TYPE - ien of event type
  1. ;Output:
  1. ; function returns 0 if this is NOT a conglomerated event, 1 if it is
  1. ;
  1. Q $P($G(^HLEV(776.3,TYPE,0)),"^",5)
  1. HOURS(TYPE) ;
  1. ;Description - returns #of hours overwhich to congregate events of this type
  1. ;Input:
  1. ; TYPE - ien of event type
  1. ;Output:
  1. ; function returns # of hours, 0 if not to be conglomerated
  1. ;
  1. Q:'$$CONG(TYPE) 0
  1. Q $P($G(^HLEV(776.3,TYPE,0)),"^",6)