clif-consortium / CLIF

Apache License 2.0
2 stars 2 forks source link

CLIF as a relational SQL database #28

Open 08wparker opened 2 hours ago

08wparker commented 2 hours ago

we should make CLIF "SQL ready" because SQL databases have an explicit relational database structure that will help us achieve the goal of having each hospitalization represented coherently in CLIF.

patient: patient_id is the primary key hospitalization: hospitalization_id is the primary key. patient_id is a foreign key to link hospitalizations to patients vitals: hospitalization_id is a foreign key to link each set of vitals to a specific hospitalization. labs: hospitalization_id also serves as a foreign key to associate lab results with the corresponding hospital stay.

I also like this:

Foreign Key Constraints: By using SQL, you can enforce foreign key constraints to maintain referential integrity. This ensures that every hospitalization_id in the vitals, labs, or medications tables must exist in the hospitalization table. It helps prevent orphaned records (e.g., vitals records that reference a non-existent hospitalization).

SQL queries will be a very efficient way to do things like identify sepsis, etc.

Let's add a running to do list to this issue. I think we are pretty close!

08wparker commented 2 hours ago
  1. add a primary key for each table, e.g. vital_id
  2. use SQL datatypes