I am trying to create a HL7 messages from the JSON input.I need to create HL7 message sgements with the nodes MSH,EVN,PID,PV1 with the fields values.
i need to write the javascript using node red.
Could you please guide me on this to achive the same.
I dont know HL7 but there are a few packages on Github and NPM.
for example, you could, in a function node, add this module on the setup tab then in the "on message" write some standard JS to create your HL7 message.
I assume you're using one of the pipe delimited formats and not FHIR? You may have some luck playing with the CSV node using | as your delimiter. Can you give an example of your input data (with PII stripped of course?) I did basically the opposite of this (parsing HL7 into JS objects to push in real time to influx) a couple years back and found that it wasn't terribly tough.