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

how to remove unwanted information from Hl7 file

  • Filter
  • Time
  • Show
Clear All
new posts

  • how to remove unwanted information from Hl7 file

    I want to process Hl7 batch messages from a log file. That file also contains some comments which are not part of HL7 syntex. I want to remove that text/comments from the file before doing transformations.

    My question is, can i do it with MIRTH? if yes how. Example text is below.

    I want to remove remove these date and comments stamps above messge header.

    12/1/2001 9:27:46 AM [T7]: 1 reports are pending delivery; Processing...
    12/1/2001 9:27:46 AM [T7]: Processing Report '84130' - Status: Final

    PID|||0-9939|71116|MR.XYZ||1831000000|F|||^^^^^^||||||||26 9939||

    ....hl7 Message continues .....


  • #2
    Re:how to remove unwanted information from Hl7 fil


    You can use the preprocessor to remove the non-HL7 lines.


    • #3
      Re:how to remove unwanted information from Hl7 fil

      Thanks. Can yo please provide some example scripts to do this job.

      I dont know how to use and which one of these to use:

      I have found folloiwng functions but how to use them , i need some sample or examples of codes.

      var date = DateUtil.getDate(pattern, date);
      var contents ='filename');
      var results = replacer.replaceValues(template, map);

      please help.


      • #4
        Re:how to remove unwanted information from Hl7 fil


        At preprocessor you have the message variable, which has the content of the file you've readed.

        The idea is to read the file and removes the non-HL7 data. You could use some javascript functions as regexp. You can find a good example here: