Skip to content

Commit

Permalink
add updating of valid_start_date
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur committed Sep 14, 2019
1 parent 34987e8 commit 81fccb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NDC_SPL/load_stage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1585,13 +1585,15 @@ WHERE cs.concept_code = i.concept_code

--34. Return proper valid_end_date from base tables
UPDATE concept_relationship_stage crs
SET valid_end_date = i.valid_end_date
SET valid_start_date = i.valid_start_date,
valid_end_date = i.valid_end_date
FROM (
SELECT c1.concept_code AS concept_code_1,
c1.vocabulary_id AS vocabulary_id_1,
c2.concept_code AS concept_code_2,
c2.vocabulary_id AS vocabulary_id_2,
r.relationship_id,
r.valid_start_date,
r.valid_end_date
FROM concept_relationship r
JOIN concept c1 ON c1.concept_id = r.concept_id_1
Expand Down

0 comments on commit 81fccb6

Please sign in to comment.