outcomesinsights / generalized_data_model

Outcomes Insights' Data Model for Clinical Research
MIT License
16 stars 3 forks source link

should Collections drop the FK to admission_details #90

Closed markdanese closed 7 years ago

markdanese commented 7 years ago

this would require us to put a collections_id in the admission_details table and would be more consistent with how measurements and drug exposure are handled

markdanese commented 7 years ago

The alternative is to add drug_exposure_details and measurement_details ids to the clinical codes table. This would be more of a "fact table" approach.

markdanese commented 7 years ago

Per Marc, yet another option is to have foreign keys in both tables so that queries are efficient in either direction. This is only a tiny step from actually pulling the details tables back into their partner tables, which is something that might be better in column store databases anyway.

marc-outins commented 7 years ago

We decided to add drug_exposure_detail_id and measurement_detail_id to the clinical_codes table and keep admission_detail_id in collections table.