|
|||||||||
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.HL7Element
Description: HL7 Network Connectivity For VMDB.
Copyright: Copyright (c) 2002-2003.
Company: Veterinary Medical Database (VMDB).
HL7 uses data elements in a nested structure of fields sometimes composed of components sometimes composed of subcomponents. The Generic HL7Element class forms the base of all our data type elements. It adds to knowledge of its own level (field, component, or subcomponent) and the machinery to build itself by parsing HL7 input under the direction of a RuleParser.
Constructor Summary | |
HL7Element()
Construct an Element using the name and type specified in its sNm and sRl constants. |
|
HL7Element(int iLevel)
Construct an Element using the name and type specified in its sNm and sRl constants. |
|
HL7Element(java.lang.String sName,
java.lang.String sType)
Construct an Element of given name and type. |
Method Summary | |
void |
clear()
Return this element to its empty state. |
boolean |
empty()
Is this Element empty? |
HL7Element |
getComponent(int iLoc)
Get component based on one based index position. |
int |
getLevel()
Get this Elements level. |
java.lang.String |
getType()
Get the HL7 data type of this element. |
java.lang.String |
getValue()
Get the first component value. |
void |
initialize()
|
java.util.Iterator |
iterator()
Get an Iterator over all the components in this element. |
static HL7Element |
makeElement(int iLevel,
java.lang.String sSeparators,
java.lang.String sType,
java.lang.String sName)
Factory method to make an element of an appropriate subclass for the type specified. |
void |
setComponent(HL7Element element,
int iLoc)
Set component based on one based index position. |
void |
setLevel(int iLevel)
Set this Element to a specified level. |
void |
setType(java.lang.String sType)
Set the HL7 data type of this element. |
void |
setValue(java.lang.String sValue)
Populate the first component with the value supplied. |
int |
size()
How many components are in this element? |
java.lang.String |
toHL7String()
Return the element as an HL7String. |
java.lang.String |
toString()
Return the element as an HL7String. |
java.lang.String |
toXML(int iDepth)
Output the element 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 HL7Element(int iLevel)
iLevel
- One of the constants for specifying level as FIELD, COMPONENT, or
SUBCOMPONENT. Default FIELD.public HL7Element()
public HL7Element(java.lang.String sName, java.lang.String sType)
sName
- The name of this element relative to its container. Example:
"PID.1" for the segquenceID in the pid segment.sType
- The HL7 data type abbreviation. Example "ST" for string or
"NM" for numeric. Note: Both of these would be instatiated as SimpleElement
objects in this library.Method Detail |
public void clear()
public static HL7Element makeElement(int iLevel, java.lang.String sSeparators, java.lang.String sType, java.lang.String sName)
iLevel
- the FIELD, COMPONENT, or SUBCOMPONENT constant
to define the level for this elementsSeparators
- the separators for this messagesType
- the type name (CE, XAD, ST, etc. for this Element)sName
- the name of the new element such as PID.3public void setLevel(int iLevel)
iLevel
- One of the constants for specifying level as FIELD, COMPONENT, or
SUBCOMPONENT. Default FIELD.public int getLevel()
public boolean empty()
public int size()
public void setValue(java.lang.String sValue)
sValue
- String value to set.public java.lang.String getValue()
public void setComponent(HL7Element element, int iLoc) throws java.lang.ArrayIndexOutOfBoundsException, MalformedFieldException
element
- HL7Element derived object to set at locationiLoc
- location in element to set (one based index).
java.lang.ArrayIndexOutOfBoundsException
- if iLoc points to a field
less than one or greater than the number of components allowed
in the message rule.
MalformedFieldException
- if the HL7Element provided as element does not
have the type required by rule for this component.public HL7Element getComponent(int iLoc)
iLoc
- location in element to get (one based index).
java.lang.ArrayIndexOutOfBoundsException
- if iLoc points to a field
less than one or greater than the number of components allowed
in the message rule.public java.util.Iterator iterator()
public void setType(java.lang.String sType)
sType
- The HL7 data type abbreviation. Example "ST" for string or
"NM" for numeric. Note: Both of these would be instatiated as SimpleElement
objects in this library.public java.lang.String getType()
public void initialize()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toHL7String()
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.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |