org.openhealthexchange.openpixpdq.ihe.configuration
Class Configuration

java.lang.Object
  extended by org.openhealthexchange.openpixpdq.ihe.configuration.Configuration

public class Configuration
extends java.lang.Object

This class contains a number of utilities for getting configuration and using configuration information from a connection description.

Version:
1.0 - Nov 22, 2005
Author:
Jim Firby

Constructor Summary
Configuration()
           
 
Method Summary
static java.lang.String applyEnumMap(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.Enum value, java.lang.Class enumType, boolean isRequired)
          Translates an enum value into a Code appropriate for this connection.
static java.lang.String applyStringMap(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.String value, java.lang.String valueType, boolean isRequired)
          Translates a symbolic string into a Code appropriate for this connection.
static com.misyshealthcare.connect.net.Identifier getIdentifier(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.String name, boolean isRequired)
          Gets an identifier description from the connection this actor is using.
static com.misyshealthcare.connect.net.PropertySet getPropertySet(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.String name, boolean isRequired)
          Gets a property set from the connection being used by this actor.
static java.lang.String getPropertySetValue(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.String setName, java.lang.String valueName, boolean isRequired)
          Gets a value from a property set defined for a connection.
static java.lang.String getPropertyValue(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.String valueName, boolean isRequired)
          Gets a value of a property defined for a connection.
static java.lang.Enum reverseEnumMap(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.String code, java.lang.Class enumType)
          Translates a code to an internal Misys Connect enum value.
static java.lang.String reverseStringMap(com.misyshealthcare.connect.net.IConnectionDescription connection, java.lang.String code, java.lang.String valueType)
          Translates a Code from this connection into a Misys Connect string value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Method Detail

getIdentifier

public static com.misyshealthcare.connect.net.Identifier getIdentifier(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                                                       java.lang.String name,
                                                                       boolean isRequired)
                                                                throws IheConfigurationException
Gets an identifier description from the connection this actor is using.

Parameters:
connection - the connection description being used
name - the name of the identifier in the configuration
isRequired - true if this identifier must exist
Returns:
the identifier
Throws:
IheConfigurationException - If this identifier must be in the configuration and it is not

getPropertySet

public static com.misyshealthcare.connect.net.PropertySet getPropertySet(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                                                         java.lang.String name,
                                                                         boolean isRequired)
                                                                  throws IheConfigurationException
Gets a property set from the connection being used by this actor.

Parameters:
connection - the connection description being used
name - the name of the property set in the configuration
isRequired - true if this property set must exist
Returns:
The property set
Throws:
IheConfigurationException - If this property set must be in the configuration and it is not

getPropertySetValue

public static java.lang.String getPropertySetValue(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                                   java.lang.String setName,
                                                   java.lang.String valueName,
                                                   boolean isRequired)
                                            throws IheConfigurationException
Gets a value from a property set defined for a connection.

Parameters:
connection - the connection description holding the set
setName - the name of the property set
valueName - the name of the value within the property set
isRequired - true if this value must be defined
Returns:
The value of the property
Throws:
IheConfigurationException - If this value must be in the configuration and it is not

getPropertyValue

public static java.lang.String getPropertyValue(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                                java.lang.String valueName,
                                                boolean isRequired)
                                         throws IheConfigurationException
Gets a value of a property defined for a connection.

Parameters:
connection - the connection description holding the set
valueName - the name of property
isRequired - true if this property must be defined
Returns:
The value of the property
Throws:
IheConfigurationException - If this value must be in the configuration and it is not

applyEnumMap

public static java.lang.String applyEnumMap(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                            java.lang.Enum value,
                                            java.lang.Class enumType,
                                            boolean isRequired)
                                     throws IheConfigurationException
Translates an enum value into a Code appropriate for this connection.

Parameters:
connection - the connection being submitted to
value - the enum value used within Misys Connect
enumType - the enum Class for this value, ie. the name of the EnumMap to use for translation
isRequired - true if a translation of this value is required, False if the value can default to itself
Returns:
The translated Code
Throws:
IheConfigurationException - When the required EnumMap is not defined for this connection

reverseEnumMap

public static java.lang.Enum reverseEnumMap(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                            java.lang.String code,
                                            java.lang.Class enumType)
Translates a code to an internal Misys Connect enum value.

Parameters:
connection - the connection to use
code - the code used by that connection
enumType - the Misys Connect enum type
Returns:
The Misys Connect enum value

applyStringMap

public static java.lang.String applyStringMap(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                              java.lang.String value,
                                              java.lang.String valueType,
                                              boolean isRequired)
                                       throws IheConfigurationException
Translates a symbolic string into a Code appropriate for this connection.

Parameters:
connection - the connection being submitted to
value - the symbolic value used within Misys Connect
valueType - the kind of value this is, ie. the name of the StringMap to use for translation
isRequired - true if a translation of this value is required, False if the value can default to itself
Returns:
The translated Code
Throws:
IheConfigurationException - When the required StringMap is not defined for this connection

reverseStringMap

public static java.lang.String reverseStringMap(com.misyshealthcare.connect.net.IConnectionDescription connection,
                                                java.lang.String code,
                                                java.lang.String valueType)
Translates a Code from this connection into a Misys Connect string value.

Parameters:
connection - the connection being submitted to
code - the Code used by the connection
valueType - the kind of value this is, ie. the name of the StringMap to use for translation
Returns:
The Misys Connect symbolic value for this Code