nci-cidc-api-modules 1.2.34__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 +15 -6
- 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 +6 -7
- 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 +11 -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 +5 -7
- cidc_api/models/db/stage2/cohort_orm.py +3 -3
- cidc_api/models/db/stage2/comorbidity_orm.py +6 -8
- cidc_api/models/db/stage2/consent_group_orm.py +4 -4
- cidc_api/models/db/stage2/contact_orm.py +16 -20
- cidc_api/models/db/stage2/demographic_orm.py +3 -3
- cidc_api/models/db/stage2/disease_orm.py +4 -4
- cidc_api/models/db/stage2/exposure_orm.py +3 -3
- cidc_api/models/db/stage2/file_orm.py +6 -9
- cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +4 -4
- cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +4 -6
- cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +3 -3
- cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +3 -3
- cidc_api/models/db/stage2/institution_orm.py +7 -7
- cidc_api/models/db/stage2/medical_history_orm.py +9 -9
- cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +8 -12
- cidc_api/models/db/stage2/other_malignancy_orm.py +8 -10
- cidc_api/models/db/stage2/participant_orm.py +23 -24
- cidc_api/models/db/stage2/prior_treatment_orm.py +12 -13
- cidc_api/models/db/stage2/publication_orm.py +9 -11
- cidc_api/models/db/stage2/radiotherapy_dose_orm.py +8 -9
- cidc_api/models/db/stage2/response_by_system_orm.py +3 -3
- cidc_api/models/db/stage2/response_orm.py +3 -3
- 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 +6 -7
- cidc_api/models/db/stage2/surgery_orm.py +6 -7
- cidc_api/models/db/stage2/therapy_agent_dose_orm.py +7 -8
- cidc_api/models/db/stage2/treatment_orm.py +15 -15
- cidc_api/models/db/stage2/trial_orm.py +15 -17
- cidc_api/models/files/facets.py +4 -0
- cidc_api/models/models.py +153 -9
- cidc_api/models/pydantic/{stage2/base.py → base.py} +1 -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 +2 -4
- 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 +1 -1
- cidc_api/models/pydantic/stage2/arm.py +2 -2
- cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +1 -1
- 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 +1 -1
- cidc_api/models/pydantic/stage2/disease.py +1 -1
- cidc_api/models/pydantic/stage2/exposure.py +1 -1
- cidc_api/models/pydantic/stage2/file.py +2 -2
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +1 -1
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +1 -1
- 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 +1 -1
- cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +1 -1
- cidc_api/models/pydantic/stage2/other_malignancy.py +1 -1
- cidc_api/models/pydantic/stage2/participant.py +6 -3
- cidc_api/models/pydantic/stage2/prior_treatment.py +6 -15
- cidc_api/models/pydantic/stage2/publication.py +2 -2
- cidc_api/models/pydantic/stage2/radiotherapy_dose.py +1 -1
- cidc_api/models/pydantic/stage2/response.py +2 -2
- cidc_api/models/pydantic/stage2/response_by_system.py +1 -1
- 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 +6 -3
- 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 +1 -1
- cidc_api/models/pydantic/stage2/trial.py +8 -10
- cidc_api/models/types.py +30 -16
- 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.34.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/METADATA +21 -12
- 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.34.dist-info/RECORD +0 -109
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/WHEEL +0 -0
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/licenses/LICENSE +0 -0
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import PositiveInt, model_validator, NonNegativeInt
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import ResponseSystem, ResponseSystemVersion, BestOverallResponse, YNUNA
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
negative_response_values = [
|
|
10
|
+
"Progressive Disease",
|
|
11
|
+
"Stable Disease",
|
|
12
|
+
"immune Unconfirmed Progressive Disease",
|
|
13
|
+
"immune Confirmed Progressive Disease",
|
|
14
|
+
"immune Stable Disease",
|
|
15
|
+
"Not available",
|
|
16
|
+
"Not assessed",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ResponseBySystem(Base):
|
|
21
|
+
__data_category__ = "response_by_system"
|
|
22
|
+
__cardinality__ = "many"
|
|
23
|
+
|
|
24
|
+
# The unique internal identifier for this ResponseBySystem record
|
|
25
|
+
response_by_system_id: int | None = None
|
|
26
|
+
|
|
27
|
+
# The unique internal identifier for the associated participant
|
|
28
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
|
|
29
|
+
participant_id: str | None = None
|
|
30
|
+
|
|
31
|
+
# A standardized method used to evaluate and categorize the participant’s clinical response to treatment based on predefined criteria.
|
|
32
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13381490%20and%20ver_nr=1
|
|
33
|
+
response_system: ResponseSystem
|
|
34
|
+
|
|
35
|
+
# The release version of the clinical assessment system used to evaluate a participant’s response to treatment.
|
|
36
|
+
response_system_version: ResponseSystemVersion
|
|
37
|
+
|
|
38
|
+
# Confirmed best overall response to study treatment by the corresponding response system.
|
|
39
|
+
best_overall_response: BestOverallResponse
|
|
40
|
+
|
|
41
|
+
# Days from first response to progression.
|
|
42
|
+
response_duration: PositiveInt | None = None
|
|
43
|
+
|
|
44
|
+
# The number of days from the start of the treatment to the first signs of disease progression.
|
|
45
|
+
duration_of_stable_disease: NonNegativeInt | None = None
|
|
46
|
+
|
|
47
|
+
# Indicates whether a patient achieved a durable clinical benefit.
|
|
48
|
+
durable_clinical_benefit: bool | None = None
|
|
49
|
+
|
|
50
|
+
# Number of days between enrollment date and the date of first response to trial treatment.
|
|
51
|
+
days_to_first_response: PositiveInt | None = None
|
|
52
|
+
|
|
53
|
+
# Number of days between enrollment date and the date of the best response to trial treatment.
|
|
54
|
+
days_to_best_response: PositiveInt | None = None
|
|
55
|
+
|
|
56
|
+
# Indicates whether a participant's disease progressed.
|
|
57
|
+
progression: YNUNA
|
|
58
|
+
|
|
59
|
+
# Number of days between enrollment date and date of disease progression.
|
|
60
|
+
days_to_disease_progression: PositiveInt | None = None
|
|
61
|
+
|
|
62
|
+
# Indicator to identify whether a patient had a Progression-Free Survival (PFS) event.
|
|
63
|
+
progression_free_survival_event: YNUNA
|
|
64
|
+
|
|
65
|
+
# The number of days from the date the patient was enrolled in the study to the date the patient was last verified to be free of progression.
|
|
66
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=5143957%20and%20ver_nr=1
|
|
67
|
+
progression_free_survival: PositiveInt | None = None
|
|
68
|
+
|
|
69
|
+
@model_validator(mode="after")
|
|
70
|
+
def validate_response_duration_cr(self) -> Self:
|
|
71
|
+
if self.best_overall_response in negative_response_values and self.response_duration:
|
|
72
|
+
raise ValueError(
|
|
73
|
+
"If best_overall_response does not indicate a positive response, "
|
|
74
|
+
"please leave response_duration blank."
|
|
75
|
+
)
|
|
76
|
+
return self
|
|
77
|
+
|
|
78
|
+
@model_validator(mode="after")
|
|
79
|
+
def validate_days_to_first_response_cr(self) -> Self:
|
|
80
|
+
if self.best_overall_response in negative_response_values and self.days_to_first_response:
|
|
81
|
+
raise ValueError(
|
|
82
|
+
"If best_overall_response does not indicate a positive response, "
|
|
83
|
+
"please leave days_to_first_response blank."
|
|
84
|
+
)
|
|
85
|
+
return self
|
|
86
|
+
|
|
87
|
+
@model_validator(mode="after")
|
|
88
|
+
def validate_days_to_best_response_cr(self) -> Self:
|
|
89
|
+
if self.best_overall_response in negative_response_values and self.days_to_best_response:
|
|
90
|
+
raise ValueError(
|
|
91
|
+
"If best_overall_response does not indicate a positive response, \
|
|
92
|
+
please leave days_to_best_response blank."
|
|
93
|
+
)
|
|
94
|
+
return self
|
|
95
|
+
|
|
96
|
+
@model_validator(mode="after")
|
|
97
|
+
def validate_days_to_disease_progression_cr(self) -> Self:
|
|
98
|
+
if self.progression in ["No", "Unknown", "Not Applicable"] and self.days_to_disease_progression:
|
|
99
|
+
raise ValueError(
|
|
100
|
+
"If progression does not indicate confirmed progression of the disease, \
|
|
101
|
+
please leave days_to_disease_progress blank."
|
|
102
|
+
)
|
|
103
|
+
return self
|
|
104
|
+
|
|
105
|
+
@model_validator(mode="after")
|
|
106
|
+
def validate_progression_free_survival_cr(self) -> Self:
|
|
107
|
+
if self.progression_free_survival_event in ["Unknown", "Not Applicable"] and self.progression_free_survival:
|
|
108
|
+
raise ValueError(
|
|
109
|
+
"If progression_free_survival_event is not known, \
|
|
110
|
+
please leave progression_free_survival blank."
|
|
111
|
+
)
|
|
112
|
+
return self
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
from cidc_api.models.pydantic.base import Base
|
|
4
|
+
from cidc_api.models.types import UberonAnatomicalTerm
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Specimen(Base):
|
|
8
|
+
__data_category__ = "specimen"
|
|
9
|
+
__cardinality__ = "many"
|
|
10
|
+
|
|
11
|
+
# The unique internal identifier for the specimen record
|
|
12
|
+
specimen_id: int | None = None
|
|
13
|
+
|
|
14
|
+
# The unique internal identifier for the associated 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 unique specimen identifier assigned by the CIMAC-CIDC Network.
|
|
19
|
+
# Formatted as CTTTPPPSS.AA for trial code TTT, participant PPP, sample SS, and aliquot AA.
|
|
20
|
+
cimac_id: str
|
|
21
|
+
|
|
22
|
+
# Categorical description of timepoint at which the sample was taken.
|
|
23
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=5899851%20and%20ver_nr=1
|
|
24
|
+
# Note: CIDC doesn't conform to this CDE's PVs
|
|
25
|
+
collection_event_name: str
|
|
26
|
+
|
|
27
|
+
# Days from enrollment date to date specimen was collected.
|
|
28
|
+
days_to_specimen_collection: int
|
|
29
|
+
|
|
30
|
+
# The location within the body from which a specimen was originally obtained as captured in the Uberon anatomical term.
|
|
31
|
+
organ_site_of_collection: UberonAnatomicalTerm
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from pydantic import NonNegativeInt
|
|
2
|
+
from cidc_api.models.pydantic.base import Base
|
|
3
|
+
from cidc_api.models.types import (
|
|
4
|
+
StemCellDonorType,
|
|
5
|
+
AllogeneicDonorType,
|
|
6
|
+
StemCellSource,
|
|
7
|
+
ConditioningRegimenType,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class StemCellTransplant(Base):
|
|
12
|
+
__data_category__ = "stem_cell_transplant"
|
|
13
|
+
__cardinality__ = "many"
|
|
14
|
+
|
|
15
|
+
# The unique internal identifier for the stem cell transplant record
|
|
16
|
+
stem_cell_transplant_id: int | None = None
|
|
17
|
+
|
|
18
|
+
# The unique internal identifier for the associated Treatment record
|
|
19
|
+
treatment_id: int | None = None
|
|
20
|
+
|
|
21
|
+
# Indicates the stem cell donor type.
|
|
22
|
+
stem_cell_donor_type: StemCellDonorType
|
|
23
|
+
|
|
24
|
+
# If "stem_cell_donor_type" is "Allogeneic", specifies the relationship and
|
|
25
|
+
# compatibility of the donor relative to the receipient
|
|
26
|
+
allogeneic_donor_type: AllogeneicDonorType | None = None
|
|
27
|
+
|
|
28
|
+
# Source of the stem cells used for transplant.
|
|
29
|
+
stem_cell_source: StemCellSource
|
|
30
|
+
|
|
31
|
+
# Days from the enrollment date to the date of the stem cell transplant.
|
|
32
|
+
days_to_transplant: NonNegativeInt
|
|
33
|
+
|
|
34
|
+
# Specifies what type of conditioning regimen was used for the stem cell transplant if applicable.
|
|
35
|
+
conditioning_regimen_type: ConditioningRegimenType | None = None
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import NonNegativeInt, model_validator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import SurgicalProcedure, UberonAnatomicalTerm, YNU
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Surgery(Base):
|
|
10
|
+
__data_category__ = "surgery"
|
|
11
|
+
__cardinality__ = "many"
|
|
12
|
+
|
|
13
|
+
# The unique internal identifier for the surgery record
|
|
14
|
+
surgery_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# The unique internal identifier for the associated treatment record
|
|
17
|
+
treatment_id: int | None = None
|
|
18
|
+
|
|
19
|
+
# The term that describes the kind of surgical procedure administered.
|
|
20
|
+
procedure: SurgicalProcedure
|
|
21
|
+
|
|
22
|
+
# The name of surgical procedure if the value provided for procedure is "Other, specify".
|
|
23
|
+
procedure_other: str | None = None
|
|
24
|
+
|
|
25
|
+
# Number of days from enrollment date to surgical procedure date.
|
|
26
|
+
days_to_procedure: NonNegativeInt
|
|
27
|
+
|
|
28
|
+
# The Uberon identifier for the location within the body targeted by a procedure that
|
|
29
|
+
# is intended to alter or stop a pathologic process.
|
|
30
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14980609%20and%20ver_nr=1
|
|
31
|
+
anatomical_location: UberonAnatomicalTerm
|
|
32
|
+
|
|
33
|
+
# An indication as to whether the surgical procedure in question was performed with therapeutic intent.
|
|
34
|
+
therapeutic: YNU
|
|
35
|
+
|
|
36
|
+
# A narrative description of any significant findings observed during the surgical procedure in question.
|
|
37
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14918773%20and%20ver_nr=1
|
|
38
|
+
findings: str | None = None
|
|
39
|
+
|
|
40
|
+
# A textual description of evidence for remaining tumor following primary treatment that is only
|
|
41
|
+
# apparent using highly sensitive techniques.
|
|
42
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13362284%20and%20ver_nr=1
|
|
43
|
+
extent_of_residual_disease: str | None = None
|
|
44
|
+
|
|
45
|
+
@model_validator(mode="after")
|
|
46
|
+
def validate_procedure_other_cr(self) -> Self:
|
|
47
|
+
if self.procedure == "Other, specify" and not self.procedure_other:
|
|
48
|
+
raise ValueError('If procedure is "Other, specify", please provide procedure_other.')
|
|
49
|
+
return self
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from typing import Self
|
|
2
|
+
|
|
3
|
+
from pydantic import NonNegativeInt, NonNegativeFloat, PositiveFloat, model_validator
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import YNU, TherapyAgentDoseUnits
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TherapyAgentDose(Base):
|
|
10
|
+
__data_category__ = "therapy_agent_dose"
|
|
11
|
+
__cardinality__ = "many"
|
|
12
|
+
|
|
13
|
+
# The unique internal identifier for the therapy agent dose record
|
|
14
|
+
therapy_agent_dose_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# The unique internal identifier for the associated treatment record
|
|
17
|
+
treatment_id: int | None = None
|
|
18
|
+
|
|
19
|
+
# A numeric identifier used to indicate a specific course or cycle of treatment.
|
|
20
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16391085%20and%20ver_nr=1
|
|
21
|
+
course_number: str | None = None
|
|
22
|
+
|
|
23
|
+
# The full generic name of the therapeutic agent, if available, as captured in the Pharmacological
|
|
24
|
+
# Substance (C1909) branch of the National Cancer Institute Thesaurus (NCIt).
|
|
25
|
+
therapy_agent_name: str
|
|
26
|
+
|
|
27
|
+
# Number of days from the enrollment date to the start date of the therapy dose.
|
|
28
|
+
days_to_start: NonNegativeInt
|
|
29
|
+
|
|
30
|
+
# Number of days from enrollment date to the end date of the therapy dose.
|
|
31
|
+
days_to_end: NonNegativeInt
|
|
32
|
+
|
|
33
|
+
# Number of individual doses the patient received of the therapy agent.
|
|
34
|
+
number_of_doses: NonNegativeInt
|
|
35
|
+
|
|
36
|
+
# The amount that represents the dose of the therapy agent received by the participant.
|
|
37
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2182728%20and%20ver_nr=3
|
|
38
|
+
received_dose: NonNegativeFloat
|
|
39
|
+
|
|
40
|
+
# Unit of measure for the dose of the agent received by the participant.
|
|
41
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2321160%20and%20ver_nr=4
|
|
42
|
+
received_dose_units: TherapyAgentDoseUnits
|
|
43
|
+
|
|
44
|
+
# The amount that represents the planned dose of the therapy agent to be received by the participant.
|
|
45
|
+
planned_dose: PositiveFloat | None = None
|
|
46
|
+
|
|
47
|
+
# Unit of measure for the planned dose of the agent to be received by the participant.
|
|
48
|
+
# TODO: This CDE will probably be 2321160 but needs to be finalized with Janice
|
|
49
|
+
planned_dose_units: TherapyAgentDoseUnits | None = None
|
|
50
|
+
|
|
51
|
+
# Indicates if the therapy agent dose was changed, missed, or delayed.
|
|
52
|
+
dose_changes_delays: YNU
|
|
53
|
+
|
|
54
|
+
# Description of the dose changes, misses, or delays.
|
|
55
|
+
changes_delays_description: str | None = None
|
|
56
|
+
|
|
57
|
+
@model_validator(mode="after")
|
|
58
|
+
def validate_changes_delays_description_cr(self) -> Self:
|
|
59
|
+
if self.dose_changes_delays == "Yes" and not self.changes_delays_description:
|
|
60
|
+
raise ValueError('If dose_changes_delays is "Yes", please provide changes_delays_description.')
|
|
61
|
+
return self
|
|
62
|
+
|
|
63
|
+
@model_validator(mode="after")
|
|
64
|
+
def validate_planned_dose_units_cr(self) -> Self:
|
|
65
|
+
if self.planned_dose and not self.planned_dose_units:
|
|
66
|
+
raise ValueError("If planned_dose is provided, please provide planned_dose_units.")
|
|
67
|
+
return self
|
|
@@ -0,0 +1,50 @@
|
|
|
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, OffTreatmentReason
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Treatment(Base):
|
|
10
|
+
__data_category__ = "treatment"
|
|
11
|
+
__cardinality__ = "many"
|
|
12
|
+
|
|
13
|
+
# The unique internal identifier for the Treatment record
|
|
14
|
+
treatment_id: int | None = None
|
|
15
|
+
|
|
16
|
+
# The unique internal identifier for the associated Participant record
|
|
17
|
+
participant_id: str | None = None
|
|
18
|
+
|
|
19
|
+
# The unique internal identifier for the associated Arm record
|
|
20
|
+
arm: str | None = None
|
|
21
|
+
|
|
22
|
+
# The unique internal identifier for the associated Cohort record
|
|
23
|
+
cohort: str | None = None
|
|
24
|
+
|
|
25
|
+
# A unique identifier used to describe a distinct, specific intervention or
|
|
26
|
+
# treatment that a group or subgroup of participants in a clinical trial receives.
|
|
27
|
+
treatment_description: str
|
|
28
|
+
|
|
29
|
+
# Indicates if the participant has stopped receiving this particular treatment at
|
|
30
|
+
# the time of data submission.
|
|
31
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16391087%20and%20ver_nr=1
|
|
32
|
+
off_treatment: YNU
|
|
33
|
+
|
|
34
|
+
# An explanation describing why an individual is no longer receiving this particular treatment.
|
|
35
|
+
off_treatment_reason: OffTreatmentReason | None = None
|
|
36
|
+
|
|
37
|
+
# If "Other" is selected for "off_treatment_reason", provide a description of the reason.
|
|
38
|
+
off_treatment_reason_other: str | None = None
|
|
39
|
+
|
|
40
|
+
@model_validator(mode="after")
|
|
41
|
+
def validate_off_treatment_reason_cr(self) -> Self:
|
|
42
|
+
if self.off_treatment == "Yes" and not self.off_treatment_reason:
|
|
43
|
+
raise ValueError('If off_treatment is "Yes", please provide off_treatment_reason.')
|
|
44
|
+
return self
|
|
45
|
+
|
|
46
|
+
@model_validator(mode="after")
|
|
47
|
+
def validate_off_treatment_reason_other_cr(self) -> Self:
|
|
48
|
+
if self.off_treatment_reason == "Other" and not self.off_treatment_reason_other:
|
|
49
|
+
raise ValueError('If off_treatment_reason is "Other", please provide off_treatment_reason_other.')
|
|
50
|
+
return self
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from pydantic import BeforeValidator
|
|
3
|
+
from typing import List, Annotated
|
|
4
|
+
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import PrimaryPurposeType, AgeGroup
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Trial(Base):
|
|
10
|
+
__data_category__ = "study"
|
|
11
|
+
__cardinality__ = None
|
|
12
|
+
|
|
13
|
+
# The unique identifier for the clinical trial. e.g. "GU16-287","BACCI"
|
|
14
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=5054234%20and%20ver_nr=1
|
|
15
|
+
trial_id: str | None = None
|
|
16
|
+
|
|
17
|
+
# The version number of the trial dataset. e.g. "1.0"
|
|
18
|
+
version: str | None = None
|
|
19
|
+
|
|
20
|
+
# A broad textual description of the primary endpoint(s) of the trial.
|
|
21
|
+
primary_endpoint: str | None = None
|
|
22
|
+
|
|
23
|
+
# The identifiable class of the study participant based upon their age.
|
|
24
|
+
age_group: Annotated[List[AgeGroup], BeforeValidator(Base.split_list)]
|
|
25
|
+
|
|
26
|
+
# Clinical and/or molecular characteristics of the cancer(s) in the study population.
|
|
27
|
+
study_population: str | None = None
|
|
28
|
+
|
|
29
|
+
# The type of clinical trial conducted
|
|
30
|
+
trial_type: str | None = None
|
|
31
|
+
|
|
32
|
+
# The official day that study activity began
|
|
33
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16333702%20and%20ver_nr=1
|
|
34
|
+
dates_of_conduct_start: datetime
|
|
35
|
+
|
|
36
|
+
# The official day that study activity ended
|
|
37
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16333703%20and%20ver_nr=1
|
|
38
|
+
dates_of_conduct_end: datetime | None = None
|
|
39
|
+
|
|
40
|
+
# A classification of the study based upon the primary intent of the study's activities.
|
|
41
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11160683%20and%20ver_nr=1
|
|
42
|
+
primary_purpose_type: PrimaryPurposeType
|
|
43
|
+
|
|
44
|
+
# The dbgap study accession number associated with the trial.
|
|
45
|
+
dbgap_study_accession: str
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import NonNegativeInt
|
|
2
|
-
from .base import Base
|
|
2
|
+
from cidc_api.models.pydantic.base import Base
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class AdditionalTreatment(Base):
|
|
@@ -10,9 +10,7 @@ class AdditionalTreatment(Base):
|
|
|
10
10
|
additional_treatment_id: int | None = None
|
|
11
11
|
|
|
12
12
|
# The unique internal identifier for the associated Participant record
|
|
13
|
-
participant_id: str | None =
|
|
14
|
-
None # TODO: fix all stage2 models for participant_id to not be nullable, after s1 models are complete
|
|
15
|
-
)
|
|
13
|
+
participant_id: str | None = None
|
|
16
14
|
|
|
17
15
|
# Number of days from the enrollment date to the first recorded administration or occurrence of the treatment modality.
|
|
18
16
|
additional_treatment_days_to_start: NonNegativeInt | None = None
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from .base import Base
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
2
|
from cidc_api.models.types import AdministrativeRole
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class AdministrativeRoleAssignment(Base):
|
|
6
6
|
# The unique identifier for the associated trial
|
|
7
|
-
trial_id:
|
|
7
|
+
trial_id: str | None = None
|
|
8
8
|
|
|
9
9
|
# The version number of the trial dataset
|
|
10
10
|
version: str | 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.reference.ctcae import is_ctcae_other_term
|
|
7
7
|
from cidc_api.models.types import (
|
|
8
8
|
CTCAEEventTerm,
|
|
@@ -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 Arm(Base):
|
|
@@ -6,7 +6,7 @@ class Arm(Base):
|
|
|
6
6
|
arm_id: int | None = None
|
|
7
7
|
|
|
8
8
|
# The unique identifier for the associated trial
|
|
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
|
|
@@ -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
|
|
@@ -2,7 +2,7 @@ from typing import Self, Annotated, List
|
|
|
2
2
|
|
|
3
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,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from pydantic import NonPositiveInt, model_validator, BeforeValidator
|
|
2
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
6
|
TumorGrade,
|
|
7
7
|
CancerStageSystem,
|
|
@@ -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
|
|
@@ -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
|
|
|
@@ -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
|
|
7
7
|
from cidc_api.models.types import OffStudyReason
|
|
8
8
|
|
|
@@ -16,13 +16,16 @@ class Participant(Base):
|
|
|
16
16
|
participant_id: str | None = None
|
|
17
17
|
|
|
18
18
|
# The participant identifier assigned by the clinical trial team overseeing the study
|
|
19
|
-
native_participant_id: str
|
|
19
|
+
native_participant_id: str
|
|
20
20
|
|
|
21
21
|
# The globally unique participant identifier assigned by the CIMAC network. e.g. C8P29A7
|
|
22
22
|
cimac_participant_id: str | None = None
|
|
23
23
|
|
|
24
24
|
# The unique identifier for the associated trial that the participant is participating in
|
|
25
|
-
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
|
|
26
29
|
|
|
27
30
|
# Indicates if the individual is no longer actively participating in the clinical trial.
|
|
28
31
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14834973%20and%20ver_nr=1
|