nci-cidc-api-modules 1.2.34__py3-none-any.whl → 1.2.53__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.
- boot.py +14 -0
- cidc_api/__init__.py +1 -0
- cidc_api/config/db.py +21 -1
- cidc_api/config/settings.py +5 -10
- 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/errors.py +7 -0
- cidc_api/models/files/facets.py +4 -0
- cidc_api/models/models.py +167 -11
- cidc_api/models/pydantic/base.py +109 -0
- 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 +127 -0
- cidc_api/models/pydantic/stage1/baseline_clinical_assessment.py +23 -0
- cidc_api/models/pydantic/stage1/comorbidity.py +43 -0
- cidc_api/models/pydantic/stage1/consent_group.py +30 -0
- cidc_api/models/pydantic/stage1/demographic.py +140 -0
- cidc_api/models/pydantic/stage1/disease.py +200 -0
- cidc_api/models/pydantic/stage1/exposure.py +38 -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 +43 -0
- cidc_api/models/pydantic/stage1/other_malignancy.py +55 -0
- cidc_api/models/pydantic/stage1/participant.py +63 -0
- cidc_api/models/pydantic/stage1/prior_treatment.py +45 -0
- cidc_api/models/pydantic/stage1/radiotherapy_dose.py +92 -0
- cidc_api/models/pydantic/stage1/response.py +84 -0
- cidc_api/models/pydantic/stage1/response_by_system.py +220 -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 +57 -0
- cidc_api/models/pydantic/stage1/therapy_agent_dose.py +80 -0
- cidc_api/models/pydantic/stage1/treatment.py +64 -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 +18 -4
- cidc_api/shared/gcloud_client.py +96 -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.53.dist-info}/METADATA +25 -15
- nci_cidc_api_modules-1.2.53.dist-info/RECORD +167 -0
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/WHEEL +1 -1
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/top_level.txt +1 -0
- cidc_api/models/db/base_orm.py +0 -25
- cidc_api/models/pydantic/stage2/base.py +0 -48
- 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.53.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from pydantic import NonNegativeInt, NonNegativeFloat, PositiveFloat
|
|
2
|
+
from cidc_api.models.pydantic.base import forced_validator, forced_validators
|
|
3
|
+
|
|
4
|
+
from cidc_api.models.errors import ValueLocError
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import YNU, TherapyAgentDoseUnits
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@forced_validators
|
|
10
|
+
class TherapyAgentDose(Base):
|
|
11
|
+
__data_category__ = "therapy_agent_dose"
|
|
12
|
+
__cardinality__ = "many"
|
|
13
|
+
|
|
14
|
+
# The unique internal identifier for the therapy agent dose record
|
|
15
|
+
therapy_agent_dose_id: int | None = None
|
|
16
|
+
|
|
17
|
+
# The unique internal identifier for the associated treatment record
|
|
18
|
+
treatment_id: int | None = None
|
|
19
|
+
|
|
20
|
+
# A numeric identifier used to indicate a specific course or cycle of treatment.
|
|
21
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16391085%20and%20ver_nr=1
|
|
22
|
+
course_number: str | None = None
|
|
23
|
+
|
|
24
|
+
# The full generic name of the therapeutic agent, if available, as captured in the Pharmacological
|
|
25
|
+
# Substance (C1909) branch of the National Cancer Institute Thesaurus (NCIt).
|
|
26
|
+
therapy_agent_name: str
|
|
27
|
+
|
|
28
|
+
# Number of days from the enrollment date to the start date of the therapy dose.
|
|
29
|
+
days_to_start: NonNegativeInt
|
|
30
|
+
|
|
31
|
+
# Number of days from enrollment date to the end date of the therapy dose.
|
|
32
|
+
days_to_end: NonNegativeInt
|
|
33
|
+
|
|
34
|
+
# Number of individual doses the patient received of the therapy agent.
|
|
35
|
+
number_of_doses: NonNegativeInt
|
|
36
|
+
|
|
37
|
+
# The amount that represents the dose of the therapy agent received by the participant.
|
|
38
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2182728%20and%20ver_nr=3
|
|
39
|
+
received_dose: NonNegativeFloat
|
|
40
|
+
|
|
41
|
+
# Unit of measure for the dose of the agent received by the participant.
|
|
42
|
+
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2321160%20and%20ver_nr=4
|
|
43
|
+
received_dose_units: TherapyAgentDoseUnits
|
|
44
|
+
|
|
45
|
+
# The amount that represents the planned dose of the therapy agent to be received by the participant.
|
|
46
|
+
planned_dose: PositiveFloat | None = None
|
|
47
|
+
|
|
48
|
+
# Unit of measure for the planned dose of the agent to be received by the participant.
|
|
49
|
+
# TODO: This CDE will probably be 2321160 but needs to be finalized with Janice
|
|
50
|
+
planned_dose_units: TherapyAgentDoseUnits | None = None
|
|
51
|
+
|
|
52
|
+
# Indicates if the therapy agent dose was changed, missed, or delayed.
|
|
53
|
+
dose_changes_delays: YNU
|
|
54
|
+
|
|
55
|
+
# Description of the dose changes, misses, or delays.
|
|
56
|
+
changes_delays_description: str | None = None
|
|
57
|
+
|
|
58
|
+
@forced_validator
|
|
59
|
+
@classmethod
|
|
60
|
+
def validate_changes_delays_description_cr(cls, data, info) -> None:
|
|
61
|
+
dose_changes_delays = data.get("dose_changes_delays", None)
|
|
62
|
+
changes_delays_description = data.get("changes_delays_description", None)
|
|
63
|
+
|
|
64
|
+
if dose_changes_delays == "Yes" and not changes_delays_description:
|
|
65
|
+
raise ValueLocError(
|
|
66
|
+
'If dose_changes_delays is "Yes", please provide changes_delays_description.',
|
|
67
|
+
loc="changes_delays_description",
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
@forced_validator
|
|
71
|
+
@classmethod
|
|
72
|
+
def validate_planned_dose_units_cr(cls, data, info) -> None:
|
|
73
|
+
planned_dose = data.get("planned_dose", None)
|
|
74
|
+
planned_dose_units = data.get("planned_dose_units", None)
|
|
75
|
+
|
|
76
|
+
if planned_dose and not planned_dose_units:
|
|
77
|
+
raise ValueLocError(
|
|
78
|
+
"If planned_dose is provided, please provide planned_dose_units.",
|
|
79
|
+
loc="planned_dose_units",
|
|
80
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from cidc_api.models.pydantic.base import forced_validator, forced_validators
|
|
2
|
+
|
|
3
|
+
from cidc_api.models.errors import ValueLocError
|
|
4
|
+
from cidc_api.models.pydantic.base import Base
|
|
5
|
+
from cidc_api.models.types import YNU, OffTreatmentReason
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@forced_validators
|
|
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
|
+
@forced_validator
|
|
41
|
+
@classmethod
|
|
42
|
+
def validate_off_treatment_reason_cr(cls, data, info) -> None:
|
|
43
|
+
off_treatment = data.get("off_treatment", None)
|
|
44
|
+
off_treatment_reason = data.get("off_treatment_reason", None)
|
|
45
|
+
|
|
46
|
+
if off_treatment == "Yes" and not off_treatment_reason:
|
|
47
|
+
raise ValueLocError(
|
|
48
|
+
'If off_treatment is "Yes", please provide off_treatment_reason.',
|
|
49
|
+
loc="off_treatment_reason",
|
|
50
|
+
)
|
|
51
|
+
return off_treatment_reason
|
|
52
|
+
|
|
53
|
+
@forced_validator
|
|
54
|
+
@classmethod
|
|
55
|
+
def validate_off_treatment_reason_other_cr(cls, data, info) -> None:
|
|
56
|
+
off_treatment_reason = data.get("off_treatment_reason", None)
|
|
57
|
+
off_treatment_reason_other = data.get("off_treatment_reason_other", None)
|
|
58
|
+
|
|
59
|
+
if off_treatment_reason == "Other" and not off_treatment_reason_other:
|
|
60
|
+
raise ValueLocError(
|
|
61
|
+
'If off_treatment_reason is "Other", please provide off_treatment_reason_other.',
|
|
62
|
+
loc="off_treatment_reason_other",
|
|
63
|
+
)
|
|
64
|
+
return off_treatment_reason_other
|
|
@@ -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
|
|
@@ -2,8 +2,8 @@ from typing import Self, Annotated, List
|
|
|
2
2
|
|
|
3
3
|
from pydantic import NonPositiveInt, NegativeInt, model_validator, BeforeValidator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
6
|
-
from cidc_api.models.types import
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
|
+
from cidc_api.models.types import ConditioningRegimenType, StemCellDonorType
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class PriorTreatment(Base):
|
|
@@ -24,12 +24,9 @@ class PriorTreatment(Base):
|
|
|
24
24
|
# the treatment modality.
|
|
25
25
|
prior_treatment_days_to_end: NonPositiveInt | None = None
|
|
26
26
|
|
|
27
|
-
# Specifies the category or kind of prior treatment modality a participant received.
|
|
28
|
-
prior_treatment_type: Annotated[List[PriorTreatmentType], BeforeValidator(Base.split_list)]
|
|
29
|
-
|
|
30
27
|
# Description of the prior treatment such as its full generic name if it is a type of therapy agent,
|
|
31
28
|
# radiotherapy procedure name and location, or surgical procedure name and location.
|
|
32
|
-
prior_treatment_description: str
|
|
29
|
+
prior_treatment_description: str
|
|
33
30
|
|
|
34
31
|
# Best response from any response assessment system to the prior treatment if available or applicable.
|
|
35
32
|
prior_treatment_best_response: str | None = None
|
|
@@ -41,12 +38,6 @@ class PriorTreatment(Base):
|
|
|
41
38
|
# If prior treatment is "Stem cell transplant", indicates what stem cell donor type used.
|
|
42
39
|
prior_treatment_stem_cell_donor_type: StemCellDonorType | None = None
|
|
43
40
|
|
|
44
|
-
# If prior treatment is "Stem cell transplant", indicates the number of days from
|
|
45
|
-
#
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
@model_validator(mode="after")
|
|
49
|
-
def validate_description_cr(self) -> Self:
|
|
50
|
-
if "Other therapy" in self.prior_treatment_type and not self.prior_treatment_description:
|
|
51
|
-
raise ValueError('If type is "Other therapy", please provide description.')
|
|
52
|
-
return self
|
|
41
|
+
# If prior treatment is "Stem cell transplant", indicates the number of days from enrollment
|
|
42
|
+
# to the prior transplant. This must be a negative number.
|
|
43
|
+
prior_treatment_days_from_transplant_to_treatment_initiation: NegativeInt | None = None
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from .base import Base
|
|
1
|
+
from cidc_api.models.pydantic.base import Base
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class Publication(Base):
|
|
@@ -6,7 +6,7 @@ class Publication(Base):
|
|
|
6
6
|
publication_id: int | None = None
|
|
7
7
|
|
|
8
8
|
# The unique internal identifier for the associated Trial record
|
|
9
|
-
trial_id:
|
|
9
|
+
trial_id: str | None = None
|
|
10
10
|
|
|
11
11
|
# The version number of the trial dataset
|
|
12
12
|
version: str | None = None
|
|
@@ -2,7 +2,7 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import NonNegativeInt, model_validator
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import SurvivalStatus, YNUNA, CauseOfDeath
|
|
7
7
|
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ class Response(Base):
|
|
|
44
44
|
evaluable_for_efficacy: bool
|
|
45
45
|
|
|
46
46
|
# Days from enrollment date to the last time the patient's vital status was verified.
|
|
47
|
-
days_to_last_vital_status: NonNegativeInt | None = None
|
|
47
|
+
days_to_last_vital_status: NonNegativeInt | None = None # TODO: Needs CR check
|
|
48
48
|
|
|
49
49
|
@model_validator(mode="after")
|
|
50
50
|
def validate_cause_of_death_cr(self) -> Self:
|
|
@@ -2,7 +2,7 @@ from typing import Self
|
|
|
2
2
|
|
|
3
3
|
from pydantic import PositiveInt, model_validator, NonNegativeInt
|
|
4
4
|
|
|
5
|
-
from .base import Base
|
|
5
|
+
from cidc_api.models.pydantic.base import Base
|
|
6
6
|
from cidc_api.models.types import ResponseSystem, ResponseSystemVersion, BestOverallResponse, YNUNA
|
|
7
7
|
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
|
|
3
|
-
from .base import Base
|
|
3
|
+
from cidc_api.models.pydantic.base import Base
|
|
4
4
|
from cidc_api.models.types import AssayPriority, AssayType, Courier, ShipmentCondition, ShipmentQuality
|
|
5
5
|
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ class Shipment(Base):
|
|
|
12
12
|
institution_id: int | None = None
|
|
13
13
|
|
|
14
14
|
# The unique internal identifier for the associated trial.
|
|
15
|
-
trial_id:
|
|
15
|
+
trial_id: str | None = None
|
|
16
16
|
|
|
17
17
|
# The version number of the trial dataset
|
|
18
18
|
version: str | None = None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
|
|
3
|
-
from .base import Base
|
|
3
|
+
from cidc_api.models.pydantic.base import Base
|
|
4
4
|
from cidc_api.models.types import (
|
|
5
5
|
UberonAnatomicalTerm,
|
|
6
6
|
ICDO3MorphologicalCode,
|
|
@@ -66,7 +66,7 @@ class Specimen(Base):
|
|
|
66
66
|
# Categorical description of timepoint at which the sample was taken.
|
|
67
67
|
# CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=5899851%20and%20ver_nr=1
|
|
68
68
|
# Note: CIDC doesn't conform to this CDE's PVs
|
|
69
|
-
collection_event_name: str
|
|
69
|
+
collection_event_name: str
|
|
70
70
|
|
|
71
71
|
# The type of the specimen
|
|
72
72
|
specimen_type: SpecimenType | None = None
|
|
@@ -208,4 +208,7 @@ class Specimen(Base):
|
|
|
208
208
|
date_ingested: datetime | None = None
|
|
209
209
|
|
|
210
210
|
# Days from enrollment date to date specimen was collected.
|
|
211
|
-
days_to_specimen_collection: int
|
|
211
|
+
days_to_specimen_collection: int
|
|
212
|
+
|
|
213
|
+
# The location within the body from which a specimen was originally obtained as captured in the Uberon anatomical term.
|
|
214
|
+
organ_site_of_collection: UberonAnatomicalTerm
|
|
@@ -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
|
from cidc_api.models.types import (
|
|
4
4
|
StemCellDonorType,
|
|
5
5
|
AllogeneicDonorType,
|
|
@@ -26,7 +26,7 @@ class StemCellTransplant(Base):
|
|
|
26
26
|
allogeneic_donor_type: AllogeneicDonorType | None = None
|
|
27
27
|
|
|
28
28
|
# Source of the stem cells used for transplant.
|
|
29
|
-
|
|
29
|
+
stem_cell_source: StemCellSource
|
|
30
30
|
|
|
31
31
|
# Days from the enrollment date to the date of the stem cell transplant.
|
|
32
32
|
days_to_transplant: NonNegativeInt
|