Class Hierarchy   Class Index   Method Index  

CHMengine Class Reference

#include <CHMengineClass.h>


Detailed Description

Instance of Chameleon engine.

The CHMengine object represents an instance of a Chameleon engine. Before it can be used the programmer must load a message definition file using the Load method of this object.


Public Member Functions

 CHMengine ()
 Constructor.
virtual ~CHMengine ()
 Destructor.
size_t AckMessageIndex () const
 Get the index of the ACK message.
size_t buildNumber () const
 Get the build number of Chameleon.
const CHMchar * ConfigurationName (size_t ConfigurationIndex) const
 Get the name of the configuration specified by ConfigurationIndex.
size_t CountOfConfiguration () const
 Get the number of configurations in the message definition (VMD) file.
size_t CountOfMessage () const
 Get the count of messages.
size_t CountOfTable () const
 Get the count of tables.
size_t CurrentConfigurationIndex () const
 Get the current configuration index of Chameleon.
const CHMengineHandle EngineHandle () const
 Get the handle to the underlying Chameleon parser object.
void extendPythonLibraryPath (const char *pPath)
 Add pPath to the path that Python will use to locate your python modules.
const CHMchar * generateAck (const CHMchar *pMessage)
 Fast optimized method to generate an ACK message based on pMessage.
void generateXsd (const char *pFilename)
 Generate an XSD to validate XML based on the XML generation style specified in the loaded VMD.
size_t IgnoreMessageIndex () const
 Get the index of the default message.
size_t InConfigurationIndex () const
 Get the index of the input configuration used for graphical transformation.
virtual void InitiateMessage (const CHMchar *pFlatWire)
 Initiate a message.
CHMboolean IsUsingPassthruMapping () const
 Check whether the engine is using passthru mapping (scripted transformation), or graphical mapping (graphical transformation).
virtual void Load (const CHMchar *pFileName)
 Load the visual message definition (VMD) file pFileName.
CHMoutputLogLog ()
 Get a non-const pointer to the CHMoutputLog object assigned to this engine.
size_t majorVersion () const
 Get the major version number of Chameleon.
CHMtableHandle MessageHandle (size_t MessageIndex) const
 Get the handle to the underlying Message at MessageIndex.
const CHMchar * MessageName (size_t MessageIndex) const
 Get the message name.
size_t minorVersion () const
 Get the minor version number of Chameleon.
const CHMchar * NewLine () const
 Get a newline as defined by the current CHMoutputLog object.
size_t OutConfigurationIndex () const
 Get the index of the output configuration for graphical transformation.
void OutputLine (const CHMchar *pLine) const
 Output pLine to the currently assigned CHMoutputLog object.
virtual void ParseMessage (const CHMchar *pFlatWire, size_t TransportIndex)
 Parse the message pFlatWire from the client at TransportIndex.
virtual void ParseMessageDynamically (const CHMchar *pFlatWire, CHMtable &Table, size_t &MessageIndex) const
 Parse the message pFlatWire dynamically.
virtual void ReplyToMessage (const CHMchar *FlatWire, size_t TransportIndex)
 Reply to message FlatWire from the client at TransportIndex.
void SetCurrentConfigurationIndex (size_t Index)
 Set the current configuration index of Chameleon to Index.
void setDefaultDatabase (const char *pAPI, const char *pName, const char *pUserName, const char *pPassword)
 Programmatically sets the default database associated with the currently selected configuration at run-time.
void SetLog (CHMoutputLog *pLog)
 Assign a CHMoutputLog object pLog to this engine.
void setPythonKeyValuePair (const char *pKey, const char *pValue)
 Assign a string value to a Python global variable.
void SetRejectBadSegmentGrammarFlag (CHMboolean Flag)
 Set the strict grammar checking flag.
void SetTransport (CHMtransport *pTransport)
 Assign a CHMtransport object to this engine.
void SetWrapper (CHMwrapper *pWrapper)
 Assign a CHMwrapper object to this engine.
CHMtableHandle TableHandle (size_t TableIndex) const
 Get the handle to the underlying Table at TableIndex.
const CHMchar * transformMessage (const CHMchar *pMessage, size_t InConfigIndex, size_t OutConfigIndex, size_t &MessageIndex)
 Transform a message from one format to another.
const char * translateMessageToXml (const char *pFlatWire)
 Translate the 2.X HL7 message FlatWire into XML using the DTDs of the format specified in the XML tab of the Options window.
const char * translateXmlToMessage (const char *pXml)
 Translate the XML message pXml conforming to the DTDs of the format specified in the XML tab of the Options window into a 2.X HL7 message.
const CHMtransportTransport () const
 Get a const pointer to the CHMtransport object assigned to this engine.
CHMtransportTransport ()
 Get a non-const pointer to the CHMtransport object assigned to this engine.
const CHMchar * versionString () const
 Get the version string.
const CHMwrapperWrapper () const
 Get a const pointer to the CHMwrapper object assigned to this engine.
CHMwrapperWrapper ()
 Get a non-const pointer to the CHMwrapper object assigned to this engine.


Constructor & Destructor Documentation

CHMengine::CHMengine  ) 
 

Constructor.

virtual CHMengine::~CHMengine  )  [virtual]
 

Destructor.


Member Function Documentation

size_t CHMengine::AckMessageIndex  )  const
 

Get the index of the ACK message.

This message is set in the Options window of Chameleon in the Special Messages tab. See http://www.interfaceware.com/manual/autoack.html for more information.

size_t CHMengine::buildNumber  )  const
 

Get the build number of Chameleon.

const CHMchar* CHMengine::ConfigurationName size_t  ConfigurationIndex  )  const
 

Get the name of the configuration specified by ConfigurationIndex.

size_t CHMengine::CountOfConfiguration  )  const
 

Get the number of configurations in the message definition (VMD) file.

size_t CHMengine::CountOfMessage  )  const
 

Get the count of messages.

This method gives the number of message definitions loaded in this CHMengine object from the message definition file (VMD). Usage of this function with MessageName offers an easy way to iterate through the messages.

size_t CHMengine::CountOfTable  )  const
 

Get the count of tables.

This method gives the number of table definitions loaded in this CHMengine object from the message definition file (VMD).

size_t CHMengine::CurrentConfigurationIndex  )  const
 

Get the current configuration index of Chameleon.

const CHMengineHandle CHMengine::EngineHandle  )  const
 

Get the handle to the underlying Chameleon parser object.

This method is part of the internal implementation of Chameleon and should not be called.

void CHMengine::extendPythonLibraryPath const char *  pPath  ) 
 

Add pPath to the path that Python will use to locate your python modules.

This is in addition to the path set in the environment variable CHM_PYTHON_LIB_PATH. A semi-colon (;) delimited string is expected as input in a Windows environment. A colon (:) delimited string is expected as input in a POSIX environment.

const CHMchar* CHMengine::generateAck const CHMchar *  pMessage  ) 
 

Fast optimized method to generate an ACK message based on pMessage.

Please read the chapter on AutoAcknowledgement in the manual http://www.interfaceware.com/manual/autoack.html

void CHMengine::generateXsd const char *  pFilename  ) 
 

Generate an XSD to validate XML based on the XML generation style specified in the loaded VMD.

The XSD will be output to pFileName.

size_t CHMengine::IgnoreMessageIndex  )  const
 

Get the index of the default message.

This message is used to identify messages which do not match the precise identification criteria for other messages in the given message definition file. This message is set in the Options window in the Special Messages tab. See http://www.interfaceware.com/manual/default_message.html for more information.

size_t CHMengine::InConfigurationIndex  )  const
 

Get the index of the input configuration used for graphical transformation.

The index returned by this method is that of the input configuration last set by the user in the Transformation window in the VMD file. This is not used for scripted transformation.

virtual void CHMengine::InitiateMessage const CHMchar *  pFlatWire  )  [virtual]
 

Initiate a message.

Deprecated:
This function will attempt to send the message given in the pFlatWire argument.
It will use the assigned CHMtransport and CHMwrapper objects that are assigned to this CHMengine object.

CHMboolean CHMengine::IsUsingPassthruMapping  )  const
 

Check whether the engine is using passthru mapping (scripted transformation), or graphical mapping (graphical transformation).

virtual void CHMengine::Load const CHMchar *  pFileName  )  [virtual]
 

Load the visual message definition (VMD) file pFileName.

This must be done before the Chameleon engine can be used. Applications should load the VMD file as part of initialization since loading may take a few seconds. Loading the VMD file every time a message is encountered will result in very slow performance.

CHMoutputLog* CHMengine::Log  ) 
 

Get a non-const pointer to the CHMoutputLog object assigned to this engine.

size_t CHMengine::majorVersion  )  const
 

Get the major version number of Chameleon.

CHMtableHandle CHMengine::MessageHandle size_t  MessageIndex  )  const
 

Get the handle to the underlying Message at MessageIndex.

This method is part of the internal implementation of Chameleon and should not be called.

const CHMchar* CHMengine::MessageName size_t  MessageIndex  )  const
 

Get the message name.

This method returns the name of the message located at the index MessageIndex. Usage of this function with CountOfMessage offers an easy way to iterate through the messages.

size_t CHMengine::minorVersion  )  const
 

Get the minor version number of Chameleon.

const CHMchar* CHMengine::NewLine  )  const
 

Get a newline as defined by the current CHMoutputLog object.

Because conventions for newlines differ between Windows edit controls and log files, this should be used to ensure that inserting a newline has the desired behavior in a given log output.

size_t CHMengine::OutConfigurationIndex  )  const
 

Get the index of the output configuration for graphical transformation.

The index returned by this method is that of the output configuration last set by the user in the Transformation window in the VMD file. This is not used for scripted transformation.

void CHMengine::OutputLine const CHMchar *  pLine  )  const
 

Output pLine to the currently assigned CHMoutputLog object.

virtual void CHMengine::ParseMessage const CHMchar *  pFlatWire,
size_t  TransportIndex
[virtual]
 

Parse the message pFlatWire from the client at TransportIndex.

This function needs to be overridden by child classes of CHMengine.

virtual void CHMengine::ParseMessageDynamically const CHMchar *  pFlatWire,
CHMtable Table,
size_t &  MessageIndex
const [virtual]
 

Parse the message pFlatWire dynamically.

This method can be used to parse messages without relying on the stubcode generation of Chameleon. See http://www.interfaceware.com/manual/cpp_dynamic_interface.html for more information. An important thing to note about this interface is that you must create a new CHMtable object each time before calling this method.

virtual void CHMengine::ReplyToMessage const CHMchar *  FlatWire,
size_t  TransportIndex
[virtual]
 

Reply to message FlatWire from the client at TransportIndex.

Deprecated:
This function uses the assigned CHMtransport and CHMwrapper classes to route a reply message back to the appropriate sender using the TransportIndex to look up that sender.

void CHMengine::SetCurrentConfigurationIndex size_t  Index  ) 
 

Set the current configuration index of Chameleon to Index.

void CHMengine::setDefaultDatabase const char *  pAPI,
const char *  pName,
const char *  pUserName,
const char *  pPassword
 

Programmatically sets the default database associated with the currently selected configuration at run-time.

Parameters:
pAPI is the database type. Choose from one of the following strings: MySQL, OCI, ODBC - PostgreSQL, ODBC - MS Access, ODBC - Oracle, ODBC - MS SQL Server, ODBC - Sybase ASA, ODBC - Sybase ASE.
pName is the name of the database.
pUserName is the user name you are using to access the database.
pPassword is the password corresponding to the user name.

void CHMengine::SetLog CHMoutputLog pLog  ) 
 

Assign a CHMoutputLog object pLog to this engine.

This method is used by the engine for logging output. Use of the python "log()" command in the vmd file will be output through the CHMoutputLog interface. Be aware this method takes ownership of the CHMoutputLog object, i.e., the CHMengine destructor will delete the CHMoutputLog object.

void CHMengine::setPythonKeyValuePair const char *  pKey,
const char *  pValue
 

Assign a string value to a Python global variable.

Note that the assigned value is always of string type. If an integer or other type is called for, you will need to convert the value to that type.

void CHMengine::SetRejectBadSegmentGrammarFlag CHMboolean  Flag  ) 
 

Set the strict grammar checking flag.

When this flag is set the parser will check for the presence of compulsory fields in each segment and enforce other rules such as maximum field length. This flag can also be set through the Options screen of Chameleon.

void CHMengine::SetTransport CHMtransport pTransport  ) 
 

Assign a CHMtransport object to this engine.

Deprecated:
The CHMtransport object pTransport is used by the engine to send and receive messages.
Be aware that this method takes ownership of the assigned CHMtransport object, i.e., the CHMengine destructor will delete the CHMtransport object.

void CHMengine::SetWrapper CHMwrapper pWrapper  ) 
 

Assign a CHMwrapper object to this engine.

Deprecated:
The CHMwrapper object pWrapper is used to wrap outgoing messages and unwrap incoming messages from the CHMtransport class.
Be aware that this method takes ownership of the assigned CHMwrapper object, i.e., the CHMengine destructor will delete the CHMwrapper object.

CHMtableHandle CHMengine::TableHandle size_t  TableIndex  )  const
 

Get the handle to the underlying Table at TableIndex.

This method is part of the internal implementation of Chameleon and should not be called.

const CHMchar* CHMengine::transformMessage const CHMchar *  pMessage,
size_t  InConfigIndex,
size_t  OutConfigIndex,
size_t &  MessageIndex
 

Transform a message from one format to another.

This function invokes Chameleon's translation logic to take a message of the InConfigIndex flavor and translate it to the OutConfigIndex flavor. The MessageIndex is set according to the type of message that the data pMessage was recognized as. The function returns the transformed data. If the translation fails, an exception is raised. See http://www.interfaceware.com/manual/transform_message.html for more information.

const char* CHMengine::translateMessageToXml const char *  pFlatWire  ) 
 

Translate the 2.X HL7 message FlatWire into XML using the DTDs of the format specified in the XML tab of the Options window.

See http://www.interfaceware.com/manual/xml.html for more information.

const char* CHMengine::translateXmlToMessage const char *  pXml  ) 
 

Translate the XML message pXml conforming to the DTDs of the format specified in the XML tab of the Options window into a 2.X HL7 message.

See http://www.interfaceware.com/manual/xml.html for more information.

CHMtransport* CHMengine::Transport  ) 
 

Get a non-const pointer to the CHMtransport object assigned to this engine.

Deprecated:

const CHMtransport* CHMengine::Transport  )  const
 

Get a const pointer to the CHMtransport object assigned to this engine.

Deprecated:

const CHMchar* CHMengine::versionString  )  const
 

Get the version string.

CHMwrapper* CHMengine::Wrapper  ) 
 

Get a non-const pointer to the CHMwrapper object assigned to this engine.

Deprecated:

const CHMwrapper* CHMengine::Wrapper  )  const
 

Get a const pointer to the CHMwrapper object assigned to this engine.

Deprecated:


The documentation for this class was generated from the following file: