Skip to content

Error returned when parsing hl7 2.4 MSH segment #613

@AndyWDev

Description

@AndyWDev

I'm using Azure Data Factory to convert HL7 2.4 ORM messages to FHIR using this Microsoft Learn page.

I am getting a bad request error when makes the conversion call

Operation on target HL7v2 to FHIR R4 Converter failed: Operation on target Convert failed: {"resourceType":"OperationOutcome","id":"00d0e45e-49fe-4185-a4a0-57142a716dbd","meta":{"lastUpdated":"2026-03-25T22:24:41.5589058+00:00"},"issue":[{"severity":"error","code":"invalid","diagnostics":"Error occurred when parsing model: 'Invalid Json encountered. Details: Bad JSON escape sequence: \\&. Path 'parameter[0].valueString', line 6, position 36.'."}]}

In effect it is failing to parse the first part of the MSH segment (msh.2 Encoding Characters).

A valid HL7 2.4 MSH segment is shown below (edited some of the detail out) and is usually treated as a string, with the field delimiters specified in field 2.

MSH|^~\\&|SendingApp|Sendingfacility|ReceivingApp|ReceivingFacility|20260122154129||ORM^O01^ORM_O01|29353502|T|2.4|||AL|NE|NZ|ASCII|ENG\r

I am using the default template hl7v2templates:default

Not sure if this is a bug in the converter or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions