Constraints for table `concept_relationship` (primary key and maybe coherence of start and end dates)

オープン
#771 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
領域
database

調査の方向性

まず concept_relationship テーブルの CSV 定義と関連ドキュメントを確認し、主キーおよび valid_end_date の要件に重点を置きます。リストされている関係、日付範囲、無効化に関する疑問を CDM ルールに基づいて解決します。制約とドキュメントが合意されたセマンティクスに明確に一致すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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 in concept_id_1 and concept_id_2?
  • Can a given pair of concept IDs in concept_id_1 and concept_id_2 exist during different periods of time defined by valid_start_date and valid_end_date?
  • Can a given pair of concept IDs in concept_id_1 and concept_id_2 (and with given relationship_id, valid_start_date, and valid_end_date depending 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?

主要言語
HTML
スター
1.1k
フォーク
515
平均マージ
10日 13時間
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OHDSI/CommonDataModel のほかの issue

OHDSI/CommonDataModel の issue をすべて見る

似ている issue

Databases の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。