Database Structure Documentation

Hello everybody,

I’m new to OpenEMR and are trying to make some database-based analytics.
My Question is where I can find a database description of the most recent OpenEMR (5.0.x), including the DB-structure but especially references (like foreign keys) between the tables of the openemr database.

So I was able to find this in the OpenEMR wiki which points out to This helps a lot, however unfortunately this is kind of outdated as it refers to OpenEMR 3.2.0. Additionally I was able to find the table descriptions for OpenEMR 4.1.1 here which refers to from 2013.

I tried to reverse engineer the db scheme, but it looks like there are no explicit FOREIGN KEYs between the tables (but only INDEXes or KEYs). Is there some documentation showing the structure and relationship of the openemr db, preferable of the most recent OpenEMR (5.0.x) ?

However if there is no such a thing, maybe there are some information to start with, it would be hard for me to start from scratch creating this, as I don’t have much insight into OpenEMR yet.

Thank you and best Regards


Hi @sandmaen,

Welcome to our community! Unfortunately, DB documentation is an area we could greatly improve on. A while back I used a tool to create a graph of the DB but as you’ve rightly concluded, without true foreign keys graphs don’t do much.

@sunsetsystems is there historical context for not using more foreign keys in the DB? Is this something we could consider introducing?

Back in the old days MySQL did not support foreign keys. I think it’s safe now to put them to good use.

1 Like

OK I understand. Thank you very much for your answer. I appreciate that.
What would be the preferred way to improve the documentation here?