Constraints for table `concept_relationship` (primary key and maybe coherence of start and end dates)
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.1k
- Forks
- 508
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 3
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?
Contributor guide
No contributing guide indexed for this repository
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.
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.
Assessment
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100