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