Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XUMFMFI

XUMFMFI.m

Go to the documentation of this file.
  1. XUMFMFI ;OIFO-OAK/RAM - HL7 MFI SEGMENT ;8/23/95
  1. ;;8.0;KERNEL;**217**;Jul 10, 1995
  1. ;
  1. ;routine copied from VAFHLMFI by ALB/CM,JLU
  1. ;
  1. ;Input Parameters:
  1. ;ID - Master File Identifier (required)
  1. ;APP - Master File Application Identifier. (required)
  1. ;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.
  1. ;ENDT - Entered date/time. If not defined, the default is today. This should be in FM date/time format.
  1. ;EFFDT - Effective date/time. If not defined, the default is today. This should be in FM date/time format.
  1. ;RESP - Response Level Code. If not defined, will be "NE" Never, No application level response needed.
  1. ;
  1. ;Output:
  1. ;MFI - contains the segment if successful
  1. ; - contains -1^error message if unsuccessful
  1. ;
  1. MFI(ID,APP,EVENT,ENDT,EFFDT,RESP) ;
  1. ;
  1. I '$D(ID)!('$D(APP)) Q "-1^Missing Required Parameter(s)"
  1. I '$D(EVENT) S EVENT="REP"
  1. I '$D(ENDT) D NOW^%DTC S ENDT=$P(%,".") K %
  1. I '$D(EFFDT) D NOW^%DTC S EFFDT=$P(%,".") K %
  1. I '$D(RESP) S RESP="NE"
  1. ;
  1. N MFI
  1. S MFI="MFI"_HLFS_ID_HLFS_APP_HLFS_EVENT_HLFS_$$HLDATE^HLFNC(ENDT)_HLFS_$$HLDATE^HLFNC(EFFDT)_HLFS_RESP
  1. Q MFI
  1. ;
  1. ;
  1. EN(ENC,FS,QUOTS,ARY) ;generic call to create MFI segments.
  1. ;
  1. ;INPUTS ENC - the encoding characters for the segments
  1. ; FS - the field separators to be used
  1. ; QUOTS - what to use as double quots
  1. ; ARY - this array contains the data to be place in the
  1. ; MFI segment. The subscripts of the array should
  1. ; be the sequence number of the data element in the
  1. ; array.
  1. ; Ex. X(1)=master fiel identifier
  1. ; X(2)=Master File Application Identifier
  1. ; X(3)=File Level Event Code
  1. ; etc.
  1. ;OUTPUT
  1. ; 0^description if there was an error.
  1. ; the formatted segment if successful.
  1. ;
  1. N SEG,LP
  1. I '$D(ENC)!('$D(FS))!('$D(QUOTS))!('$D(ARY)) S SEG="0^Missing parameters." G MFIQ
  1. I $D(@ARY)<10 S SEG="0^Field array not populated." G MFIQ
  1. S SEG=""
  1. F LP=0:0 S LP=$O(@ARY@(LP)) Q:'LP S $P(SEG,FS,LP+1)=@ARY@(LP)
  1. S $P(SEG,FS,1)="MFI"
  1. MFIQ Q SEG