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

VAFHLA34.m

Go to the documentation of this file.
  1. VAFHLA34 ;ALB/JLU;creates the A34 message.
  1. ;;5.3;Registration;**91**;Jun 06, 1996
  1. ;
  1. EN(DFN,GBL,CTR,APL,BEF,STAT,PID,ZPD,ID) ;builds the actual A34 message content. INIT OF
  1. ;HLTRANS and all of the HL7 varaiables most have been set up.
  1. ;
  1. ;DFN - The DFN of the Patient
  1. ;GBL - The GLOBAL to store message
  1. ;CTR - the counter to start at
  1. ;APL - The HL7 application or HLMTN
  1. ;BEF - This is the before value of the PID
  1. ;STAT - The status of this event (old or new)
  1. ;PID - The fields to be returned from the PID call
  1. ;ZPD - The fields to be returned from the ZPD call
  1. ;ID - Contains the set ID field for HL7 (OPTIONAL)
  1. ;
  1. N VAR
  1. DO
  1. .I $S('$D(DFN):1,DFN="":1,1:0) S VAR="Patient not identified" Q
  1. .I $S('$D(GBL):1,GBL="":1,1:0) S VAR="Storage global not identified" Q
  1. .I $S('$D(CTR):1,CTR="":1,1:0) S VAR="Counter to start at not identified" Q
  1. .I $S('$D(APL):1,APL="":1,1:0) S VAR="Calling application not identified" Q
  1. .I $S('$D(BEF):1,BEF="":1,1:0) S VAR="Before value of PID not identified" Q
  1. .I $S('$D(STAT):1,STAT="":1,1:0) S VAR="Status of event not identified" Q
  1. .I $S('$D(PID):1,PID="":1,1:0) S VAR="Fields for PID not identified" Q
  1. .I $S('$D(ZPD):1,ZPD="":1,1:0) S VAR="Fields for ZPD not identified" Q
  1. .Q
  1. I $D(VAR) G ERR
  1. S @GBL@(CTR)=$$EVN^VAFHLEVN("A34",STAT) ;creates the EVN segment
  1. S CTR=CTR+1
  1. S @GBL@(CTR)=$$EN^VAFHLPID(DFN,PID) ;creates the PID segment
  1. S CTR=CTR+1
  1. S @GBL@(CTR)=$$EN^VAFHLZPD(DFN,ZPD) ;creates the ZPD segment
  1. S CTR=CTR+1
  1. S @GBL@(CTR)=$$EN^VAFHLMRG(DFN,BEF) ;creates the MRG segment
  1. Q 1_U_CTR
  1. ERR Q -1_U_VAR