Announcement

Collapse
No announcement yet.

get hl7 field from xml

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 11:33 PM.

  • #2
    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'];

    Comment


    • #3
      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)

      Comment

      Working...
      X