No announcement yet.

Clearhealth Mysql connection

  • Filter
  • Time
  • Show
Clear All
new posts

  • Clearhealth Mysql connection

    I am trying create channels to connect one Clearhealth EHR (MySQL) system to another Clearhealth system. The desired result being I create a patient on System A, and it appears on System B. Has anyone done something similar to this? Specifically, I would like to know how to query the CH db to gather the patient data needed to create a "HL7 Add person message (HL7 ADT:A28)", and to create and configure a tracking table to mark which patients have already been exported... assuming that's the right way to do things.

    Sample code would be most helpful if anyone has it.


  • #2
    Re:Clearhealth Mysql connection

    I think you're the first person to mention ClearHealth.

    Does ClearHealth do HL7 messaging on its own? If so you'd need to be dealing only with the messages. If not you'll be querying its database on your own.

    I'll assume its the latter case.

    There are many ways to do this, but I'm going to illustrate how you'd set up Mirth to be the Hl7 interface for an instance of CH. You'll have one instance of Mirth for each CH system. You could do it with a single instance of Mirth for both, but having separate instances will help keep the two systems isolated and minimize any risks from exposing your databases.

    This approach is a bit blunt, it can be improved a LOT with the addition of some database triggers, but I think it would be best to get the basics down first and then refine it.

    The first instance will have Mirth querying the A database to get patient records. That query would get info about the patient and other relevant data (guarantors, pcp, etc.). From that query build out an HL7 message (probably an ADT) and send it to the second instance of Mirth.

    This query will track which records it has seen, not by a tracking table, but by simply recording the last run-time of its query and looking for records newer than that. So if your query runs every 5 minutes, the first time it runs it would get all records, the next time it would only get records updated or created in the last 5 minutes. This is much simpler since you are only tracking one value, the time of the query, instead of a long list of patient records.

    The second instance of Mirth will listen for HL7 messages. When it gets one it will first need to query database B and see if it has information for a patient and if that information is newer or older. If the information in the message is newer create or update the records. If the information is older, simply drop the message.

    Its early on a Monday, so I might have missed something. Keep asking questions and the community will be happy to help!
    Jon Bartels

    Zen is hiring!!!!
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.