web stats
Really New - HL7 to HL7 with minor adjustments - Mirth Community

Go Back   Mirth Community > Mirth Connect > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 06-27-2017, 08:27 AM
justinjoseph justinjoseph is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
justinjoseph is on a distinguished road
Default Really New - HL7 to HL7 with minor adjustments

Hey guys!

I am really new to the Mirth engine. I have been playing with it for about 48 hours now and it has been much different than Qvera.

With that said, when I add a message template for both inbound and outbound messages. I just basically copy an message I am receiving, and then add an transformer (source) message builder step where:

Message segment: tmp['FT1']['FT1.21']['FT1.21.1']
Mapping: msg['FT1']['FT1.20']['FT1.20.1'].toString()

This should move the FT1-20.1 value to the FT1-21.1 in my final message.

I set the destination to a file using ${message.encodedData}

The file is created but it does not keep the original values and fields in tact and change just what I chose to change, instead it pushes through my template and makes only the adjustment I provided in the first FT1 segment (there can be multiple).

So I am not getting the source messages with just the changes going to my destination folder, so it's not working well.

Am I missing something? or doing something incorrect?

I would appreciate your help! I have watched many videos on youtube, and read as much documentation as I could find so far.
Reply With Quote
  #2  
Old 06-27-2017, 09:13 AM
nafwa03 nafwa03 is offline
Mirth Newb
 
Join Date: Nov 2015
Posts: 24
nafwa03 is on a distinguished road
Default

Turn on process batch and set what to split by (default MSH)..
Reply With Quote
  #3  
Old 06-27-2017, 09:22 AM
justinjoseph justinjoseph is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
justinjoseph is on a distinguished road
Default

Quote:
Originally Posted by nafwa03 View Post
Turn on process batch and set what to split by (default MSH)..
Just wondering but where might I find process batch?

Wouldn't that just separate more than one hl7 message in a file creating separate ones? I am just trying to push one MSH per file through.
Reply With Quote
  #4  
Old 06-27-2017, 09:27 AM
nafwa03 nafwa03 is offline
Mirth Newb
 
Join Date: Nov 2015
Posts: 24
nafwa03 is on a distinguished road
Default

Its on the source connector. It will write out to separate files or to one depending on what you want to do.. Can you post your channel to take a look?
Reply With Quote
  #5  
Old 06-27-2017, 09:28 AM
justinjoseph justinjoseph is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
justinjoseph is on a distinguished road
Default

Here is an example hl7 message (it's not valid - I am just teaching myself how the Mirth system works by trying to move fields around currently)

MSH|^~\&|TEST-TEST^TEST-TEST^TEST||TEST^TEST^TEST||20121211170953||SIU^S14 |D6B31EEB-EB84-4f15-B74C-C278B7C481B0|P|2.3||||NE
FT1||||||||||||||||||TEST0|TEST|20|21|22|||||||||| ||||||||||||||

I need to move '20' in the FT1-20 to FT1-21 while keeping the rest of the message in tact.

Then I will need to perform the same task for multiple FT1's in a message if they exist so the result will be:

MSH|^~\&|TEST-TEST^TEST-TEST^TEST||TEST^TEST^TEST||20121211170953||SIU^S14 |D6B31EEB-EB84-4f15-B74C-C278B7C481B0|P|2.3||||NE
FT1||||||||||||||||||TEST0|TEST||20|22|||||||||||| ||||||||||||
FT1||||||||||||||||||TEST0|TEST||20|22|||||||||||| ||||||||||||
Reply With Quote
  #6  
Old 06-27-2017, 09:30 AM
justinjoseph justinjoseph is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
justinjoseph is on a distinguished road
Default

Quote:
Originally Posted by nafwa03 View Post
Its on the source connector. It will write out to separate files or to one depending on what you want to do.. Can you post your channel to take a look?
Sure, how do I post my channel? I am trying to learn the Mirth engine so I am just trying to perform some of the most simplistic tasks there are.

Right now I want to move one value from one field to another. I don't know why but for some reason it wants to only make the change I give it and then use the template message as the result. It's confusing.
Reply With Quote
  #7  
Old 06-27-2017, 10:06 AM
nafwa03 nafwa03 is offline
Mirth Newb
 
Join Date: Nov 2015
Posts: 24
nafwa03 is on a distinguished road
Default

You have to select Go Advanced in the reply box. Try this.. Edit your transformer step to Javascript. Remove your outbound template. Put this in:
PHP Code:
for(var i=0;i<msg['FT1'].length();i++)
{
msg['FT1'][i]['FT1.21']['FT1.21.1'] = msg['FT1'][i]['FT1.20']['FT1.20.1'].toString();
delete msg['FT1'][i]['FT1.20']['FT1.20.1'];
//for loop end

Reply With Quote
  #8  
Old 06-27-2017, 10:28 AM
justinjoseph justinjoseph is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
justinjoseph is on a distinguished road
Default

Quote:
Originally Posted by nafwa03 View Post
You have to select Go Advanced in the reply box. Try this.. Edit your transformer step to Javascript. Remove your outbound template. Put this in:
PHP Code:
for(var i=0;i<msg['FT1'].length();i++)
{
msg['FT1'][i]['FT1.21']['FT1.21.1'] = msg['FT1'][i]['FT1.20']['FT1.20.1'].toString();
delete msg['FT1'][i]['FT1.20']['FT1.20.1'];
//for loop end

Okay i added the above line of code as javascript to the transform instead.

Raw:
MSH|^~\&|TEST-TEST^TEST-TEST^TEST||TEST^TEST^TEST||20121211170953||SIU^S14 |D6B31EEB-EB84-4f15-B74C-C278B7C481B0|P|2.3||||NE
FT1||||||||||||||||||TEST0|TEST|20|21|22|||||||||| ||||||||||||||
FT1||||||||||||||||||TEST0|TEST|20|21|22|||||||||| ||||||||||||||

Encoded:
MSH|^~\&|MIK-AIG^MIK-AIG^GUID||SRS^SRS^GUID||20121211170953||SIU^S14|D6 B31EEB-EB84-4f15-B74C-C278B7C481B0|P|2.3||||NE
FT1||||||||||||||||||||20|21|||||||||||||||||||||| |||

It still seems to be doing the same thing, it's not passing through the original message with only the change, it seems to still be pulling from the inbound or outbound msg template. Also note it only passed one FT1 segment through.
Reply With Quote
  #9  
Old 06-27-2017, 10:34 AM
justinjoseph justinjoseph is offline
Mirth Newb
 
Join Date: Jun 2017
Posts: 10
justinjoseph is on a distinguished road
Default

Attached Channel per request:
Attached Files
File Type: xml Channel.xml (24.1 KB, 8 views)
Reply With Quote
  #10  
Old 06-27-2017, 10:45 AM
nafwa03 nafwa03 is offline
Mirth Newb
 
Join Date: Nov 2015
Posts: 24
nafwa03 is on a distinguished road
Default

In the transformer remove the outbound message
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 09:41 PM.


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