web stats
XML to HL7 conversion problem - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2014, 08:19 AM
Renzo_Passolini Renzo_Passolini is offline
Mirth Newb
 
Join Date: Feb 2013
Posts: 19
Renzo_Passolini is on a distinguished road
Default XML to HL7 conversion problem

Hello
I have a problem, and I know for sure I'm missing something.

I have a wsdl message coming to my channel, through a channel reader.
This message is hl7 formatted as xml.
I have set up my channel as source connector inbound xml, and outbound hl72.x
I have tried to set a message transformer in the Destination, and If I paste the inbound message (xml) it says its not a valid hl72.x (but the inbound template was set to xml!)

I have changed "strip namespaces" field but without results...
Any help would be apreciated.
I attach the channel.
Attached Files
File Type: xml resultado de demograficos.xml (12.4 KB, 53 views)
Reply With Quote
  #2  
Old 09-11-2014, 08:45 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

You have quite a few issues going on here.

First, you have an outbound template set in your source transformer, yet you're not using it. If you don't know what outbound templates are for, best not to use it. Right now your source encoded data is always going to be overwritten with whatever you have in the outbound template.

Next, your source outbound data type is HL7 v2.x, yet you're not doing any conversion from XML to HL7 v2.x. If you want to do that in the destination transformer instead, change your source outbound data type to XML. And get rid of that outbound template.

You also have Strip Namespaces enabled on the source inbound data type (XML). Make sure to disable that since it looks like you'll need the namespaces preserved. When you change the source outbound data type to XML, make sure to also disable Strip Namespaces on the destination inbound serialization properties.

In your destination transformer, all you have is this:

Code:
SerializerFactory.getHL7Serializer().fromXML(message);
That's definitely not enough. You're going to need to take whatever's in the "MensSalida" node first (using the correct namespaces and everything). At that point just overwrite msg with it and you should be fine. Since it's the per-spec HL7 XML, you'll need to enable the strict parser for the HL7 v2.x deserialization properties.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 09-17-2014, 02:08 AM
Renzo_Passolini Renzo_Passolini is offline
Mirth Newb
 
Join Date: Feb 2013
Posts: 19
Renzo_Passolini is on a distinguished road
Default

Hi, thanks for replying
I have changed all you menctioned on here.
I have deleted the SerializerFactory.getHL7Serializer().fromXML(messa ge);

I now have in the output the same as in the template, but the field PID 5.2 is not being populated.

I'm using a Message Builder Rule:

Message segmente: tmp['PID']['PID.5']['PID.5.2']
Mapping: msg['SOAP-ENV:Body']['S101Response']['MensSalida']['RSP_K23']['RSP_K23.QUERY_RESPONSE']['PID']['PID.5']['XPN.1']['FN.1'].toString()

Is that correct?

Again, thanks.
Reply With Quote
  #4  
Old 09-19-2014, 03:17 AM
Renzo_Passolini Renzo_Passolini is offline
Mirth Newb
 
Join Date: Feb 2013
Posts: 19
Renzo_Passolini is on a distinguished road
Default

Hi, I have now understand. Sorry I am a bit "slow" and english is not my native language. Sometimes I understood the words but not the meaning of them.

Yet the outbound was set to hl7 because at the end this is what I want to have, but meanwhile file writer to set my test is ok.

Now what I have understood the importance of the namespaces, and in this case is critical 'cause I have two PID .3 . How will be the best way? javascript looking for the only pid .3 I am interested and ignoring the others?

Thanks for your patience and cooperation
Reply With Quote
  #5  
Old 04-28-2016, 01:25 AM
satyaprakash satyaprakash is offline
Mirth Newb
 
Join Date: May 2011
Posts: 11
satyaprakash is on a distinguished road
Default

Hello All,

In the below piece of code, I see "getHL7Serializer()" deprecated in Mirth 3.3.2.7911.

SerializerFactory.getHL7Serializer().fromXML("<xml >XML_TYPE_STRING</xml>"));

Please, could someone suggest me an alternative for use in - Mirth 3.3.2.7911 ?
A few lines of code would be of immense help.

Thanks a lot in advance.

Kindest Regards,
Satya
Reply With Quote
  #6  
Old 04-28-2016, 02:07 AM
vibinChander vibinChander is offline
OBX.2 Kenobi
 
Join Date: Jul 2015
Location: Chennai
Posts: 74
vibinChander is on a distinguished road
Send a message via Skype™ to vibinChander
Default getHL7Serializer is deprecated

yes, getHL7Serializer() is deprecated and it is replaced by just getSerializer() method.

Code:
SerializerFactory.getSerializer('HL7V2').fromXML(message);
__________________

Mirth Interface Engineer
AWS DevOps
Reply With Quote
  #7  
Old 04-28-2016, 02:49 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Default

Check the "Set Data Types" on Summary tab of your channel.
Check the Inbound/Outbound types.
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 08:50 PM.


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