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

Pre-processing HL7 embedded in and XML message

  • Filter
  • Time
  • Show
Clear All
new posts

  • Pre-processing HL7 embedded in and XML message

    I am having difficulty doing anything in the pre-processor script. I seem to be missing something about the environment. The HL7 payload in the XML is in Base64 and I can not get it decoded. Here is the information:

    // Modify the message variable below to pre process data
    var m = new XML(message);
    var payload = m['Payload'].toString();
    message = payload;
    return message;
    The log has the following:
    ERROR 2007-09-26 09:23:52,281 [_soapConnector#15904854.soap:MirthHL7toXML.receiver.3] preprocessor: <Doc>
    ERROR 2007-09-26 09:23:52,281 [_soapConnector#15904854.soap:MirthHL7toXML.receiver.3] preprocessor: TVNIfF5...cwoKfA==
    ERROR 2007-09-26 09:23:52,281 [_soapConnector#15904854.soap:MirthHL7toXML.receiver.3] preprocessor: AAA
    ERROR 2007-09-26 09:23:52,281 [_soapConnector#15904854.soap:MirthHL7toXML.receiver.3] com.webreach.mirth.connectors.soap.ServiceProxy$AxisServiceHandler: org.mule.umo.routing.RoutingException: Failed to transform message before applying the filter. Failed to route event via endpoint: ImmutableMuleEndpoint{[email protected]13efd0b, endpointUri=soap://localhost:2100/services, transformer=Transformer{name='SOAPRequestToString', returnClass=false, returnClass=false, sourceTypes=[]}, name='_soapEndpoint#-469336871', type='receiver', properties={}, [email protected], filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=true, initialState=started, createConnector=0}. Message payload is of type: [Ljava.lang.Object;
    What is going on? As you can see the decode method does not work.

    Scott HL7_to_XML_Transformers.xml (32264 bytes)

    Post edited by: [email protected], at: 09/26/2007 08:51

    Post edited by: [email protected], at: 09/26/2007 08:54

    Post edited by: [email protected], at: 09/26/2007 09:34

  • #2
    Re:Pre-processing HL7 embedded in and XML message

    payload = FileUtil.decode(payload);
    The decode method returns the decoded string back to you, it doesn't modify the variable in place.

    Post edited by: chrisl, at: 09/26/2007 11:20
    Chris Lang


    • #3
      Re:Pre-processing HL7 embedded in and XML message

      I tried that and it still fails exactly the same way. For some reason the decode is throwing an error. The Base64 string was encoded using .NET standard conversions.

      I also got an error when I attempted to write the payload string to a file from the pre-processor.

      I am totally at a loss as to what to do.


      • #4
        Re:Pre-processing HL7 embedded in and XML message

        Two things -

        Your the base64 decoder gives you a byte array - if this is String data, do

        payload = new String(FileUtil.decode(payload));
        Alternatively you can try:

        var decoder = new Packages.sun.misc.BASE64Decoder();
        payload = new String(decoder.decodeBuffer(payload));
        What platform is this on?
        Chris Lang


        • #5
          Re:Pre-processing HL7 embedded in and XML message

          This is on Windows Server 2003.

          The same problem still ocurrs with your suggestion.

          I think it has to have something to do with the base64 encoding. I encode in .NET 2.0. Or does it have something to do with 8 bit ASCII strings in .NET - I do not know how Java handles strings - I am a .NET developer, not Java.

          Post edited by: [email protected], at: 09/27/2007 08:30