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

VAFHLZHF.m

Go to the documentation of this file.
  1. VAFHLZHF ;ALB/KUM - Create generic HL7 Enrollment (ZHF) segment ;Sept 04, 2022@15:28:52
  1. ;;5.3;Registration;**1082**;Aug 13, 1993;Build 29
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ; This generic extrinsic function is designed to return the
  1. ; HL7 Enrollment (ZHF) segment. This segment contains VA-specific
  1. ; health factor information for a patient.
  1. ;
  1. ;ICRs
  1. ; Reference to GET1^DIQ in ICR #10004
  1. ; Reference to $$NOW^XLFDT in ICR #10103
  1. ; Reference to $$HLDATE^HLFNC in ICR #10106
  1. ;
  1. EN(DFN,VAFSTR,VAFHLQ,VAFHLFS) ; --
  1. ; Entry point for creating HL7 Health Factor (ZHF) segment.
  1. ;
  1. ; Input(s):
  1. ; DFN - internal entry number of Patient (#2) file
  1. ; VAFSTR - (optional) string of fields requested, separated by
  1. ; commas. If not passed, return all data fields.
  1. ; VAFHLQ - (optional) HL7 null variable.
  1. ; VAFHLFS - (optional) HL7 field separator.
  1. ;
  1. ; Output(s):
  1. ; String containing the desired components of the HL7 ZHF segment
  1. ;
  1. N VAFPSY,VAFPREF,VAFY,SEQ,DGDATE,DGDT
  1. ;
  1. ; if VAFHLQ or VAFHLFS not passed, use default HL7 variables
  1. S VAFHLQ=$S($D(VAFHLQ):VAFHLQ,1:$G(HLQ)),VAFHLFS=$S($D(VAFHLFS):VAFHLFS,1:$G(HLFS))
  1. ;
  1. ; if DFN not passed, exit
  1. I '$G(DFN) S VAFY=1 G ENQ
  1. ;
  1. ; if VAFSTR not passed, return all data fields (SEQ's)
  1. I $G(VAFSTR)']"" F SEQ=1:1:5 S $P(VAFSTR,",",SEQ)=SEQ
  1. ;
  1. ; get data from Presumptive Psychosis Category Changes (#33.1) file
  1. D GETDATA331^DGPPSYCH(DFN,.VAFPSY)
  1. ;
  1. ; initialize output string and requested data fields
  1. S VAFSTR=","_VAFSTR_","
  1. ;
  1. ; set-up segment data fields
  1. I VAFSTR[",1," S $P(VAFY,VAFHLFS,1)=$S($G(VAFPSY("PPCAT"))]"":VAFPSY("PPCAT"),1:VAFHLQ) ; Psychosis Category
  1. I VAFSTR[",2," S $P(VAFY,VAFHLFS,2)=$S($G(VAFPSY("PPCATDT")):$$HLDATE^HLFNC(VAFPSY("PPCATDT"),"DT"),1:VAFHLQ) ; Psychosis Category Change Date
  1. I VAFSTR[",3," S $P(VAFY,VAFHLFS,3)=VAFHLQ
  1. I VAFSTR[",4," S $P(VAFY,VAFHLFS,4)=VAFHLQ
  1. I VAFSTR[",5," S $P(VAFY,VAFHLFS,5)=VAFHLQ
  1. ;
  1. ENQ Q "ZHF"_VAFHLFS_$G(VAFY)
  1. ;