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

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

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1DGQEHLNT ;ALB/RPM - VIC REPLACEMENT HL7 BUILD NTE SEGMENT ; 10/20/05
2 ;;5.3;Registration;**679**;Aug 13, 1993
3 ;
4 Q
5 ;
6NTE(DGREQ,DGFLD,DGHL) ;NTE Segment API
7 ;This function wraps the data retrieval and segment creation APIs and
8 ;returns a formatted NTE segment.
9 ;
10 ; Input:
11 ; DGREQ - (required) VIC REQUEST data array
12 ; DGFLD - (optional) List of comma-separated fields (sequence #'s)
13 ; to include. Defaults to all required fields (4).
14 ; DGHL - HL7 environment array
15 ;
16 ; Output:
17 ; Function Value - NTE segment on success, "" on failure
18 ;
19 N DGNTE
20 N DGVAL
21 ;
22 S DGNTE=""
23 I $D(DGREQ) D
24 . S DGFLD=","_DGFLD_","
25 . I $$NTEVAL(DGFLD,.DGREQ,.DGVAL) D
26 . . S DGNTE=$$BLDSEG^DGQEHLUT("NTE",.DGVAL,.DGHL)
27 Q DGNTE
28 ;
29NTEVAL(DGFLD,DGREQ,DGVAL) ;build NTE value array
30 ;
31 ; Input:
32 ; DGFLD - (required) Fields string
33 ; DGREQ - (required) VIC REQUEST data array
34 ;
35 ; Output:
36 ; Function Value - 1 on sucess, 0 on failure
37 ; DGVAL - NTE field array [SUB1:field, SUB2:repetition,
38 ; SUB3:component, SUB4:sub-component]
39 ;
40 N DGRSLT ;function value
41 ;
42 S DGRSLT=0
43 I $G(DGFLD)]"",+$G(DGREQ("DFN"))>0 D
44 . ;
45 . ; seq 1 Set ID
46 . I DGFLD[",1," D
47 . ;
48 . ; seq 2 Source of comment
49 . I DGFLD[",2," D
50 . ;
51 . ; seq 3 Comment
52 . I DGFLD[",3," D
53 . . N DGENRST ;enrollment status
54 . . S DGENRST=$$STATUS^DGENA(DGREQ("DFN"))
55 . . S DGVAL(3,1)="POW:"_$S($$ISENRPND^DGQEUT1(DGENRST):"P",1:$$GETPOW^DGQEUT1(DGREQ("DFN")))
56 . . S DGVAL(3,2)="PH:"_$$GETPH^DGQEUT1(DGREQ("DFN"))
57 . ;
58 . ; seq 4 Comment type
59 . I DGFLD[",4," D
60 . ;
61 . S DGRSLT=1
62 I 'DGRSLT K DGVAL
63 Q DGRSLT
Note: See TracBrowser for help on using the repository browser.