Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: VAFHLROL

VAFHLROL.m

Go to the documentation of this file.
  1. 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
  1. ;
  1. ;Entry from top of routine not allowed - must use supported line tags
  1. Q
  1. ;
  1. OUTPAT(PARAM,OUTARR,FIELDS,FLDSEP,ENCODE,NULL,MAXLEN) ;Build segment for
  1. ; transmission of outpatient data
  1. ;
  1. ;Input : PARAM - Array, subscripted by paramter name, that contains
  1. ; information specific to building of segment
  1. ; (full global reference)
  1. ; - Supported parameters/subscripts listed below
  1. ; OUTARR - Output array (full global reference)
  1. ; - Defaults to ^TMP("VAFHLROL",$J)
  1. ; FIELDS - List of fields (sequence numbers) to include
  1. ; seperated by commas
  1. ; - Defaults to all required fields (1-4)
  1. ; FLDSEP - HL7 field seperator (1 character)
  1. ; - Defaults to ^ (carrot)
  1. ; ENCODE - HL7 encoding characters (4 characters)
  1. ; - Defaults to ~|\& (tilde bar backslash ampersand)
  1. ; NULL - HL7 null designation
  1. ; - Defaults to "" (quote quote)
  1. ; MAXLEN - Maximum length of a single line in the segment
  1. ; array (i.e. when to wrap to next node in output)
  1. ; - Defaults to 245
  1. ;Output : None
  1. ; OUTARR(0) will contain ROL segment (first MAXLEN characters)
  1. ; OUTARR(1) will contain rest of ROL segment (if needed)
  1. ;
  1. ; Errors associated to required data elements returned in
  1. ; OUTARR("ERROR",Seq#,x) = Error text
  1. ;
  1. ; Errors associated to optional data elements returned in
  1. ; OUTARR("WARNING",Seq#,x) = Error text
  1. ;
  1. ;Subscripts for PARAM array : (Sample use: @PARAM@("PTRVPRV")=1234)
  1. ; PTR200 - Pointer to entry in NEW PERSON file (#200)
  1. ; - ** Required if not using ROLE and PERSON parameters **
  1. ; - Definition of calculated ROLE found in ROLE^VAFHLRO3()
  1. ; - Definition of calculated PERSON found in PERSON^VAFHLRO3()
  1. ; CODEONLY - Flag indicating if calculations for ROLE & PERSON should
  1. ; only include their coded/table values
  1. ; 1 = Yes (internal only)
  1. ; 0 = No (internal & external) (default)
  1. ; - Value not applied to input values of ROLE & PERSON
  1. ; INSTID - Value to use for Role Instance ID (seq #1)
  1. ; - ** Required **
  1. ; ACTION - Value to use for Action Code (seq #2)
  1. ; - AD (Add) UP (Update) DE (Delete) CO (Correct)
  1. ; LI (Link) UN (Unlink) UC (Unchanged)
  1. ; - ** Required **
  1. ; ROLE - Value to use for first three components of Role (seq #3)
  1. ; - Use this parameter to over-ride calculation based on PTR200
  1. ; ALTROLE - Value to use for last three components of Role (seq #3)
  1. ; - Use this parameter to include alternate role
  1. ; PERSON - Value to use for Role Person (seq #4)
  1. ; - Use this parameter to over-ride calculation based on PTR200
  1. ; - note that only values for the 1st instance can be
  1. ; passed, i.e., do not pass provider SSN
  1. ; RDATE - (optional) Use this parameter to obtain person role
  1. ; - "as of" the date specified. The current date will be used
  1. ; - if this parameter is undefined.
  1. ;
  1. ;Notes : Sequence numbers 5 - 8 are not currently supported
  1. ; : OUTARR() will be initialized (i.e. KILLed) on input
  1. ; : OUTARR(0) will be set to NULL on bad input
  1. ; : The local array VAFHLROL() is internally used for building
  1. ; of the segment and should not be used as the output array
  1. ;
  1. ;Check input
  1. S PARAM=$G(PARAM)
  1. S OUTARR=$G(OUTARR,$NA(^TMP("VAFHLROU",$J)))
  1. S FIELDS=$G(FIELDS,"1,2,3,4")
  1. S FLDSEP=$G(FLDSEP,"^")
  1. S:($L(FLDSEP)'=1) FLDSEP="^"
  1. S ENCODE=$G(ENCODE,"~|\&")
  1. S:($L(ENCODE)'=4) ENCODE="~|\&"
  1. S:('$D(NULL)) NULL=$C(34,34)
  1. S MAXLEN=+$G(MAXLEN)
  1. S:(MAXLEN<1) MAXLEN=245
  1. ;Call outpatient segment builder
  1. D OUTPAT^VAFHLRO2
  1. ;Done
  1. Q