Home » Convert CSV file to HL7 messages
This tutorial shows you how to create HL7-like messages using a .csv file Caristix software.
We’ve had a lot of questions from users about how to send data from flat files or databases to an HL7 system. First, we need to keep in mind the HL7 system is expecting messages in a very specific event-based format. The format would define the list of supported trigger events as well as the list of segments and fields supported for each trigger event. It would also include attributes such as optionality, repeatability and data length description. You can even define code sets for specific fields. In other words, the format is the message specification the system is expecting to receive.
This tutorial explains how to generate valid HL7 messages where data comes from a csv file.
Scroll down to download files used in this tutorial.
The process is straightforward. First, create a task that includes all the configuration information needed to populate a message template from data sources. To make this example self-contained, we will send the message to a second task. This second task will take the message and save it to a file. The process then needs to be re-run to process the second (and subsequent) csv file rows.
Here is a step-by-step explanation.
For the purposes of this tutorial, name the suite Caristix Test Tutorial – Convert csv file to HL7 messages
Name the scenario How To
Name the action Generate messages from csv file
Call this new task Generate message
Call it Receive generated messages
In this step, you’ll configure the message template and the data sources to populate the template.
– OR –
Now you’re going to set up variables to link .csv file fields (data sources) to HL7 fields (message target). During execution, the HL7 message fields are populated with data from the data source, so a new message is created for each file row. Here, the data source will be a .csv file, but it can also be an Excel file or a database.
Repeat these steps for each field to be linked to the HL7 message template, changing the variable name and column to pick data from. Once all fields are linked, move to the next step.
As explained earlier, for the purpose of this tutorial, we will send generated messages to an internal task. If you want to send messages directly to the remote HL7 system, you can skip this step.
A file (Caristix Test Tutorial – Convert csv file to HL7 messages.hl7) is created with 10 messages in it.
Enjoy!
NORTH AMERICA: +1 (877)-872-0027
WORLD: 1-418-872-4000
EMAIL: info@caristix.com
ASIA-PACIFIC
DENIS CANTIN
T: +61418441388
denis.cantin@caristix.com
NORTH AMERICA & EUROPE
JEAN-LUC MORIN
T: 418 872-4000
jeanluc.morin@caristix.com
HL7® / FHIR® are a registered trademarks of Health Level Seven International. The use of this trademark does not constitute an endorsement by HL7.