nci-cidc-api-modules 1.2.16__py3-none-any.whl → 1.2.25__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/config/db.py +1 -3
- cidc_api/models/__init__.py +2 -0
- cidc_api/models/data.py +15 -0
- cidc_api/models/db/base_orm.py +25 -0
- cidc_api/models/db/stage2/__init__.py +78 -0
- cidc_api/models/db/stage2/additional_treatment_orm.py +22 -0
- cidc_api/models/db/stage2/administrative_person_orm.py +25 -0
- cidc_api/models/db/stage2/administrative_role_assignment_orm.py +28 -0
- cidc_api/models/db/stage2/adverse_event_orm.py +47 -0
- cidc_api/models/db/stage2/arm_orm.py +23 -0
- cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +23 -0
- cidc_api/models/db/stage2/cohort_orm.py +23 -0
- cidc_api/models/db/stage2/comorbidity_orm.py +24 -0
- cidc_api/models/db/stage2/consent_group_orm.py +31 -0
- cidc_api/models/db/stage2/contact_orm.py +32 -0
- cidc_api/models/db/stage2/demographic_orm.py +44 -0
- cidc_api/models/db/stage2/disease_orm.py +53 -0
- cidc_api/models/db/stage2/exposure_orm.py +21 -0
- cidc_api/models/db/stage2/file_orm.py +38 -0
- cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +33 -0
- cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +37 -0
- cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +20 -0
- cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +20 -0
- cidc_api/models/db/stage2/institution_orm.py +33 -0
- cidc_api/models/db/stage2/medical_history_orm.py +29 -0
- cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +28 -0
- cidc_api/models/db/stage2/other_malignancy_orm.py +30 -0
- cidc_api/models/db/stage2/participant_orm.py +79 -0
- cidc_api/models/db/stage2/prior_treatment_orm.py +28 -0
- cidc_api/models/db/stage2/publication_orm.py +31 -0
- cidc_api/models/db/stage2/radiotherapy_dose_orm.py +39 -0
- cidc_api/models/db/stage2/response_by_system_orm.py +28 -0
- cidc_api/models/db/stage2/response_orm.py +27 -0
- cidc_api/models/db/stage2/shipment_orm.py +47 -0
- cidc_api/models/db/stage2/shipment_specimen_orm.py +24 -0
- cidc_api/models/db/stage2/specimen_orm.py +100 -0
- cidc_api/models/db/stage2/stem_cell_transplant_orm.py +25 -0
- cidc_api/models/db/stage2/surgery_orm.py +27 -0
- cidc_api/models/db/stage2/therapy_agent_dose_orm.py +31 -0
- cidc_api/models/db/stage2/treatment_orm.py +39 -0
- cidc_api/models/db/stage2/trial_orm.py +60 -0
- cidc_api/models/files/facets.py +5 -0
- cidc_api/models/migrations.py +12 -39
- cidc_api/models/models.py +65 -14
- cidc_api/models/pydantic/stage2/__init__.py +78 -0
- cidc_api/models/pydantic/stage2/additional_treatment.py +23 -0
- cidc_api/models/pydantic/stage2/administrative_person.py +30 -0
- cidc_api/models/pydantic/stage2/administrative_role_assignment.py +16 -0
- cidc_api/models/pydantic/stage2/adverse_event.py +100 -0
- cidc_api/models/pydantic/stage2/arm.py +16 -0
- cidc_api/models/pydantic/stage2/base.py +30 -0
- cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +23 -0
- cidc_api/models/pydantic/stage2/cohort.py +16 -0
- cidc_api/models/pydantic/stage2/comorbidity.py +36 -0
- cidc_api/models/pydantic/stage2/consent_group.py +30 -0
- cidc_api/models/pydantic/stage2/contact.py +35 -0
- cidc_api/models/pydantic/stage2/demographic.py +114 -0
- cidc_api/models/pydantic/stage2/disease.py +144 -0
- cidc_api/models/pydantic/stage2/exposure.py +32 -0
- cidc_api/models/pydantic/stage2/file.py +44 -0
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +33 -0
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +32 -0
- cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +22 -0
- cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +23 -0
- cidc_api/models/pydantic/stage2/institution.py +10 -0
- cidc_api/models/pydantic/stage2/medical_history.py +36 -0
- cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +32 -0
- cidc_api/models/pydantic/stage2/other_malignancy.py +45 -0
- cidc_api/models/pydantic/stage2/participant.py +47 -0
- cidc_api/models/pydantic/stage2/prior_treatment.py +52 -0
- cidc_api/models/pydantic/stage2/publication.py +37 -0
- cidc_api/models/pydantic/stage2/radiotherapy_dose.py +79 -0
- cidc_api/models/pydantic/stage2/response.py +71 -0
- cidc_api/models/pydantic/stage2/response_by_system.py +109 -0
- cidc_api/models/pydantic/stage2/shipment.py +48 -0
- cidc_api/models/pydantic/stage2/shipment_specimen.py +15 -0
- cidc_api/models/pydantic/stage2/specimen.py +211 -0
- cidc_api/models/pydantic/stage2/stem_cell_transplant.py +35 -0
- cidc_api/models/pydantic/stage2/surgery.py +49 -0
- cidc_api/models/pydantic/stage2/therapy_agent_dose.py +67 -0
- cidc_api/models/pydantic/stage2/treatment.py +50 -0
- cidc_api/models/pydantic/stage2/trial.py +85 -0
- cidc_api/models/types.py +1439 -0
- cidc_api/shared/file_handling.py +37 -2
- cidc_api/shared/utils.py +4 -1
- {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/METADATA +6 -4
- nci_cidc_api_modules-1.2.25.dist-info/RECORD +104 -0
- nci_cidc_api_modules-1.2.16.dist-info/RECORD +0 -26
- {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/WHEEL +0 -0
- {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/licenses/LICENSE +0 -0
- {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from pydantic import BaseModel, ConfigDict
|
|
2
|
+
from contextlib import contextmanager
|
|
3
|
+
|
|
4
|
+
import copy
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Base(BaseModel):
|
|
8
|
+
|
|
9
|
+
model_config = ConfigDict(validate_assignment=True, from_attributes=True)
|
|
10
|
+
|
|
11
|
+
# Validates the new state and updates the object if valid
|
|
12
|
+
def update(self, **kwargs):
|
|
13
|
+
self.model_validate(self.__dict__ | kwargs)
|
|
14
|
+
self.__dict__.update(kwargs)
|
|
15
|
+
|
|
16
|
+
# CM that delays validation until all fields are applied.
|
|
17
|
+
# If validation fails the original fields are restored and the ValidationError is raised.
|
|
18
|
+
@contextmanager
|
|
19
|
+
def delay_validation(self):
|
|
20
|
+
original_dict = copy.deepcopy(self.__dict__)
|
|
21
|
+
self.model_config["validate_assignment"] = False
|
|
22
|
+
try:
|
|
23
|
+
yield
|
|
24
|
+
finally:
|
|
25
|
+
self.model_config["validate_assignment"] = True
|
|
26
|
+
try:
|
|
27
|
+
self.model_validate(self.__dict__)
|
|
28
|
+
except:
|
|
29
|
+
self.__dict__.update(original_dict)
|
|
30
|
+
raise
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .base import Base
|
|
2
|
+
from cidc_api.models.types import ECOGScore, KarnofskyScore
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class BaselineClinicalAssessment(Base):
|
|
6
|
+
__data_category__ = "baseline_clinical_assessment"
|
|
7
|
+
__cardinality__ = "one"
|
|
8
|
+
|
|
9
|
+
# A unique internal identifier for the baseline clinical assessment
|
|
10
|
+
baseline_clinical_assessment_id: int | None = None
|
|
11
|
+
|
|
12
|
+
# The unique identifier for the associated participant
|
|
13
|
+
participant_id: int | None = None
|
|
14
|
+
|
|
15
|
+
# The numerical score that represents the functional capabilities of a participant at the
|
|
16
|
+
# enrollment date using the Eastern Cooperative Oncology Group Performance Status assessment.
|
|
17
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=88%20and%20ver_nr=5.1
|
|
18
|
+
ecog_score: ECOGScore | None = None
|
|
19
|
+
|
|
20
|
+
# Score from the Karnofsky Performance status scale, representing the functional capabilities of a participant
|
|
21
|
+
# at the enrollment date.
|
|
22
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2003853%20and%20ver_nr=4.2
|
|
23
|
+
karnofsky_score: KarnofskyScore | None = None
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from .base import Base
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Cohort(Base):
|
|
5
|
+
# A unique internal identifier for the cohort
|
|
6
|
+
cohort_id: int | None = None
|
|
7
|
+
|
|
8
|
+
# The unique identifier for the associated trial
|
|
9
|
+
trial_id: str | None = None
|
|
10
|
+
|
|
11
|
+
# The version number of the trial dataset
|
|
12
|
+
version: str | None = None
|
|
13
|
+
|
|
14
|
+
# The name of the cohort, e.g. "Cohort A"
|
|
15
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=7979585%20and%20ver_nr=1
|
|
16
|
+
name: str
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
|
|
5
|
+
from .base import Base
|
|
6
|
+
from cidc_api.models.types import ICD10CMCode, ICD10CMTerm
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Comorbidity(Base):
|
|
10
|
+
__data_category__ = "comorbidity"
|
|
11
|
+
__cardinality__ = "many"
|
|
12
|
+
|
|
13
|
+
# The unique internal identifier for the comorbidity record
|
|
14
|
+
comorbidity_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 diagnosis, in humans, as captured in the tenth version of the
|
|
20
|
+
# International Classification of Disease (ICD-10-CM, the disease code subset of ICD-10).
|
|
21
|
+
comorbidity_code: ICD10CMCode | None = None
|
|
22
|
+
|
|
23
|
+
# The words from the tenth version of the International Classification of Disease (ICD-10-CM,
|
|
24
|
+
# the disease subset of ICD-10) used to identify the diagnosis in humans.
|
|
25
|
+
comorbidity_term: ICD10CMTerm | None = None
|
|
26
|
+
|
|
27
|
+
# A descriptive string that names or briefly describes the comorbidity.
|
|
28
|
+
comorbidity_other: str | None = None
|
|
29
|
+
|
|
30
|
+
@model_validator(mode="after")
|
|
31
|
+
def validate_code_or_term_or_other_cr(self) -> Self:
|
|
32
|
+
if not self.comorbidity_code and not self.comorbidity_term and not self.comorbidity_other:
|
|
33
|
+
raise ValueError(
|
|
34
|
+
'Please provide at least one of "comorbidity_code", "comorbidity_term" or "comorbidity_other".'
|
|
35
|
+
)
|
|
36
|
+
return self
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from pydantic import NonNegativeInt
|
|
2
|
+
|
|
3
|
+
from .base import Base
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ConsentGroup(Base):
|
|
7
|
+
__data_category__ = "consent_group"
|
|
8
|
+
__cardinality__ = "one"
|
|
9
|
+
|
|
10
|
+
# The unique internal identifier for the consent group record
|
|
11
|
+
consent_group_id: int | None = None
|
|
12
|
+
|
|
13
|
+
# The unique internal identifier for the associated Trial record
|
|
14
|
+
trial_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# The version number of the trial dataset
|
|
17
|
+
version: str | None = None
|
|
18
|
+
|
|
19
|
+
# An abbreviated name for the consent group
|
|
20
|
+
consent_group_short_name: str
|
|
21
|
+
|
|
22
|
+
# The words or acronym which describe a set of study participants
|
|
23
|
+
# who have signed the same consent agreement and that will be included in the dbGaP repository.
|
|
24
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14534329%20and%20ver_nr=1.00
|
|
25
|
+
consent_group_name: str
|
|
26
|
+
|
|
27
|
+
# A numeral or string of numerals used to identify the set of study participants who have signed the same consent
|
|
28
|
+
# agreement and that will be included in the dbGaP repository.
|
|
29
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14534330%20and%20ver_nr=1.00
|
|
30
|
+
consent_group_number: NonNegativeInt
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from .base import Base
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Contact(Base):
|
|
5
|
+
contact_id: int | None = None
|
|
6
|
+
institution_id: int | None = None
|
|
7
|
+
shipment_from_id: int | None = None
|
|
8
|
+
shipment_to_id: int | None = None
|
|
9
|
+
|
|
10
|
+
# The name of the contact
|
|
11
|
+
name: str | None = None
|
|
12
|
+
|
|
13
|
+
# The email address of the contact
|
|
14
|
+
email: str | None = None
|
|
15
|
+
|
|
16
|
+
# The phone number of the contact
|
|
17
|
+
phone: str | None = None
|
|
18
|
+
|
|
19
|
+
# Line 1 of the street address of the contact
|
|
20
|
+
street1: str | None = None
|
|
21
|
+
|
|
22
|
+
# Line 2 of the street address of the contact
|
|
23
|
+
street2: str | None = None
|
|
24
|
+
|
|
25
|
+
# The city where the contact is located
|
|
26
|
+
city: str | None = None
|
|
27
|
+
|
|
28
|
+
# The state where the contact is located
|
|
29
|
+
state: str | None = None
|
|
30
|
+
|
|
31
|
+
# The zip code where the contact is located
|
|
32
|
+
zip: str | None = None
|
|
33
|
+
|
|
34
|
+
# The country where the contact is located
|
|
35
|
+
country: str | None = None
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import PositiveInt, NonNegativeFloat, PositiveFloat, model_validator, field_validator
|
|
4
|
+
|
|
5
|
+
from .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: int | 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 older. (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_older: 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: Race
|
|
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
|
|
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
|
|
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
|
|
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_older:
|
|
96
|
+
if self.age_at_enrollment or self.age_at_enrollment_units:
|
|
97
|
+
raise ValueError(
|
|
98
|
+
'If "age_90_or_older" 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_older" 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
|
+
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.')
|
|
114
|
+
return self
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
from pydantic import NonPositiveInt, model_validator
|
|
2
|
+
from typing import List, Self
|
|
3
|
+
|
|
4
|
+
from .base import Base
|
|
5
|
+
from cidc_api.models.types import (
|
|
6
|
+
PrimaryDiagnosisDiseaseGroup,
|
|
7
|
+
TumorGrade,
|
|
8
|
+
CancerStageSystem,
|
|
9
|
+
CancerStageSystemVersion,
|
|
10
|
+
CancerStage,
|
|
11
|
+
TCategory,
|
|
12
|
+
NCategory,
|
|
13
|
+
MCategory,
|
|
14
|
+
UberonAnatomicalTerm,
|
|
15
|
+
ICDO3MorphologicalCode,
|
|
16
|
+
ICDO3MorphologicalTerm,
|
|
17
|
+
YNU,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Disease(Base):
|
|
22
|
+
__data_category__ = "disease"
|
|
23
|
+
__cardinality__ = "many"
|
|
24
|
+
|
|
25
|
+
# The unique internal identifier for this disease record
|
|
26
|
+
disease_id: int | None = None
|
|
27
|
+
|
|
28
|
+
# The unique internal identifier for the associated participant
|
|
29
|
+
# 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
|
|
36
|
+
|
|
37
|
+
# The location within the body from where the disease of interest originated as captured in the Uberon identifier. e.g. "lung"
|
|
38
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14883047%20and%20ver_nr=1
|
|
39
|
+
primary_disease_site: UberonAnatomicalTerm
|
|
40
|
+
|
|
41
|
+
# The ICD-O-3 morphology code that describes the tumor's histology, behavior, and grade-differentiation. e.g. "8480/6"
|
|
42
|
+
# CDE: TBD
|
|
43
|
+
morphological_code: ICDO3MorphologicalCode
|
|
44
|
+
|
|
45
|
+
# The ICD-O-3 morphology term that describes the tumor's type. e.g. "Mucinous adenoma"
|
|
46
|
+
# CDE: TBD
|
|
47
|
+
morphological_term: ICDO3MorphologicalTerm
|
|
48
|
+
|
|
49
|
+
# Words that broadly describe the cancer's characteristics and type. e.g. "Inflitrating Ductal Carcinoma"
|
|
50
|
+
# CDE: TBD
|
|
51
|
+
cancer_type_description: str | None = None
|
|
52
|
+
|
|
53
|
+
# The number of days elapsed since the participant was first diagnosed with this condition.
|
|
54
|
+
days_since_original_diagnosis: NonPositiveInt
|
|
55
|
+
|
|
56
|
+
# Words that express the degree of abnormality of cancer cells as a measure of differentiation and aggressiveness. e.g. "G1 Low Grade"
|
|
57
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11325685%20and%20ver_nr=2
|
|
58
|
+
tumor_grade: TumorGrade | None = None
|
|
59
|
+
|
|
60
|
+
# The name of the staging system used in the evaluation of the disease. e.g. "AJCC"
|
|
61
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=7429602%20and%20ver_nr=1
|
|
62
|
+
cancer_stage_system: CancerStageSystem
|
|
63
|
+
|
|
64
|
+
# Release version of the staging system used in the evaluation of the disease. e.g. "8" (for AJCC)
|
|
65
|
+
cancer_stage_system_version: CancerStageSystemVersion | None = None
|
|
66
|
+
|
|
67
|
+
# Stage of the cancer at enrollment date as determined by the specific staging system. e.g. "Stage 0" (for AJCC)
|
|
68
|
+
# CDE(AJCC): https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440332%20and%20ver_nr=1
|
|
69
|
+
# CDE(FIGO): TBD
|
|
70
|
+
# CDE(RISS): TBD
|
|
71
|
+
cancer_stage: CancerStage
|
|
72
|
+
|
|
73
|
+
# Extent of the primary cancer based on evidence obtained from clinical assessment parameters determined prior to treatment. e.g. "T0"
|
|
74
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440328%20and%20ver_nr=1
|
|
75
|
+
# TODO: Verify this CDE
|
|
76
|
+
t_category: TCategory
|
|
77
|
+
|
|
78
|
+
# Extent of the regional lymph node involvement for the cancer based on evidence obtained from clinical assessment parameters
|
|
79
|
+
# determined prior to treatment. e.g. "N0"
|
|
80
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440330%20and%20ver_nr=1
|
|
81
|
+
# TODO: Verify this CDE
|
|
82
|
+
n_category: NCategory
|
|
83
|
+
|
|
84
|
+
# Extent of the distant metastasis for the cancer based on evidence obtained from clinical assessment parameters determined
|
|
85
|
+
# prior to treatment. e.g. "M0"
|
|
86
|
+
# 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
|
+
# TODO: Verify this CDE
|
|
88
|
+
m_category: MCategory
|
|
89
|
+
|
|
90
|
+
# The organ site where a tumor develops outside of the bone marrow as specified in the Uberon antatomical term.
|
|
91
|
+
metastatic_organ: List[UberonAnatomicalTerm] = []
|
|
92
|
+
|
|
93
|
+
# Indicates if participant has a hematological malignancy that is only extramedullary. e.g. "Yes"
|
|
94
|
+
solely_extramedullary_disease: YNU
|
|
95
|
+
|
|
96
|
+
extramedullary_organ: List[UberonAnatomicalTerm] = []
|
|
97
|
+
|
|
98
|
+
@model_validator(mode="after")
|
|
99
|
+
def validate_code_or_term_or_description_cr(self) -> Self:
|
|
100
|
+
if not self.morphological_code and not self.morphological_term and not self.cancer_type_description:
|
|
101
|
+
raise ValueError(
|
|
102
|
+
'Please provide at least one of "morphological_code", "morphological_term" or "cancer_type_description".'
|
|
103
|
+
)
|
|
104
|
+
return self
|
|
105
|
+
|
|
106
|
+
@model_validator(mode="after")
|
|
107
|
+
def validate_cancer_stage_system_version_cr(self) -> Self:
|
|
108
|
+
if self.cancer_stage_system != "Not Applicable" and not self.cancer_stage_system_version:
|
|
109
|
+
raise ValueError(
|
|
110
|
+
f'Please provide cancer_stage_system_version when cancer_stage_system is "{self.cancer_stage_system}"'
|
|
111
|
+
)
|
|
112
|
+
return self
|
|
113
|
+
|
|
114
|
+
@model_validator(mode="after")
|
|
115
|
+
def validate_cancer_stage_cr(self) -> Self:
|
|
116
|
+
if self.cancer_stage_system != "Not Applicable" and not self.cancer_stage:
|
|
117
|
+
raise ValueError(f'Please provide cancer_stage when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
118
|
+
return self
|
|
119
|
+
|
|
120
|
+
@model_validator(mode="after")
|
|
121
|
+
def validate_t_category_cr(self) -> Self:
|
|
122
|
+
if self.cancer_stage_system == "AJCC" and not self.t_category:
|
|
123
|
+
raise ValueError(f'Please provide t_category when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
124
|
+
return self
|
|
125
|
+
|
|
126
|
+
@model_validator(mode="after")
|
|
127
|
+
def validate_n_category_cr(self) -> Self:
|
|
128
|
+
if self.cancer_stage_system == "AJCC" and not self.n_category:
|
|
129
|
+
raise ValueError(f'Please provide n_category when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
130
|
+
return self
|
|
131
|
+
|
|
132
|
+
@model_validator(mode="after")
|
|
133
|
+
def validate_m_category_cr(self) -> Self:
|
|
134
|
+
if self.cancer_stage_system == "AJCC" and not self.m_category:
|
|
135
|
+
raise ValueError(f'Please provide m_category when cancer_stage_system is "{self.cancer_stage_system}"')
|
|
136
|
+
return self
|
|
137
|
+
|
|
138
|
+
@model_validator(mode="after")
|
|
139
|
+
def validate_extramedullary_organ_cr(self) -> Self:
|
|
140
|
+
if self.solely_extramedullary_disease in ["No", "Unknown"] and self.extramedullary_organ:
|
|
141
|
+
raise ValueError(
|
|
142
|
+
"If solely_extramedullary_disease indicates no disease, please leave extramedullary_organ blank."
|
|
143
|
+
)
|
|
144
|
+
return self
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import model_validator
|
|
4
|
+
|
|
5
|
+
from .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: int | 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
|
|
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,44 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from .base import Base
|
|
3
|
+
from cidc_api.models.types import ChecksumType, FileFormat
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class File(Base):
|
|
7
|
+
# The unique internal identifier for this File record
|
|
8
|
+
file_id: int | None = None
|
|
9
|
+
|
|
10
|
+
# The unique identifier for the associated trial
|
|
11
|
+
trial_id: int | None = None
|
|
12
|
+
|
|
13
|
+
# The version number of the trial dataset
|
|
14
|
+
version: str | None = None
|
|
15
|
+
|
|
16
|
+
# The unique internal identifier of the institution that created this file
|
|
17
|
+
creator_id: int | None = None
|
|
18
|
+
|
|
19
|
+
# A description of the file's purpose and contents
|
|
20
|
+
description: str | None = None
|
|
21
|
+
|
|
22
|
+
# A unique UUID to identify the file across systems
|
|
23
|
+
uuid: str
|
|
24
|
+
|
|
25
|
+
# The name of the file
|
|
26
|
+
file_name: str
|
|
27
|
+
|
|
28
|
+
# The url of the file object as found in cloud storage, a bucket, external system, etc.
|
|
29
|
+
object_url: str
|
|
30
|
+
|
|
31
|
+
# The timestamp of when CIDC received the file
|
|
32
|
+
uploaded_timestamp: datetime
|
|
33
|
+
|
|
34
|
+
# The size of the file's contents, in bytes
|
|
35
|
+
file_size_bytes: int
|
|
36
|
+
|
|
37
|
+
# The value of the checksum calculated for the file's contents
|
|
38
|
+
checksum_value: str
|
|
39
|
+
|
|
40
|
+
# The type of the checksum calculated for the file's contents
|
|
41
|
+
checksum_type: ChecksumType
|
|
42
|
+
|
|
43
|
+
# A description or abbreviation of the format of the file's contents, possibly different than the extension
|
|
44
|
+
file_format: FileFormat
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from .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: int | 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 .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: int | 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 .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 .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
|