|
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectcom.merge.HL7.HL7Field
public class HL7Field
The HL7Field class represents a generic field in a segment. The toolkit provides specialized classes for each HL7 defined data type to allow setting/reading components by name. This class provides the base functionality for managing the components of the field.
The components of the field are HL7Field objects as well and are referenced by the methods of this class by the component's index number. The first component has the index = 1. Components that are not set, are considered empty and retrieving such component's value results in empty value. For simple data types, fields that do not have components, the value of the field is a string.
Instances of this class should be created through the createField(String) method or using
one of the specialized classes defined in the com.merge.HL7.fields package.
Methods of this class are synchronized.
| Nested Class Summary | |
|---|---|
static interface |
HL7Field.FieldFormatter
Defines the interface for formatting simple field values before sending and after receiving. |
| Field Summary | |
|---|---|
static java.lang.String |
EMPTY_VALUE
Represents an Empty field value as defined by HL7, which is a zero length string. |
static java.lang.String |
NULL_VALUE
Represents a Null field value as defined by HL7, which is a string containing two double quote characters. |
| Method Summary | |
|---|---|
HL7Field |
clone()
Creates a copy of this field. |
static HL7Field |
createField(java.lang.String fieldType)
Creates a specific type of field object. |
static HL7Field |
createField(java.lang.String fieldType,
HL7Toolkit.HL7Version version)
Creates a specific type of field object. |
boolean |
getBoolValue()
Gets the value of this field as a boolean. |
HL7Field |
getComponent(int index)
Gets a component of this field. |
java.lang.String |
getComponentDescription(int index)
Gets the description of a component in this field. |
int |
getComponentLength(int index)
Gets the maximum number of characters for a component in this field. |
java.lang.String |
getComponentType(int index)
Gets the HL7 data type of a component in this field. |
java.lang.String |
getContent()
Provides the HL7 encoded representation of the value in this field using the default separators. |
java.lang.String |
getContent(boolean subcomponent)
Provides the HL7 encoded representation of the value in this field using the default separators. |
java.lang.String |
getContent(HL7MessageConfiguration config,
boolean subcomponent)
Provides the HL7 encoded representation of the value in this field using the default separators. |
java.lang.String |
getDataType()
Gets the HL7 data type of this field. |
java.util.Calendar |
getDateValue()
Gets the value of TM, DTM and DT type fields. |
java.lang.Double |
getDoubleValue()
Gets the value of double type fields. |
static HL7Field.FieldFormatter |
getFieldFormatter()
Gets the current field formatter used by the toolkit. |
java.lang.String |
getFieldName()
Gets the name of this HL7 data type. |
HL7Toolkit.HL7Version |
getHL7Version()
|
int |
getIntValue()
Gets the value of integer type fields. |
int |
getMaxSize()
Gets the number of components defined for this field. |
int |
getMinSize()
Gets the minimum number of components this field must have. |
java.lang.String |
getTableNo(int index)
Gets the table identifier of a component in this field. |
java.lang.String |
getValue()
Gets the value of this field. |
java.lang.String |
getValue(int index)
Gets the value of a component in this field. |
boolean |
isBasicType()
Tells whether the HL7 data type of this field is a basic type that, i.e. |
boolean |
isComponentMandatory(int index)
Tells whether a component is mandatory. |
boolean |
isEmpty()
Tells whether this field is empty, i.e. |
boolean |
isNull()
Tells whether this field has Null value, i.e. |
void |
setComponent(int index,
HL7Field val)
Sets a component of this field. |
void |
setContent(java.lang.String content)
Sets the value of this field from an HL7 encoded representation using the default separators. |
void |
setContent(java.lang.String content,
HL7MessageConfiguration config,
boolean subcomponent)
Sets the value of this field from an HL7 encoded representation. |
static void |
setFieldClass(java.lang.String fieldType,
java.lang.Class<? extends HL7Field> fieldClass)
Registers an HL7Field derived class as the handler for the specified HL7 data type. |
static void |
setFormatter(HL7Field.FieldFormatter formatter)
Sets the field formatter that will be used by the toolkit. |
void |
setValue(boolean val)
Sets the value of this field to "Y" or "N" as specified by the Yes/No table indicator (0136) in section 2.24.23.1. |
void |
setValue(java.util.Calendar val)
Sets the value for TM, TS and DT type fields. |
void |
setValue(java.util.Calendar val,
int precision)
Sets the value for TM, DTM and DT type fields. |
void |
setValue(double val)
Sets the value of this field. |
void |
setValue(int val)
Sets the value of this field. |
void |
setValue(int index,
double val)
Sets the value of a component of this field. |
void |
setValue(int index,
int val)
Sets the value of a component of this field. |
void |
setValue(int index,
java.lang.String val)
Sets the value of a component of this field. |
void |
setValue(java.lang.String val)
Sets the value of this field. |
int |
size()
Gets the actual number of components of this field. |
java.lang.String |
toAnnotatedString()
Provides an easy readable representation of this field. |
java.lang.String |
toAnnotatedString(int verbosityLevel,
int indentLevel)
Provides an easy readable representation of this field. |
java.lang.String |
toString()
Returns a string description of this instance. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String NULL_VALUE
public static final java.lang.String EMPTY_VALUE
| Method Detail |
|---|
public HL7Toolkit.HL7Version getHL7Version()
public static HL7Field createField(java.lang.String fieldType,
HL7Toolkit.HL7Version version)
fieldType - The HL7 data type of the field.version - The HL7 version of the desired field.
public static HL7Field createField(java.lang.String fieldType)
fieldType - The HL7 data type of the field.
public static void setFieldClass(java.lang.String fieldType,
java.lang.Class<? extends HL7Field> fieldClass)
fieldType - The HL7 data type the class will handle.fieldClass - The class associated with the data type or null to revert
to the default field handler class.public static void setFormatter(HL7Field.FieldFormatter formatter)
formatter - An object implementing the HL7Field.FieldFormatter interface.public static HL7Field.FieldFormatter getFieldFormatter()
HL7Field.FieldFormatter object.public java.lang.String getDataType()
public java.lang.String getFieldName()
public int getMinSize()
public int getMaxSize()
public java.lang.String getComponentType(int index)
index - The one based index of the component.
public java.lang.String getComponentDescription(int index)
index - The one based index of the component.
public int getComponentLength(int index)
index - The one based index of the component.
public java.lang.String getTableNo(int index)
index - The one based index of the component.
public boolean isComponentMandatory(int index)
index - The one based index of the component.
public void setContent(java.lang.String content)
content - The encoded value.
public void setContent(java.lang.String content,
HL7MessageConfiguration config,
boolean subcomponent)
content - The encoded value.config - The configuration object containing the encoding separators.subcomponent - Flag indicating whether this field is a subcomponent of another field.public java.lang.String getContent()
public java.lang.String getContent(boolean subcomponent)
subcomponent - Flag indicating whether this field is a subcomponent of another field.
public java.lang.String getContent(HL7MessageConfiguration config,
boolean subcomponent)
config - The configuration object containing the encoding separators.subcomponent - Flag indicating whether this field is a subcomponent of another field.
public java.lang.String getValue()
public java.lang.String getValue(int index)
index - The one based index of the component.
public HL7Field getComponent(int index)
index - The one based index of the component to return.
this ).public boolean isEmpty()
true
if all components are empty.
true if this field is empty.public boolean isNull()
true if all components have Null values.
true if this field has Null value.public HL7Field clone()
createField(String, HL7Toolkit.HL7Version) method.
clone in class java.lang.Objectpublic int size()
public int getIntValue()
public java.lang.Double getDoubleValue()
public java.util.Calendar getDateValue()
Calendar object representing the value of this field.public boolean getBoolValue()
boolean. If this field has components
the value of the first component is returned.
true if the value starts with "Y" or "y".public void setValue(int val)
val - The value to set.
public void setValue(int index,
int val)
index - The one based index of the component to set.val - The value to set.public void setValue(double val)
val - The value to set.
public void setValue(int index,
double val)
index - The one based index of the component to set.val - The value to set.public void setValue(java.lang.String val)
val - The value to set.
public void setValue(int index,
java.lang.String val)
index - The one based index of the component to set.val - The value to set.
public void setComponent(int index,
HL7Field val)
index - The one based index of the component to set.val - The component to set.public void setValue(java.util.Calendar val)
val - A Calendar object representing the value to set.public void setValue(boolean val)
val - The value to set.
public void setValue(java.util.Calendar val,
int precision)
val - A Calendar object representing the value to set.precision - The maximum number of characters in the value.public java.lang.String toAnnotatedString()
public java.lang.String toAnnotatedString(int verbosityLevel,
int indentLevel)
verbosityLevel - The detail level to include in the returned string. Accepted
values are HL7Toolkit.EXPAND_NONE, HL7Toolkit.EXPAND_SEGMENT,
HL7Toolkit.EXPAND_FIELD and HL7Toolkit.EXPAND_NONEMPTY_FIELD.indentLevel - The number of white spaces to insert before each line.
public boolean isBasicType()
true if this field is of a basic type.public java.lang.String toString()
toString in class java.lang.Object
|
Copyright © 2010 Merge Healthcare Inc. All Rights Reserved. | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||