source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/VAFHLZTA.m@ 1685

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

initial load of WorldVistAEHR

File size: 1.9 KB
RevLine 
[613]1VAFHLZTA ;ALB/ESD,TDM - Creation of ZTA segment ; 9/22/05 2:04pm
2 ;;5.3;Registration;**68,653**;Aug 13, 1993;Build 2
3 ;
4 ; This generic extrinsic function returns the HL7 VA-Specific Temporary Address (ZTA) segment.
5 ;
6 ;
7EN(DFN,VAFSTR,VAFNUM) ; Returns HL7 ZTA segment containing temporary address
8 ; data.
9 ;
10 ; Input - DFN as internal entry number of the PATIENT file
11 ; VAFSTR as string of fields requested separated by commas.
12 ; VAFNUM as SetId - set to 1.
13 ;
14 ; Output - string of components forming the ZTA segment.
15 ;
16 ; ******** Also assumes all HL7 variables returned from ********
17 ; INIT^HLTRANS are defined.
18 ;
19 ;
20 N VAFNODE,VAFY,X,X1
21 I '$G(DFN)!($G(VAFSTR)']"") G QUIT
22 S VAFNODE=$G(^DPT(DFN,.121))
23 S $P(VAFY,HLFS,7)="",VAFSTR=","_VAFSTR_","
24 S $P(VAFY,HLFS,1)=1 ; SetId equal to 1
25 I VAFSTR[",2," S X=$P(VAFNODE,"^",9),$P(VAFY,HLFS,2)=$$YN^VAFHLFNC(X) ; Temporary Address Enter/Edit?
26 I VAFSTR[",3," S X=$$HLDATE^HLFNC($P(VAFNODE,"^",7)),$P(VAFY,HLFS,3)=$S(X]"":X,1:HLQ) ; Temporary Address Start Date
27 I VAFSTR[",4," S X=$$HLDATE^HLFNC($P(VAFNODE,"^",8)),$P(VAFY,HLFS,4)=$S(X]"":X,1:HLQ) ; Temporary Address End Date
28 I VAFSTR[",5,"!(VAFSTR[",6,") D
29 . S X1=$$ADDR^VAFHLFNC($P(VAFNODE,"^",1,5)_"^"_$P(VAFNODE,"^",12),$P(VAFNODE,"^",11))
30 . I VAFSTR[",5," S $P(VAFY,HLFS,5)=$S($P(X1,HLFS,1)]"":$P(X1,HLFS,1),1:HLQ) ; Temporary Address
31 . I VAFSTR[",6," S $P(VAFY,HLFS,6)=$S($P(X1,HLFS,2)]"":$P(X1,HLFS,2),1:HLQ) ; Temporary Address County
32 I VAFSTR[",7," S X=$$HLPHONE^HLFNC($P(VAFNODE,"^",10)),$P(VAFY,HLFS,7)=$S(X]"":X,1:HLQ) ; Temporary Address Phone
33 I VAFSTR[",8," S X=$$HLDATE^HLFNC($P(VAFNODE,"^",13)),$P(VAFY,HLFS,8)=$S(X]"":X,1:HLQ) ; Temp Addr Last Updated
34 I VAFSTR[",9," D ; Temp Addr Site of Change
35 . S X=$P(VAFNODE,"^",14),X=$$GET1^DIQ(4,(+X)_",",99)
36 . S $P(VAFY,HLFS,9)=$S(X]"":X,1:HLQ)
37QUIT Q "ZTA"_HLFS_$G(VAFY)
Note: See TracBrowser for help on using the repository browser.