nci-cidc-api-modules 1.2.28__tar.gz → 1.2.30__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. {nci_cidc_api_modules-1.2.28/nci_cidc_api_modules.egg-info → nci_cidc_api_modules-1.2.30}/PKG-INFO +2 -1
  2. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/data.py +4 -0
  3. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/additional_treatment_orm.py +1 -0
  4. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/adverse_event_orm.py +1 -0
  5. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +1 -0
  6. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/comorbidity_orm.py +1 -0
  7. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/consent_group_orm.py +1 -0
  8. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/demographic_orm.py +2 -1
  9. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/disease_orm.py +9 -10
  10. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/exposure_orm.py +2 -1
  11. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +1 -0
  12. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +1 -0
  13. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +1 -0
  14. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +1 -0
  15. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/medical_history_orm.py +1 -0
  16. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/other_malignancy_orm.py +1 -0
  17. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/participant_orm.py +4 -3
  18. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/prior_treatment_orm.py +1 -0
  19. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/radiotherapy_dose_orm.py +1 -0
  20. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/response_by_system_orm.py +1 -0
  21. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/response_orm.py +1 -0
  22. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/stem_cell_transplant_orm.py +1 -0
  23. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/surgery_orm.py +1 -0
  24. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/therapy_agent_dose_orm.py +1 -0
  25. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/treatment_orm.py +1 -0
  26. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/trial_orm.py +2 -2
  27. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/models.py +1 -0
  28. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/additional_treatment.py +3 -1
  29. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/adverse_event.py +1 -1
  30. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/base.py +12 -0
  31. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +1 -1
  32. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/demographic.py +15 -14
  33. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/disease.py +32 -18
  34. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/exposure.py +2 -2
  35. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +1 -1
  36. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +1 -1
  37. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/medical_history.py +1 -1
  38. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/participant.py +6 -5
  39. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/prior_treatment.py +1 -1
  40. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/radiotherapy_dose.py +1 -1
  41. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/response.py +1 -1
  42. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/response_by_system.py +5 -5
  43. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/specimen.py +2 -2
  44. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/treatment.py +1 -1
  45. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/trial.py +2 -6
  46. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/types.py +12 -29
  47. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30/nci_cidc_api_modules.egg-info}/PKG-INFO +2 -1
  48. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/nci_cidc_api_modules.egg-info/requires.txt +1 -0
  49. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/requirements.modules.txt +1 -0
  50. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/LICENSE +0 -0
  51. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/MANIFEST.in +0 -0
  52. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/README.md +0 -0
  53. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/config/__init__.py +0 -0
  54. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/config/db.py +0 -0
  55. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/config/logging.py +0 -0
  56. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/config/secrets.py +0 -0
  57. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/config/settings.py +0 -0
  58. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/__init__.py +0 -0
  59. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/base_orm.py +0 -0
  60. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/__init__.py +0 -0
  61. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/administrative_person_orm.py +0 -0
  62. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/administrative_role_assignment_orm.py +0 -0
  63. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/arm_orm.py +0 -0
  64. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/cohort_orm.py +0 -0
  65. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/contact_orm.py +0 -0
  66. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/file_orm.py +0 -0
  67. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/institution_orm.py +0 -0
  68. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +0 -0
  69. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/publication_orm.py +0 -0
  70. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/shipment_orm.py +0 -0
  71. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/shipment_specimen_orm.py +0 -0
  72. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/db/stage2/specimen_orm.py +0 -0
  73. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/files/__init__.py +0 -0
  74. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/files/details.py +0 -0
  75. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/files/facets.py +0 -0
  76. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/migrations.py +0 -0
  77. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/__init__.py +0 -0
  78. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/administrative_person.py +0 -0
  79. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/administrative_role_assignment.py +0 -0
  80. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/arm.py +0 -0
  81. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/cohort.py +0 -0
  82. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/comorbidity.py +0 -0
  83. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/consent_group.py +0 -0
  84. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/contact.py +0 -0
  85. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/file.py +0 -0
  86. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +0 -0
  87. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +0 -0
  88. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/institution.py +0 -0
  89. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +0 -0
  90. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/other_malignancy.py +0 -0
  91. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/publication.py +0 -0
  92. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/shipment.py +0 -0
  93. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/shipment_specimen.py +0 -0
  94. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/stem_cell_transplant.py +0 -0
  95. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/surgery.py +0 -0
  96. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/pydantic/stage2/therapy_agent_dose.py +0 -0
  97. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/models/schemas.py +0 -0
  98. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/reference/ctcae.py +0 -0
  99. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/reference/gvhd.py +0 -0
  100. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/reference/icd10cm.py +0 -0
  101. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/reference/icdo3.py +0 -0
  102. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/reference/uberon.py +0 -0
  103. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/__init__.py +0 -0
  104. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/auth.py +0 -0
  105. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/email_layout.html +0 -0
  106. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/emails.py +0 -0
  107. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/file_handling.py +0 -0
  108. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/gcloud_client.py +0 -0
  109. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/jose.py +0 -0
  110. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/rest_utils.py +0 -0
  111. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/cidc_api/shared/utils.py +0 -0
  112. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/nci_cidc_api_modules.egg-info/SOURCES.txt +0 -0
  113. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/nci_cidc_api_modules.egg-info/dependency_links.txt +0 -0
  114. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/nci_cidc_api_modules.egg-info/not-zip-safe +0 -0
  115. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/nci_cidc_api_modules.egg-info/top_level.txt +0 -0
  116. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/pyproject.toml +0 -0
  117. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/setup.cfg +0 -0
  118. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/setup.py +0 -0
  119. {nci_cidc_api_modules-1.2.28 → nci_cidc_api_modules-1.2.30}/tests/test_api.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nci_cidc_api_modules
3
- Version: 1.2.28
3
+ Version: 1.2.30
4
4
  Summary: SQLAlchemy data models and configuration tools used in the NCI CIDC API
5
5
  Home-page: https://github.com/NCI-CIDC/cidc-api-gae
6
6
  License: MIT license
@@ -12,6 +12,7 @@ Requires-Dist: cloud-sql-python-connector[pg8000]>=1.18.5
12
12
  Requires-Dist: flask>=3.1.2
13
13
  Requires-Dist: flask-migrate>=4.1.0
14
14
  Requires-Dist: flask-sqlalchemy>=3.1.1
15
+ Requires-Dist: flask-talisman>=0.7.0
15
16
  Requires-Dist: google-auth==2.43.0
16
17
  Requires-Dist: google-api-python-client>=2.185.0
17
18
  Requires-Dist: google-cloud-bigquery>=3.38.0
@@ -1,4 +1,5 @@
1
1
  from cidc_api.models.pydantic.stage2 import all_models
2
+ from cidc_api.models.db.stage2 import all_models as all_db_models
2
3
 
3
4
  standard_data_categories = [model.__data_category__ for model in all_models if hasattr(model, "__data_category__")]
4
5
 
@@ -13,3 +14,6 @@ class Dataset(dict):
13
14
 
14
15
  # Maps data categories like "treatment" to their associated pydantic model
15
16
  data_category_to_model = {model.__data_category__: model for model in all_models if hasattr(model, "__data_category__")}
17
+ data_category_to_db_model = {
18
+ model.__data_category__: model for model in all_db_models if hasattr(model, "__data_category__")
19
+ }
@@ -11,6 +11,7 @@ class AdditionalTreatmentORM(BaseORM):
11
11
  __tablename__ = "additional_treatment"
12
12
  __repr_attrs__ = ["additional_treatment_id", "participant_id", "description"]
13
13
  __table_args__ = {"schema": "stage2"}
14
+ __data_category__ = "additional_treatment"
14
15
 
15
16
  additional_treatment_id: Mapped[int] = mapped_column(primary_key=True)
16
17
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -22,6 +22,7 @@ class AdverseEventORM(BaseORM):
22
22
  __tablename__ = "adverse_event"
23
23
  __repr_attrs__ = ["adverse_event_id", "participant_id", "event_term"]
24
24
  __table_args__ = {"schema": "stage2"}
25
+ __data_category__ = "adverse_event"
25
26
 
26
27
  adverse_event_id: Mapped[int] = mapped_column(primary_key=True)
27
28
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -11,6 +11,7 @@ class BaselineClinicalAssessmentORM(BaseORM):
11
11
  __tablename__ = "baseline_clinical_assessment"
12
12
  __repr_attrs__ = ["baseline_clinical_assessment_id", "participant_id"]
13
13
  __table_args__ = {"schema": "stage2"}
14
+ __data_category__ = "baseline_clinical_assessment"
14
15
 
15
16
  baseline_clinical_assessment_id: Mapped[int] = mapped_column(primary_key=True)
16
17
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -11,6 +11,7 @@ class ComorbidityORM(BaseORM):
11
11
  __tablename__ = "comorbidity"
12
12
  __repr_attrs__ = ["comorbidity_id", "comorbidity_term"]
13
13
  __table_args__ = {"schema": "stage2"}
14
+ __data_category__ = "comorbidity"
14
15
 
15
16
  comorbidity_id: Mapped[int] = mapped_column(primary_key=True)
16
17
  medical_history_id: Mapped[int] = mapped_column(
@@ -16,6 +16,7 @@ class ConsentGroupORM(BaseORM):
16
16
  ),
17
17
  {"schema": "stage2"},
18
18
  )
19
+ __data_category__ = "consent_group"
19
20
 
20
21
  consent_group_id: Mapped[int] = mapped_column(primary_key=True)
21
22
  trial_id: Mapped[str]
@@ -21,12 +21,13 @@ class DemographicORM(BaseORM):
21
21
  __tablename__ = "demographic"
22
22
  __repr_attrs__ = ["demographic_id", "participant_id", "age_at_enrollment", "sex"]
23
23
  __table_args__ = {"schema": "stage2"}
24
+ __data_category__ = "demographic"
24
25
 
25
26
  demographic_id: Mapped[int] = mapped_column(primary_key=True)
26
27
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
27
28
  age_at_enrollment: Mapped[PositiveInt | None]
28
29
  age_at_enrollment_units: Mapped[AgeAtEnrollmentUnits | None]
29
- age_90_or_older: Mapped[bool]
30
+ age_90_or_over: Mapped[bool]
30
31
  sex: Mapped[Sex]
31
32
  race: Mapped[Race]
32
33
  ethnicity: Mapped[Ethnicity]
@@ -7,7 +7,6 @@ from sqlalchemy.types import JSON
7
7
 
8
8
  from cidc_api.models.db.base_orm import BaseORM
9
9
  from cidc_api.models.types import (
10
- PrimaryDiagnosisDiseaseGroup,
11
10
  TumorGrade,
12
11
  CancerStageSystem,
13
12
  CancerStageSystemVersion,
@@ -30,23 +29,23 @@ class DiseaseORM(BaseORM):
30
29
  "participant_id",
31
30
  ]
32
31
  __table_args__ = {"schema": "stage2"}
32
+ __data_category__ = "disease"
33
33
 
34
34
  disease_id: Mapped[int] = mapped_column(primary_key=True)
35
35
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
36
- primary_diagnosis_disease_group: Mapped[PrimaryDiagnosisDiseaseGroup]
37
36
  primary_disease_site: Mapped[UberonAnatomicalTerm]
38
- morphological_code: Mapped[ICDO3MorphologicalCode]
39
- morphological_term: Mapped[ICDO3MorphologicalTerm]
37
+ morphological_code: Mapped[ICDO3MorphologicalCode | None]
38
+ morphological_term: Mapped[ICDO3MorphologicalTerm | None]
40
39
  cancer_type_description: Mapped[str | None]
41
- days_since_original_diagnosis: Mapped[NonPositiveInt]
40
+ days_since_original_diagnosis: Mapped[NonPositiveInt | None]
42
41
  tumor_grade: Mapped[TumorGrade | None]
43
42
  cancer_stage_system: Mapped[CancerStageSystem]
44
43
  cancer_stage_system_version: Mapped[CancerStageSystemVersion | None] = mapped_column(String, nullable=True)
45
- cancer_stage: Mapped[CancerStage] = mapped_column(String)
46
- t_category: Mapped[TCategory]
47
- n_category: Mapped[NCategory]
48
- m_category: Mapped[MCategory]
49
- metastatic_organ: Mapped[List[UberonAnatomicalTerm]] = mapped_column(JSON, nullable=True)
44
+ cancer_stage: Mapped[CancerStage | None] = mapped_column(String)
45
+ t_category: Mapped[TCategory | None]
46
+ n_category: Mapped[NCategory | None]
47
+ m_category: Mapped[MCategory | None]
48
+ metastatic_organ: Mapped[List[UberonAnatomicalTerm] | None] = mapped_column(JSON, nullable=True)
50
49
  solely_extramedullary_disease: Mapped[YNU]
51
50
  extramedullary_organ: Mapped[List[UberonAnatomicalTerm]] = mapped_column(JSON, nullable=True)
52
51
 
@@ -11,11 +11,12 @@ class ExposureORM(BaseORM):
11
11
  __tablename__ = "exposure"
12
12
  __repr_attrs__ = ["exposure_id", "exposure_type", "carcinogen_exposure"]
13
13
  __table_args__ = {"schema": "stage2"}
14
+ __data_category__ = "exposure"
14
15
 
15
16
  exposure_id: Mapped[int] = mapped_column(primary_key=True)
16
17
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
17
18
 
18
19
  carcinogen_exposure: Mapped[YNU]
19
- exposure_type: Mapped[ExposureType]
20
+ exposure_type: Mapped[ExposureType | None]
20
21
 
21
22
  participant: Mapped["ParticipantORM"] = relationship(back_populates="exposures", cascade="all, delete")
@@ -19,6 +19,7 @@ class GVHDDiagnosisAcuteORM(BaseORM):
19
19
  {"schema": "stage2"},
20
20
  )
21
21
  __repr_attrs__ = ["gvhd_diagnosis_acute_id", "pre_or_post_enrollment"]
22
+ __data_category__ = "gvhd_diagnosis_acute"
22
23
 
23
24
  gvhd_diagnosis_acute_id: Mapped[int] = mapped_column(primary_key=True)
24
25
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -21,6 +21,7 @@ class GVHDDiagnosisChronicORM(BaseORM):
21
21
  {"schema": "stage2"},
22
22
  )
23
23
  __repr_attrs__ = ["gvhd_diagnosis_chronic_id", "pre_or_post_enrollment"]
24
+ __data_category__ = "gvhd_diagnosis_chronic"
24
25
 
25
26
  gvhd_diagnosis_chronic_id: Mapped[int] = mapped_column(primary_key=True)
26
27
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -9,6 +9,7 @@ class GVHDOrganAcuteORM(BaseORM):
9
9
  __tablename__ = "gvhd_organ_acute"
10
10
  __repr_attrs__ = ["gvhd_organ_acute_id", "organ"]
11
11
  __table_args__ = {"schema": "stage2"}
12
+ __data_category__ = "gvhd_organ_acute"
12
13
 
13
14
  gvhd_organ_acute_id: Mapped[int] = mapped_column(primary_key=True)
14
15
  gvhd_diagnosis_acute_id: Mapped[int] = mapped_column(
@@ -9,6 +9,7 @@ class GVHDOrganChronicORM(BaseORM):
9
9
  __tablename__ = "gvhd_organ_chronic"
10
10
  __repr_attrs__ = ["gvhd_organ_chronic_id", "organ"]
11
11
  __table_args__ = {"schema": "stage2"}
12
+ __data_category__ = "gvhd_organ_chronic"
12
13
 
13
14
  gvhd_organ_chronic_id: Mapped[int] = mapped_column(primary_key=True)
14
15
  gvhd_diagnosis_chronic_id: Mapped[int] = mapped_column(
@@ -12,6 +12,7 @@ class MedicalHistoryORM(BaseORM):
12
12
  __tablename__ = "medical_history"
13
13
  __repr_attrs__ = ["medical_history_id"]
14
14
  __table_args__ = {"schema": "stage2"}
15
+ __data_category__ = "medical_history"
15
16
 
16
17
  medical_history_id: Mapped[int] = mapped_column(primary_key=True)
17
18
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -12,6 +12,7 @@ class OtherMalignancyORM(BaseORM):
12
12
  __tablename__ = "other_malignancy"
13
13
  __repr_attrs__ = ["other_malignancy_id", "primary_disease_site"]
14
14
  __table_args__ = {"schema": "stage2"}
15
+ __data_category__ = "other_malignancy"
15
16
 
16
17
  other_malignancy_id: Mapped[int] = mapped_column(primary_key=True)
17
18
  medical_history_id: Mapped[int] = mapped_column(
@@ -4,7 +4,7 @@ from sqlalchemy import ForeignKey, ForeignKeyConstraint
4
4
  from sqlalchemy.orm import Mapped, mapped_column, relationship
5
5
 
6
6
  from cidc_api.models.db.base_orm import BaseORM
7
- from cidc_api.models.types import OffStudyReason
7
+ from cidc_api.models.types import OffStudyReason, YNU
8
8
 
9
9
 
10
10
  class ParticipantORM(BaseORM):
@@ -16,17 +16,18 @@ class ParticipantORM(BaseORM):
16
16
  ),
17
17
  {"schema": "stage2"},
18
18
  )
19
+ __data_category__ = "participant"
19
20
 
20
21
  participant_id: Mapped[int] = mapped_column(primary_key=True)
21
22
  trial_id: Mapped[str]
22
23
  version: Mapped[str]
23
24
 
24
- native_participant_id: Mapped[str]
25
+ native_participant_id: Mapped[str | None]
25
26
  cimac_participant_id: Mapped[str] = mapped_column(unique=True)
26
27
  consent_group_id: Mapped[Optional[int]] = mapped_column(
27
28
  ForeignKey("stage2.consent_group.consent_group_id", ondelete="CASCADE")
28
29
  )
29
- off_study: Mapped[bool]
30
+ off_study: Mapped[YNU]
30
31
  off_study_reason: Mapped[Optional[OffStudyReason]]
31
32
  off_study_reason_other: Mapped[Optional[str]]
32
33
 
@@ -12,6 +12,7 @@ class PriorTreatmentORM(BaseORM):
12
12
  __tablename__ = "prior_treatment"
13
13
  __repr_attrs__ = ["prior_treatment_id", "type"]
14
14
  __table_args__ = {"schema": "stage2"}
15
+ __data_category__ = "prior_treatment"
15
16
 
16
17
  prior_treatment_id: Mapped[int] = mapped_column(primary_key=True)
17
18
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -18,6 +18,7 @@ class RadiotherapyDoseORM(BaseORM):
18
18
  __tablename__ = "radiotherapy_dose"
19
19
  __repr_attrs__ = ["radiotherapy_dose_id", "procedure"]
20
20
  __table_args__ = {"schema": "stage2"}
21
+ __data_category__ = "radiotherapy_dose"
21
22
 
22
23
  radiotherapy_dose_id: Mapped[int] = mapped_column(primary_key=True)
23
24
  treatment_id: Mapped[int] = mapped_column(ForeignKey("stage2.treatment.treatment_id", ondelete="CASCADE"))
@@ -10,6 +10,7 @@ class ResponseBySystemORM(BaseORM):
10
10
  __tablename__ = "response_by_system"
11
11
  __repr_attrs__ = ["response_by_system_id", "participant_id"]
12
12
  __table_args__ = {"schema": "stage2"}
13
+ __data_category__ = "response_by_system"
13
14
 
14
15
  response_by_system_id: Mapped[int] = mapped_column(primary_key=True)
15
16
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -11,6 +11,7 @@ class ResponseORM(BaseORM):
11
11
  __tablename__ = "response"
12
12
  __repr_attrs__ = ["response_id", "participant_id"]
13
13
  __table_args__ = {"schema": "stage2"}
14
+ __data_category__ = "response"
14
15
 
15
16
  response_id: Mapped[int] = mapped_column(primary_key=True)
16
17
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -12,6 +12,7 @@ class StemCellTransplantORM(BaseORM):
12
12
  __tablename__ = "stem_cell_transplant"
13
13
  __repr_attrs__ = ["stem_cell_transplant_id"]
14
14
  __table_args__ = {"schema": "stage2"}
15
+ __data_category__ = "stem_cell_transplant"
15
16
 
16
17
  stem_cell_transplant_id: Mapped[int] = mapped_column(primary_key=True)
17
18
  treatment_id: Mapped[int] = mapped_column(ForeignKey("stage2.treatment.treatment_id", ondelete="CASCADE"))
@@ -12,6 +12,7 @@ class SurgeryORM(BaseORM):
12
12
  __tablename__ = "surgery"
13
13
  __repr_attrs__ = ["surgery_id", "procedure"]
14
14
  __table_args__ = {"schema": "stage2"}
15
+ __data_category__ = "surgery"
15
16
 
16
17
  surgery_id: Mapped[int] = mapped_column(primary_key=True)
17
18
  treatment_id: Mapped[int] = mapped_column(ForeignKey("stage2.treatment.treatment_id", ondelete="CASCADE"))
@@ -12,6 +12,7 @@ class TherapyAgentDoseORM(BaseORM):
12
12
  __tablename__ = "therapy_agent_dose"
13
13
  __repr_attrs__ = ["therapy_agent_dose_id", "therapy_agent_name"]
14
14
  __table_args__ = {"schema": "stage2"}
15
+ __data_category__ = "therapy_agent_dose"
15
16
 
16
17
  therapy_agent_dose_id: Mapped[int] = mapped_column(primary_key=True)
17
18
  treatment_id: Mapped[int] = mapped_column(ForeignKey("stage2.treatment.treatment_id", ondelete="CASCADE"))
@@ -11,6 +11,7 @@ class TreatmentORM(BaseORM):
11
11
  __tablename__ = "treatment"
12
12
  __repr_attrs__ = ["treatment_id", "participant_id", "treatment_description"]
13
13
  __table_args__ = {"schema": "stage2"}
14
+ __data_category__ = "treatment"
14
15
 
15
16
  treatment_id: Mapped[int] = mapped_column(primary_key=True)
16
17
  participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
@@ -6,13 +6,14 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
6
6
  from sqlalchemy.types import JSON
7
7
 
8
8
  from cidc_api.models.db.base_orm import BaseORM
9
- from cidc_api.models.types import TrialStatus, AssayType, TrialOrganization, TrialFundingAgency
9
+ from cidc_api.models.types import AssayType, TrialOrganization, TrialFundingAgency
10
10
 
11
11
 
12
12
  class TrialORM(BaseORM):
13
13
  __tablename__ = "trial"
14
14
  __repr_attrs__ = ["trial_id", "version"]
15
15
  __table_args__ = {"schema": "stage2"}
16
+ __data_category__ = "study"
16
17
 
17
18
  trial_id: Mapped[str] = mapped_column(primary_key=True)
18
19
  version: Mapped[str] = mapped_column(primary_key=True)
@@ -24,7 +25,6 @@ class TrialORM(BaseORM):
24
25
  trial_description: Mapped[Optional[str]]
25
26
  trial_organization: Mapped[Optional[TrialOrganization]]
26
27
  grant_or_affiliated_network: Mapped[Optional[TrialFundingAgency]]
27
- trial_status: Mapped[TrialStatus]
28
28
  biobank_institution_id: Mapped[Optional[int]]
29
29
  justification: Mapped[Optional[str]]
30
30
  dates_of_conduct_start: Mapped[datetime]
@@ -3399,6 +3399,7 @@ class PreprocessedFiles(CommonColumns):
3399
3399
  (cls.file_category == latest_subquery.c.file_category)
3400
3400
  & (cls._created == latest_subquery.c.latest_created),
3401
3401
  )
3402
+ .order_by(cls.file_category)
3402
3403
  .all()
3403
3404
  )
3404
3405
  return latest_files
@@ -10,7 +10,9 @@ class AdditionalTreatment(Base):
10
10
  additional_treatment_id: int | None = None
11
11
 
12
12
  # The unique internal identifier for the associated Participant record
13
- participant_id: int | None = None
13
+ participant_id: str | None = (
14
+ None # TODO: fix all stage2 models for participant_id to not be nullable, after s1 models are complete
15
+ )
14
16
 
15
17
  # Number of days from the enrollment date to the first recorded administration or occurrence of the treatment modality.
16
18
  days_to_start: NonNegativeInt | None = None
@@ -25,7 +25,7 @@ class AdverseEvent(Base):
25
25
  adverse_event_id: int | None = None
26
26
 
27
27
  # The unique internal identifier of the associated participant
28
- participant_id: int | None = None
28
+ participant_id: str | None = None
29
29
 
30
30
  # The unique internal identifier of the attributed treatment, if any
31
31
  treatment_id: int | None = None
@@ -28,3 +28,15 @@ class Base(BaseModel):
28
28
  except:
29
29
  self.__dict__.update(original_dict)
30
30
  raise
31
+
32
+ @classmethod
33
+ def split_list(cls, val):
34
+ """Listify fields that are multi-valued in input data, e.g. 'lung|kidney'"""
35
+ if type(val) == list:
36
+ return val
37
+ elif type(val) == str:
38
+ if not val:
39
+ return []
40
+ return val.split("|")
41
+ else:
42
+ raise ValueError("Field value must be string or list")
@@ -10,7 +10,7 @@ class BaselineClinicalAssessment(Base):
10
10
  baseline_clinical_assessment_id: int | None = None
11
11
 
12
12
  # The unique identifier for the associated participant
13
- participant_id: int | None = None
13
+ participant_id: str | None = None
14
14
 
15
15
  # The numerical score that represents the functional capabilities of a participant at the
16
16
  # enrollment date using the Eastern Cooperative Oncology Group Performance Status assessment.
@@ -1,6 +1,6 @@
1
- from typing import Self
1
+ from typing import Self, Annotated, List
2
2
 
3
- from pydantic import PositiveInt, NonNegativeFloat, PositiveFloat, model_validator, field_validator
3
+ from pydantic import PositiveInt, NonNegativeFloat, PositiveFloat, model_validator, field_validator, BeforeValidator
4
4
 
5
5
  from .base import Base
6
6
  from cidc_api.models.types import (
@@ -25,7 +25,7 @@ class Demographic(Base):
25
25
 
26
26
  # The unique internal identifier for the associated participant
27
27
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
28
- participant_id: int | None = None
28
+ participant_id: str | None = None
29
29
 
30
30
  # The age of the subject when the subject enrolled in the study.
31
31
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15742605%20and%20ver_nr=1
@@ -34,9 +34,9 @@ class Demographic(Base):
34
34
  # Unit of measurement for the age of the participant. e.g. "Years"
35
35
  age_at_enrollment_units: AgeAtEnrollmentUnits | None = None
36
36
 
37
- # Indicates whether the participant is 90 years old or older. (for PHI purposes)
37
+ # Indicates whether the participant is 90 years old or over. (for PHI purposes)
38
38
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15354920%20and%20ver_nr=1
39
- age_90_or_older: bool
39
+ age_90_or_over: bool
40
40
 
41
41
  # A textual description of a person's sex at birth. e.g. "Male"
42
42
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=7572817%20and%20ver_nr=3
@@ -44,7 +44,7 @@ class Demographic(Base):
44
44
 
45
45
  # The race of the participant. e.g. "White"
46
46
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2192199%20and%20ver_nr=1
47
- race: Race
47
+ race: Annotated[List[Race], BeforeValidator(Base.split_list)]
48
48
 
49
49
  # The ethnicity of the participant. e.g. "Hispanic or Latino"
50
50
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2192217%20and%20ver_nr=2
@@ -92,23 +92,24 @@ class Demographic(Base):
92
92
 
93
93
  @model_validator(mode="after")
94
94
  def validate_age_at_enrollment_cr(self) -> Self:
95
- if self.age_90_or_older:
95
+ if self.age_90_or_over:
96
96
  if self.age_at_enrollment or self.age_at_enrollment_units:
97
97
  raise ValueError(
98
- 'If "age_90_or_older" is "Yes" then "age_at_enrollment" and "age_at_enrollment_units" must be blank.'
98
+ 'If "age_90_or_over" is "Yes" then "age_at_enrollment" and "age_at_enrollment_units" must be blank.'
99
99
  )
100
100
  else:
101
101
  if not self.age_at_enrollment or not self.age_at_enrollment_units:
102
102
  raise ValueError(
103
- 'If "age_90_or_older" is "No" then "age_at_enrollment" and "age_at_enrollment_units" are required.'
103
+ 'If "age_90_or_over" is "No" then "age_at_enrollment" and "age_at_enrollment_units" are required.'
104
104
  )
105
105
  return self
106
106
 
107
107
  @model_validator(mode="after")
108
108
  def validate_age_at_enrollment_value(self) -> Self:
109
- age_in_years = (
110
- self.age_at_enrollment if self.age_at_enrollment_units == "Years" else self.age_at_enrollment / 365.25
111
- )
112
- if age_in_years >= 90:
113
- raise ValueError('"age_at_enrollment" cannot represent a value greater than 90 years of age.')
109
+ if not self.age_90_or_over:
110
+ age_in_years = (
111
+ self.age_at_enrollment if self.age_at_enrollment_units == "Years" else self.age_at_enrollment / 365.25
112
+ )
113
+ if age_in_years >= 90:
114
+ raise ValueError('"age_at_enrollment" cannot represent a value greater than 90 years of age.')
114
115
  return self
@@ -1,12 +1,14 @@
1
- from pydantic import NonPositiveInt, model_validator
2
- from typing import List, Self
1
+ from pydantic import NonPositiveInt, model_validator, BeforeValidator
2
+ from typing import List, Self, Annotated, get_args
3
3
 
4
4
  from .base import Base
5
5
  from cidc_api.models.types import (
6
- PrimaryDiagnosisDiseaseGroup,
7
6
  TumorGrade,
8
7
  CancerStageSystem,
9
8
  CancerStageSystemVersion,
9
+ CancerStageSystemVersionAJCC,
10
+ CancerStageSystemVersionRISS,
11
+ CancerStageSystemVersionFIGO,
10
12
  CancerStage,
11
13
  TCategory,
12
14
  NCategory,
@@ -27,12 +29,7 @@ class Disease(Base):
27
29
 
28
30
  # The unique internal identifier for the associated participant
29
31
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
30
- participant_id: int | None = None
31
-
32
- # A term describing the main condition for evaluation and treatment as captured in the Disease or Diagnosis (C2991)
33
- # branch of the National Cancer Institute Thesaurus (NCIt) hierarchy tree. e.g. "Melanoma"
34
- # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14905532%20and%20ver_nr=1
35
- primary_diagnosis_disease_group: PrimaryDiagnosisDiseaseGroup
32
+ participant_id: str | None = None
36
33
 
37
34
  # The location within the body from where the disease of interest originated as captured in the Uberon identifier. e.g. "lung"
38
35
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14883047%20and%20ver_nr=1
@@ -40,18 +37,18 @@ class Disease(Base):
40
37
 
41
38
  # The ICD-O-3 morphology code that describes the tumor's histology, behavior, and grade-differentiation. e.g. "8480/6"
42
39
  # CDE: TBD
43
- morphological_code: ICDO3MorphologicalCode
40
+ morphological_code: ICDO3MorphologicalCode | None
44
41
 
45
42
  # The ICD-O-3 morphology term that describes the tumor's type. e.g. "Mucinous adenoma"
46
43
  # CDE: TBD
47
- morphological_term: ICDO3MorphologicalTerm
44
+ morphological_term: ICDO3MorphologicalTerm | None
48
45
 
49
46
  # Words that broadly describe the cancer's characteristics and type. e.g. "Inflitrating Ductal Carcinoma"
50
47
  # CDE: TBD
51
48
  cancer_type_description: str | None = None
52
49
 
53
50
  # The number of days elapsed since the participant was first diagnosed with this condition.
54
- days_since_original_diagnosis: NonPositiveInt
51
+ days_since_original_diagnosis: NonPositiveInt | None
55
52
 
56
53
  # Words that express the degree of abnormality of cancer cells as a measure of differentiation and aggressiveness. e.g. "G1 Low Grade"
57
54
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11325685%20and%20ver_nr=2
@@ -68,32 +65,32 @@ class Disease(Base):
68
65
  # CDE(AJCC): https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440332%20and%20ver_nr=1
69
66
  # CDE(FIGO): TBD
70
67
  # CDE(RISS): TBD
71
- cancer_stage: CancerStage
68
+ cancer_stage: CancerStage | None = None
72
69
 
73
70
  # Extent of the primary cancer based on evidence obtained from clinical assessment parameters determined prior to treatment. e.g. "T0"
74
71
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440328%20and%20ver_nr=1
75
72
  # TODO: Verify this CDE
76
- t_category: TCategory
73
+ t_category: TCategory | None = None
77
74
 
78
75
  # Extent of the regional lymph node involvement for the cancer based on evidence obtained from clinical assessment parameters
79
76
  # determined prior to treatment. e.g. "N0"
80
77
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440330%20and%20ver_nr=1
81
78
  # TODO: Verify this CDE
82
- n_category: NCategory
79
+ n_category: NCategory | None = None
83
80
 
84
81
  # Extent of the distant metastasis for the cancer based on evidence obtained from clinical assessment parameters determined
85
82
  # prior to treatment. e.g. "M0"
86
83
  # CDE: https://teams.microsoft.com/l/message/19:1c292b63-5df1-4f29-b177-86aed53f393d_f224ae83-209b-4cd9-a7ef-83d9d2120a27@unq.gbl.spaces/1758827414202?context=%7B%22contextType%22%3A%22chat%22%7D
87
84
  # TODO: Verify this CDE
88
- m_category: MCategory
85
+ m_category: MCategory | None = None
89
86
 
90
87
  # The organ site where a tumor develops outside of the bone marrow as specified in the Uberon antatomical term.
91
- metastatic_organ: List[UberonAnatomicalTerm] = []
88
+ metastatic_organ: Annotated[List[UberonAnatomicalTerm] | None, BeforeValidator(Base.split_list)] = []
92
89
 
93
90
  # Indicates if participant has a hematological malignancy that is only extramedullary. e.g. "Yes"
94
91
  solely_extramedullary_disease: YNU
95
92
 
96
- extramedullary_organ: List[UberonAnatomicalTerm] = []
93
+ extramedullary_organ: Annotated[List[UberonAnatomicalTerm] | None, BeforeValidator(Base.split_list)] = []
97
94
 
98
95
  @model_validator(mode="after")
99
96
  def validate_code_or_term_or_description_cr(self) -> Self:
@@ -103,6 +100,23 @@ class Disease(Base):
103
100
  )
104
101
  return self
105
102
 
103
+ @model_validator(mode="after")
104
+ def validate_cancer_stage_system_version(self) -> Self:
105
+ msg = f"{self.cancer_stage_system_version} is not applicable to {self.cancer_stage_system}"
106
+ if self.cancer_stage_system == "AJCC" and self.cancer_stage_system_version not in get_args(
107
+ CancerStageSystemVersionAJCC
108
+ ):
109
+ raise ValueError(msg)
110
+ elif self.cancer_stage_system == "RISS" and self.cancer_stage_system_version not in get_args(
111
+ CancerStageSystemVersionRISS
112
+ ):
113
+ raise ValueError(msg)
114
+ elif self.cancer_stage_system == "FIGO" and self.cancer_stage_system_version not in get_args(
115
+ CancerStageSystemVersionFIGO
116
+ ):
117
+ raise ValueError(msg)
118
+ return self
119
+
106
120
  @model_validator(mode="after")
107
121
  def validate_cancer_stage_system_version_cr(self) -> Self:
108
122
  if self.cancer_stage_system != "Not Applicable" and not self.cancer_stage_system_version:
@@ -14,7 +14,7 @@ class Exposure(Base):
14
14
  exposure_id: int | None = None
15
15
 
16
16
  # The unique identifier for the associated participant
17
- participant_id: int | None = None
17
+ participant_id: str | None = None
18
18
 
19
19
  # An indication of whether the subject was exposed to any chemical, biological or physical agents
20
20
  # that increase the risk of neoplasms in humans or animals.
@@ -23,7 +23,7 @@ class Exposure(Base):
23
23
 
24
24
  # The type of potentially harmful environmental agents to which an individual was exposed.
25
25
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15753203%20and%20ver_nr=1
26
- exposure_type: ExposureType
26
+ exposure_type: ExposureType | None = None
27
27
 
28
28
  @model_validator(mode="after")
29
29
  def validate_exposure_type_cr(self) -> Self:
@@ -15,7 +15,7 @@ class GVHDDiagnosisAcute(Base):
15
15
  gvhd_diagnosis_acute_id: int | None = None
16
16
 
17
17
  # The unique internal identifier for the associated participant
18
- participant_id: int | None = None
18
+ participant_id: str | None = None
19
19
 
20
20
  # The clinical grading system used to stage involvement of affected organs (skin, liver, GI tract)
21
21
  # in acute GVHD and assign an overall severity grade (I–IV) based on predefined criteria.
@@ -15,7 +15,7 @@ class GVHDDiagnosisChronic(Base):
15
15
  gvhd_diagnosis_chronic_id: int | None = None
16
16
 
17
17
  # The unique internal identifier for the associated participant
18
- participant_id: int | None = None
18
+ participant_id: str | None = None
19
19
 
20
20
  # The standardized clinical system used to evaluate and grade the extent and severity
21
21
  # of organ involvement in chronic GVHD, resulting in an overall disease severity score.
@@ -14,7 +14,7 @@ class MedicalHistory(Base):
14
14
  medical_history_id: int | None = None
15
15
 
16
16
  # The unique identifier for the associated participant
17
- participant_id: int | None = None
17
+ participant_id: str | None = None
18
18
 
19
19
  # Text representation of a person's status relative to smoking tobacco in the form of cigarettes,
20
20
  # based on questions about current and former use of cigarettes.