source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/VAFHLMFI.m@ 677

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

initial load of FOIAVistA 6/30/08 version

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