public interface Segment extends Structure
Modifier and Type | Method and Description |
---|---|
String |
encode()
Encodes this message using the parser returned by
Message.getParser() |
Type[] |
getField(int number)
Returns the array of Fields at the specified index.
|
Type |
getField(int number,
int rep)
Returns a specific repetition of field at the specified index.
|
int |
getLength(int number)
Returns the maximum length of the field at the given index, in characters.
|
int |
getMaxCardinality(int number)
Returns the maximum number of repetitions of this field that are allowed.
|
String[] |
getNames()
Returns the names of the fields in this segment.
|
boolean |
isRequired(int number)
Returns true if the field at the given index is required, false otherwise.
|
int |
numFields()
Returns the number of fields defined by this segment (repeating
fields are not counted multiple times).
|
void |
parse(String string)
Parses the string into this segment using the parser returned by
Message.getParser() |
getMessage, getName, getParent
accept, isEmpty, provideLocation
String encode() throws HL7Exception
Message.getParser()
HL7Exception
- if errors occurred during encodingType[] getField(int number) throws HL7Exception
number
- field number (starting at 1)HL7Exception
- if field index is out of range.Type getField(int number, int rep) throws HL7Exception
Type t = getField(x, 2);
number
- the field number (starting at 1)rep
- the repetition number (starting at 0)HL7Exception
- if field index is out of range, or if the specified
repetition is more than 1 greater than the highest index of existing repetitions.
NOTE: to facilitate local extensions, no exception is thrown if
rep > max cardinalityint getLength(int number) throws HL7Exception
number
- field number starting at 1HL7Exception
- if field index is out of range.int getMaxCardinality(int number) throws HL7Exception
number
- field number starting at 1HL7Exception
- if field index is out of range.String[] getNames()
boolean isRequired(int number) throws HL7Exception
number
- field number starting at 1HL7Exception
- if field index is out of range.int numFields()
void parse(String string) throws HL7Exception
Message.getParser()
string
- encoded segmentHL7Exception
- if errors occurred during parsingCopyright © 2001–2017 University Health Network. All rights reserved.