0
votes

I have tried and tried to get the expressions option working in a transformer on Mirth and the channel won't start if I include it. Basically, I have Last^First^MI^^ in the XML. I want to transform the Last portion to HL7 field for LastName, same for first, etc.

If I try an expression I know works elsewhere: ([^^]*) which should take the Last Name only, it won't start the channel.

Any help on how I can get XML field Last^First^MI^^ to give me just the last name for the last name HL7 mapping, then one that will give me first name, etc. would be most appreciated!

1

1 Answers

2
votes

Why use a regular expression for that? If I understand correctly you want to extract the Last name first name and MI from the message.

Use the transformer type mapper. type in the a variable name as last_name and mapping as msg['PID']['PID.5']['PID.5.1'].toString(), nothing in default.

similarly for first_name,create another variable and mapping as msg['PID']['PID.5']['PID.5.2'].toString()

and like wise for MI as well.

Alternatively, you can paste a sample HL7 message in the Message Template section, which will break your message in individual components in message trees and then you can drag and drop required field from there and put it for use.

save and deploy the channel.