Apply a set of rule_template records to a raw HL7 v2.x message.
The ``rules`` list contains rule_template records fetched from the external
API. This service does not store them — it only executes them.
Only ``is_active=true`` rules are applied, sorted by ``position`` ascending.
Rules with ``condition_data`` are skipped when their condition is not met.
Returns the original message, the transformed message, and a per-rule log.
When ``include_diff=true``, a ``diff`` field carries the before/after state
of the message around each rule, for the UI to debug modifications.
Request
This endpoint expects an object.
messagestringRequired
Raw HL7 v2.x message (segments separated by \r or \n)
ruleslist of objectsRequired
rule_template records to apply (from the external service)
Response
Successful Response
transformed_messagestring
difflist of objects or nullOptional
Per-rule before/after snapshots; present only with include_diff