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

VAFHLMFE.m

Go to the documentation of this file.
  1. VAFHLMFE ;ALB/CM,JLU-HL7 MFE SEGMENT ;8/23/95
  1. ;;5.3;Registration;**149**;Aug 13, 1993
  1. ;;5.3;Registration;**Philly 2 Prototype**;Aug 13, 1993
  1. ;
  1. MFE(EVENT,MFN,EDT,CODE) ;
  1. ;
  1. ;Input Parameters:
  1. ;EVENT - Record-level Event Code. If not defined, the default is MAD (always add record to master file
  1. ;MFN - MFN Control ID. If not defined, the default is null
  1. ;EDT - Effective date/time. If not defined, the default is today. This should be in FM date/time format.
  1. ;CODE - REQUIRED! Primary Key Value. If not defined, segment will not be built and record will not be sent.
  1. ;
  1. ;Output:
  1. ;MFE - contains the segment if successful
  1. ; - contains -1^error message if unsuccessful
  1. ;
  1. I '$D(EVENT) S EVENT="MAD"
  1. I '$D(MFN) S MFN=""
  1. I '$D(EDT) D NOW^%DTC S EDT=$P(%,".") K %
  1. I '$D(CODE) S MFE="-1^No Primary Key Value" G EXIT
  1. N MFE
  1. S MFE="MFE"_HLFS_EVENT_HLFS_MFN_HLFS_$$HLDATE^HLFNC(EDT)_HLFS_CODE
  1. EXIT ;
  1. Q MFE
  1. ;
  1. EN(ENC,FS,QUOTS,ARY) ;formats the MFE segment
  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. ; MFE segment. The subscripts of the array should
  1. ; be the sequence number of the data element in the
  1. ; array.
  1. ; Ex. X(1)=Record Level Event Code
  1. ; X(2)=MFN Control ID
  1. ; X(3)=Effective Date/time
  1. ; etc.
  1. ;OUTPUT
  1. ; 0^description if there was an error.
  1. ; the formatted segment if successful.
  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)="MFE"
  1. MFIQ Q SEG