[613] | 1 | HLTP1 ;AISC/SAW-Transaction Processor Module (Cont'd) ;09/13/2006
|
---|
| 2 | ;;1.6;HEALTH LEVEL SEVEN;**34,47,91,133**;Oct 13, 1995;Build 13
|
---|
| 3 | ;Per VHA Directive 2004-038, this routine should not be modified.
|
---|
| 4 | GENACK(HLMIDA,HLMTIENA,HLEIDS,HLARYTYP,HLFORMAT,HLRESLTA,HLP) ;
|
---|
| 5 | ;Entry point to generate an acknowledgement message
|
---|
| 6 | ;
|
---|
| 7 | ;This is a subroutine call with parameter passing. It returns a value
|
---|
| 8 | ;in the variable HLRESLTA of null if no error occurs, or the following
|
---|
| 9 | ;two piece value if an error occurs: error code^error description
|
---|
| 10 | ;
|
---|
| 11 | ;Required Input Parameters
|
---|
| 12 | ; HLMIDA = Message ID of aknowledgement message
|
---|
| 13 | ; HLMTIENA = IEN of entry in Message Text file where acknowledgement
|
---|
| 14 | ; message will be stored
|
---|
| 15 | ; HLEIDS = IEN of subscriber protocol from the Protocol file
|
---|
| 16 | ; HLARYTYP = Array type. One of the following codes:
|
---|
| 17 | ; LM = local array containing a single message
|
---|
| 18 | ; LB = local array containig a batch of messages
|
---|
| 19 | ; GM = global array containing a single message
|
---|
| 20 | ; GB = global array containing a batch of messages
|
---|
| 21 | ; HLFORMAT = Format of array, 1 for pre-formatted in HL7 format,
|
---|
| 22 | ; otherwise 0
|
---|
| 23 | ;NOTE: The variable HLRESLTA must be passed by reference
|
---|
| 24 | ; HLRESLTA = The variable that will be returned to the calling
|
---|
| 25 | ; application as descibed above
|
---|
| 26 | ;Optional Parameters
|
---|
| 27 | ; HLP("SECURITY") = A 1 to 40 character string
|
---|
| 28 | ; HLP("GROUTINE") = The M code to execute to generate the
|
---|
| 29 | ; acknowledgement message
|
---|
| 30 | ; HLP("MSACK") = 1 if this acknowledgment message is being
|
---|
| 31 | ; generated by the Messaging System
|
---|
| 32 | ; HLP("NAMESPACE") = Passed in by application namespace - HL*1.6*91
|
---|
| 33 | ;
|
---|
| 34 | S HLRESLTA=""
|
---|
| 35 | ;
|
---|
| 36 | ;Check for required parameters
|
---|
| 37 | 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
|
---|
| 38 | ;Extract data from file 101 and store in separate variables
|
---|
| 39 | D EVENT^HLUTIL1(HLEIDS,770,.HLN)
|
---|
| 40 | S HLSAN=$P($G(^HL(771,+$P(HLN(770),"^",2),0)),"^"),HLQ=""""""
|
---|
| 41 | S HLP("MSGTYPE")=$E(HLARYTYP,2)
|
---|
| 42 | ;Update zero node of Message Text file
|
---|
| 43 | D UPDATE^HLTF0(HLMTIENA,HLP("MTIENS"),"O",HLEIDS,"",$P(HLN(770),"^",2),"",$P($G(^HL(772,HLP("MTIENS"),0)),"^",8),"",.HLP)
|
---|
| 44 | ;Update status to Being Generated
|
---|
| 45 | D STATUS^HLTF0(HLMTIENA,8)
|
---|
| 46 | ;Check that local/global array exists and store in Message Text file
|
---|
| 47 | ; if pre-compiled
|
---|
| 48 | I HLFORMAT D I (+$G(HLRESLTA)) D STATUS^HLTF0(HLMTIENA,4,+HLRESLTA) G EXIT
|
---|
| 49 | .I $E(HLARYTYP)="G" D
|
---|
| 50 | ..I $O(^TMP("HLA",$J,0))']"" S HLRESLTA="8^"_$G(^HL(771.7,8,0)) Q
|
---|
| 51 | ..D MERGE^HLTF1("G",HLMTIENA,"HLA")
|
---|
| 52 | .I $E(HLARYTYP)="L" D
|
---|
| 53 | ..I $O(HLA("HLA",0))']"" S HLRESLTA="8^"_$G(^HL(771.7,8,0)) Q
|
---|
| 54 | ..D MERGE^HLTF1("L",HLMTIENA,"HLA")
|
---|
| 55 | ;If array is not pre-compiled, call message generation routine
|
---|
| 56 | I 'HLFORMAT N HLERR D I $D(HLERR) S HLRESLTA="9^"_HLERR D STATUS^HLTF0(HLMTIENA,4,9,HLERR) G EXIT
|
---|
| 57 | .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_")"
|
---|
| 58 | .X HLP("GROUTINE")
|
---|
| 59 | ;Invoke communication server module to send message to subscribers
|
---|
| 60 | K HLARYTYP,HLFORMAT,HLQ
|
---|
| 61 | D SENDACK^HLCS(HLMTIENA,HLP("EID"),HLEIDS,.HLRESLTA) ;,$G(HLP("MSACK")))
|
---|
| 62 | EXIT K HLQ,HLSAN
|
---|
| 63 | Q
|
---|