Interface Type

All Superinterfaces:
Serializable, Visitable
All Known Subinterfaces:
Composite, Primitive, Variable
All Known Implementing Classes:
AbstractComposite, AbstractPersonNameComposite, AbstractPrimitive, AbstractTextPrimitive, AbstractType, CM, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DT, DTM, DTM, DTM, DTM, DTM, DTM, DTM, GenericComposite, GenericPrimitive, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, ID, IDWithNamespace, IS, IS, IS, IS, IS, IS, IS, IS, IS, IS, IS, IS, ISWithNamespace, NULLDT, NULLDT, NULLDT, NULLDT, NULLDT, NULLDT, NULLDT, SNM, SNM, SNM, SNM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TM, TS, TSComponentOne, TSComponentOne, TSComponentOne, TSComponentOne, TSComponentOne, Varies

public interface Type extends Serializable, Visitable
An HL7 datatype. Datatypes normally implement either Composite or Primitive.
Author:
Bryan Tripp (bryan_tripp@sourceforge.net)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all data from this type
    Encodes this type using HL7 encoding.
    Returns an object containing any extra (non-standard) components that have been added to this type at run-time.
     
    Returns the name of the type (used in XML encoding and profile checking)
    void
    parse(String string)
    Parses the string into this type and replaces the current contents with the parsed value.

    Methods inherited from interface ca.uhn.hl7v2.model.Visitable

    accept, isEmpty, provideLocation
  • Method Details

    • getName

      Returns the name of the type (used in XML encoding and profile checking)
      Returns:
      the name of the type
    • getExtraComponents

      Returns an object containing any extra (non-standard) components that have been added to this type at run-time. This object can also be used to add components.
      Returns:
      an object containing any extra (non-standard) components
    • getMessage

      Returns:
      the message to which this Type belongs
    • parse

      void parse(String string) throws HL7Exception

      Parses the string into this type and replaces the current contents with the parsed value. This method accepts HL7 encoded text and treats its input as such.

      Note that this method is subtly different from calling Primitive.setValue(String), but can be quite powerful. For example, using the argument of "milk&cookies" on an ST datatype:

      • If you are using Primitive.setValue(String), the ampersand is treated as an actual ampersand in the text, and the field will be treated as a single field which is encoded as "milk\T\cookies" (\T\ is the escape sequence for the subcomponent delimiter).
      • If you are using parse(String), the ampersand is treated as a subcomponent delimiter, meaning that the value is set to "milk", and a second component is added with the value of "cookies".

      This method makes use of the parser which is stored within the enclosing Message. At this time, only PipeParsers are supported.

      Parameters:
      string - the message to be parsed
      Throws:
      HL7Exception - if errors occurred while parsing
    • encode

      Encodes this type using HL7 encoding.
      Returns:
      the encoded message
      Throws:
      HL7Exception - if errors occurred while encoding
    • clear

      void clear()
      Clears all data from this type