web stats
get hl7 field from xml - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2017, 05:17 AM
Pilar77 Pilar77 is offline
What's HL7?
 
Join Date: Aug 2009
Posts: 5
Pilar77 is on a distinguished road
Default get hl7 field from xml

I have a channel that recieves (HTTP listener) the next XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<message>
<Mensaje>MSH|^~\&|BLA||BLA||20170323110616||PMU^B02|HIS_113961|P|2.5|||||||||^^^|PMU|20170323110606|2 0170323110616||||eeeeee^^^^^^^^^P^^^^P^^^|dfdf dfdf dfdf&dfdf&dfdf&dfdf^dfdf^dfdf^dfdf||||Y|V|^||||||| |||^^||^|^|
</Mensaje>
<http.request>/</http.request>
<http.version>HTTP/1.1</http.version>
<Host>192.168.1.22:8090</Host>
<http.method>GET</http.method>
<Connection>Keep-Alive</Connection>
</message>

The field "message" conatins pure HL7 text. I need to get ['MSH']['MSH.9']['MSH.9.2'] (in green) but canīt find the way.

Thanks in advance.

Last edited by Pilar77; 03-26-2017 at 11:33 PM.
Reply With Quote
  #2  
Old 03-24-2017, 06:23 AM
agradinc agradinc is offline
Mirth Newb
 
Join Date: Dec 2015
Posts: 14
agradinc is on a distinguished road
Default

I think you want to do something like this.
Code:
var newMSH = SerializerFactory.getSerializer('HL7V2').toXML(hl7string);
var msh_9_2 = newMSH['MSH']['MSH.9']['MSH.9.2'];
Reply With Quote
  #3  
Old 03-25-2017, 01:08 AM
Pilar77 Pilar77 is offline
What's HL7?
 
Join Date: Aug 2009
Posts: 5
Pilar77 is on a distinguished road
Default

Thanks for quick reply but

When I tried

"var newMSH = SerializerFactory.getSerializer('HL7V2').toXML(hl7 string);"

mirth laucnhs error "Can't find method com.webreach.mirth.model.converters.SerializerFact ory.getSerializer(string)."

(my mirth version is 1.8.2.4472)
Reply With Quote
Reply

Tags
convert to hl7, hl7, xml

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 12:21 PM.


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