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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.9 KB
Line 
1VAFHLROL ;BP/JRP - BUILD HL7 ROLE SEGMENT;11/18/1997 ; 6/14/01 12:52pm
2 ;;5.3;Registration;**160,215,389**;Aug 13, 1993
3 ;
4 ;Entry from top of routine not allowed - must use supported line tags
5 Q
6 ;
7OUTPAT(PARAM,OUTARR,FIELDS,FLDSEP,ENCODE,NULL,MAXLEN) ;Build segment for
8 ; transmission of outpatient data
9 ;
10 ;Input : PARAM - Array, subscripted by paramter name, that contains
11 ; information specific to building of segment
12 ; (full global reference)
13 ; - Supported parameters/subscripts listed below
14 ; OUTARR - Output array (full global reference)
15 ; - Defaults to ^TMP("VAFHLROL",$J)
16 ; FIELDS - List of fields (sequence numbers) to include
17 ; seperated by commas
18 ; - Defaults to all required fields (1-4)
19 ; FLDSEP - HL7 field seperator (1 character)
20 ; - Defaults to ^ (carrot)
21 ; ENCODE - HL7 encoding characters (4 characters)
22 ; - Defaults to ~|\& (tilde bar backslash ampersand)
23 ; NULL - HL7 null designation
24 ; - Defaults to "" (quote quote)
25 ; MAXLEN - Maximum length of a single line in the segment
26 ; array (i.e. when to wrap to next node in output)
27 ; - Defaults to 245
28 ;Output : None
29 ; OUTARR(0) will contain ROL segment (first MAXLEN characters)
30 ; OUTARR(1) will contain rest of ROL segment (if needed)
31 ;
32 ; Errors associated to required data elements returned in
33 ; OUTARR("ERROR",Seq#,x) = Error text
34 ;
35 ; Errors associated to optional data elements returned in
36 ; OUTARR("WARNING",Seq#,x) = Error text
37 ;
38 ;Subscripts for PARAM array : (Sample use: @PARAM@("PTRVPRV")=1234)
39 ; PTR200 - Pointer to entry in NEW PERSON file (#200)
40 ; - ** Required if not using ROLE and PERSON parameters **
41 ; - Definition of calculated ROLE found in ROLE^VAFHLRO3()
42 ; - Definition of calculated PERSON found in PERSON^VAFHLRO3()
43 ; CODEONLY - Flag indicating if calculations for ROLE & PERSON should
44 ; only include their coded/table values
45 ; 1 = Yes (internal only)
46 ; 0 = No (internal & external) (default)
47 ; - Value not applied to input values of ROLE & PERSON
48 ; INSTID - Value to use for Role Instance ID (seq #1)
49 ; - ** Required **
50 ; ACTION - Value to use for Action Code (seq #2)
51 ; - AD (Add) UP (Update) DE (Delete) CO (Correct)
52 ; LI (Link) UN (Unlink) UC (Unchanged)
53 ; - ** Required **
54 ; ROLE - Value to use for first three components of Role (seq #3)
55 ; - Use this parameter to over-ride calculation based on PTR200
56 ; ALTROLE - Value to use for last three components of Role (seq #3)
57 ; - Use this parameter to include alternate role
58 ; PERSON - Value to use for Role Person (seq #4)
59 ; - Use this parameter to over-ride calculation based on PTR200
60 ; - note that only values for the 1st instance can be
61 ; passed, i.e., do not pass provider SSN
62 ; RDATE - (optional) Use this parameter to obtain person role
63 ; - "as of" the date specified. The current date will be used
64 ; - if this parameter is undefined.
65 ;
66 ;Notes : Sequence numbers 5 - 8 are not currently supported
67 ; : OUTARR() will be initialized (i.e. KILLed) on input
68 ; : OUTARR(0) will be set to NULL on bad input
69 ; : The local array VAFHLROL() is internally used for building
70 ; of the segment and should not be used as the output array
71 ;
72 ;Check input
73 S PARAM=$G(PARAM)
74 S OUTARR=$G(OUTARR,$NA(^TMP("VAFHLROU",$J)))
75 S FIELDS=$G(FIELDS,"1,2,3,4")
76 S FLDSEP=$G(FLDSEP,"^")
77 S:($L(FLDSEP)'=1) FLDSEP="^"
78 S ENCODE=$G(ENCODE,"~|\&")
79 S:($L(ENCODE)'=4) ENCODE="~|\&"
80 S:('$D(NULL)) NULL=$C(34,34)
81 S MAXLEN=+$G(MAXLEN)
82 S:(MAXLEN<1) MAXLEN=245
83 ;Call outpatient segment builder
84 D OUTPAT^VAFHLRO2
85 ;Done
86 Q
Note: See TracBrowser for help on using the repository browser.