nci-cidc-api-modules 1.2.29__py3-none-any.whl → 1.2.45__py3-none-any.whl
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.
- cidc_api/__init__.py +1 -0
- cidc_api/config/db.py +21 -1
- cidc_api/config/settings.py +1 -0
- cidc_api/models/__init__.py +0 -2
- cidc_api/models/data.py +17 -4
- cidc_api/models/db/stage1/__init__.py +56 -0
- cidc_api/models/db/stage1/additional_treatment_orm.py +22 -0
- cidc_api/models/db/stage1/adverse_event_orm.py +46 -0
- cidc_api/models/db/stage1/base_orm.py +7 -0
- cidc_api/models/db/stage1/baseline_clinical_assessment_orm.py +22 -0
- cidc_api/models/db/stage1/comorbidity_orm.py +23 -0
- cidc_api/models/db/stage1/consent_group_orm.py +32 -0
- cidc_api/models/db/stage1/demographic_orm.py +47 -0
- cidc_api/models/db/stage1/disease_orm.py +52 -0
- cidc_api/models/db/stage1/exposure_orm.py +22 -0
- cidc_api/models/db/stage1/gvhd_diagnosis_acute_orm.py +34 -0
- cidc_api/models/db/stage1/gvhd_diagnosis_chronic_orm.py +36 -0
- cidc_api/models/db/stage1/gvhd_organ_acute_orm.py +21 -0
- cidc_api/models/db/stage1/gvhd_organ_chronic_orm.py +21 -0
- cidc_api/models/db/stage1/medical_history_orm.py +30 -0
- cidc_api/models/db/stage1/other_malignancy_orm.py +29 -0
- cidc_api/models/db/stage1/participant_orm.py +77 -0
- cidc_api/models/db/stage1/prior_treatment_orm.py +29 -0
- cidc_api/models/db/stage1/radiotherapy_dose_orm.py +39 -0
- cidc_api/models/db/stage1/response_by_system_orm.py +30 -0
- cidc_api/models/db/stage1/response_orm.py +28 -0
- cidc_api/models/db/stage1/specimen_orm.py +46 -0
- cidc_api/models/db/stage1/stem_cell_transplant_orm.py +25 -0
- cidc_api/models/db/stage1/surgery_orm.py +27 -0
- cidc_api/models/db/stage1/therapy_agent_dose_orm.py +31 -0
- cidc_api/models/db/stage1/treatment_orm.py +38 -0
- cidc_api/models/db/stage1/trial_orm.py +35 -0
- cidc_api/models/db/stage2/additional_treatment_orm.py +8 -8
- cidc_api/models/db/stage2/administrative_person_orm.py +4 -4
- cidc_api/models/db/stage2/administrative_role_assignment_orm.py +4 -4
- cidc_api/models/db/stage2/adverse_event_orm.py +12 -13
- cidc_api/models/db/stage2/arm_orm.py +3 -3
- cidc_api/models/db/stage2/base_orm.py +7 -0
- cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +6 -7
- cidc_api/models/db/stage2/cohort_orm.py +3 -3
- cidc_api/models/db/stage2/comorbidity_orm.py +7 -8
- cidc_api/models/db/stage2/consent_group_orm.py +5 -4
- cidc_api/models/db/stage2/contact_orm.py +16 -20
- cidc_api/models/db/stage2/demographic_orm.py +11 -8
- cidc_api/models/db/stage2/disease_orm.py +13 -14
- cidc_api/models/db/stage2/exposure_orm.py +5 -4
- cidc_api/models/db/stage2/file_orm.py +6 -9
- cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +5 -4
- cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +5 -6
- cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +4 -3
- cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +4 -3
- cidc_api/models/db/stage2/institution_orm.py +7 -7
- cidc_api/models/db/stage2/medical_history_orm.py +10 -9
- cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +8 -12
- cidc_api/models/db/stage2/other_malignancy_orm.py +10 -11
- cidc_api/models/db/stage2/participant_orm.py +28 -28
- cidc_api/models/db/stage2/prior_treatment_orm.py +15 -14
- cidc_api/models/db/stage2/publication_orm.py +9 -11
- cidc_api/models/db/stage2/radiotherapy_dose_orm.py +9 -9
- cidc_api/models/db/stage2/response_by_system_orm.py +5 -3
- cidc_api/models/db/stage2/response_orm.py +6 -5
- cidc_api/models/db/stage2/shipment_orm.py +17 -17
- cidc_api/models/db/stage2/shipment_specimen_orm.py +4 -4
- cidc_api/models/db/stage2/specimen_orm.py +7 -6
- cidc_api/models/db/stage2/stem_cell_transplant_orm.py +7 -7
- cidc_api/models/db/stage2/surgery_orm.py +7 -7
- cidc_api/models/db/stage2/therapy_agent_dose_orm.py +8 -8
- cidc_api/models/db/stage2/treatment_orm.py +16 -15
- cidc_api/models/db/stage2/trial_orm.py +34 -33
- cidc_api/models/files/facets.py +4 -0
- cidc_api/models/models.py +154 -9
- cidc_api/models/pydantic/{stage2/base.py → base.py} +19 -1
- cidc_api/models/pydantic/stage1/__init__.py +56 -0
- cidc_api/models/pydantic/stage1/additional_treatment.py +23 -0
- cidc_api/models/pydantic/stage1/adverse_event.py +100 -0
- cidc_api/models/pydantic/stage1/baseline_clinical_assessment.py +23 -0
- cidc_api/models/pydantic/stage1/comorbidity.py +36 -0
- cidc_api/models/pydantic/stage1/consent_group.py +30 -0
- cidc_api/models/pydantic/stage1/demographic.py +123 -0
- cidc_api/models/pydantic/stage1/disease.py +158 -0
- cidc_api/models/pydantic/stage1/exposure.py +32 -0
- cidc_api/models/pydantic/stage1/gvhd_diagnosis_acute.py +33 -0
- cidc_api/models/pydantic/stage1/gvhd_diagnosis_chronic.py +32 -0
- cidc_api/models/pydantic/stage1/gvhd_organ_acute.py +22 -0
- cidc_api/models/pydantic/stage1/gvhd_organ_chronic.py +23 -0
- cidc_api/models/pydantic/stage1/medical_history.py +36 -0
- cidc_api/models/pydantic/stage1/other_malignancy.py +49 -0
- cidc_api/models/pydantic/stage1/participant.py +51 -0
- cidc_api/models/pydantic/stage1/prior_treatment.py +45 -0
- cidc_api/models/pydantic/stage1/radiotherapy_dose.py +79 -0
- cidc_api/models/pydantic/stage1/response.py +65 -0
- cidc_api/models/pydantic/stage1/response_by_system.py +112 -0
- cidc_api/models/pydantic/stage1/specimen.py +31 -0
- cidc_api/models/pydantic/stage1/stem_cell_transplant.py +35 -0
- cidc_api/models/pydantic/stage1/surgery.py +49 -0
- cidc_api/models/pydantic/stage1/therapy_agent_dose.py +67 -0
- cidc_api/models/pydantic/stage1/treatment.py +50 -0
- cidc_api/models/pydantic/stage1/trial.py +45 -0
- cidc_api/models/pydantic/stage2/additional_treatment.py +5 -5
- cidc_api/models/pydantic/stage2/administrative_person.py +1 -1
- cidc_api/models/pydantic/stage2/administrative_role_assignment.py +2 -2
- cidc_api/models/pydantic/stage2/adverse_event.py +2 -2
- cidc_api/models/pydantic/stage2/arm.py +2 -2
- cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +2 -2
- cidc_api/models/pydantic/stage2/cohort.py +1 -1
- cidc_api/models/pydantic/stage2/comorbidity.py +1 -1
- cidc_api/models/pydantic/stage2/consent_group.py +2 -2
- cidc_api/models/pydantic/stage2/contact.py +1 -1
- cidc_api/models/pydantic/stage2/demographic.py +27 -18
- cidc_api/models/pydantic/stage2/disease.py +33 -19
- cidc_api/models/pydantic/stage2/exposure.py +3 -3
- cidc_api/models/pydantic/stage2/file.py +2 -2
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +2 -2
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +2 -2
- cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +1 -1
- cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +1 -1
- cidc_api/models/pydantic/stage2/institution.py +1 -1
- cidc_api/models/pydantic/stage2/medical_history.py +2 -2
- cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +1 -1
- cidc_api/models/pydantic/stage2/other_malignancy.py +12 -8
- cidc_api/models/pydantic/stage2/participant.py +10 -6
- cidc_api/models/pydantic/stage2/prior_treatment.py +14 -23
- cidc_api/models/pydantic/stage2/publication.py +2 -2
- cidc_api/models/pydantic/stage2/radiotherapy_dose.py +2 -2
- cidc_api/models/pydantic/stage2/response.py +5 -11
- cidc_api/models/pydantic/stage2/response_by_system.py +10 -7
- cidc_api/models/pydantic/stage2/shipment.py +2 -2
- cidc_api/models/pydantic/stage2/shipment_specimen.py +1 -1
- cidc_api/models/pydantic/stage2/specimen.py +8 -5
- cidc_api/models/pydantic/stage2/stem_cell_transplant.py +2 -2
- cidc_api/models/pydantic/stage2/surgery.py +1 -1
- cidc_api/models/pydantic/stage2/therapy_agent_dose.py +1 -1
- cidc_api/models/pydantic/stage2/treatment.py +2 -2
- cidc_api/models/pydantic/stage2/trial.py +19 -15
- cidc_api/models/types.py +45 -42
- cidc_api/shared/assay_handling.py +68 -0
- cidc_api/shared/auth.py +5 -5
- cidc_api/shared/file_handling.py +16 -4
- cidc_api/shared/gcloud_client.py +78 -16
- cidc_api/shared/utils.py +18 -9
- cidc_api/telemetry.py +101 -0
- {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/METADATA +25 -14
- nci_cidc_api_modules-1.2.45.dist-info/RECORD +165 -0
- cidc_api/models/db/base_orm.py +0 -25
- nci_cidc_api_modules-1.2.29.dist-info/RECORD +0 -109
- {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/WHEEL +0 -0
- {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/licenses/LICENSE +0 -0
- {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from pydantic import NonNegativeInt
|
|
2
2
|
|
|
3
|
-
from .base import Base
|
|
3
|
+
from cidc_api.models.pydantic.base import Base
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class ConsentGroup(Base):
|
|
@@ -11,7 +11,7 @@ class ConsentGroup(Base):
|
|
|
11
11
|
consent_group_id: int | None = None
|
|
12
12
|
|
|
13
13
|
# The unique internal identifier for the associated Trial record
|
|
14
|
-
trial_id:
|
|
14
|
+
trial_id: str | None = None
|
|
15
15
|
|
|
16
16
|
# The version number of the trial dataset
|
|
17
17
|
version: str | None = None
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import (
|
|
7
7
|
Sex,
|
|
8
8
|
Race,
|
|
@@ -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:
|
|
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
|
|
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
|
-
|
|
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
|
|
@@ -68,15 +68,15 @@ class Demographic(Base):
|
|
|
68
68
|
|
|
69
69
|
# The body mass index of the participant at the enrollment date.
|
|
70
70
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2006410%20and%20ver_nr=3
|
|
71
|
-
body_mass_index: PositiveFloat
|
|
71
|
+
body_mass_index: PositiveFloat | None = None
|
|
72
72
|
|
|
73
73
|
# A decimal number that represents the measure of the 2-dimensional extent of the body surface (i.e., the skin) of the participant at the enrollment date.
|
|
74
74
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=6606197%20and%20ver_nr=1
|
|
75
|
-
body_surface_area: PositiveFloat
|
|
75
|
+
body_surface_area: PositiveFloat | None = None
|
|
76
76
|
|
|
77
77
|
# Unit of measurement for body surface area of the participant at the enrollment date. e.g. "m2"
|
|
78
78
|
# https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15114329%20and%20ver_nr=1
|
|
79
|
-
body_surface_area_units: BodySurfaceAreaUnits
|
|
79
|
+
body_surface_area_units: BodySurfaceAreaUnits | None = None
|
|
80
80
|
|
|
81
81
|
# The occupation/job category of the participant. e.g. "Manager"
|
|
82
82
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=6617540%20and%20ver_nr=1
|
|
@@ -92,23 +92,32 @@ class Demographic(Base):
|
|
|
92
92
|
|
|
93
93
|
@model_validator(mode="after")
|
|
94
94
|
def validate_age_at_enrollment_cr(self) -> Self:
|
|
95
|
-
if self.
|
|
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 "
|
|
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 "
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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.')
|
|
115
|
+
return self
|
|
116
|
+
|
|
117
|
+
@model_validator(mode="after")
|
|
118
|
+
def validate_body_surface_area_units_cr(self) -> Self:
|
|
119
|
+
if self.body_surface_area and not self.body_surface_area_units:
|
|
120
|
+
raise ValueError(
|
|
121
|
+
'If "body_surface_area" is provided then "body_surface_area_units_other" must also be provided.'
|
|
122
|
+
)
|
|
114
123
|
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
|
-
from .base import Base
|
|
4
|
+
from cidc_api.models.pydantic.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:
|
|
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:
|
|
@@ -2,7 +2,7 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import model_validator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import YNU, ExposureType
|
|
7
7
|
|
|
8
8
|
|
|
@@ -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:
|
|
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:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
from .base import Base
|
|
2
|
+
from cidc_api.models.pydantic.base import Base
|
|
3
3
|
from cidc_api.models.types import ChecksumType, FileFormat
|
|
4
4
|
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ class File(Base):
|
|
|
8
8
|
file_id: int | None = None
|
|
9
9
|
|
|
10
10
|
# The unique identifier for the associated trial
|
|
11
|
-
trial_id:
|
|
11
|
+
trial_id: str | None = None
|
|
12
12
|
|
|
13
13
|
# The version number of the trial dataset
|
|
14
14
|
version: str | None = None
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .base import Base
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
2
|
from cidc_api.models.types import (
|
|
3
3
|
GVHDDiagnosisAcuteAssessmentSystem,
|
|
4
4
|
GVHDDiagnosisAcuteAssessmentSystemVersion,
|
|
@@ -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:
|
|
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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .base import Base
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
2
|
from cidc_api.models.types import (
|
|
3
3
|
GVHDDiagnosisChronicAssessmentSystem,
|
|
4
4
|
GVHDDiagnosisChronicAssessmentSystemVersion,
|
|
@@ -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:
|
|
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.
|
|
@@ -2,7 +2,7 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import NonNegativeInt, PositiveFloat, model_validator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import TobaccoSmokingStatus
|
|
7
7
|
|
|
8
8
|
|
|
@@ -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:
|
|
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.
|
|
@@ -2,7 +2,7 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import NonPositiveInt, model_validator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import UberonAnatomicalTerm, ICDO3MorphologicalCode, ICDO3MorphologicalTerm, MalignancyStatus
|
|
7
7
|
|
|
8
8
|
|
|
@@ -17,28 +17,32 @@ class OtherMalignancy(Base):
|
|
|
17
17
|
medical_history_id: int | None = None
|
|
18
18
|
|
|
19
19
|
# The location within the body from where the prior malignancy originated as captured in the Uberon anatomical term.
|
|
20
|
-
|
|
20
|
+
other_malignancy_primary_disease_site: UberonAnatomicalTerm
|
|
21
21
|
|
|
22
22
|
# The ICD-O-3 code which identifies the specific appearance of cells and tissues (normal and abnormal) used
|
|
23
23
|
# to define the presence and nature of disease.
|
|
24
|
-
|
|
24
|
+
other_malignancy_morphological_code: ICDO3MorphologicalCode | None = None
|
|
25
25
|
|
|
26
26
|
# The ICD-O-3 textual label which identifies the specific appearance of cells and tissues (normal and abnormal) used
|
|
27
27
|
# to define the presence and nature of disease.
|
|
28
|
-
|
|
28
|
+
other_malignancy_morphological_term: ICDO3MorphologicalTerm | None = None
|
|
29
29
|
|
|
30
30
|
# Description of the cancer type as recorded in the trial.
|
|
31
|
-
|
|
31
|
+
other_malignancy_description: str | None = None
|
|
32
32
|
|
|
33
33
|
# Number of days since original diagnosis from the enrollment date. This may be a negative number.
|
|
34
|
-
|
|
34
|
+
other_malignancy_days_since_diagnosis: NonPositiveInt | None = None
|
|
35
35
|
|
|
36
36
|
# Indicates the participant’s current clinical state regarding the cancer diagnosis.
|
|
37
|
-
|
|
37
|
+
other_malignancy_status: MalignancyStatus | None = None
|
|
38
38
|
|
|
39
39
|
@model_validator(mode="after")
|
|
40
40
|
def validate_code_or_term_or_description_cr(self) -> Self:
|
|
41
|
-
if
|
|
41
|
+
if (
|
|
42
|
+
not self.other_malignancy_morphological_code
|
|
43
|
+
and not self.other_malignancy_morphological_term
|
|
44
|
+
and not self.other_malignancy_description
|
|
45
|
+
):
|
|
42
46
|
raise ValueError(
|
|
43
47
|
'Please provide at least one of "morphological_code", "morphological_term" or "malignancy_description".'
|
|
44
48
|
)
|
|
@@ -2,7 +2,8 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import model_validator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import YNU
|
|
6
7
|
from cidc_api.models.types import OffStudyReason
|
|
7
8
|
|
|
8
9
|
|
|
@@ -12,20 +13,23 @@ class Participant(Base):
|
|
|
12
13
|
|
|
13
14
|
# The unique internal identifier for the participant
|
|
14
15
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
|
|
15
|
-
participant_id:
|
|
16
|
+
participant_id: str | None = None
|
|
16
17
|
|
|
17
18
|
# The participant identifier assigned by the clinical trial team overseeing the study
|
|
18
19
|
native_participant_id: str
|
|
19
20
|
|
|
20
21
|
# The globally unique participant identifier assigned by the CIMAC network. e.g. C8P29A7
|
|
21
|
-
cimac_participant_id: str
|
|
22
|
+
cimac_participant_id: str | None = None
|
|
22
23
|
|
|
23
24
|
# The unique identifier for the associated trial that the participant is participating in
|
|
24
|
-
trial_id:
|
|
25
|
+
trial_id: str | None = None
|
|
26
|
+
|
|
27
|
+
# The version number of the trial dataset. e.g. "1.0"
|
|
28
|
+
version: str | None = None
|
|
25
29
|
|
|
26
30
|
# Indicates if the individual is no longer actively participating in the clinical trial.
|
|
27
31
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14834973%20and%20ver_nr=1
|
|
28
|
-
off_study:
|
|
32
|
+
off_study: YNU
|
|
29
33
|
|
|
30
34
|
# An explanation describing why an individual is no longer participating in the clinical trial.
|
|
31
35
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13362265%20and%20ver_nr=1
|
|
@@ -36,7 +40,7 @@ class Participant(Base):
|
|
|
36
40
|
|
|
37
41
|
@model_validator(mode="after")
|
|
38
42
|
def off_study_reason_cr(self) -> Self:
|
|
39
|
-
if self.off_study and not self.off_study_reason:
|
|
43
|
+
if self.off_study == "Yes" and not self.off_study_reason:
|
|
40
44
|
raise ValueError('If "off_study" is "Yes" then "off_study_reason" is required.')
|
|
41
45
|
return self
|
|
42
46
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
from typing import Self
|
|
1
|
+
from typing import Self, Annotated, List
|
|
2
2
|
|
|
3
|
-
from pydantic import NonPositiveInt,
|
|
3
|
+
from pydantic import NonPositiveInt, NegativeInt, model_validator, BeforeValidator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
6
|
-
from cidc_api.models.types import
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import ConditioningRegimenType, StemCellDonorType
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class PriorTreatment(Base):
|
|
@@ -14,39 +14,30 @@ class PriorTreatment(Base):
|
|
|
14
14
|
prior_treatment_id: int | None = None
|
|
15
15
|
|
|
16
16
|
# A unique internal identifier for the associated participant record
|
|
17
|
-
participant_id:
|
|
17
|
+
participant_id: str | None = None
|
|
18
18
|
|
|
19
19
|
# Number of days from the enrollment date to the first recorded administration or occurrence of
|
|
20
20
|
# the treatment modality.
|
|
21
|
-
|
|
21
|
+
prior_treatment_days_to_start: NonPositiveInt | None = None
|
|
22
22
|
|
|
23
23
|
# Number of days from the enrollment date to the last recorded administration or occurrence of
|
|
24
24
|
# the treatment modality.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# Specifies the category or kind of prior treatment modality a participant received.
|
|
28
|
-
type: PriorTreatmentType
|
|
25
|
+
prior_treatment_days_to_end: NonPositiveInt | None = None
|
|
29
26
|
|
|
30
27
|
# Description of the prior treatment such as its full generic name if it is a type of therapy agent,
|
|
31
28
|
# radiotherapy procedure name and location, or surgical procedure name and location.
|
|
32
|
-
|
|
29
|
+
prior_treatment_description: str
|
|
33
30
|
|
|
34
31
|
# Best response from any response assessment system to the prior treatment if available or applicable.
|
|
35
|
-
|
|
32
|
+
prior_treatment_best_response: str | None = None
|
|
36
33
|
|
|
37
34
|
# If the prior treatment is "Conditioning therapy" received before a stem cell transplant, specifies what
|
|
38
35
|
# type of conditioning regimen used.
|
|
39
|
-
|
|
36
|
+
prior_treatment_conditioning_regimen_type: ConditioningRegimenType | None = None
|
|
40
37
|
|
|
41
38
|
# If prior treatment is "Stem cell transplant", indicates what stem cell donor type used.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# If prior treatment is "Stem cell transplant", indicates the number of days from the transplant
|
|
45
|
-
# date to the start of the current treatment.
|
|
46
|
-
days_from_transplant_to_treatment_initiation: NonNegativeInt | None = None
|
|
39
|
+
prior_treatment_stem_cell_donor_type: StemCellDonorType | None = None
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
raise ValueError('If type is "Other therapy", please provide description.')
|
|
52
|
-
return self
|
|
41
|
+
# If prior treatment is "Stem cell transplant", indicates the number of days from enrollment
|
|
42
|
+
# to the prior transplant. This must be a negative number.
|
|
43
|
+
prior_treatment_days_from_transplant_to_treatment_initiation: NegativeInt | None = None
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .base import Base
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class Publication(Base):
|
|
@@ -6,7 +6,7 @@ class Publication(Base):
|
|
|
6
6
|
publication_id: int | None = None
|
|
7
7
|
|
|
8
8
|
# The unique internal identifier for the associated Trial record
|
|
9
|
-
trial_id:
|
|
9
|
+
trial_id: str | None = None
|
|
10
10
|
|
|
11
11
|
# The version number of the trial dataset
|
|
12
12
|
version: str | None = None
|
|
@@ -2,7 +2,7 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import NonNegativeInt, NonNegativeFloat, model_validator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import (
|
|
7
7
|
YNU,
|
|
8
8
|
RadiotherapyProcedure,
|
|
@@ -17,7 +17,7 @@ class RadiotherapyDose(Base):
|
|
|
17
17
|
__cardinality__ = "many"
|
|
18
18
|
|
|
19
19
|
# The unique internal identifier for the radiotherapy dose record
|
|
20
|
-
|
|
20
|
+
radiotherapy_dose_id: int | None = None
|
|
21
21
|
|
|
22
22
|
# The unique internal identifier for the associated treatment record
|
|
23
23
|
treatment_id: int | None = None
|
|
@@ -2,7 +2,7 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import NonNegativeInt, model_validator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import SurvivalStatus, YNUNA, CauseOfDeath
|
|
7
7
|
|
|
8
8
|
|
|
@@ -15,14 +15,14 @@ class Response(Base):
|
|
|
15
15
|
|
|
16
16
|
# The unique internal identifier for the associated participant
|
|
17
17
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
|
|
18
|
-
participant_id:
|
|
18
|
+
participant_id: str | None = None
|
|
19
19
|
|
|
20
20
|
# The response to a question that describes a participant's survival status.
|
|
21
21
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2847330%20and%20ver_nr=1
|
|
22
22
|
survival_status: SurvivalStatus
|
|
23
23
|
|
|
24
24
|
# Number of days from enrollment date to death date.
|
|
25
|
-
overall_survival: NonNegativeInt
|
|
25
|
+
overall_survival: NonNegativeInt
|
|
26
26
|
|
|
27
27
|
# Indicator for whether there was an abscopal effect on disease after local therapy.
|
|
28
28
|
abscopal_response: YNUNA | None = None
|
|
@@ -43,14 +43,8 @@ class Response(Base):
|
|
|
43
43
|
# Indicates whether participant was evaluable for efficacy (for example, response, PFS, OS, etc.) overall.
|
|
44
44
|
evaluable_for_efficacy: bool
|
|
45
45
|
|
|
46
|
-
# Days from enrollment date to the last time patient
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
@model_validator(mode="after")
|
|
50
|
-
def validate_overall_survival_cr(self) -> Self:
|
|
51
|
-
if self.survival_status != "Unknown" and not self.overall_survival:
|
|
52
|
-
raise ValueError('If survival_status is not "Unknown" then overall_survival is required.')
|
|
53
|
-
return self
|
|
46
|
+
# Days from enrollment date to the last time the patient's vital status was verified.
|
|
47
|
+
days_to_last_vital_status: NonNegativeInt | None = None # TODO: Needs CR check
|
|
54
48
|
|
|
55
49
|
@model_validator(mode="after")
|
|
56
50
|
def validate_cause_of_death_cr(self) -> Self:
|