I have been trying to create an Outbound HL7 message with multiple segments for Next of kin, Allergies, and Insurance companies from my MS SQL database. I have created a channel that uses source message builder type transformers to map my database fields to my HL7 Template. This works fine, but I can only map one next of kin, one allergy, and one insurance company per patient. I would like to know how to support multiple segments in my outbound message if the number of segments is different for each patient.
One thought I had was to create a javascript source transformer that queries the database for the detail next of kin, allergy, and insurance information and then write a segment directly to the output. Is there a better way to do this? if so, how? I have not found any examples of outbound channels that do this, only inbound. Any suggestions about how this is supposed to work would be appreciated.
If it is possible to to this, do I need to change all my message builder transforms to use javascript or can I use a combination of javascript, mapper, and message builder types? If so, how do I know which transformer runs first, second...? Also, How can I write directly to the output of the channel via javascript? Or should the template be modified on the fly to allow various segment formats?
One thought I had was to create a javascript source transformer that queries the database for the detail next of kin, allergy, and insurance information and then write a segment directly to the output. Is there a better way to do this? if so, how? I have not found any examples of outbound channels that do this, only inbound. Any suggestions about how this is supposed to work would be appreciated.
If it is possible to to this, do I need to change all my message builder transforms to use javascript or can I use a combination of javascript, mapper, and message builder types? If so, how do I know which transformer runs first, second...? Also, How can I write directly to the output of the channel via javascript? Or should the template be modified on the fly to allow various segment formats?
Comment