Importing into openEMR

jmprice wrote on Tuesday, August 09, 2011:

Hi,

I have an app that need to send data to openEMR.  I would prefer to be able to use HL7 but I understand that there is currently no inbound HL7 interface to openEMR. 

What other options do I have for how to get data into openEMR programatically ?

The data I am trying to get into openEMR consists of various observations for specific patients, such as a blood pressure or glucose level.

I could either interface directly, or use an interface engine like Mirth where I could send the HL7 to Mirth and it would do whatever is needed (which would be what ?)  to then interface with openEMR.

Feel free to contact me directly if you wish
Thank you for your help in advance.

Jeff
jmprice@gmwhi.org
858-361-5751

sunsetsystems wrote on Tuesday, August 09, 2011:

I think Mirth may be overkill for something like this.  HL7 is not hard to parse with PHP, so I’m guessing a PHP script would be the way to go.

Rod
www.sunsetsystems.com

jmprice wrote on Wednesday, August 10, 2011:

Thanks Rod.   Is there some documentation on how to interface with openEMR using php ?    One disadvantage I have is I do not know php (I am a software developer and know C/C++),   Tony McCormik said there is an example in the contribs/utilsdirectly but it seems pretty complex and does much more than I need and I am not sure what parts are relevant.
  I just want a  blood pressure reading from my device to show up in the correct patients record.   

Thank you again

yehster wrote on Wednesday, August 10, 2011:

If you are unwilling to learn PHP, then you could just write a C script to import data into the form_vitals table of the database.

Otherwise, RTFM
http://www.oemr.org/wiki/Main_Page#Developer_Manuals

sunsetsystems wrote on Wednesday, August 10, 2011:

Depends a lot on what interfacing methods your device/app offers. Can it send HTTP to transmit the info?  I do PHP development… :slight_smile:

Rod
www.sunsetsystems.com

jmprice wrote on Wednesday, August 10, 2011:

Thanks for the replies. 

Rod, Yes I can make it do an HTTP POST I think.

As for the manuals I could not find anything that says how to import things into the database. It probably is right under my nose, but my nose is so big I cannot see beyond it……Can you point me to some documentation, and perhaps some examples of how to import data in that (or any table ?) 

Also, while it might be overkill, has anyone used Mirth to get something into openEMR ?

Thank You

sunsetsystems wrote on Thursday, August 11, 2011:

I don’t know of a good import example for vitals.  But you might look at the vitals form code to see what it does.  Shouldn’t be a huge deal just to get blood pressure recorded.

Rod
www.sunsetsystems.com

tmccormi wrote on Thursday, August 11, 2011:

This is code in the contrib/utils/import_mi2xml.php
line:

function add_vitals( $patient_pid, $dos, $encounter_id, $medics, &$errors ) {
  $bmi;
  $bmi_status;
  // Create Vitals form.
  if (!empty($medics->medical->physicalexamsvitals->bps)) {
/*  DISABLED
  // Calculate BMI_status
  if ($medics->medical->physicalexamsvitals->weight > 0 &&
      $medics->medical->physicalexamsvitals->height > 0) {
        $bmi = ($weight/$height/$height)*703;
        if ( $bmi > 42 )       $bmi_status = 'Obesity III';
        elseif ( $bmi > 34   ) $bmi_status = 'Obesity II';
        elseif ( $bmi > 30   ) $bmi_status = 'Obesity I';
        elseif ( $bmi > 27   ) $bmi_status = 'Overweight';
        elseif ( $bmi > 25   ) $bmi_status = 'Normal BL';
        elseif ( $bmi > 18.5 ) $bmi_status = 'Normal';
        elseif ( $bmi > 10   ) $bmi_status = 'Underweight';
  }
*/
    addForm($encounter_id, "Vitals",
      sqlInsert("INSERT INTO form_vitals SET " .
        "date = '$dos', "        .
        "pid = '$patient_pid', " .
        "user = '"              . form2db($patient_provider_name)                           . "', " .
        "groupname = '', "      .
        "authorized = 1, "      .
        "activity = 1, "        .
        "mentalstate = '"       . form2db($medics->medical->physicalexamsvitals->mentalstatus) . "', " .
        "bps = '"               . form2db($medics->medical->physicalexamsvitals->bps)       . "', " .
        "bpd = '"               . form2db($medics->medical->physicalexamsvitals->bpd)       . "', " .
        "weight = '"            . form2db($medics->medical->physicalexamsvitals->weight)     . "', " .
        "height = '"            . form2db($medics->medical->physicalexamsvitals->height)     . "', " .
        "temperature = '"       . form2db($medics->medical->physicalexamsvitals->temperature). "', " .
        "temp_method = '"       . form2db($medics->medical->physicalexamsvitals->tempmethods). "', " .
        "pulse = '"             . form2db($medics->medical->physicalexamsvitals->pulse)      . "', " .
        "respiration = '"       . form2db($medics->medical->physicalexamsvitals->respiration). "', " .
        "BMI = '"               . form2db($medics->medical->physicalexamsvitals->bmi)        . "', " .
        "BMI_status = '$bmi_status', " .
        "waist_circ = '"        . form2db($medics->medical->physicalexamsvitals->waistcirc)  . "', " .
        "head_circ = '"         . form2db($medics->medical->physicalexamsvitals->headcirc)   . "', " .
        "oxygen_saturation = '" . form2db($medics->medical->physicalexamsvitals->o2)         . "'"
      ),
      "vitals", $patient_pid, 1, $dos
    );
        return "Created vitals form for Patient ID " . $patient_pid . ".\n";
  }
  return "No vitals form created for Patient ID " . $patient_pid . ".\n";
}

deeptieene wrote on Wednesday, May 15, 2013:

Hello,

I want to write PHP script to fetch/store data from/to OpenEMR using CCD
(i.e. CDA{HL7}+CCR).

visolveemr wrote on Wednesday, May 15, 2013:

Hi,

OpenEMR does have the feature to Import data (in CCD) from the Patient Document Section and the same can be viewed. Even the data can also be fetched/downloaded in CCD format from Patient Dashboard-Report section.

OpenEMR doesnt have the functionality to parse the imported CCD, but only view. Hope this helps

Thanks
ViSolve

deeptieene wrote on Friday, May 17, 2013:

deeptieene wrote on Friday, May 17, 2013:

deeptieene wrote on Friday, May 17, 2013:

deeptieene wrote on Friday, May 17, 2013:

Thanks ViSolve,

Your answer will help me. Also i’v seen Import/Export and Database option in :
Administration > Other > Database

Actually I am creating a website where giving provision to get values from user and want to store data in OpenEMR, the same for Fetch/Edit record(S). Want to write something in PHP.

Is it Possible? Or I am mistaking somewhere…


CCD is not giving option to donwload XML file, please refer attachment

deeptieene wrote on Friday, May 17, 2013:

visolveemr wrote on Friday, May 17, 2013:

Hi,

The Database Import/Export is directly associated with OpenEMR tables and this will not meet your requirement

You can either opt developing interfacing (between your application and OpenEMR) with SOAP/RESTful APIs or use any of the existing thirdparty applications.

N.B CCD Download option is available in the latest dev release. Attached for your reference

Thanks
Devi

deeptieene wrote on Friday, May 17, 2013:

Hi Devi,

I am so thankful.
Can you please explain a bit more about SOAP/RESTful and Thirdparty applications?

Also can you provide me the link for latest version of OpenEMR.

Thanks
Deepti

visolveemr wrote on Saturday, May 18, 2013:

Hi,

Here is the link to download latest dev release code from git GitHub - openemr/openemr: OpenEMR is the most popular open source electronic health records and medical practice management solution. ONC certified with international usage, OpenEMR's goal is a superior alternative to its proprietary counterparts. or from downloads (both dev & stable) http://www.open-emr.org/wiki/index.php/OpenEMR_Downloads

Regarding your clarification on interfacing applications, please write you specific question to services@visolve.com

Thanks
Devi