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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.9 KB
Line 
1VAFHLZIE ;ALB/KCL - Create generic HL7 Ineligible (ZIE) segment ; 12-SEPTEMBER-1997
2 ;;5.3;Registration;**122**;Aug 13, 1993
3 ;
4 ;
5 ; This generic extrinsic function is designed to return the
6 ; HL7 Ineligible (ZIE) segment. This segment contains VA-specific
7 ; ineligible information from the Patient (#2) file for a patient.
8 ;
9EN(DFN,VAFSTR,VAFNUM,VAFHLQ,VAFHLFS) ; --
10 ; Entry point for creating HL7 Ineligible (ZIE) segment.
11 ;
12 ; Input(s):
13 ; DFN - internal entry number of Patient (#2) file
14 ; VAFSTR - (optional) string of fields requested, separated by
15 ; commas. If not passed, return all data fields.
16 ; VAFNUM - (optional) sequential number for SET ID (default=1)
17 ; VAFHLQ - (optional) HL7 null variable.
18 ; VAFHLFS - (optional) HL7 field separator.
19 ;
20 ; Output(s):
21 ; String containing the desired components of the HL7 ZIE segment
22 ;
23 N VAFY,VAF15,VAF3,VAFINE
24 ;
25 ; if VAFHLQ or VAFHLFS not passed, use default HL7 variables
26 S VAFHLQ=$S($D(VAFHLQ):VAFHLQ,1:$G(HLQ)),VAFHLFS=$S($D(VAFHLFS):VAFHLFS,1:$G(HLFS))
27 ;
28 ; if set id not passed, use default
29 S VAFNUM=$S($G(VAFNUM):VAFNUM,1:1)
30 ;
31 ; if DFN not passed, exit
32 I '$G(DFN) S VAFY=1 G ENQ
33 ;
34 ; if VAFSTR not passed, return all data fields
35 I $G(VAFSTR)']"" S VAFSTR="1,2,3,4"
36 ;
37 ; initialize output string and requested data fields
38 S $P(VAFY,VAFHLFS,5)="",VAFSTR=","_VAFSTR_","
39 ;
40 ; get ineligible data nodes of Patient (#2) file
41 S VAF15=$G(^DPT(DFN,.15)),VAF3=$G(^(.3)),VAFINE=$G(^("INE"))
42 ;
43 S $P(VAFY,VAFHLFS,1)=$S($G(VAFNUM):VAFNUM,1:1) ; Set ID
44 I VAFSTR[",2," S $P(VAFY,VAFHLFS,2)=$S($P(VAF15,"^",2)]"":$$HLDATE^HLFNC($P(VAF15,"^",2)),1:VAFHLQ) ; Ineligible Date
45 I VAFSTR[",3," S $P(VAFY,VAFHLFS,3)=$S($P(VAF3,"^",7)]"":$P(VAF3,"^",7),1:VAFHLQ) ; Ineligible Reason
46 I VAFSTR[",4," S $P(VAFY,VAFHLFS,4)=$S($P(VAFINE,"^",6)]"":$P(VAFINE,"^",6),1:VAFHLQ) ; Ineligible VARO Decision
47 ;
48ENQ Q "ZIE"_VAFHLFS_$G(VAFY)
Note: See TracBrowser for help on using the repository browser.