Missing primary key for table `death`?

Open
#770 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
sql
Domain
databases

Research direction

Start by comparing the death-table field definitions linked for OMOP CDM versions 5.3, 5.4, and 6.0. Determine whether person_id uniquely identifies rows and whether death_type_concept_id or cause_concept_id permit multiple records per event. Done means the key decision is resolved and the affected model definitions and DDLs are updated consistently across all three versions.

Written by the indexing model from the issue text.

Description

Table death does not have a primary key, although this would help with data integrity. How unique are rows in that table?

My initial thought is that person_id can be a primary key in that table -- as all can be anticipated to die at most once --, but I am unclear
about whether death_type_concept_id and cause_concept_id model a 1:1 relationship with a death event. If not the case, and a death event can be associated with multiple death types or causes, a different primary key should be used.

This is currently present in all three versions 5.3, 5.4, and 6.0.

5.3
https://github.com/OHDSI/CommonDataModel/blob/d83d48c2ba1b641879c33958903f630318421cb8/inst/csv/OMOP_CDMv5.3_Field_Level.csv#L181-L187

5.4
https://github.com/OHDSI/CommonDataModel/blob/d83d48c2ba1b641879c33958903f630318421cb8/inst/csv/OMOP_CDMv5.4_Field_Level.csv#L193-L199

6.0
https://github.com/OHDSI/CommonDataModel/blob/d83d48c2ba1b641879c33958903f630318421cb8/inst/csv/OMOP_CDMv6.0_Field_Level.csv#L185-L191

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OHDSI/CommonDataModel

All issues in OHDSI/CommonDataModel

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.