unresolvable fk cycles between concept and concept_class

Đang mở
#706 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
postgresql, python
Lĩnh vực
databases

Hướng nghiên cứu

Bắt đầu với ddl/5.4/postgresql/OMOPCDM_postgresql_5.4_ddl.sql ở khoảng dòng 422 và 444, sau đó kiểm tra các định nghĩa khóa ngoại tương ứng ở khoảng dòng 156 và 159 trong OMOPCDM_postgresql_5.4_constraints.sql. Xác định xem schema có cung cấp một đường dẫn chèn được hỗ trợ để duy trì cả hai ràng buộc hay không; ghi lại quy trình đã được xác minh hoặc phần sửa schema cần thiết, kèm theo một ví dụ có thể tái hiện cho thấy có thể chèn dữ liệu concept và concept_class.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Question

Howdy lovely CDM Community,

i am new to all this and i am in the process to create a bunch of python representations for the OMOP-CDM Model (https://github.com/DZD-eV-Diabetes-Research/dzd-omop-cdm-python-models) .

Now i ran into a problem with the CDM schema leaving me scratching my head:

In 5.4 we have the table concept which has a NOT NULL-able foreign key that references concept_class

FK Col concept_class_id in concept: https://github.com/OHDSI/CommonDataModel/blob/main/ddl/5.4/postgresql/OMOPCDM_postgresql_5.4_ddl.sql#L422

FK definition: https://github.com/OHDSI/CommonDataModel/blob/main/ddl/5.4/postgresql/OMOPCDM_postgresql_5.4_constraints.sql#L156

At the same time we have a NOT NULL-able foreign key in concept_class that references concept

FK Col concept_class_concept_id in concept_class - https://github.com/OHDSI/CommonDataModel/blob/main/ddl/5.4/postgresql/OMOPCDM_postgresql_5.4_ddl.sql#L444

FK definition: https://github.com/OHDSI/CommonDataModel/blob/main/ddl/5.4/postgresql/OMOPCDM_postgresql_5.4_constraints.sql#L159

The problem is if i want to create a new row in concept i need an existing concept_class to reference but if i want to create concept_class i need an existing concept to reference but if i want to create a new concept... you get the point :)

How am i supposed to insert concept data without having some cumbersome scripts that will disable constraints under certain circumstances (which runs against the whole idea of having a data model with constraints in the first place)

I could not find any information on how to solve this in a cleanly manner. if anyone has any hints for me, I would be very grateful. cheers.

Ngôn ngữ chính
HTML
Star
1.1k
Fork
515
Merge trung bình
10 ngày 13 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OHDSI/CommonDataModel

Tất cả issue của OHDSI/CommonDataModel

Issue tương tự

Thêm issue về Databases

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.