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
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
from typing import Self, Annotated, List
|
|
2
|
+
|
|
3
|
+
from pydantic import PositiveInt, NonNegativeFloat, PositiveFloat, model_validator, field_validator, BeforeValidator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import (
|
|
7
|
+
Sex,
|
|
8
|
+
Race,
|
|
9
|
+
Ethnicity,
|
|
10
|
+
HeightUnits,
|
|
11
|
+
WeightUnits,
|
|
12
|
+
BodySurfaceAreaUnits,
|
|
13
|
+
Occupation,
|
|
14
|
+
Education,
|
|
15
|
+
AgeAtEnrollmentUnits,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Demographic(Base):
|
|
20
|
+
__data_category__ = "demographic"
|
|
21
|
+
__cardinality__ = "one"
|
|
22
|
+
|
|
23
|
+
# The unique internal identifier for this demographic record
|
|
24
|
+
demographic_id: int | None = None
|
|
25
|
+
|
|
26
|
+
# The unique internal identifier for the associated participant
|
|
27
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
|
|
28
|
+
participant_id: str | None = None
|
|
29
|
+
|
|
30
|
+
# The age of the subject when the subject enrolled in the study.
|
|
31
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15742605%20and%20ver_nr=1
|
|
32
|
+
age_at_enrollment: PositiveInt | None = None
|
|
33
|
+
|
|
34
|
+
# Unit of measurement for the age of the participant. e.g. "Years"
|
|
35
|
+
age_at_enrollment_units: AgeAtEnrollmentUnits | None = None
|
|
36
|
+
|
|
37
|
+
# Indicates whether the participant is 90 years old or over. (for PHI purposes)
|
|
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_over: bool
|
|
40
|
+
|
|
41
|
+
# A textual description of a person's sex at birth. e.g. "Male"
|
|
42
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=7572817%20and%20ver_nr=3
|
|
43
|
+
sex: Sex
|
|
44
|
+
|
|
45
|
+
# The race of the participant. e.g. "White"
|
|
46
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2192199%20and%20ver_nr=1
|
|
47
|
+
race: Annotated[List[Race], BeforeValidator(Base.split_list)]
|
|
48
|
+
|
|
49
|
+
# The ethnicity of the participant. e.g. "Hispanic or Latino"
|
|
50
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2192217%20and%20ver_nr=2
|
|
51
|
+
ethnicity: Ethnicity
|
|
52
|
+
|
|
53
|
+
# The number that describes the vertical distance of the participant at enrollment date.
|
|
54
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2179643%20and%20ver_nr=4
|
|
55
|
+
height: PositiveFloat
|
|
56
|
+
|
|
57
|
+
# Unit of measurement for the height of the participant at the enrollment date. e.g. "in"
|
|
58
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2538920%20and%20ver_nr=1
|
|
59
|
+
height_units: HeightUnits
|
|
60
|
+
|
|
61
|
+
# The mass of the participant's entire body at the enrollment date.
|
|
62
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2179689%20and%20ver_nr=4
|
|
63
|
+
weight: PositiveFloat
|
|
64
|
+
|
|
65
|
+
# Unit of measurement for the weight of the participant at the enrollment date. e.g. "kg"
|
|
66
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2630200%20and%20ver_nr=1
|
|
67
|
+
weight_units: WeightUnits
|
|
68
|
+
|
|
69
|
+
# The body mass index of the participant at the enrollment date.
|
|
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 | None = None
|
|
72
|
+
|
|
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
|
+
# 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 | None = None
|
|
76
|
+
|
|
77
|
+
# Unit of measurement for body surface area of the participant at the enrollment date. e.g. "m2"
|
|
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 | None = None
|
|
80
|
+
|
|
81
|
+
# The occupation/job category of the participant. e.g. "Manager"
|
|
82
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=6617540%20and%20ver_nr=1
|
|
83
|
+
occupation: Occupation | None = None
|
|
84
|
+
|
|
85
|
+
# The amount of earnings in USD made by the participant's family in a year.
|
|
86
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14834966%20and%20ver_nr=1
|
|
87
|
+
income: NonNegativeFloat | None = None
|
|
88
|
+
|
|
89
|
+
# The highest level of education attained by the participant. e.g. "Bachelor's Degree"
|
|
90
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2681552%20and%20ver_nr=1
|
|
91
|
+
highest_level_of_education: Education | None = None
|
|
92
|
+
|
|
93
|
+
@model_validator(mode="after")
|
|
94
|
+
def validate_age_at_enrollment_cr(self) -> Self:
|
|
95
|
+
if self.age_90_or_over:
|
|
96
|
+
if self.age_at_enrollment or self.age_at_enrollment_units:
|
|
97
|
+
raise ValueError(
|
|
98
|
+
'If "age_90_or_over" is "Yes" then "age_at_enrollment" and "age_at_enrollment_units" must be blank.'
|
|
99
|
+
)
|
|
100
|
+
else:
|
|
101
|
+
if not self.age_at_enrollment or not self.age_at_enrollment_units:
|
|
102
|
+
raise ValueError(
|
|
103
|
+
'If "age_90_or_over" is "No" then "age_at_enrollment" and "age_at_enrollment_units" are required.'
|
|
104
|
+
)
|
|
105
|
+
return self
|
|
106
|
+
|
|
107
|
+
@model_validator(mode="after")
|
|
108
|
+
def validate_age_at_enrollment_value(self) -> Self:
|
|
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
|
+
)
|
|
123
|
+
return self
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
from pydantic import NonPositiveInt, model_validator, BeforeValidator
|
|
2
|
+
from typing import List, Self, Annotated, get_args
|
|
3
|
+
|
|
4
|
+
from cidc_api.models.pydantic.base import Base
|
|
5
|
+
from cidc_api.models.types import (
|
|
6
|
+
TumorGrade,
|
|
7
|
+
CancerStageSystem,
|
|
8
|
+
CancerStageSystemVersion,
|
|
9
|
+
CancerStageSystemVersionAJCC,
|
|
10
|
+
CancerStageSystemVersionRISS,
|
|
11
|
+
CancerStageSystemVersionFIGO,
|
|
12
|
+
CancerStage,
|
|
13
|
+
TCategory,
|
|
14
|
+
NCategory,
|
|
15
|
+
MCategory,
|
|
16
|
+
UberonAnatomicalTerm,
|
|
17
|
+
ICDO3MorphologicalCode,
|
|
18
|
+
ICDO3MorphologicalTerm,
|
|
19
|
+
YNU,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Disease(Base):
|
|
24
|
+
__data_category__ = "disease"
|
|
25
|
+
__cardinality__ = "many"
|
|
26
|
+
|
|
27
|
+
# The unique internal identifier for this disease record
|
|
28
|
+
disease_id: int | None = None
|
|
29
|
+
|
|
30
|
+
# The unique internal identifier for the associated participant
|
|
31
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
|
|
32
|
+
participant_id: str | None = None
|
|
33
|
+
|
|
34
|
+
# The location within the body from where the disease of interest originated as captured in the Uberon identifier. e.g. "lung"
|
|
35
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14883047%20and%20ver_nr=1
|
|
36
|
+
primary_disease_site: UberonAnatomicalTerm
|
|
37
|
+
|
|
38
|
+
# The ICD-O-3 morphology code that describes the tumor's histology, behavior, and grade-differentiation. e.g. "8480/6"
|
|
39
|
+
# CDE: TBD
|
|
40
|
+
morphological_code: ICDO3MorphologicalCode | None
|
|
41
|
+
|
|
42
|
+
# The ICD-O-3 morphology term that describes the tumor's type. e.g. "Mucinous adenoma"
|
|
43
|
+
# CDE: TBD
|
|
44
|
+
morphological_term: ICDO3MorphologicalTerm | None
|
|
45
|
+
|
|
46
|
+
# Words that broadly describe the cancer's characteristics and type. e.g. "Inflitrating Ductal Carcinoma"
|
|
47
|
+
# CDE: TBD
|
|
48
|
+
cancer_type_description: str | None = None
|
|
49
|
+
|
|
50
|
+
# The number of days elapsed since the participant was first diagnosed with this condition.
|
|
51
|
+
days_since_original_diagnosis: NonPositiveInt | None
|
|
52
|
+
|
|
53
|
+
# Words that express the degree of abnormality of cancer cells as a measure of differentiation and aggressiveness. e.g. "G1 Low Grade"
|
|
54
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11325685%20and%20ver_nr=2
|
|
55
|
+
tumor_grade: TumorGrade | None = None
|
|
56
|
+
|
|
57
|
+
# The name of the staging system used in the evaluation of the disease. e.g. "AJCC"
|
|
58
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=7429602%20and%20ver_nr=1
|
|
59
|
+
cancer_stage_system: CancerStageSystem
|
|
60
|
+
|
|
61
|
+
# Release version of the staging system used in the evaluation of the disease. e.g. "8" (for AJCC)
|
|
62
|
+
cancer_stage_system_version: CancerStageSystemVersion | None = None
|
|
63
|
+
|
|
64
|
+
# Stage of the cancer at enrollment date as determined by the specific staging system. e.g. "Stage 0" (for AJCC)
|
|
65
|
+
# CDE(AJCC): https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440332%20and%20ver_nr=1
|
|
66
|
+
# CDE(FIGO): TBD
|
|
67
|
+
# CDE(RISS): TBD
|
|
68
|
+
cancer_stage: CancerStage | None = None
|
|
69
|
+
|
|
70
|
+
# Extent of the primary cancer based on evidence obtained from clinical assessment parameters determined prior to treatment. e.g. "T0"
|
|
71
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440328%20and%20ver_nr=1
|
|
72
|
+
# TODO: Verify this CDE
|
|
73
|
+
t_category: TCategory | None = None
|
|
74
|
+
|
|
75
|
+
# Extent of the regional lymph node involvement for the cancer based on evidence obtained from clinical assessment parameters
|
|
76
|
+
# determined prior to treatment. e.g. "N0"
|
|
77
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440330%20and%20ver_nr=1
|
|
78
|
+
# TODO: Verify this CDE
|
|
79
|
+
n_category: NCategory | None = None
|
|
80
|
+
|
|
81
|
+
# Extent of the distant metastasis for the cancer based on evidence obtained from clinical assessment parameters determined
|
|
82
|
+
# prior to treatment. e.g. "M0"
|
|
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
|
|
84
|
+
# TODO: Verify this CDE
|
|
85
|
+
m_category: MCategory | None = None
|
|
86
|
+
|
|
87
|
+
# The organ site where a tumor develops outside of the bone marrow as specified in the Uberon antatomical term.
|
|
88
|
+
metastatic_organ: Annotated[List[UberonAnatomicalTerm] | None, BeforeValidator(Base.split_list)] = []
|
|
89
|
+
|
|
90
|
+
# Indicates if participant has a hematological malignancy that is only extramedullary. e.g. "Yes"
|
|
91
|
+
solely_extramedullary_disease: YNU
|
|
92
|
+
|
|
93
|
+
extramedullary_organ: Annotated[List[UberonAnatomicalTerm] | None, BeforeValidator(Base.split_list)] = []
|
|
94
|
+
|
|
95
|
+
@model_validator(mode="after")
|
|
96
|
+
def validate_code_or_term_or_description_cr(self) -> Self:
|
|
97
|
+
if not self.morphological_code and not self.morphological_term and not self.cancer_type_description:
|
|
98
|
+
raise ValueError(
|
|
99
|
+
'Please provide at least one of "morphological_code", "morphological_term" or "cancer_type_description".'
|
|
100
|
+
)
|
|
101
|
+
return self
|
|
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
|
+
|
|
120
|
+
@model_validator(mode="after")
|
|
121
|
+
def validate_cancer_stage_system_version_cr(self) -> Self:
|
|
122
|
+
if self.cancer_stage_system != "Not Applicable" and not self.cancer_stage_system_version:
|
|
123
|
+
raise ValueError(
|
|
124
|
+
f'Please provide cancer_stage_system_version when cancer_stage_system is "{self.cancer_stage_system}"'
|
|
125
|
+
)
|
|
126
|
+
return self
|
|
127
|
+
|
|
128
|
+
@model_validator(mode="after")
|
|
129
|
+
def validate_cancer_stage_cr(self) -> Self:
|
|
130
|
+
if self.cancer_stage_system != "Not Applicable" and not self.cancer_stage:
|
|
131
|
+
raise ValueError(f'Please provide cancer_stage when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
132
|
+
return self
|
|
133
|
+
|
|
134
|
+
@model_validator(mode="after")
|
|
135
|
+
def validate_t_category_cr(self) -> Self:
|
|
136
|
+
if self.cancer_stage_system == "AJCC" and not self.t_category:
|
|
137
|
+
raise ValueError(f'Please provide t_category when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
138
|
+
return self
|
|
139
|
+
|
|
140
|
+
@model_validator(mode="after")
|
|
141
|
+
def validate_n_category_cr(self) -> Self:
|
|
142
|
+
if self.cancer_stage_system == "AJCC" and not self.n_category:
|
|
143
|
+
raise ValueError(f'Please provide n_category when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
144
|
+
return self
|
|
145
|
+
|
|
146
|
+
@model_validator(mode="after")
|
|
147
|
+
def validate_m_category_cr(self) -> Self:
|
|
148
|
+
if self.cancer_stage_system == "AJCC" and not self.m_category:
|
|
149
|
+
raise ValueError(f'Please provide m_category when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
150
|
+
return self
|
|
151
|
+
|
|
152
|
+
@model_validator(mode="after")
|
|
153
|
+
def validate_extramedullary_organ_cr(self) -> Self:
|
|
154
|
+
if self.solely_extramedullary_disease in ["No", "Unknown"] and self.extramedullary_organ:
|
|
155
|
+
raise ValueError(
|
|
156
|
+
"If solely_extramedullary_disease indicates no disease, please leave extramedullary_organ blank."
|
|
157
|
+
)
|
|
158
|
+
return self
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import YNU, ExposureType
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Exposure(Base):
|
|
10
|
+
__data_category__ = "exposure"
|
|
11
|
+
__cardinality__ = "many"
|
|
12
|
+
|
|
13
|
+
# A unique internal identifier for the exposure
|
|
14
|
+
exposure_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# The unique identifier for the associated participant
|
|
17
|
+
participant_id: str | None = None
|
|
18
|
+
|
|
19
|
+
# An indication of whether the subject was exposed to any chemical, biological or physical agents
|
|
20
|
+
# that increase the risk of neoplasms in humans or animals.
|
|
21
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=5205578%20and%20ver_nr=3
|
|
22
|
+
carcinogen_exposure: YNU
|
|
23
|
+
|
|
24
|
+
# The type of potentially harmful environmental agents to which an individual was exposed.
|
|
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 | None = None
|
|
27
|
+
|
|
28
|
+
@model_validator(mode="after")
|
|
29
|
+
def validate_exposure_type_cr(self) -> Self:
|
|
30
|
+
if self.carcinogen_exposure in ["No", "Unknown"] and self.exposure_type:
|
|
31
|
+
raise ValueError("If carcinogen_exposure indicates non exposure, please leave exposure_type blank.")
|
|
32
|
+
return self
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
|
+
from cidc_api.models.types import (
|
|
3
|
+
GVHDDiagnosisAcuteAssessmentSystem,
|
|
4
|
+
GVHDDiagnosisAcuteAssessmentSystemVersion,
|
|
5
|
+
GVHDDiagnosisAcuteGrade,
|
|
6
|
+
PreOrPostEnrollment,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class GVHDDiagnosisAcute(Base):
|
|
11
|
+
__data_category__ = "gvhd_diagnosis_acute"
|
|
12
|
+
__cardinality__ = "many"
|
|
13
|
+
|
|
14
|
+
# The unique internal identifier for the GVHD Diagnosis Acute Record
|
|
15
|
+
gvhd_diagnosis_acute_id: int | None = None
|
|
16
|
+
|
|
17
|
+
# The unique internal identifier for the associated participant
|
|
18
|
+
participant_id: str | None = None
|
|
19
|
+
|
|
20
|
+
# The clinical grading system used to stage involvement of affected organs (skin, liver, GI tract)
|
|
21
|
+
# in acute GVHD and assign an overall severity grade (I–IV) based on predefined criteria.
|
|
22
|
+
acute_assessment_system: GVHDDiagnosisAcuteAssessmentSystem
|
|
23
|
+
|
|
24
|
+
# Release version of the clinical grading system used in the evaluation of acute GVHD.
|
|
25
|
+
system_version: GVHDDiagnosisAcuteAssessmentSystemVersion
|
|
26
|
+
|
|
27
|
+
# The overall severity grade (I–IV) assigned to a patient with acute GVHD based on the extent of
|
|
28
|
+
# involvement in affected organs (skin, liver, and GI tract), determined using a standardized
|
|
29
|
+
# assessment system.
|
|
30
|
+
acute_grade: GVHDDiagnosisAcuteGrade
|
|
31
|
+
|
|
32
|
+
# Indicator for whether the acute GVHD diagnosis was made before or after trial enrollment.
|
|
33
|
+
pre_or_post_enrollment: PreOrPostEnrollment
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
|
+
from cidc_api.models.types import (
|
|
3
|
+
GVHDDiagnosisChronicAssessmentSystem,
|
|
4
|
+
GVHDDiagnosisChronicAssessmentSystemVersion,
|
|
5
|
+
GVHDDiagnosisChronicGlobalSeverity,
|
|
6
|
+
PreOrPostEnrollment,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class GVHDDiagnosisChronic(Base):
|
|
11
|
+
__data_category__ = "gvhd_diagnosis_chronic"
|
|
12
|
+
__cardinality__ = "many"
|
|
13
|
+
|
|
14
|
+
# The unique internal identifier for the GVHD chronic diagnosis
|
|
15
|
+
gvhd_diagnosis_chronic_id: int | None = None
|
|
16
|
+
|
|
17
|
+
# The unique internal identifier for the associated participant
|
|
18
|
+
participant_id: str | None = None
|
|
19
|
+
|
|
20
|
+
# The standardized clinical system used to evaluate and grade the extent and severity
|
|
21
|
+
# of organ involvement in chronic GVHD, resulting in an overall disease severity score.
|
|
22
|
+
chronic_assessment_system: GVHDDiagnosisChronicAssessmentSystem
|
|
23
|
+
|
|
24
|
+
# Release version of the clinical grading system used in the evaluation of chronic GVHD.
|
|
25
|
+
system_version: GVHDDiagnosisChronicAssessmentSystemVersion
|
|
26
|
+
|
|
27
|
+
# An overall score reflecting the combined severity of chronic graft-versus-host disease
|
|
28
|
+
# across all affected organs, summarizing the participant’s total disease burden.
|
|
29
|
+
chronic_global_severity: GVHDDiagnosisChronicGlobalSeverity
|
|
30
|
+
|
|
31
|
+
# Indicator for whether the chronic GVHD diagnosis was made before or after trial enrollment.
|
|
32
|
+
pre_or_post_enrollment: PreOrPostEnrollment
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
|
+
from cidc_api.models.types import (
|
|
3
|
+
GVHDOrgan,
|
|
4
|
+
GVHDOrganAcuteStage,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class GVHDOrganAcute(Base):
|
|
9
|
+
__data_category__ = "gvhd_organ_acute"
|
|
10
|
+
__cardinality__ = "many"
|
|
11
|
+
|
|
12
|
+
# The unique internal identifier for the GVHD Organ Acute Record
|
|
13
|
+
gvhd_organ_acute_id: int | None = None
|
|
14
|
+
|
|
15
|
+
# The unique internal identifier for the associated GVHD Diagnosis Acute record
|
|
16
|
+
gvhd_diagnosis_acute_id: int | None = None
|
|
17
|
+
|
|
18
|
+
# An organ affected by acute GVHD for which the stage is assessed as part of the overall acute GVHD evaluation.
|
|
19
|
+
organ: GVHDOrgan
|
|
20
|
+
|
|
21
|
+
# The severity level of an individual organ’s involvement in acute GVHD, usually scored from 0 (none) to 4 (severe).
|
|
22
|
+
acute_stage: GVHDOrganAcuteStage
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
|
+
from cidc_api.models.types import (
|
|
3
|
+
GVHDOrgan,
|
|
4
|
+
GVHDOrganChronicScore,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class GVHDOrganChronic(Base):
|
|
9
|
+
__data_category__ = "gvhd_organ_chronic"
|
|
10
|
+
__cardinality__ = "many"
|
|
11
|
+
|
|
12
|
+
# The unique internal identifier for the GVHD Organ Chronic Record
|
|
13
|
+
gvhd_organ_chronic_id: int | None = None
|
|
14
|
+
|
|
15
|
+
# The unique internal identifier for the associated GVHD Diagnosis Chronic record
|
|
16
|
+
gvhd_diagnosis_chronic_id: int | None = None
|
|
17
|
+
|
|
18
|
+
# An organ affected by chronic GVHD identified by its Uberon ontology ID
|
|
19
|
+
# and evaluated for severity as part of the overall chronic GVHD assessment.
|
|
20
|
+
organ: GVHDOrgan
|
|
21
|
+
|
|
22
|
+
# The severity score for an individual organ affected by chronic GVHD based on clinical criteria.
|
|
23
|
+
chronic_score: GVHDOrganChronicScore
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import NonNegativeInt, PositiveFloat, model_validator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import TobaccoSmokingStatus
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class MedicalHistory(Base):
|
|
10
|
+
__data_category__ = "medical_history"
|
|
11
|
+
__cardinality__ = "one"
|
|
12
|
+
|
|
13
|
+
# A unique internal identifier for the medical history
|
|
14
|
+
medical_history_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# The unique identifier for the associated participant
|
|
17
|
+
participant_id: str | None = None
|
|
18
|
+
|
|
19
|
+
# Text representation of a person's status relative to smoking tobacco in the form of cigarettes,
|
|
20
|
+
# based on questions about current and former use of cigarettes.
|
|
21
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16333929%20and%20ver_nr=1
|
|
22
|
+
tobacco_smoking_status: TobaccoSmokingStatus | None = None
|
|
23
|
+
|
|
24
|
+
# Average number of packs of cigarettes smoked per day multiplied by number of years the participant has smoked.
|
|
25
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=6841869%20and%20ver_nr=1
|
|
26
|
+
pack_years_smoked: PositiveFloat | None = None
|
|
27
|
+
|
|
28
|
+
# Number of prior systemic therapies.
|
|
29
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16089302%20and%20ver_nr=1
|
|
30
|
+
num_prior_systemic_therapies: NonNegativeInt | None = None
|
|
31
|
+
|
|
32
|
+
@model_validator(mode="after")
|
|
33
|
+
def validate_pack_years_smoked_cr(self) -> Self:
|
|
34
|
+
if self.tobacco_smoking_status in ["Never Smoker", "Unknown", "Not reported"] and self.pack_years_smoked:
|
|
35
|
+
raise ValueError("If tobacco_smoking_status indicates non-smoker, please leave pack_years_smoked blank.")
|
|
36
|
+
return self
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import NonPositiveInt, model_validator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import UberonAnatomicalTerm, ICDO3MorphologicalCode, ICDO3MorphologicalTerm, MalignancyStatus
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class OtherMalignancy(Base):
|
|
10
|
+
__data_category__ = "other_malignancy"
|
|
11
|
+
__cardinality__ = "many"
|
|
12
|
+
|
|
13
|
+
# The unique internal identifier for the OtherMalignancy record
|
|
14
|
+
other_malignancy_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# The unique internal identifier for the associated MedicalHistory record
|
|
17
|
+
medical_history_id: int | None = None
|
|
18
|
+
|
|
19
|
+
# The location within the body from where the prior malignancy originated as captured in the Uberon anatomical term.
|
|
20
|
+
other_malignancy_primary_disease_site: UberonAnatomicalTerm
|
|
21
|
+
|
|
22
|
+
# The ICD-O-3 code which identifies the specific appearance of cells and tissues (normal and abnormal) used
|
|
23
|
+
# to define the presence and nature of disease.
|
|
24
|
+
other_malignancy_morphological_code: ICDO3MorphologicalCode | None = None
|
|
25
|
+
|
|
26
|
+
# The ICD-O-3 textual label which identifies the specific appearance of cells and tissues (normal and abnormal) used
|
|
27
|
+
# to define the presence and nature of disease.
|
|
28
|
+
other_malignancy_morphological_term: ICDO3MorphologicalTerm | None = None
|
|
29
|
+
|
|
30
|
+
# Description of the cancer type as recorded in the trial.
|
|
31
|
+
other_malignancy_description: str | None = None
|
|
32
|
+
|
|
33
|
+
# Number of days since original diagnosis from the enrollment date. This may be a negative number.
|
|
34
|
+
other_malignancy_days_since_diagnosis: NonPositiveInt | None = None
|
|
35
|
+
|
|
36
|
+
# Indicates the participant’s current clinical state regarding the cancer diagnosis.
|
|
37
|
+
other_malignancy_status: MalignancyStatus | None = None
|
|
38
|
+
|
|
39
|
+
@model_validator(mode="after")
|
|
40
|
+
def validate_code_or_term_or_description_cr(self) -> Self:
|
|
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
|
+
):
|
|
46
|
+
raise ValueError(
|
|
47
|
+
'Please provide at least one of "morphological_code", "morphological_term" or "malignancy_description".'
|
|
48
|
+
)
|
|
49
|
+
return self
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import YNU
|
|
7
|
+
from cidc_api.models.types import OffStudyReason
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Participant(Base):
|
|
11
|
+
__data_category__ = "participant"
|
|
12
|
+
__cardinality__ = "one"
|
|
13
|
+
|
|
14
|
+
# The unique internal identifier for the participant
|
|
15
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
|
|
16
|
+
participant_id: str | None = None
|
|
17
|
+
|
|
18
|
+
# The participant identifier assigned by the clinical trial team overseeing the study
|
|
19
|
+
native_participant_id: str | None = None
|
|
20
|
+
|
|
21
|
+
# The globally unique participant identifier assigned by the CIMAC network. e.g. C8P29A7
|
|
22
|
+
cimac_participant_id: str | None = None
|
|
23
|
+
|
|
24
|
+
# The unique identifier for the associated trial that the participant is participating in
|
|
25
|
+
trial_id: str | None = None
|
|
26
|
+
|
|
27
|
+
# The version number of the trial dataset. e.g. "1.0"
|
|
28
|
+
version: str | None = None
|
|
29
|
+
|
|
30
|
+
# Indicates if the individual is no longer actively participating in the clinical trial.
|
|
31
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14834973%20and%20ver_nr=1
|
|
32
|
+
off_study: YNU
|
|
33
|
+
|
|
34
|
+
# An explanation describing why an individual is no longer participating in the clinical trial.
|
|
35
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13362265%20and%20ver_nr=1
|
|
36
|
+
off_study_reason: OffStudyReason | None = None
|
|
37
|
+
|
|
38
|
+
# Additional information if "Other" is selected for off_study_reason. e.g. "Transfer to another study"
|
|
39
|
+
off_study_reason_other: str | None = None
|
|
40
|
+
|
|
41
|
+
@model_validator(mode="after")
|
|
42
|
+
def off_study_reason_cr(self) -> Self:
|
|
43
|
+
if self.off_study == "Yes" and not self.off_study_reason:
|
|
44
|
+
raise ValueError('If "off_study" is "Yes" then "off_study_reason" is required.')
|
|
45
|
+
return self
|
|
46
|
+
|
|
47
|
+
@model_validator(mode="after")
|
|
48
|
+
def off_study_reason_other_cr(self) -> Self:
|
|
49
|
+
if self.off_study_reason == "Other" and not self.off_study_reason_other:
|
|
50
|
+
raise ValueError('If "off_study_reason" is "Other" then "off_study_reason_other" is required.')
|
|
51
|
+
return self
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from typing import Self, Annotated, List
|
|
2
|
+
|
|
3
|
+
from pydantic import NonPositiveInt, NegativeInt, model_validator, BeforeValidator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import ConditioningRegimenType, StemCellDonorType
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PriorTreatment(Base):
|
|
10
|
+
__data_category__ = "prior_treatment"
|
|
11
|
+
__cardinality__ = "many"
|
|
12
|
+
|
|
13
|
+
# A unique internal identifier for the prior treatment record
|
|
14
|
+
prior_treatment_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# A unique internal identifier for the associated participant record
|
|
17
|
+
participant_id: str | None = None
|
|
18
|
+
|
|
19
|
+
# Number of days from the enrollment date to the first recorded administration or occurrence of
|
|
20
|
+
# the treatment modality.
|
|
21
|
+
prior_treatment_days_to_start: NonPositiveInt | None = None
|
|
22
|
+
|
|
23
|
+
# Number of days from the enrollment date to the last recorded administration or occurrence of
|
|
24
|
+
# the treatment modality.
|
|
25
|
+
prior_treatment_days_to_end: NonPositiveInt | None = None
|
|
26
|
+
|
|
27
|
+
# Specifies the category or kind of prior treatment modality a participant received.
|
|
28
|
+
|
|
29
|
+
# Description of the prior treatment such as its full generic name if it is a type of therapy agent,
|
|
30
|
+
# radiotherapy procedure name and location, or surgical procedure name and location.
|
|
31
|
+
prior_treatment_description: str
|
|
32
|
+
|
|
33
|
+
# Best response from any response assessment system to the prior treatment if available or applicable.
|
|
34
|
+
prior_treatment_best_response: str | None = None
|
|
35
|
+
|
|
36
|
+
# If the prior treatment is "Conditioning therapy" received before a stem cell transplant, specifies what
|
|
37
|
+
# type of conditioning regimen used.
|
|
38
|
+
prior_treatment_conditioning_regimen_type: ConditioningRegimenType | None = None
|
|
39
|
+
|
|
40
|
+
# If prior treatment is "Stem cell transplant", indicates what stem cell donor type used.
|
|
41
|
+
prior_treatment_stem_cell_donor_type: StemCellDonorType | None = None
|
|
42
|
+
|
|
43
|
+
# If prior treatment is "Stem cell transplant", indicates the number of days from enrollment
|
|
44
|
+
# to the prior transplant. This must be a negative number.
|
|
45
|
+
prior_treatment_days_from_transplant_to_treatment_initiation: NegativeInt | None = None
|