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

HLTP1.m

Go to the documentation of this file.
  1. HLTP1 ;AISC/SAW-Transaction Processor Module (Cont'd) ;09/13/2006
  1. ;;1.6;HEALTH LEVEL SEVEN;**34,47,91,133**;Oct 13, 1995;Build 13
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. GENACK(HLMIDA,HLMTIENA,HLEIDS,HLARYTYP,HLFORMAT,HLRESLTA,HLP) ;
  1. ;Entry point to generate an acknowledgement message
  1. ;
  1. ;This is a subroutine call with parameter passing. It returns a value
  1. ;in the variable HLRESLTA of null if no error occurs, or the following
  1. ;two piece value if an error occurs: error code^error description
  1. ;
  1. ;Required Input Parameters
  1. ; HLMIDA = Message ID of aknowledgement message
  1. ; HLMTIENA = IEN of entry in Message Text file where acknowledgement
  1. ; message will be stored
  1. ; HLEIDS = IEN of subscriber protocol from the Protocol file
  1. ; HLARYTYP = Array type. One of the following codes:
  1. ; LM = local array containing a single message
  1. ; LB = local array containig a batch of messages
  1. ; GM = global array containing a single message
  1. ; GB = global array containing a batch of messages
  1. ; HLFORMAT = Format of array, 1 for pre-formatted in HL7 format,
  1. ; otherwise 0
  1. ;NOTE: The variable HLRESLTA must be passed by reference
  1. ; HLRESLTA = The variable that will be returned to the calling
  1. ; application as descibed above
  1. ;Optional Parameters
  1. ; HLP("SECURITY") = A 1 to 40 character string
  1. ; HLP("GROUTINE") = The M code to execute to generate the
  1. ; acknowledgement message
  1. ; HLP("MSACK") = 1 if this acknowledgment message is being
  1. ; generated by the Messaging System
  1. ; HLP("NAMESPACE") = Passed in by application namespace - HL*1.6*91
  1. ;
  1. S HLRESLTA=""
  1. ;
  1. ;Check for required parameters
  1. I '$G(HLMIDA)!('$G(HLMTIENA))!('$G(HLEIDS))!($G(HLARYTYP)']"")!($G(HLFORMAT)']"") S HLRESLTA="7^"_$G(^HL(771.7,7,0))_" at GENACK^HLTP1 entry point" G EXIT
  1. ;Extract data from file 101 and store in separate variables
  1. D EVENT^HLUTIL1(HLEIDS,770,.HLN)
  1. S HLSAN=$P($G(^HL(771,+$P(HLN(770),"^",2),0)),"^"),HLQ=""""""
  1. S HLP("MSGTYPE")=$E(HLARYTYP,2)
  1. ;Update zero node of Message Text file
  1. D UPDATE^HLTF0(HLMTIENA,HLP("MTIENS"),"O",HLEIDS,"",$P(HLN(770),"^",2),"",$P($G(^HL(772,HLP("MTIENS"),0)),"^",8),"",.HLP)
  1. ;Update status to Being Generated
  1. D STATUS^HLTF0(HLMTIENA,8)
  1. ;Check that local/global array exists and store in Message Text file
  1. ; if pre-compiled
  1. I HLFORMAT D I (+$G(HLRESLTA)) D STATUS^HLTF0(HLMTIENA,4,+HLRESLTA) G EXIT
  1. .I $E(HLARYTYP)="G" D
  1. ..I $O(^TMP("HLA",$J,0))']"" S HLRESLTA="8^"_$G(^HL(771.7,8,0)) Q
  1. ..D MERGE^HLTF1("G",HLMTIENA,"HLA")
  1. .I $E(HLARYTYP)="L" D
  1. ..I $O(HLA("HLA",0))']"" S HLRESLTA="8^"_$G(^HL(771.7,8,0)) Q
  1. ..D MERGE^HLTF1("L",HLMTIENA,"HLA")
  1. ;If array is not pre-compiled, call message generation routine
  1. I 'HLFORMAT N HLERR D I $D(HLERR) S HLRESLTA="9^"_HLERR D STATUS^HLTF0(HLMTIENA,4,9,HLERR) G EXIT
  1. .S HLP("GROUTINE")=HLP("GROUTINE")_"("_HLMIDA_","_HLMTIENA_","_HLQ_HLARYTYP_HLQ_","_HLSAN_","_$P($G(^HL(771.2,$P(HLN(770),"^",3),0)),"^")_","_$P($G(^HL(779.001,$P(HLN(770),"^",4),0)),"^")_","_HLQ_$TR($P(HLN(770),"^",6),"id","ID")_HLQ_")"
  1. .X HLP("GROUTINE")
  1. ;Invoke communication server module to send message to subscribers
  1. K HLARYTYP,HLFORMAT,HLQ
  1. D SENDACK^HLCS(HLMTIENA,HLP("EID"),HLEIDS,.HLRESLTA) ;,$G(HLP("MSACK")))
  1. EXIT K HLQ,HLSAN
  1. Q