public interface Type extends Serializable, Visitable
Modifier and Type | Method and Description |
---|---|
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.
|
accept, isEmpty, provideLocation
String getName()
ExtraComponents getExtraComponents()
Message getMessage()
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:
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).
This method makes use of the parser which is stored within the enclosing Message
.
At this time, only PipeParsers are supported.
string
- the message to be parsedHL7Exception
- if errors occurred while parsingString encode() throws HL7Exception
HL7Exception
- if errors occurred while encodingvoid clear()
Copyright © 2001–2017 University Health Network. All rights reserved.