Loading

MuleSoft HL7 Connector Read Fails With Required Segment Missing

Julkaisupäivä: Jan 22, 2026
Kuvaus

Mule application using the Health Level 7 (HL7) connector Read operation, fails to parse an incoming HL7 data with error "fatal message error: required segment missing".

Error from logs:

ERROR 2021-10-14 19:17:23,881 [[MuleRuntime].uber.02: [hl7-test-api].hl7-test-apiFlow.BLOCKING @4f71b7e3] [processor: ; event: 08b79ef1-2d5e-11ec-aebe-f01898971dd7] com.mulesoft.flatfile.schema.hl7.HL7SchemaParser: fatal message error: required segment missing: EVN at segment 1 (MSH) of message 00000006
ERROR 2021-10-14 19:17:23,882 [[MuleRuntime].uber.02: [hl7-test-api].hl7-test-apiFlow.BLOCKING @4f71b7e3] [processor: ; event: 08b79ef1-2d5e-11ec-aebe-f01898971dd7] com.mulesoft.flatfile.schema.hl7.HL7SchemaParser: fatal message error: required segment missing: PID at segment 1 (MSH) of message 00000006
ERROR 2021-10-14 19:17:23,882 [[MuleRuntime].uber.02: [hl7-test-api].hl7-test-apiFlow.BLOCKING @4f71b7e3] [processor: ; event: 08b79ef1-2d5e-11ec-aebe-f01898971dd7] com.mulesoft.flatfile.schema.hl7.HL7SchemaParser: fatal message error: required segment missing: MRG at segment 1 (MSH) of message 00000006
{Errors=[HL7Error(2,true,ErrorSegmentSequence,100,required segment missing)], Delimiters=|^~\&, MSH={MSH-05={HD-01=RSP1P8}, MSH-06={HD-01=MCM}, MSH-17=MR1, MSH-07={TS-01=199601051530}, MSH-08=SEC, MSH-19={CE-01=RODRIGUEZ, CE-02=JOHN}, MSH-09={CM_MSG-02=A49, CM_MSG-01=ADT}, MSH-10=00000006, MSH-11={PT-01=P}, MSH-12=2.3
EVN, MSH-13=49, MSH-03={HD-01=REGADT}, MSH-14=199601051530
PID, MSH-04={HD-01=MCM}}, ACK={MSH={MSH-05={HD-01=REGADT}, MSH-06={HD-01=MCM}, MSH-17=MR1, MSH-07={TS-01=199601051530}, MSH-08=SEC, MSH-19={CE-01=RODRIGUEZ, CE-02=JOHN}, MSH-09={CM_MSG-02=A49, MSG-03=ACK, CM_MSG-01=ACK}, MSH-10=00000006, MSH-11={PT-01=P}, MSH-12=2.3
EVN, MSH-13=49, MSH-03={HD-01=RSP1P8}, MSH-14=199601051530
PID, MSH-04={HD-01=MCM}}, ERR=[{ERR-01=[{ELD-04={CE-01=102, CE-02=Data type error, CE-03=HL70357}, ELD-01=MSH, ELD-02=0, ELD-03=13}]}, {ERR-01=[{ELD-04={CE-01=102, CE-02=Data type error, CE-03=HL70357}, ELD-01=MSH, ELD-02=0, ELD-03=13}]}, {ERR-01=[{ELD-04={CE-01=100, CE-02=Segment sequence error, CE-03=HL70357}, ELD-01=EVN, ELD-02=1}]}, {ERR-01=[{ELD-04={CE-01=100, CE-02=Segment sequence error, CE-03=HL70357}, ELD-01=PID, ELD-02=1}]}, {ERR-01=[{ELD-04={CE-01=100, CE-02=Segment sequence error, CE-03=HL70357}, ELD-01=MRG, ELD-02=1}]}], MSA={MSA-02=00000006, MSA-01=AR}}, Data={ADT_A49={MSH={MSH-05={HD-01=RSP1P8}, MSH-06={HD-01=MCM}, MSH-17=MR1, MSH-07={TS-01=199601051530}, MSH-08=SEC, MSH-19={CE-01=RODRIGUEZ, CE-02=JOHN}, MSH-09={CM_MSG-02=A49, CM_MSG-01=ADT}, MSH-10=00000006, MSH-11={PT-01=P}, MSH-12=2.3
EVN, MSH-13=49, MSH-03={HD-01=REGADT}, MSH-14=199601051530
PID, MSH-04={HD-01=MCM}}}}, Id=ADT_A49, Name=ADT_A49}
Ratkaisu

The Anypoint Connector for HL7 message parsing depends on the Message segment terminator that is coming in the incoming data and what is configured in the connector.

While copying the HL7 data from the file to the postman or any other REST client, there are chances that the segment terminator values got altered and caused the issue with the HL7 connector.

SOLUTION

The message segment terminator that is coming in the incoming data should match with the HL7 connector parser configurations as shown here:

  • Segment terminator: LF  (Hex decimal value = 0A)
  • Segment terminator: CR (Hex decimal value = 0D)


Segment terminator         Hex decimal value
LF                                         0A
CR                                        0D


HL7 Connector configuration:

     User-added image
     
 Hex Dump of the Input file :
     User-added image

Knowledge-artikkelin numero

001122637

 
Ladataan
Salesforce Help | Article