source: FOIAVistA/trunk/r/ZZREGIONAL-A1C-A5C-CRHD-RGED-RGUT-RGWB-RG/RGFIACK.m@ 905

Last change on this file since 905 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.4 KB
Line 
1RGFIACK ;ALB/CJM-PROCESS APPLICATION ACKNOWLEDGMENT ;08/27/99
2 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**5,13**;30 Apr 99
3 ;
4ACK ;
5 ;Description: Process the application ack to the Facility Integration
6 ;Message
7 ;
8 ;Input:
9 ; HL7 variables must be defined
10 ;Output: none
11 ;Variables:
12 ; FS - field seperator
13 ; CS - component seperator
14 ; CODE - returned error code
15 ; MSG - error text returned
16 ; TYPE - ack type (AA,ER)
17 ; MSGID - HL7 msg id
18 ; RGLOG - ien of entry in the CIRN HL7 Exception file
19 ; ICN - Integrated Control Number
20 ; DFN - patient DFN
21 ; SITE - station # of site that sent the app ack
22 ;
23 N FS,CS,QUIT,CODE,MSG,TYPE,MSGID,RGLOG,ICN,DFN,SITE
24 S FS=HL("FS")
25 S CS=$E(HL("ECH"),1)
26 S QUIT=0
27 K HLERR
28 ;
29 X HLNEXT D Q:QUIT
30 .I (HLQUIT'>0) S HLERR="MISSING MSH SEGMENT",QUIT=1 Q
31 .I $P(HLNODE,FS)'["MSH" S HLERR="MISSING MSH SEGMENT",QUIT=1 Q
32 X HLNEXT D Q:QUIT
33 .I (HLQUIT'>0) S HLERR="MISSING MSA SEGMENT",QUIT=1 Q
34 .I $P(HLNODE,FS)'["MSA" S HLERR="MISSING MSA SEGMENT",QUIT=1 Q
35 .S TYPE=$P(HLNODE,FS,2)
36 .S MSGID=$P(HLNODE,FS,3)
37 .S MSG=$P(HLNODE,FS,4)
38 .S ICN=+$P(MSG,"ICN:",2)
39 .S DFN=$S(ICN:$$DFN^RGFIU(ICN),1:"")
40 .S SITE=$P(MSG,"From Station:",2),SITE=$P(SITE," ICN:")
41 .S CODE=$P($P(HLNODE,FS,7),CS,4)
42 I ($G(TYPE)["R"),$G(MSGID),$G(CODE) D
43 .N HLMTIEN
44 .S HLMTIEN=MSGID
45 .D EXC^RGFIU(CODE,"APPLICATION ACKNOWLEDGMENT TO MSGID: "_MSGID_" - "_MSG,DFN,MSGID,SITE)
46 .D STOP^RGHLLOG(1)
47 Q
Note: See TracBrowser for help on using the repository browser.