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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1VAFHLZM2 ;ALB/KCL - Create HL7 Military History segment (ZMH) Cont ; 1/26/06
2 ;;5.3;Registration;**673**;Aug 13, 1993
3 ;
4 ;--------------------------------------------------------------------------------
5 ;This routine creates HL7 VA-specific Military History ("ZMH") segments. It is a
6 ;continuation of VAFHLZM1 and uses variables from both VAFHLZMH and VAFHLZM1.
7 ;--------------------------------------------------------------------------------
8 ;
9 ;no direct entry
10 Q
11 ;
12 ;
13OEIF ;Build Operation Enduring/Iraqi Freedom segments
14 ;
15 N VAFDATA,VAFFROM,VAFIDX,VAFNODE,VAFSITE,VAFTO,VAFTYPE
16 ;
17 ;need to build segment even if no data in OEIF array
18 S $P(VAFY,VAFHLS,2)="OEIF"
19 I VAFSTR[",3," S $P(VAFY,VAFHLS,3)=VAFHLQ_$E(VAFHLC)_VAFHLQ
20 I VAFSTR[",4," S $P(VAFY,VAFHLS,4)=VAFHLQ_$E(VAFHLC)_VAFHLQ
21 I VAFSTR[",5," S $P(VAFY,VAFHLS,5)=VAFHLQ
22 Q:'$D(VAFOPS)
23 ;
24 ;if data in OEIF array, build segment for each episode
25 S (VAFNODE,VAFIDX)=0
26 F S VAFNODE=$O(VAFOPS(VAFNODE)) Q:'$G(VAFNODE) D
27 .;
28 .S VAFDATA=$G(VAFOPS(VAFNODE))
29 .;
30 .I VAFSTR[",3," D
31 ..S VAFTYPE=$$EXTERNAL^DILFD(2.3215,.01,"F",$P(VAFDATA,U,1)) I VAFTYPE']"" S VAFTYPE=VAFHLQ
32 ..S VAFSITE=$$STATION^VAFHLFNC($P(VAFDATA,U,6)) I VAFSITE="" S VAFSITE=VAFHLQ
33 ..S $P(VAFY,VAFHLS,3)=VAFTYPE_$E(VAFHLC)_VAFSITE
34 .;
35 .I VAFSTR[",4," D
36 ..S VAFFROM=$P(VAFDATA,U,2) S VAFFROM=$S(VAFFROM:$$HLDATE^HLFNC(VAFFROM),1:VAFHLQ)
37 ..S VAFTO=$P(VAFDATA,U,3) S VAFTO=$S(VAFTO:$$HLDATE^HLFNC(VAFTO),1:VAFHLQ)
38 ..S $P(VAFY,VAFHLS,4)=VAFFROM_$E(VAFHLC)_VAFTO
39 .;
40 .I VAFSTR[",5," D
41 ..S $P(VAFY,VAFHLS,5)=VAFHLQ
42 .;
43 .;put segment into array
44 .S VAFIDX=VAFIDX+1
45 .S VAFY(VAFIDX)=$G(VAFY)
46 ;
47 Q
48 ;
49 ;
50NOSEG ;
51 Q
Note: See TracBrowser for help on using the repository browser.