Skip to content

Commit

Permalink
Dereference visit_occurrence_id, visit_detail_id during prune.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-cockayne-ad committed Jan 10, 2025
1 parent c9942ea commit 6e830f5
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ where gender_concept_id is null
or race_concept_id is null
or ethnicity_concept_id is null;

update o
set
visit_occurrence_id = null,
visit_detail_id = null
from cdm.observation o
inner join @personsToDelete ptd
on o.person_id = ptd.person_id;

delete co
from cdm.condition_occurrence co
inner join @personsToDelete p
Expand Down

0 comments on commit 6e830f5

Please sign in to comment.