Constraints for table `concept_relationship` (primary key and maybe coherence of start and end dates)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- database
Research direction
Start by reviewing the CSV definitions for the concept_relationship table and the related documentation, focusing on primary-key and valid_end_date requirements. Resolve the listed relationship, date-range, and invalidation questions with the CDM rules; done means the constraints and documentation clearly match the agreed semantics.
Written by the indexing model from the issue text.
Description
The CDM definitions of fields for the table concept_relationship (in the CSV files) are likely missing useful constraints:
There is no primary key, which is otherwise recommended to help with data integrity. A composite primary key could be the easiest and least disruptive way to address this, even though if would not completely ensure the consistency/coherence of data in that table (more on this in points after this paragraph). I did not find the answer to the following questions in the documentation:
- Can different
relationship_ids exist between a given pair of concept IDs inconcept_id_1andconcept_id_2? - Can a given pair of concept IDs in
concept_id_1andconcept_id_2exist during different periods of time defined byvalid_start_dateandvalid_end_date? - Can a given pair of concept IDs in
concept_id_1andconcept_id_2(and with givenrelationship_id,valid_start_date, andvalid_end_datedepending on the answers to the question above) be invalidated for different reasons?
If the answer to all three questions is "No", a composite primary key could be concept_id_1 and concept_id_2. If some answers are "Yes", the composite key would need to add columns accordingly.
Also, valid_end_date is required (to have a value), and is meant to capture "the date when the relationship is invalidated.". Shouldn't valid_end_date be non-required (nullable?). Otherwise how are concept_relationship that are still active (not invalidated) recorded?
- Dominant language
- HTML
- Stars
- 1.1k
- Forks
- 513
- Avg merge
- 8d 3h
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OHDSI/CommonDataModel
-
Difficulty 1/5 Under an hour Newbie friendliness 74/100
OHDSI/CommonDataModel#802 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OHDSI/CommonDataModel#799 ·
-
fix: mark cohort_definition_id as primary key in cohort_definition table for v5.3 and v5.4Possibly taken @rtmalikian claimed this 136 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OHDSI/CommonDataModel#787 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OHDSI/CommonDataModel#784 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
OHDSI/CommonDataModel#823 ·
All issues in OHDSI/CommonDataModel
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scylladb/kafka-connect-scylladb#297 ·
Maintainers usually reply within 2 days
-
--dry-run runs the real operation in ruvector migrate, ruvector backup restore and deployment deployPossibly taken @tanishqbaweja claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
GoogleCloudPlatform/spanner-migration-tool#1479 ·
Maintainers usually reply within 8 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mferretti/SeedStream#443 ·
Maintainers usually reply within 4 days