Announcement

Collapse
No announcement yet.

Extract (Base64)PDF from large >10MB HL7 messages

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

  • Extract (Base64)PDF from large >10MB HL7 messages

    I'm processing HL7 messages that include extraction of multiple PDF's stored as base64 and write these to file(s). Problem is that mirth throws an heap space error for larger HL7 files (Usually larger then a few Megabytes). I've already increased Java workspace in mirth configuration but without luck. I'm using mirth 3.0.2.

    Any suggestions how to process these kind of larger messages ?

  • #2
    Originally posted by Fysicon View Post
    I'm processing HL7 messages that include extraction of multiple PDF's stored as base64 and write these to file(s). Problem is that mirth throws an heap space error for larger HL7 files (Usually larger then a few Megabytes). I've already increased Java workspace in mirth configuration but without luck. I'm using mirth 3.0.2.

    Any suggestions how to process these kind of larger messages ?
    That's exactly what attachment handlers are for. Watch this (@1:03:21): http://www.mirthcorp.com/featured-we...t-30-beta-demo

    The regex attachment handler even gives you an example of how to extract data from OBX.5.5.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Hello,

      Thanks for the information.
      I've seen the demo video where the attachment handlers are explained.
      I am wondering if i should use the javascript attachment handler or the regular expression attachment handler while i have multiple attachments in a single HL7 message (up to 15).

      Comment


      • #4
        Originally posted by Fysicon View Post
        Hello,

        Thanks for the information.
        I've seen the demo video where the attachment handlers are explained.
        I am wondering if i should use the javascript attachment handler or the regular expression attachment handler while i have multiple attachments in a single HL7 message (up to 15).
        It depends on how exactly the data should be extracted. If you can use a regex to match all locations where your attachments could possibly reside, then might as well.
        Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

        Nicholas Rupley
        Work: 949-237-6069
        Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


        - How do I foo?
        - You just bar.

        Comment


        • #5
          Because there are multiple PDF's inside (up to 15), can i use the Regex to get them all out?
          In my current channel i'm parsing over the message using javascript and are able to find them all, but obviously run into java memory issues.

          Comment


          • #6
            Is there a possiblity that i send you an example of my hl7 files with multiple PDF's encoded inside, and you provide me the channel configuration to extract all the files?

            Comment


            • #7
              Originally posted by Fysicon View Post
              Because there are multiple PDF's inside (up to 15), can i use the Regex to get them all out?
              In my current channel i'm parsing over the message using javascript and are able to find them all, but obviously run into java memory issues.
              Depends on the message, but generally yes you can build a regex that will match all cases.

              Originally posted by Fysicon View Post
              Is there a possiblity that i send you an example of my hl7 files with multiple PDF's encoded inside, and you provide me the channel configuration to extract all the files?
              Sorry but no. This is a place to get help when you're stuck or run into a bug or something; it's not a "do your homework for you for free" place.
              Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

              Nicholas Rupley
              Work: 949-237-6069
              Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


              - How do I foo?
              - You just bar.

              Comment


              • #8
                No problem. Thanks
                Last edited by Fysicon; 09-05-2014, 04:11 AM.

                Comment


                • #9
                  If I may, I should just like to add a further query to this post...

                  I am wondering what happens if a portion of a message is removed as an attachment within Mirth Connect, and you later need to reprocess the message. Does Mirth add the attachment again or does it try and process the message with the placeholder?

                  Comment


                  • #10
                    Originally posted by seaston View Post
                    If I may, I should just like to add a further query to this post...

                    I am wondering what happens if a portion of a message is removed as an attachment within Mirth Connect, and you later need to reprocess the message. Does Mirth add the attachment again or does it try and process the message with the placeholder?
                    In 2.x no it doesn't, however in 3.x it does. When you reprocess a message in 3.x, the source raw content is taken and any attachment content is re-inserted, then the resulting content is what gets sent to the channel. In the vast majority of cases this means that the raw message that gets sent into the channel during a reprocess will be identical to what the channel originally received (before any attachment extraction was done).
                    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

                    Nicholas Rupley
                    Work: 949-237-6069
                    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


                    - How do I foo?
                    - You just bar.

                    Comment


                    • #11
                      Originally posted by narupley View Post
                      That's exactly what attachment handlers are for. Watch this (@1:03:21): http://www.mirthcorp.com/featured-we...t-30-beta-demo

                      The regex attachment handler even gives you an example of how to extract data from OBX.5.5.
                      Link is broken now, I was wondering if this demo video is still available.

                      Thanks,
                      Dave

                      Comment


                      • #12
                        Hello sarcophyton,

                        If you have access to the Mirth Client Portal there are recordings of the Developer Q&A webinars. #68 has the topic of Regex Pattern in Attachments listed and #70 has the topic Base64 Conversions listed.
                        Brian Scheller
                        Mirth Fundamentals Certified 06/15
                        Mirth Advanced Certified 10/15

                        Comment

                        Working...
                        X