Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

XML parsing

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

  • XML parsing

    I'm having problems with a channel that used to work (and still does) on Mirth 1.4 but not on Mirth 1.6.
    The problem is in the area of parsing a XML SOAP response an putting it in a Outgoing Data template.

    E.G I have a XML message in strXMLData like
    Code:
    <NewDataSet>
      <Table>
        <RECORD>588085</RECORD>
        <PATIENTNUMMER_IN>9999199</PATIENTNUMMER_IN>
        <PATIENTNUMMER>9999199</PATIENTNUMMER>
        <GEBOORTEDATUM>30-12-1937</GEBOORTEDATUM>
        <GEBOORTEDATUM_VAAGHEID>0</GEBOORTEDATUM_VAAGHEID>
        <NAAM_MAN>PatientName</NAAM_MAN>
        <EERSTE_VOORLETTER_OF_VOORNAAM>BERNHARD</EERSTE_VOORLETTER_OF_VOORNAAM>
        <OVERIGE_VOORLETTERS>H.C.G.</OVERIGE_VOORLETTERS>
        <GESLACHT>M</GESLACHT>
        <GESLACHT_UK>M</GESLACHT_UK>
      </Table>
    </NewDataSet>
    When I use
    Code:
    msg2 = new XML(strXMLData);
    var PatientID= msg2.Table.PATIENTNUMMER;
    and insert it in the Outgoing message
    Code:
    tmp['PID']['PID.3']['PID.3.1'] = PatientID;
    The result is
    Code:
    <PID.3><PATIENTNUMMER>9999199</PATIENTNUMMER></PID.3>
    Logging PatientID with
    Code:
    logger.info('PATIENTID:'+PatientID);
    gives a correct value being '9999199';

    Is there a change in Mirth 1.4 to Mirth 1.6 that can explain this ????


    DinetH7ADT-d3b0154470c3b3b8132455f23e48eaf1.xml (112480 bytes)

    Post edited by: huubvandemortel, at: 01/14/2008 01:52

    Post edited by: huubvandemortel, at: 01/14/2008 04:10

  • #2
    Re:XML parsing

    Java and javascripting isn't my thing

    I changed
    Code:
    var PatientID= msg2.Table.PATIENTNUMMER;

    to
    Code:
    var PatientID= msg2['Table']['PATIENTNUMMER'].toString();
    and that did do the job ...

    Post edited by: huubvandemortel, at: 01/14/2008 05:52

    Comment


    • #3
      documentation for XML Javascript Object

      Hi, I'm just and enthusiast regarding to javascript, I am looging a snmax like this one in Mirth Javascript transformers.

      var wsResponseXML = new XML(wsResponse);
      wsResponseXML..*::codigoUsuario

      Where can I find documentation for this kind of syntax? is this javascript native syntax? I need to work with namespaces, and I can't find anything about it.

      Comment


      • #4
        I'm not exactly sure what you are looking for but we use E4X for dealing with xml.
        Last edited by bradd; 04-23-2010, 02:42 PM.

        Comment


        • #5
          Originally posted by bradd View Post
          I'm not exactly sure what you are looking for but we use E4X dealing with xml.
          yes that was the thing I was looking for,, I'm not really familiar with javascript as I said, and I didn't know that E4X was part of the javascript standard since 1.6. Thank you.

          Comment


          • #6
            cool, the latest version of Flash also uses e4x so you may be able to find even more information from Flash e4x articles.

            Comment

            Working...
            X