1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
1.0K views
by (290 points)
I would like to take HL7 messages and pull the values out of certain fields and insert them as a comma separated row in a csv file. Each HL7 message would be a single row that is appended to a file. Each row would have values from the HL7 message such as patient_id, last_name, first_name, referring_provider, and so on.

1 Answer

+1 vote
 
Best answer

The first step is to create a new message and set the format to CSV - Comma Separated Values.  In a CSV file each field is a node, so if you want the value in PID-3  to be the first field in the CSV file use the following:

var value = source.getNode("PID-3");
message.setNode("1", value);

The destination would be a file, with the Append to the file checkbox checked.  

by terrie-g-7436 (4.0k points)
selected by sam-s-1510
by (290 points)
Thank you. I see my error now.
...