From 9b84078bff2c0c63dbed45d9259007848ba7a3ff Mon Sep 17 00:00:00 2001 From: Timur Date: Wed, 17 Jun 2020 15:39:32 +0300 Subject: [PATCH] fix bug --- working/generic_update.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/working/generic_update.sql b/working/generic_update.sql index 986534fa0..bdb585188 100644 --- a/working/generic_update.sql +++ b/working/generic_update.sql @@ -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