RADar-AZDelta / Rabbit-in-a-Blender

An ETL pipeline to transform your EMP data to OMOP.
https://radar-azdelta.github.io/Rabbit-in-a-Blender/
GNU General Public License v3.0
11 stars 3 forks source link

Running the --cleanup on one table, should also cleanup the dependent tables in the ETL flow. #67

Closed pjlammertyn closed 3 months ago

pjlammertyn commented 3 months ago

Because the --cleanup command triggers the generation of new auto numbered id's (in the next ETL run), the foreign keys of the dependent tables will have invalid wring foreign keys to that table.

So all the dependent tables should also be cleared!

pjlammertyn commented 3 months ago

For example if you cleanup the person table.

riab --cleanup person

All dependent tables in the ETL flow, must also be cleaned up!

└──person
  ├──condition_era
  ├──death
  ├──dose_era
  ├──drug_era
  ├──episode
  ├──observation_period
  ├──payer_plan_period
  ├──specimen
  └──visit_occurrence
    ├──episode_event
    └──visit_detail
      ├──condition_occurrence
      ├──device_exposure
      ├──drug_exposure
      ├──measurement
      ├──note
      ├──observation
      └──procedure_occurrence
        └──note_nlp