|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.vmdb.hl7.HL7Object | +--org.vmdb.hl7.HL7Segment
Description: HL7 Network Connectivity For VMDB.
Copyright: Copyright (c) 2002-2003.
Company: Veterinary Medical Database (VMDB).
A segment is a collection of related fields whose positions are specified in the segment rule. The primary function of the base class is to handle the complex processes of parsing and building segments from and to HL7 and XML. Each derived class provides a rule. The base class passes that rule to a RuleParser object which acts as a director with calls back to this object to read the input string, add fields, etc..
The base segment class also provides the mechanics for accessing fields by position based upon an index. Most of the class is made up of a huge variety of methods for getting, setting, and listing fields. These are normally intended to be used by derived classes to implement named accessor methods. In most cases, an application should use these higher-level set, get, and list methods that provide more segment and message specific access. The base getField() and setField() methods are made public to provide the ability to extend messages to any of the infinite possible variations allowed under HL7.
Constructor Summary | |
HL7Segment(HL7SegmentContainer msgParent)
Construct a segment as part of a specific message or loop. |
Method Summary | |
void |
clearField(int iFieldNo)
Clear the value in the specified field and remove any components and subcomponents. |
HL7Element |
getField(int iFieldNo)
Get Field in Segment by position as named in HL7, i.e., 1 based index (zero is the segment name). |
java.lang.String |
getFieldValue(int iFieldNo)
Get Field Value in Segment by position as named in HL7, i.e., 1 based index. |
java.util.Iterator |
iterator()
Get an Iterator over the HL7Element derived objects that make up this segment. |
java.util.Iterator |
listFields(int iFieldNo)
Get Iterator over all instances of a repeatable Field in Segment by position as named in HL7, i.e., 1 based index (zero is the segment name). |
void |
setField(HL7Element eField,
int iFieldNo)
Set the field at position specified to the HL7Element derived object provided. |
void |
setField(HL7Element eField,
int iFieldNo,
boolean bAdd)
Set the field at position specified to the HL7Element derived object provided. |
void |
setField(HL7Element eField,
java.lang.String sFieldName)
Set the field at position specified to the HL7Element derived object provided. |
void |
setField(HL7Element eField,
java.lang.String sFieldName,
boolean bRepeatable)
Set the field at position specified to the HL7Element derived object provided. |
void |
setField(java.lang.String sValue,
int iFieldNo)
Set the field at position specified to a SimpleElement with the value provided. |
void |
setField(java.lang.String sValue,
int iFieldNo,
boolean bAdd)
Set the field at position specified to a SimpleElement with the value provided. |
void |
setField(java.lang.String sField,
java.lang.String sFieldName)
Set the field at position specified to a SimpleElement with the value provided. |
java.lang.String |
toString()
Output this segment as an HL7 String. |
java.lang.String |
toXML(int iDepth)
Output the this segment as XML. |
Methods inherited from class org.vmdb.hl7.HL7Object |
getRule |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HL7Segment(HL7SegmentContainer msgParent)
msgParent
- HL7SegmentContainer to allow this segment to make
calls to its parent message or loop.Method Detail |
public java.util.Iterator iterator()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXML(int iDepth)
toXML
in class HL7Object
iDepth
- int value for the number of spaces to indent this object. Used just
to make the XML easier to read as unformatted text.
public void setField(HL7Element eField, java.lang.String sFieldName, boolean bRepeatable) throws java.lang.NumberFormatException, java.lang.ArrayIndexOutOfBoundsException, MalformedSegmentException
eField
- The specific object to be inserted by reference.sFieldName
- String with field name based on segment and position. Example:
"PID.3"bRepeatable
- Boolean true if this is a repeatable field.
java.lang.NumberFormatException
- if the string in sFieldName cannot be
parsed to a string segment name plus a period and an integer.
java.lang.ArrayIndexOutOfBoundsException
- if the field specified in sFieldName is
either zero or less or greater than the number of fields.
MalformedSegmentException
- if the HL7Element provided as eField does not
have the type required by rule for this field or when attempting to add to
a non-repeatable field.public void setField(HL7Element eField, java.lang.String sFieldName) throws java.lang.NumberFormatException, java.lang.ArrayIndexOutOfBoundsException, MalformedSegmentException
eField
- The specific object to be inserted by reference.sFieldName
- String with field name based on segment and position. Example:
"PID.3"
java.lang.NumberFormatException
- if the string in sFieldName cannot be
parsed to a string segment name plus a period and an integer.
java.lang.ArrayIndexOutOfBoundsException
- if the field specified in sFieldName is
either zero or less or greater than the number of fields.
MalformedSegmentException
- if the HL7Element provided as eField does not
have the type required by rule for this field.public void setField(java.lang.String sField, java.lang.String sFieldName) throws java.lang.NumberFormatException, java.lang.ArrayIndexOutOfBoundsException, MalformedSegmentException
sField
- String value for any of the simple types.sFieldName
- String with field name based on segment and position. Example:
"PID.3"
java.lang.NumberFormatException
- if the string in sFieldName cannot be
parsed to a string segment name plus a period and an integer.
java.lang.ArrayIndexOutOfBoundsException
- if the field specified in sFieldName is
either zero or less or greater than the number of fields.
MalformedSegmentException
- if the HL7Element provided as eField does not
have the type required by rule for this field.public void setField(HL7Element eField, int iFieldNo, boolean bAdd) throws java.lang.ArrayIndexOutOfBoundsException, MalformedSegmentException
eField
- The specific object to be inserted by reference.iFieldNo
- Integer field number.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rule
MalformedSegmentException
- if the HL7Element provided as eField does not
have the type required by rule for this field or when attempting to add to
a non-repeatable field.public void setField(HL7Element eField, int iFieldNo) throws java.lang.ArrayIndexOutOfBoundsException, MalformedSegmentException
eField
- The specific object to be inserted by reference.iFieldNo
- Integer field number.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rule
MalformedSegmentException
- if the HL7Element provided as eField does not
have the type required by rule for this field.public void setField(java.lang.String sValue, int iFieldNo, boolean bAdd) throws java.lang.ArrayIndexOutOfBoundsException, MalformedSegmentException
iFieldNo
- Integer field number.bAdd
- Boolean true to add rather than replace an existing value in
a repeatable field.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rule
MalformedSegmentException
- if attempting to add to a non-repeatable field.public void setField(java.lang.String sValue, int iFieldNo) throws java.lang.ArrayIndexOutOfBoundsException
iFieldNo
- Integer field number.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rulepublic void clearField(int iFieldNo) throws java.lang.ArrayIndexOutOfBoundsException
iFieldNo
- One based index (zero is the segment name) of field to clear.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rulepublic HL7Element getField(int iFieldNo) throws java.lang.ArrayIndexOutOfBoundsException
iFieldNo
- One based index (zero is the segment name) of field.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rulepublic java.util.Iterator listFields(int iFieldNo) throws java.lang.ArrayIndexOutOfBoundsException
iFieldNo
- One based index (zero is the segment name) of field.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rulepublic java.lang.String getFieldValue(int iFieldNo) throws java.lang.ArrayIndexOutOfBoundsException
iFieldNo
- One based index (zero is the segment name) of field.
java.lang.ArrayIndexOutOfBoundsException
- if iFieldNo points to a field
less than zero or greater than the number of fields allowed in the message
rule
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |