EER (Data Modeling) Diagram for OpenEMR?

gsporter wrote on Friday, December 23, 2011:

Has anyone created a EER (Data Modeling) Diagram for OpenEMR?   I am trying to get a feel for the
relationships between the tables.   I wondered whether anyone had all ready built one before I side
tracked off to building one with some thing like MySQL Workbench.

Thanks for your attention to this matter,
Greg Porter

aethelwulffe wrote on Friday, December 23, 2011:

DOOOO IIIIT!!!!  DOOOO IT!

There is a diagram in the developer resources somewhere, but……

yehster wrote on Friday, December 23, 2011:

I’ve loaded the schema into workbench, and it’s too much data to really be useful, plus there aren’t defined foreign key constraints that can really help you understand relationships.

However, key tables to understand off the top of my head
patient_data
forms
form_encounter
form_* (the other forms tables.  the form_encounter is special because of the encounter column used in the forms table
lists
users
postcalendar_events (not it’s exact name…)

that’s where I’d start I think.
-Kevin Yeh
kevin.y@integralemr.com

yehster wrote on Friday, December 23, 2011:

billing table is useful too.
The encounter column is referenced in billing.

yehster wrote on Friday, December 23, 2011:

the ID column in patient_data is referred to in many other tables as PID (to identify which patient the data belongs to)  again, no formally defined foreign key constraint, but it’s treated that way.

codes and code_types are kind of useful too.

Another way you might explore is to just “do stuff” with your installation (create patients, encounters, etc…) and then inspect the log table.  The log table is the “audit log” generated by OpenEMR and you should be able to see which tables it accesses and updates that way.

tmccormi wrote on Friday, December 23, 2011:

This was done in the past. It required converting the DB to INNODB, then adding references where tables connect.  It produce an huge map (had to be printed on very large 36" wide paper to be readable.   The table from 4.0.x-dev and the resulting PDF are posted on the wiki at: http://www.open-emr.org/wiki/index.php/Mapping_OpenEMR_Data_for_CCD/CCR_and_CQM#Data_Descriptions

Look for the 2. These files are EMRTech Data Maps and Proposed new tables

–Tony