Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur committed Jun 17, 2020
1 parent 6630e05 commit 9b84078
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions working/generic_update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ BEGIN
--10.1. Update the concept for non-CPT4, non-ICD9Proc and non-HCPCS vocabularies
UPDATE concept c SET
invalid_reason = 'D',
standard_concept = NULL,
valid_end_date = (SELECT latest_update-1 FROM vocabulary WHERE vocabulary_id = c.vocabulary_id)
WHERE NOT EXISTS (SELECT 1 FROM concept_stage cs WHERE cs.concept_id = c.concept_id AND cs.vocabulary_id = c.vocabulary_id) -- if concept missing from concept_stage
AND c.vocabulary_id IN (SELECT vocabulary_id FROM vocabulary WHERE latest_update IS NOT NULL) -- only for current vocabularies
Expand Down

0 comments on commit 9b84078

Please sign in to comment.