1 | HLOSRVR2 ;ALB/CJM-HL7 - HLO Server ;07/20/2007
|
---|
2 | ;;1.6;HEALTH LEVEL SEVEN;**131,137**;Oct 13, 1995;Build 21
|
---|
3 | ;Per VHA Directive 2004-038, this routine should not be modified.
|
---|
4 | ;
|
---|
5 | NEWMSG(HLCSTATE,HLMSTATE,HDR) ;
|
---|
6 | ;initialize the HLMSTATE array after reading the header
|
---|
7 | ;Inputs:
|
---|
8 | ; HLCSTATE (pass by reference)
|
---|
9 | ; HDR (pass by reference) parsed header
|
---|
10 | ;Output:
|
---|
11 | ; HLMSTATE (pass by reference)
|
---|
12 | ;
|
---|
13 | K HLMSTATE
|
---|
14 | S HLMSTATE("IEN")=""
|
---|
15 | S HLMSTATE("BODY")=""
|
---|
16 | S HLMSTATE("DIRECTION")="IN"
|
---|
17 | S HLMSTATE("CURRENT SEGMENT")=0 ;no segments in cache
|
---|
18 | S HLMSTATE("UNSTORED LINES")=1 ;just the header in cache so far
|
---|
19 | S HLMSTATE("LINE COUNT")=0 ;no lines within message stored to disk
|
---|
20 | I HDR("SEGMENT TYPE")="BHS" D
|
---|
21 | .S HLMSTATE("BATCH")=1
|
---|
22 | .S HLMSTATE("ID")=HDR("BATCH CONTROL ID")
|
---|
23 | .S HLMSTATE("BATCH","CURRENT MESSAGE")=0 ;no messages in batch
|
---|
24 | .S HLMSTATE("UNSTORED MSH")=0
|
---|
25 | E D
|
---|
26 | .S HLMSTATE("BATCH")=0
|
---|
27 | .S HLMSTATE("ID")=HDR("MESSAGE CONTROL ID")
|
---|
28 | M HLMSTATE("HDR")=HDR
|
---|
29 | M HLMSTATE("SYSTEM")=HLCSTATE("SYSTEM")
|
---|
30 | S HLMSTATE("STATUS")=""
|
---|
31 | S HLMSTATE("STATUS","QUEUE")=""
|
---|
32 | S HLMSTATE("STATUS","ACTION")=""
|
---|
33 | S HLMSTATE("STATUS","LINK NAME")=HLCSTATE("LINK","NAME")
|
---|
34 | S HLMSTATE("STATUS","PORT")=$P(HDR("SENDING FACILITY",2),":",2)
|
---|
35 | ;
|
---|
36 | ;if this is a batch, and it references another batch, assume it is a b.
|
---|
37 | I HLMSTATE("BATCH"),HLMSTATE("ID")]"" D
|
---|
38 | .N IEN
|
---|
39 | .S HLMSTATE("ACK TO")=HLMSTATE("ID")
|
---|
40 | .S HLMSTATE("ACK TO","STATUS")="SU"
|
---|
41 | .S IEN=$O(^HLB("B",HLMSTATE("ID"),0))
|
---|
42 | .I IEN S HLMSTATE("ACK TO","IEN")=IEN_"^"
|
---|
43 | E S HLMSTATE("ACK TO")=""
|
---|
44 | I 'HLMSTATE("BATCH"),HDR("ACCEPT ACK TYPE")="",HDR("APP ACK TYPE")="" D
|
---|
45 | .S HLMSTATE("ORIGINAL MODE")=1
|
---|
46 | E D
|
---|
47 | .S HLMSTATE("ORIGINAL MODE")=0
|
---|
48 | N I F I=1,3 S HLMSTATE("MSA",I)=""
|
---|
49 | S HLMSTATE("MSA",2)=HLMSTATE("ID")
|
---|
50 | Q
|
---|