Package ca.uhn.hl7v2.model
Interface Type
- All Superinterfaces:
Serializable,Visitable
- 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
An HL7 datatype. Datatypes normally implement either Composite or Primitive.
- Author:
- Bryan Tripp (bryan_tripp@sourceforge.net)
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all data from this typeencode()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.getName()Returns the name of the type (used in XML encoding and profile checking)voidParses 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
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
-
If you are using
-
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
-