DB question - history_data table

jwagman wrote on Sunday, November 11, 2012:

Can anyone explain how the history_data table “knows” which encounter to stick to - it has no encounter id and it doesn’t get registered in the ‘forms’ table. Can you please go through the process (tables touched, keys, etc.) when I input data which winds up in the history_data table, such as smoking?

sunsetsystems wrote on Sunday, November 11, 2012:

history_data is not encounter-specific, it’s just associated with the patient.  It’s layout-driven, meaning much of the UI logic is in library/options.inc.php.  Note that its rows are never deleted, so it’s important to get the one with the most recent date.  Hope this helps.

Rod
www.sunsetsystems.com

jwagman wrote on Sunday, November 11, 2012:

very helpful, thanks. Can I ask another db question? do you know in which table is stored the provider chosen? Or provider=>chosen? Thanks

sunsetsystems wrote on Sunday, November 11, 2012:

Chosen for what?  The encounter-level “default” provider is referenced by form_encounter.provider_id.  The “supervising provider”, if any, is in form_encounter.supervisor_id.  If a provider is specified at the service level (overriding the default for that line), that’s in billing.provider_id.  There’s also a provider and referring provider in the patient_data table.

Rod
www.sunsetsystems.com

jwagman wrote on Sunday, November 11, 2012:

A provider can be chosen in the Demographics section, under the Choices tab. I can’t find it in the db.
Btw, how can I paste an image in here? Thanks much!

bradymiller wrote on Monday, November 12, 2012:

Hi,

It is the providerID column in the patient_data table.

-brady
OpenEMR

jwagman wrote on Monday, November 12, 2012:

Great! Thanks.