The Database Message Extraction filter provides the ability to generate an XML message with data obtained from a JDBC accessible data source. In effect, it replaces the original message with the results from the database query.

This scenario involves generating an XML message containing a patient's data from an SQL database based on the ID number of the patient.

The following diagram illustrates a simple route.

Database Configuration File

As the scenario reads information from an ADT^A09 message, a message definition is required to allow Rhapsody to parse the message and extract the patient ID. In this scenario, we will use a definition created in the EDI Message Designer using the HL7 2.5 libraries and previously loaded into Rhapsody.

The database configuration file contains the SQL query to run. The SQL query determines the structure of the XML document that is generated.

This looks at the Patient table of our database and returns PatientIDs that match the PatientID.IDNumber field in the PID segment of our ADTA09 message. The filter configuration should look like this:

When a message with the desired PatientID is sent to the filter and successfully found an XML message is generated; for example:

<?xml version="1.0"?>

<message>

<get_patient>

<Gender>M</Gender>

<FamilyName>Doe</FamilyName>

<Address>742 Evergreen Terrace, Springfeild</Address>

<DateOfBirth null="yes"></DateOfBirth>

<PatientID>100</PatientID>

<PhoneHome>096237548</PhoneHome>

<PhoneWork>096247348</PhoneWork>

<PhoneMob>021458745</PhoneMob>

<GivenName>John</GivenName>

</get_patient>

</message>