freemed / freemed

FreeMED Electronic Medical Record / Practice Management System
GNU General Public License v2.0
100 stars 54 forks source link

HL7 and Mirth #11

Open ghost opened 9 years ago

ghost commented 9 years ago

Is it possible to send HL7 messages out of FreeMED? I have Mirth Connect running and it is connected to the MIrth SOAP endpoint. My company is testing software that needs to read HL7 messages and so far FreeMED appears to be the closest platform I have found to get us there.

jbuchbinder commented 9 years ago

The short answer is "yes". We can either generate HL7 messages in FreeMED's code or have the Mirth connector generate the messages from the database.

jbuchbinder commented 9 years ago

Reference is this:

https://github.com/freemed/freemed/blob/master/lib/org/freemedsoftware/core/MirthExport.class.php

Essentially, whenever we fire off a supported event (which is one of the Generator classes), we check to see if MirthExport is configured, and if it is, we send a SOAP message to the defined endpoint of type acceptMessage.

For example, this is the A04 generation code:

https://github.com/freemed/freemed/blob/master/lib/org/freemedsoftware/core/Generator_HL7v2_A04.class.php

It's called here:

https://github.com/freemed/freemed/blob/master/lib/org/freemedsoftware/module/PatientModule.class.php

during add_post() (which is called after an entry is added).

jbuchbinder commented 9 years ago

I just put together a reference page in the FreeMED wiki for implementation here:

https://github.com/freemed/freemed/wiki/HL7-Support

ghost commented 9 years ago

Thank you very much for such a quick reply. Would it be better to have the code generate the HL7 messages or have Mirth pull them from the database?

jbuchbinder commented 9 years ago

It's probably smarter to have FreeMED's code generate the messages, since they would be fired off when the corresponding event occurred, rather than periodically when Mirth would choose to search for new events.