source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUMFMFI.m@ 1009

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1XUMFMFI ;OIFO-OAK/RAM - HL7 MFI SEGMENT ;8/23/95
2 ;;8.0;KERNEL;**217**;Jul 10, 1995
3 ;
4 ;routine copied from VAFHLMFI by ALB/CM,JLU
5 ;
6 ;Input Parameters:
7 ;ID - Master File Identifier (required)
8 ;APP - Master File Application Identifier. (required)
9 ;EVENT - File-Level Event Code. If not defined, the default will be "REP" to replace current version of this master file with the version contained in the message.
10 ;ENDT - Entered date/time. If not defined, the default is today. This should be in FM date/time format.
11 ;EFFDT - Effective date/time. If not defined, the default is today. This should be in FM date/time format.
12 ;RESP - Response Level Code. If not defined, will be "NE" Never, No application level response needed.
13 ;
14 ;Output:
15 ;MFI - contains the segment if successful
16 ; - contains -1^error message if unsuccessful
17 ;
18MFI(ID,APP,EVENT,ENDT,EFFDT,RESP) ;
19 ;
20 I '$D(ID)!('$D(APP)) Q "-1^Missing Required Parameter(s)"
21 I '$D(EVENT) S EVENT="REP"
22 I '$D(ENDT) D NOW^%DTC S ENDT=$P(%,".") K %
23 I '$D(EFFDT) D NOW^%DTC S EFFDT=$P(%,".") K %
24 I '$D(RESP) S RESP="NE"
25 ;
26 N MFI
27 S MFI="MFI"_HLFS_ID_HLFS_APP_HLFS_EVENT_HLFS_$$HLDATE^HLFNC(ENDT)_HLFS_$$HLDATE^HLFNC(EFFDT)_HLFS_RESP
28 Q MFI
29 ;
30 ;
31EN(ENC,FS,QUOTS,ARY) ;generic call to create MFI segments.
32 ;
33 ;INPUTS ENC - the encoding characters for the segments
34 ; FS - the field separators to be used
35 ; QUOTS - what to use as double quots
36 ; ARY - this array contains the data to be place in the
37 ; MFI segment. The subscripts of the array should
38 ; be the sequence number of the data element in the
39 ; array.
40 ; Ex. X(1)=master fiel identifier
41 ; X(2)=Master File Application Identifier
42 ; X(3)=File Level Event Code
43 ; etc.
44 ;OUTPUT
45 ; 0^description if there was an error.
46 ; the formatted segment if successful.
47 ;
48 N SEG,LP
49 I '$D(ENC)!('$D(FS))!('$D(QUOTS))!('$D(ARY)) S SEG="0^Missing parameters." G MFIQ
50 I $D(@ARY)<10 S SEG="0^Field array not populated." G MFIQ
51 S SEG=""
52 F LP=0:0 S LP=$O(@ARY@(LP)) Q:'LP S $P(SEG,FS,LP+1)=@ARY@(LP)
53 S $P(SEG,FS,1)="MFI"
54MFIQ Q SEG
Note: See TracBrowser for help on using the repository browser.