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

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1VAFHLZCL ;ALB/ESD - Create generic HL7 ZCL Segment ; 02-MAY-1996
2 ;;5.3;Registration;**94,103,102,397,423**;Aug 13, 1993
3 ;
4 ; This function will create VA-specific ZCL segment(s) for a
5 ; given outpatient encounter. The ZCL segment is designed to transfer
6 ; generic information about outpatient classifications.
7 ;
8 ;
9EN(DFN,VAFENC,VAFSTR,VAFHLQ,VAFHLFS,VAFARRY) ; Entry point to return the HL7 ZCL segment
10 ;
11 ; Input: DFN - IEN of the Patient (#2) file
12 ; VAFENC - IEN of the Outpatient Encounter (#409.68) file
13 ; VAFSTR - String of fields requested separated by commas
14 ; VAFHLQ - Optional HL7 null variable. If not there, use
15 ; default HL7 variable
16 ; VAFHLFS - Optional HL7 field separator. If not there, use
17 ; default HL7 variable
18 ; VAFARRY - Optional user-supplied array name which will hold ZCL segments
19 ;
20 ; Output: Array of HL7 ZCL segments
21 ;
22 ;
23 N I,VAFCLASS,VAFIDX,VAFY
24 S VAFARRY=$G(VAFARRY)
25 ;
26 ; - If VAFARRY not defined, use ^TMP("VAFHL",$J,"CLASS")
27 S:(VAFARRY="") VAFARRY="^TMP(""VAFHL"",$J,""CLASS"")"
28 ;
29 ; - If VAFHLQ or VAFHLFS aren't passed in, use default HL7 variables
30 S VAFHLQ=$S($D(VAFHLQ):VAFHLQ,1:$G(HLQ)),VAFHLFS=$S($D(VAFHLFS):VAFHLFS,1:$G(HLFS))
31 I '$G(DFN)!('$G(VAFENC))!($G(VAFSTR)']"") S @VAFARRY@(1,0)="ZCL"_VAFHLFS_1 G ENQ
32 S VAFIDX=0,VAFSTR=","_VAFSTR_","
33 ;
34ALL ; - All active outpatient classifications for encounter
35 S VAFCLASS=$$CHKCLASS^SCDXUTL0(DFN,VAFENC)
36 S VAFCLASS=$G(VAFCLASS)
37 I '$D(VAFCLASS) S @VAFARRY@(1,0)="ZCL"_VAFHLFS_1 G ENQ
38 ;
39 ; - Build array of HL7 (ZCL) segments
40 F I=1:1:$L(VAFCLASS,"^") D BUILD
41 ;
42ENQ ;
43 Q
44 ;
45 ;
46BUILD ; - Build for each classification question
47 S $P(VAFY,VAFHLFS,3)="",VAFIDX=VAFIDX+1
48 ;
49 ; - Sequential number (required field)
50 S $P(VAFY,VAFHLFS,1)=VAFIDX
51 ;
52 ; - Classification type (1=AO,2=IR,3=SC,4=EC,5=MST,6=HNC)
53 I VAFSTR[",2," S $P(VAFY,VAFHLFS,2)=$S($G(I)]"":I,1:VAFHLQ) ; Outpatient Classification Type
54 ;
55 ; - Value (1=Yes, 0=No, ""=N/A)
56 I VAFSTR[",3," S $P(VAFY,VAFHLFS,3)=$S($P(VAFCLASS,"^",I)]"":$P(VAFCLASS,"^",I),1:VAFHLQ) ; Value
57 ;
58 ; - If occasion of service, stuff 0 (N) if class value = Y
59 I (VAFSTR[",3,"),($$CHKOCC^SCMSVDG1(VAFENC)=1),($P(VAFY,VAFHLFS,3)=1) S $P(VAFY,VAFHLFS,3)=0
60 ;
61 ; - Set all outpatient classifications into array
62 S @VAFARRY@(VAFIDX,0)="ZCL"_VAFHLFS_$G(VAFY)
63 Q
Note: See TracBrowser for help on using the repository browser.