nci-cidc-api-modules 1.2.29__py3-none-any.whl → 1.2.45__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. cidc_api/__init__.py +1 -0
  2. cidc_api/config/db.py +21 -1
  3. cidc_api/config/settings.py +1 -0
  4. cidc_api/models/__init__.py +0 -2
  5. cidc_api/models/data.py +17 -4
  6. cidc_api/models/db/stage1/__init__.py +56 -0
  7. cidc_api/models/db/stage1/additional_treatment_orm.py +22 -0
  8. cidc_api/models/db/stage1/adverse_event_orm.py +46 -0
  9. cidc_api/models/db/stage1/base_orm.py +7 -0
  10. cidc_api/models/db/stage1/baseline_clinical_assessment_orm.py +22 -0
  11. cidc_api/models/db/stage1/comorbidity_orm.py +23 -0
  12. cidc_api/models/db/stage1/consent_group_orm.py +32 -0
  13. cidc_api/models/db/stage1/demographic_orm.py +47 -0
  14. cidc_api/models/db/stage1/disease_orm.py +52 -0
  15. cidc_api/models/db/stage1/exposure_orm.py +22 -0
  16. cidc_api/models/db/stage1/gvhd_diagnosis_acute_orm.py +34 -0
  17. cidc_api/models/db/stage1/gvhd_diagnosis_chronic_orm.py +36 -0
  18. cidc_api/models/db/stage1/gvhd_organ_acute_orm.py +21 -0
  19. cidc_api/models/db/stage1/gvhd_organ_chronic_orm.py +21 -0
  20. cidc_api/models/db/stage1/medical_history_orm.py +30 -0
  21. cidc_api/models/db/stage1/other_malignancy_orm.py +29 -0
  22. cidc_api/models/db/stage1/participant_orm.py +77 -0
  23. cidc_api/models/db/stage1/prior_treatment_orm.py +29 -0
  24. cidc_api/models/db/stage1/radiotherapy_dose_orm.py +39 -0
  25. cidc_api/models/db/stage1/response_by_system_orm.py +30 -0
  26. cidc_api/models/db/stage1/response_orm.py +28 -0
  27. cidc_api/models/db/stage1/specimen_orm.py +46 -0
  28. cidc_api/models/db/stage1/stem_cell_transplant_orm.py +25 -0
  29. cidc_api/models/db/stage1/surgery_orm.py +27 -0
  30. cidc_api/models/db/stage1/therapy_agent_dose_orm.py +31 -0
  31. cidc_api/models/db/stage1/treatment_orm.py +38 -0
  32. cidc_api/models/db/stage1/trial_orm.py +35 -0
  33. cidc_api/models/db/stage2/additional_treatment_orm.py +8 -8
  34. cidc_api/models/db/stage2/administrative_person_orm.py +4 -4
  35. cidc_api/models/db/stage2/administrative_role_assignment_orm.py +4 -4
  36. cidc_api/models/db/stage2/adverse_event_orm.py +12 -13
  37. cidc_api/models/db/stage2/arm_orm.py +3 -3
  38. cidc_api/models/db/stage2/base_orm.py +7 -0
  39. cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +6 -7
  40. cidc_api/models/db/stage2/cohort_orm.py +3 -3
  41. cidc_api/models/db/stage2/comorbidity_orm.py +7 -8
  42. cidc_api/models/db/stage2/consent_group_orm.py +5 -4
  43. cidc_api/models/db/stage2/contact_orm.py +16 -20
  44. cidc_api/models/db/stage2/demographic_orm.py +11 -8
  45. cidc_api/models/db/stage2/disease_orm.py +13 -14
  46. cidc_api/models/db/stage2/exposure_orm.py +5 -4
  47. cidc_api/models/db/stage2/file_orm.py +6 -9
  48. cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +5 -4
  49. cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +5 -6
  50. cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +4 -3
  51. cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +4 -3
  52. cidc_api/models/db/stage2/institution_orm.py +7 -7
  53. cidc_api/models/db/stage2/medical_history_orm.py +10 -9
  54. cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +8 -12
  55. cidc_api/models/db/stage2/other_malignancy_orm.py +10 -11
  56. cidc_api/models/db/stage2/participant_orm.py +28 -28
  57. cidc_api/models/db/stage2/prior_treatment_orm.py +15 -14
  58. cidc_api/models/db/stage2/publication_orm.py +9 -11
  59. cidc_api/models/db/stage2/radiotherapy_dose_orm.py +9 -9
  60. cidc_api/models/db/stage2/response_by_system_orm.py +5 -3
  61. cidc_api/models/db/stage2/response_orm.py +6 -5
  62. cidc_api/models/db/stage2/shipment_orm.py +17 -17
  63. cidc_api/models/db/stage2/shipment_specimen_orm.py +4 -4
  64. cidc_api/models/db/stage2/specimen_orm.py +7 -6
  65. cidc_api/models/db/stage2/stem_cell_transplant_orm.py +7 -7
  66. cidc_api/models/db/stage2/surgery_orm.py +7 -7
  67. cidc_api/models/db/stage2/therapy_agent_dose_orm.py +8 -8
  68. cidc_api/models/db/stage2/treatment_orm.py +16 -15
  69. cidc_api/models/db/stage2/trial_orm.py +34 -33
  70. cidc_api/models/files/facets.py +4 -0
  71. cidc_api/models/models.py +154 -9
  72. cidc_api/models/pydantic/{stage2/base.py → base.py} +19 -1
  73. cidc_api/models/pydantic/stage1/__init__.py +56 -0
  74. cidc_api/models/pydantic/stage1/additional_treatment.py +23 -0
  75. cidc_api/models/pydantic/stage1/adverse_event.py +100 -0
  76. cidc_api/models/pydantic/stage1/baseline_clinical_assessment.py +23 -0
  77. cidc_api/models/pydantic/stage1/comorbidity.py +36 -0
  78. cidc_api/models/pydantic/stage1/consent_group.py +30 -0
  79. cidc_api/models/pydantic/stage1/demographic.py +123 -0
  80. cidc_api/models/pydantic/stage1/disease.py +158 -0
  81. cidc_api/models/pydantic/stage1/exposure.py +32 -0
  82. cidc_api/models/pydantic/stage1/gvhd_diagnosis_acute.py +33 -0
  83. cidc_api/models/pydantic/stage1/gvhd_diagnosis_chronic.py +32 -0
  84. cidc_api/models/pydantic/stage1/gvhd_organ_acute.py +22 -0
  85. cidc_api/models/pydantic/stage1/gvhd_organ_chronic.py +23 -0
  86. cidc_api/models/pydantic/stage1/medical_history.py +36 -0
  87. cidc_api/models/pydantic/stage1/other_malignancy.py +49 -0
  88. cidc_api/models/pydantic/stage1/participant.py +51 -0
  89. cidc_api/models/pydantic/stage1/prior_treatment.py +45 -0
  90. cidc_api/models/pydantic/stage1/radiotherapy_dose.py +79 -0
  91. cidc_api/models/pydantic/stage1/response.py +65 -0
  92. cidc_api/models/pydantic/stage1/response_by_system.py +112 -0
  93. cidc_api/models/pydantic/stage1/specimen.py +31 -0
  94. cidc_api/models/pydantic/stage1/stem_cell_transplant.py +35 -0
  95. cidc_api/models/pydantic/stage1/surgery.py +49 -0
  96. cidc_api/models/pydantic/stage1/therapy_agent_dose.py +67 -0
  97. cidc_api/models/pydantic/stage1/treatment.py +50 -0
  98. cidc_api/models/pydantic/stage1/trial.py +45 -0
  99. cidc_api/models/pydantic/stage2/additional_treatment.py +5 -5
  100. cidc_api/models/pydantic/stage2/administrative_person.py +1 -1
  101. cidc_api/models/pydantic/stage2/administrative_role_assignment.py +2 -2
  102. cidc_api/models/pydantic/stage2/adverse_event.py +2 -2
  103. cidc_api/models/pydantic/stage2/arm.py +2 -2
  104. cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +2 -2
  105. cidc_api/models/pydantic/stage2/cohort.py +1 -1
  106. cidc_api/models/pydantic/stage2/comorbidity.py +1 -1
  107. cidc_api/models/pydantic/stage2/consent_group.py +2 -2
  108. cidc_api/models/pydantic/stage2/contact.py +1 -1
  109. cidc_api/models/pydantic/stage2/demographic.py +27 -18
  110. cidc_api/models/pydantic/stage2/disease.py +33 -19
  111. cidc_api/models/pydantic/stage2/exposure.py +3 -3
  112. cidc_api/models/pydantic/stage2/file.py +2 -2
  113. cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +2 -2
  114. cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +2 -2
  115. cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +1 -1
  116. cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +1 -1
  117. cidc_api/models/pydantic/stage2/institution.py +1 -1
  118. cidc_api/models/pydantic/stage2/medical_history.py +2 -2
  119. cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +1 -1
  120. cidc_api/models/pydantic/stage2/other_malignancy.py +12 -8
  121. cidc_api/models/pydantic/stage2/participant.py +10 -6
  122. cidc_api/models/pydantic/stage2/prior_treatment.py +14 -23
  123. cidc_api/models/pydantic/stage2/publication.py +2 -2
  124. cidc_api/models/pydantic/stage2/radiotherapy_dose.py +2 -2
  125. cidc_api/models/pydantic/stage2/response.py +5 -11
  126. cidc_api/models/pydantic/stage2/response_by_system.py +10 -7
  127. cidc_api/models/pydantic/stage2/shipment.py +2 -2
  128. cidc_api/models/pydantic/stage2/shipment_specimen.py +1 -1
  129. cidc_api/models/pydantic/stage2/specimen.py +8 -5
  130. cidc_api/models/pydantic/stage2/stem_cell_transplant.py +2 -2
  131. cidc_api/models/pydantic/stage2/surgery.py +1 -1
  132. cidc_api/models/pydantic/stage2/therapy_agent_dose.py +1 -1
  133. cidc_api/models/pydantic/stage2/treatment.py +2 -2
  134. cidc_api/models/pydantic/stage2/trial.py +19 -15
  135. cidc_api/models/types.py +45 -42
  136. cidc_api/shared/assay_handling.py +68 -0
  137. cidc_api/shared/auth.py +5 -5
  138. cidc_api/shared/file_handling.py +16 -4
  139. cidc_api/shared/gcloud_client.py +78 -16
  140. cidc_api/shared/utils.py +18 -9
  141. cidc_api/telemetry.py +101 -0
  142. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/METADATA +25 -14
  143. nci_cidc_api_modules-1.2.45.dist-info/RECORD +165 -0
  144. cidc_api/models/db/base_orm.py +0 -25
  145. nci_cidc_api_modules-1.2.29.dist-info/RECORD +0 -109
  146. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/WHEEL +0 -0
  147. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/licenses/LICENSE +0 -0
  148. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.45.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,79 @@
1
+ from typing import Self
2
+
3
+ from pydantic import NonNegativeInt, NonNegativeFloat, model_validator
4
+
5
+ from cidc_api.models.pydantic.base import Base
6
+ from cidc_api.models.types import (
7
+ YNU,
8
+ RadiotherapyProcedure,
9
+ UberonAnatomicalTerm,
10
+ RadiotherapyDoseUnits,
11
+ RadiationExtent,
12
+ )
13
+
14
+
15
+ class RadiotherapyDose(Base):
16
+ __data_category__ = "radiotherapy_dose"
17
+ __cardinality__ = "many"
18
+
19
+ # The unique internal identifier for the radiotherapy dose record
20
+ radiotherapy_dose_id: int | None = None
21
+
22
+ # The unique internal identifier for the associated treatment record
23
+ treatment_id: int | None = None
24
+
25
+ # Number of days from enrollment date to the start of the radiotherapy dose.
26
+ days_to_start: NonNegativeInt
27
+
28
+ # Number of days from enrollment date to the end of the radiotherapy dose.
29
+ days_to_end: NonNegativeInt
30
+
31
+ # The term that describes the kind of radiotherapy procedure administered.
32
+ procedure: RadiotherapyProcedure
33
+
34
+ # The Uberon anatomical term for the site of surgery.
35
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14461856%20and%20ver_nr=1
36
+ anatomical_location: UberonAnatomicalTerm | None = None
37
+
38
+ # Indicates whether the record represents the total dose for a radiotherapy treatment course (which may be either
39
+ # a multi-fractionated or a single-fraction dose).
40
+ is_total_dose: bool
41
+
42
+ # The number of fractions a participant received to deliver the radiation dose.
43
+ number_of_fractions: NonNegativeInt | None = None
44
+
45
+ # The dose amount received by the participant.
46
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13433490%20and%20ver_nr=1
47
+ received_dose: NonNegativeFloat
48
+
49
+ # Unit of measure for the dose of the radiotherapy to be received by the participant.
50
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13383458%20and%20ver_nr=1
51
+ received_dose_units: RadiotherapyDoseUnits
52
+
53
+ # The planned dose amount for the participant.
54
+ planned_dose: NonNegativeFloat | None = None
55
+
56
+ # Unit of measure for the planned total dose of the radiotherapy to be received by the participant.
57
+ planned_dose_units: RadiotherapyDoseUnits | None = None
58
+
59
+ # Indicates if the radiotherapy dose was changed, missed, or delayed.
60
+ dose_changes_delays: YNU
61
+
62
+ # Description of the radiotherapy dose changes, misses, or delays.
63
+ changes_delays_description: str | None = None
64
+
65
+ # The extent of radiation exposure administered to the patient's body during radiation therapy.
66
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=7063755%20and%20ver_nr=1
67
+ radiation_extent: RadiationExtent
68
+
69
+ @model_validator(mode="after")
70
+ def validate_changes_delays_description_cr(self) -> Self:
71
+ if self.dose_changes_delays == "Yes" and not self.changes_delays_description:
72
+ raise ValueError('If dose_changes_delays is "Yes", please provide changes_delays_description.')
73
+ return self
74
+
75
+ @model_validator(mode="after")
76
+ def validate_planned_dose_units_cr(self) -> Self:
77
+ if self.planned_dose and not self.planned_dose_units:
78
+ raise ValueError("If planned_dose is provided, please provide planned_dose_units.")
79
+ return self
@@ -0,0 +1,65 @@
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 SurvivalStatus, YNUNA, CauseOfDeath
7
+
8
+
9
+ class Response(Base):
10
+ __data_category__ = "response"
11
+ __cardinality__ = "one"
12
+
13
+ # The unique internal identifier for the response record
14
+ response_id: int | None = None
15
+
16
+ # The unique internal identifier for the associated participant
17
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
18
+ participant_id: str | None = None
19
+
20
+ # The response to a question that describes a participant's survival status.
21
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2847330%20and%20ver_nr=1
22
+ survival_status: SurvivalStatus
23
+
24
+ # Number of days from enrollment date to death date.
25
+ overall_survival: NonNegativeInt
26
+
27
+ # Indicator for whether there was an abscopal effect on disease after local therapy.
28
+ abscopal_response: YNUNA | None = None
29
+
30
+ # Indicates if pathological complete response (pCR) occurred.
31
+ pathological_complete_response: YNUNA | None = None
32
+
33
+ # Number of days between enrollment date and date of death, if applicable.
34
+ days_to_death: NonNegativeInt | None = None
35
+
36
+ # The circumstance or condition of greatest rank or importance that results in the death of the participant
37
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=4783274%20and%20ver_nr=1
38
+ cause_of_death: CauseOfDeath | None = None
39
+
40
+ # Indicates whether participant was evaluable for toxicity (adverse events, DLT, etc.) overall.
41
+ evaluable_for_toxicity: bool
42
+
43
+ # Indicates whether participant was evaluable for efficacy (for example, response, PFS, OS, etc.) overall.
44
+ evaluable_for_efficacy: bool
45
+
46
+ # Days from enrollment date to the last time the patient's vital status was verified.
47
+ days_to_last_vital_status: NonNegativeInt | None = None # TODO: Needs CR check
48
+
49
+ @model_validator(mode="after")
50
+ def validate_cause_of_death_cr(self) -> Self:
51
+ if self.survival_status == "Dead" and not self.cause_of_death:
52
+ raise ValueError('If survival_status is "Dead" then cause_of_death is required.')
53
+ return self
54
+
55
+ @model_validator(mode="after")
56
+ def validate_cause_of_death_cr2(self) -> Self:
57
+ if self.survival_status == "Alive" and self.cause_of_death:
58
+ raise ValueError('If survival_status is "Alive", please leave cause_of_death blank.')
59
+ return self
60
+
61
+ @model_validator(mode="after")
62
+ def validate_days_to_death_cr(self) -> Self:
63
+ if self.survival_status in ["Alive", "Unknown"] and self.days_to_death:
64
+ raise ValueError("If survival_status does not indicate death, please leave days_to_death blank.")
65
+ return self
@@ -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,14 +10,14 @@ 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: int | None = None
13
+ participant_id: str | None = None
14
14
 
15
15
  # Number of days from the enrollment date to the first recorded administration or occurrence of the treatment modality.
16
- days_to_start: NonNegativeInt | None = None
16
+ additional_treatment_days_to_start: NonNegativeInt | None = None
17
17
 
18
18
  # Number of days from the enrollment date to the last recorded administration or occurrence of the treatment modality.
19
- days_to_end: NonNegativeInt | None = None
19
+ additional_treatment_days_to_end: NonNegativeInt | None = None
20
20
 
21
21
  # Description of the prior treatment such as its full generic name if it is a type of therapy agent, radiotherapy procedure
22
22
  # name and location, or surgical procedure name and location.
23
- description: str
23
+ additional_treatment_description: str
@@ -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 AdministrativePerson(Base):
@@ -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: int | None = None
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,
@@ -25,7 +25,7 @@ class AdverseEvent(Base):
25
25
  adverse_event_id: int | None = None
26
26
 
27
27
  # The unique internal identifier of the associated participant
28
- participant_id: int | None = None
28
+ participant_id: str | None = None
29
29
 
30
30
  # The unique internal identifier of the attributed treatment, if any
31
31
  treatment_id: int | 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 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: int | None = None
9
+ trial_id: str | None = None
10
10
 
11
11
  # The version number of the trial dataset
12
12
  version: str | None = None
@@ -1,4 +1,4 @@
1
- from .base import Base
1
+ from cidc_api.models.pydantic.base import Base
2
2
  from cidc_api.models.types import ECOGScore, KarnofskyScore
3
3
 
4
4
 
@@ -10,7 +10,7 @@ class BaselineClinicalAssessment(Base):
10
10
  baseline_clinical_assessment_id: int | None = None
11
11
 
12
12
  # The unique identifier for the associated participant
13
- participant_id: int | None = None
13
+ participant_id: str | None = None
14
14
 
15
15
  # The numerical score that represents the functional capabilities of a participant at the
16
16
  # enrollment date using the Eastern Cooperative Oncology Group Performance Status assessment.
@@ -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 Cohort(Base):
@@ -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 ICD10CMCode, ICD10CMTerm
7
7
 
8
8