Announcement

Collapse
No announcement yet.

md5 hashing

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

  • md5 hashing

    Hi All,

    We process results (ORU) in mirth and and store these in a database for results viewing by clinicians.

    OBX segments often contain comments and text that is the same every time (e.g. information about the lab or physician that is at the bottom of every result). To improve db performance and minimize bloat we have been taking a md5 hash of any textual result and checking if this has been stored before in the db. We are using a hex_md5 function in jscript to achieve this from this source: http://pajhome.org.uk/crypt/md5.

    Unfortunately this can take 30 seconds or more to process some large textual results, particularly histo pathology which could be 130+ lines of text.

    Does anyone have any suggestions on how to generate the md5 hash faster? Could I call something via java rather than javascript?

  • #2
    The JavaScript engine we use (Rhino) integrates seamlessly with the underlying JVM, so you can use whatever Java classes/methods you want. As of 3.2 we include the Guava library by default, so you can use the Hashing utility class:

    Code:
    var hash = com.google.common.hash.Hashing.md5().hashString('message digest', java.nio.charset.Charset.forName('US-ASCII')).toString();
    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
      Fantastic! Thanks so much Nick.

      Comment

      Working...
      X