com.merge.HL7
Class HL7Toolkit

java.lang.Object
  extended by com.merge.HL7.HL7Toolkit

public class HL7Toolkit
extends java.lang.Object

This class provides an interface for various non HL7 specific features.


Field Summary
static int EXPAND_FIELD
          This field represents the highest detail level used in the toAnnotatedString methods of the message and segment classes.
static int EXPAND_NONE
          This field represents the minimal detail level used in the toAnnotatedString methods of the message and segment classes.
static int EXPAND_NONEMPTY_FIELD
          This field represents the field detail level used in the toAnnotatedString methods of the message and segment classes.
static int EXPAND_SEGMENT
          This field represents the segment detail level used in the toAnnotatedString methods of the message and segment classes.
 
Constructor Summary
HL7Toolkit()
           
 
Method Summary
static HL7Logger getLogger()
          Gets the current logger object.
static java.util.Properties getProperties()
          Gets the current set of configuration settings of the toolkit.
static java.lang.String getToolkitVersion()
          Gets the version of this toolkit.
static void setLogger(HL7Logger logger)
          Sets the HL7Logger instance the toolkit will use to log messages.
static void setProperties(java.util.Properties props)
          This method allows the application to specify the configuration settings for the toolkit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPAND_NONE

public static final int EXPAND_NONE
This field represents the minimal detail level used in the toAnnotatedString methods of the message and segment classes. Specifying the value of this field in an toAnnotatedString call results in an output that does not contain field level details, only the encoded content of sequences will be included in the output.

See Also:
Constant Field Values

EXPAND_SEGMENT

public static final int EXPAND_SEGMENT
This field represents the segment detail level used in the toAnnotatedString methods of the message and segment classes. Specifying the value of this field in an toAnnotatedString call results in an output that contains the segment's fields detail without the field's components.

See Also:
Constant Field Values

EXPAND_FIELD

public static final int EXPAND_FIELD
This field represents the highest detail level used in the toAnnotatedString methods of the message and segment classes. Specifying the value of this field in an toAnnotatedString call results in an output that contains the segment's fields detail including all components and subcomponents.

See Also:
Constant Field Values

EXPAND_NONEMPTY_FIELD

public static final int EXPAND_NONEMPTY_FIELD
This field represents the field detail level used in the toAnnotatedString methods of the message and segment classes. Specifying the value of this field in an toAnnotatedString call results in an output that contains the segment's non-empty fields detail including all components and subcomponents.

See Also:
Constant Field Values
Constructor Detail

HL7Toolkit

public HL7Toolkit()
Method Detail

setProperties

public static void setProperties(java.util.Properties props)
This method allows the application to specify the configuration settings for the toolkit.

The toolkit does not keep a local cache of the settings so changes to the values of the properties object after a call to this method may affect the toolkit's functionality.

If the application does not set the properties, the toolkit will try to load them from the HL7Toolkit.properties file located in the class path. If the HL7Toolkit.properties file can not be found or read the toolkit will use the default configuration values.

Additionally to the following list of settings any settings defined in HL7SocketConfiguration, HL7TransmitterConfiguration and HL7ReceiverConfiguration are recognized by the toolkit.

Setting Default value Description
LAZY_SEGMENT_PARSING yes Controls whether the content of a segment is parsed when set (no) or only when required (yes)
LICENSE_KEY   Contains the toolkit's license key
FILL_REQUIRED_COMPONENTS no Controls whether the toolkit adds missing required components in a field when encoding (yes/no)
ENCODE_EMPTY_FIELDS no Controls whether trailing empty fields are encoded in a segment (yes/no)
TRIM_FIELDS_ON_ENCODE yes Controls whether trailing whitespace characters are removed from field values before encoding (yes/no)
LOG_DESTINATION mergehl7.log Specifies the log destination. The value is either the location of the log file or the word "CONSOLE" in which case the log destination is the system output (console).
LOG_ERRORS yes Controls whether errors are logged by the toolkit. (yes/no)
LOG_WARNINGS no Controls whether warnings are logged by the toolkit. (yes/no)
TRACE_MAPPING no Controls whether segment mapping trace messages are logged by the toolkit. (yes/no)
TRACE_SEND no Controls whether information about sent messages is logged by the toolkit. (yes/no)
TRACE_RECEIVE no Controls whether information about received messages is logged by the toolkit. (yes/no)
TRACE_CONNECTIONS no Controls whether information about network connections is logged by the toolkit. (yes/no)
TRACE_RAW_DATA no Controls whether the binary data sent or received is logged by the toolkit. (yes/no)
SEGMENT_[segmentName]   Defines the private segment type [segmentName]. The value should be in the following format:

[fieldType1]:[fieldType2]:...:[fieldTypen]

where fieldTypeX is the HL7 data type of the field with sequence number X.

E.g. "SEGMENT_ZMY = SI:CX:CX:XAD:ST:ST:IS:CE" defines a segment named ZMY that has 8 fields of the specified type.

Parameters:
props - A Properties object containing settings for the toolkit.

getProperties

public static java.util.Properties getProperties()
Gets the current set of configuration settings of the toolkit.

Returns:
A Properties object containing settings for the toolkit.

getToolkitVersion

public static java.lang.String getToolkitVersion()
Gets the version of this toolkit.

Returns:
A String representing the current version of the toolkit.

setLogger

public static void setLogger(HL7Logger logger)
Sets the HL7Logger instance the toolkit will use to log messages. If the application does not set a logger the toolkit will use its own internal logger.

Parameters:
logger - The new logger object.

getLogger

public static HL7Logger getLogger()
Gets the current logger object.

Returns:
The HL7Logger instance used by the toolkit to log messages.

Copyright © 2009 Merge Healthcare Inc. All Rights Reserved.