HL7 Client and Server with Ack

This flow illustrates how to create a HL7 client that sends a message to a HL7 server and receives an acknowlege.

This flow is for didactical purposes only, and has not been tested in production.

[{"id":"94cef3ec.91c7b","type":"tab","label":"HL7 TEST","disabled":false,"info":""},{"id":"5b6a3d79.e22e74","type":"inject","z":"94cef3ec.91c7b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":240,"wires":[["e73e041c.364e18"]]},{"id":"e73e041c.364e18","type":"function","z":"94cef3ec.91c7b","name":"","func":"msg.payload = '\\x0b';                                                                        \nmsg.payload += \"MSH|^~\\\\&|LIS|HL7|IM|IM|20090326101845||ORM^O01|1|P|2.4|||AL|NE\"+\"\\r\";          \nmsg.payload += \"PID|1||18474632||TEST^PATIENT^D||19640712|M|||||||||||\"+\"\\r\";\nmsg.payload += \"PV1|1||1|\"+\"\\r\";\nmsg.payload += \"ORC|NW|00350448483|||||R\"+\"\\r\";\nmsg.payload += \"OBR|1|00350448483||GLI|R||20090311103300||||A||||SUERO|||VITROS|^^^^^^P||\"+\"\\r\";\nmsg.payload += '\\x1c'+'\\x0d';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":240,"wires":[["8473591.10d0fa8"]]},{"id":"8473591.10d0fa8","type":"tcp request","z":"94cef3ec.91c7b","server":"localhost","port":"1234","out":"sit","splitc":" ","name":"","x":470,"y":240,"wires":[["ec68926f.9546e"]]},{"id":"ec68926f.9546e","type":"debug","z":"94cef3ec.91c7b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":240,"wires":[]},{"id":"1ca4fa11.aa2946","type":"tcp in","z":"94cef3ec.91c7b","name":"","server":"server","host":"","port":"1234","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":100,"y":100,"wires":[["a8cd9be8.9eada8"]]},{"id":"a8cd9be8.9eada8","type":"function","z":"94cef3ec.91c7b","name":"HL7 ACK","func":"msg.payload = '\\x0b';\nmsg.payload += \"MSH|^~\\\\&|LIS|HL7|IM|IM|||ACK|42|P|2.4|\"+'\\r';                                                      \nmsg.payload += \"MSA|AA|42|\" + '\\r';\nmsg.payload += '\\x1c'+'\\r';  \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":100,"wires":[["1cb235d7.70fa6a"]]},{"id":"1cb235d7.70fa6a","type":"tcp out","z":"94cef3ec.91c7b","host":"","port":"","beserver":"reply","base64":false,"end":false,"name":"","x":430,"y":100,"wires":[]},{"id":"501dbcf.f914b44","type":"comment","z":"94cef3ec.91c7b","name":"HL7 Server","info":"","x":110,"y":60,"wires":[]},{"id":"109a470e.c39f79","type":"comment","z":"94cef3ec.91c7b","name":"HL7 client","info":"","x":100,"y":200,"wires":[]}]

Flow Info

Created 4 years, 10 months ago
Rating:

Owner

Actions

Rate:

Node Types

Core
  • comment (x2)
  • debug (x1)
  • function (x2)
  • inject (x1)
  • tcp in (x1)
  • tcp out (x1)
  • tcp request (x1)
Other
  • tab (x1)

Tags

  • HL7
  • FHIR
  • ASTM
  • 1394
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option