web stats
Generating Repeating Segment - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2018, 12:40 PM
cabanjose367 cabanjose367 is offline
What's HL7?
 
Join Date: Sep 2018
Posts: 1
cabanjose367 is on a distinguished road
Unhappy Generating Repeating Segment

Hello, I am fairly new in Mirth and I'm working on developing a channel that will receive HL7 from a Practice Management to EHR. I'm working with ver3.6 and I need to be able to generate a segment if the incoming HL7 message has more than one of those particular segments. Example I have a template built on the destination side of the channel that is mapped. But instead of mapping multiple segments of the same, I need to have it automatically generated.
Incoming message:
MSH|||||||
PID||||||||
IN1||||||||
IN2||||||||
IN1||||||||
IN2||||||||
NTE|||||||
NTE|||||||

Destination Template:
MSH|||||||
PID||||||||
IN1||||||||
IN2||||||||
NTE|||||||

So I need to have Mirth via a setting or by JS to loop through all of the segments and if there are any repeating segments to generate and populate with the same information as the original template mapping.
I hope this makes sense because I really need some help THanks
Reply With Quote
  #2  
Old 10-03-2018, 05:11 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 476
agermano is on a distinguished road
Default

Not sure exactly what you're trying to do here, but one of the things that isn't immediately clear to a new mirth user is how outbound data types work.

If you specify an outbound template, that should be considered your 'default' outbound message. It will be deserialized to the variable tmp at the start of your transformer*, including any values you set, and whatever tmp holds at the end of your transformer will be serialized according to the outbound data type properties.

If you leave the outbound template empty, tmp will not be defined. Instead, at the end of your transformer msg will be serialized according to the outbound data type properties. This is useful when the inbound and outbound types are the same and you want to pass the incoming message largely unchanged. You can read/modify/add/delete values directly to msg instead of copying everything that doesn't need to change to tmp.

*technically it's deserialized before either the filter or transformer run and can be modified in either.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Mirth Corporation