ca.uhn.hl7v2.model
Interface Type

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

public interface Type
extends Serializable

An HL7 datatype. Datatypes normally implement either Composite or Primitive.

Author:
Bryan Tripp (bryan_tripp@sourceforge.net)

Method Summary
 void clear()
          Clears all data from this type
 String encode()
          Encodes this type using HL7 encoding.
 ExtraComponents getExtraComponents()
          Returns an object containing any extra (non-standard) components that have been added to this type at run-time.
 Message getMessage()
           
 String getName()
          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.
 

Method Detail

getName

String getName()
Returns the name of the type (used in XML encoding and profile checking)


getExtraComponents

ExtraComponents 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.


getMessage

Message 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:

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

Throws:
HL7Exception

encode

String encode()
              throws HL7Exception
Encodes this type using HL7 encoding.

Throws:
HL7Exception

clear

void clear()
Clears all data from this type



Copyright © 2001-2012 University Health Network. All Rights Reserved.