IBM Master Data Management HL7 message broker rule engine configuration reference

The IBM Master Data Management HL7 message broker rule engine configuration is a JSON structure that defines how HL7 v2 messages are transformed, routed, and responded to by the message broker.

Configuration structure

The rule engine configuration consists of three main components:

  • Global mappings: Field mappings that apply to all interaction handles
  • Source definitions: Mappings specific to particular data sources
  • Interaction handles: Definitions for processing specific HL7 message types

Global mappings

Global mappings define field mappings that apply to all interaction handles unless overridden by source-specific or interaction-specific mappings.

{
  "global": {
    "mappings": [
      {
        "mdm_attr": "attribute_name",
        "msg_attr": "HL7_field_reference"
      }
    ]
  }
}

Each mapping includes:

mdm_attr
The IBM Master Data Management attribute path (for example, legal_name.given_name).
msg_attr
The HL7 field reference using standard HL7 notation (for example, PID-5-2 for the given name in the patient name field).

Source definitions

Source definitions provide mappings specific to particular data sources. These mappings are combined with global mappings when processing messages from the specified source.

{
  "sources": [
    {
      "id": "source_system_id",
      "mappings": [
        {
          "mdm_attr": "attribute_name",
          "msg_attr": "HL7_field_reference"
        }
      ]
    }
  ]
}

Each source definition includes:

id
The unique identifier for the source system.
mappings
An array of field mappings specific to this source system.

Interaction handles

Interaction handles define how specific HL7 message types are processed. Each interaction handle includes request configuration, success response configuration, error handling, and response message settings.

Interaction handle structure

{
  "interaction_handles": [
    {
      "id": "INTERACTION_ID",
      "description": "Description of the interaction",
      "request": {
        "mdm_op": {
          "name": "OPERATION_NAME",
          "search_type": "RECORD|ENTITY",
          "return_type": "RECORD|ENTITY",
          "limit": 10,
          "offset": 0
        },
        "mappings": []
      },
      "success": {
        "description": "Success phase description",
        "mappings": [],
        "events": [],
        "message_type": "HL7_MESSAGE_TYPE",
        "ack_code": "AA",
        "qr_status": "OK"
      },
      "not_found": {
        "description": "Not found phase description",
        "mappings": [],
        "message_type": "HL7_MESSAGE_TYPE",
        "ack_code": "AE",
        "qr_status": "NF"
      },
      "failure": {
        "description": "Failure phase description",
        "mappings": [],
        "message_type": "HL7_MESSAGE_TYPE",
        "ack_code": "AR",
        "qr_status": "AE"
      }
    }
  ]
}

Request configuration

The request section defines how incoming HL7 messages are processed and mapped to IBM Master Data Management operations.

mdm_op
Defines the IBM Master Data Management operation to perform. Contains the following properties:
name
The operation name (for example, SEARCH, GET_CROSS_RECORD_IDENTIFIERS).
search_type
For search operations, specifies whether to search on RECORD or ENTITY.
return_type
Specifies whether to return RECORD or ENTITY data in the response.
limit
Maximum number of results to return (for pagination).
offset
Starting position for results (for pagination).
entity_type
For PIX queries, specifies the entity type to query.
mappings
An array of field mappings that define how HL7 message fields map to IBM Master Data Management attributes for the request.

Success response configuration

The success section defines how to construct response messages when the operation succeeds.

mappings
An array of field mappings that define how IBM Master Data Management attributes map to HL7 response fields.
events
An array of transformation events to apply to the data before constructing the response:
{
  "enabled": true,
  "mdm_attr": "attribute_name",
  "modifiers": [
    {
      "name": "ModifierName",
      "params": ["param1", "param2"]
    }
  ]
}
message_type
The HL7 message type for the response (for example, RSP^K22).
ack_code
The acknowledgment code (for example, AA for application accept).
qr_status
The query response status (for example, OK for success).

Error response configurations

The not_found and failure sections define how to construct response messages for error conditions.

not_found
Used when the requested data is not found. Typically uses acknowledgment code AE (application error) and query response status NF (no data found).
failure
Used when a processing error occurs. Typically uses acknowledgment code AR (application reject) and query response status AE (application error).

Mapping types

Mappings can include different types of values:

Standard mapping
Maps an IBM Master Data Management attribute to an HL7 field:
{
  "mdm_attr": "legal_name.given_name",
  "msg_attr": "PID-5-2"
}
Literal value mapping
Sets an HL7 field to a literal value:
{
  "msg_attr": "QAK-2",
  "lit": "NF"
}

Transformation modifiers

Transformation modifiers apply data transformations before constructing response messages. Common modifiers include:

FormatDate
Converts date formats. Parameters specify the input format and output format:
{
  "name": "FormatDate",
  "params": ["YYYY-MM-DD hh:mm:ss", "YYYYMMDDhhmmss"]
}

Complete example

The following example shows a complete rule engine configuration with global mappings, source definitions, and interaction handles for PIX an PDQ:

{
  "global": {
    "mappings": [
      {
        "mdm_attr": "record_id",
        "msg_attr": "PID-3-1"
      }
    ]
  },
  "sources": [
    {
      "id": "hospital_system_1",
      "mappings": [
        {
          "mdm_attr": "record_source",
          "msg_attr": "PID-3-4-1"
        }
      ]
    }
  ],
  "interaction_handles": [
    {
      "id": "PDQ_SEARCH_RECORD",
      "description": "Patient Demographics Query",
      "request": {
        "mdm_op": {
          "name": "SEARCH",
          "search_type": "RECORD",
          "return_type": "RECORD",
          "limit": 10,
          "offset": 0
        },
        "mappings": [
          {
            "mdm_attr": "legal_name.given_name",
            "msg_attr": "QPD-3-1"
          },
          {
            "mdm_attr": "legal_name.last_name",
            "msg_attr": "QPD-3-2"
          }
        ]
      },
      "success": {
        "mappings": [
          {
            "mdm_attr": "legal_name.given_name",
            "msg_attr": "PID-5-2"
          },
          {
            "mdm_attr": "legal_name.last_name",
            "msg_attr": "PID-5-1"
          }
        ],
        "events": [
          {
            "enabled": true,
            "mdm_attr": "birth_date.value",
            "modifiers": [
              {
                "name": "FormatDate",
                "params": ["YYYY-MM-DD hh:mm:ss", "YYYYMMDDhhmmss"]
              }
            ]
          }
        ],
        "message_type": "RSP^K22",
        "ack_code": "AA",
        "qr_status": "OK"
      },
      "not_found": {
        "mappings": [
          {
            "msg_attr": "QAK-2",
            "lit": "NF"
          }
        ],
        "message_type": "RSP^K22",
        "ack_code": "AE",
        "qr_status": "NF"
      },
      "failure": {
        "mappings": [
          {
            "mdm_attr": "error.code",
            "msg_attr": "ERR-1",
            "lit": "APPLICATION_ERROR"
          }
        ],
        "message_type": "RSP^K22",
        "ack_code": "AR",
        "qr_status": "AE"
      }
    }
  ]
}