Sending Hl7 message from ubuntu to PACS

Hi, I am new to Hl7. I am trying to send a message from my ubuntu machine to a PACS. I am doing curl POST request. I am creating the message using https://www.npmjs.com/package/hl7-builder this hl7 builder using a node application. Message is getting build properly with all the segments. While sending it through curl, the delimiters are getting changed to \n string which the receiving PACS is not taking as delimiter.

Message on my side is like this:

MSH|^~\&|5CPACS|5CNetwork|EnterpriseServer|EnterpriseServer|202002171602||ORU^R01|476|D|2.3
EVN|R01|202002171602
PID|||ABC0050000027456||ANANTHA BELLARY|||M
OBR||||XRay Others|||20200214|||||||||||||||||
OBX|||XRay Others||TEMP||||||SIGNEDOFF|||20200214

But while on PACS side its getting converted to:

MSH|^~\&|5CPACS|5CNetwork|EnterpriseServer|EnterpriseServer|202002171602||ORU^R01|476|D|2.3\nEVN|R01|202002171602\nPID|||ABC0050000027456||ANANTHA BELLARY|||M\nOBR||||XRay Others|||20200214|||||||||||||||||\nOBX|||XRay Others||TEMP||||||SIGNEDOFF|||20200214

Can anyone suggest a fix for this. Is there any other better way to send an HL7 message from a linux machine to PACS.

The messages you’re using are HL7 v2 messages, not HL7 FHIR, so you won’t likely find much help on this forum Try asking on http://chat.hl7.org.