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.
Files changed (151) hide show
  1. boot.py +14 -0
  2. cidc_api/__init__.py +1 -0
  3. cidc_api/config/db.py +21 -1
  4. cidc_api/config/settings.py +5 -10
  5. cidc_api/models/__init__.py +0 -2
  6. cidc_api/models/data.py +15 -6
  7. cidc_api/models/db/stage1/__init__.py +56 -0
  8. cidc_api/models/db/stage1/additional_treatment_orm.py +22 -0
  9. cidc_api/models/db/stage1/adverse_event_orm.py +46 -0
  10. cidc_api/models/db/stage1/base_orm.py +7 -0
  11. cidc_api/models/db/stage1/baseline_clinical_assessment_orm.py +22 -0
  12. cidc_api/models/db/stage1/comorbidity_orm.py +23 -0
  13. cidc_api/models/db/stage1/consent_group_orm.py +32 -0
  14. cidc_api/models/db/stage1/demographic_orm.py +47 -0
  15. cidc_api/models/db/stage1/disease_orm.py +52 -0
  16. cidc_api/models/db/stage1/exposure_orm.py +22 -0
  17. cidc_api/models/db/stage1/gvhd_diagnosis_acute_orm.py +34 -0
  18. cidc_api/models/db/stage1/gvhd_diagnosis_chronic_orm.py +36 -0
  19. cidc_api/models/db/stage1/gvhd_organ_acute_orm.py +21 -0
  20. cidc_api/models/db/stage1/gvhd_organ_chronic_orm.py +21 -0
  21. cidc_api/models/db/stage1/medical_history_orm.py +30 -0
  22. cidc_api/models/db/stage1/other_malignancy_orm.py +29 -0
  23. cidc_api/models/db/stage1/participant_orm.py +77 -0
  24. cidc_api/models/db/stage1/prior_treatment_orm.py +29 -0
  25. cidc_api/models/db/stage1/radiotherapy_dose_orm.py +39 -0
  26. cidc_api/models/db/stage1/response_by_system_orm.py +30 -0
  27. cidc_api/models/db/stage1/response_orm.py +28 -0
  28. cidc_api/models/db/stage1/specimen_orm.py +46 -0
  29. cidc_api/models/db/stage1/stem_cell_transplant_orm.py +25 -0
  30. cidc_api/models/db/stage1/surgery_orm.py +27 -0
  31. cidc_api/models/db/stage1/therapy_agent_dose_orm.py +31 -0
  32. cidc_api/models/db/stage1/treatment_orm.py +38 -0
  33. cidc_api/models/db/stage1/trial_orm.py +35 -0
  34. cidc_api/models/db/stage2/additional_treatment_orm.py +6 -7
  35. cidc_api/models/db/stage2/administrative_person_orm.py +4 -4
  36. cidc_api/models/db/stage2/administrative_role_assignment_orm.py +4 -4
  37. cidc_api/models/db/stage2/adverse_event_orm.py +11 -13
  38. cidc_api/models/db/stage2/arm_orm.py +3 -3
  39. cidc_api/models/db/stage2/base_orm.py +7 -0
  40. cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +5 -7
  41. cidc_api/models/db/stage2/cohort_orm.py +3 -3
  42. cidc_api/models/db/stage2/comorbidity_orm.py +6 -8
  43. cidc_api/models/db/stage2/consent_group_orm.py +4 -4
  44. cidc_api/models/db/stage2/contact_orm.py +16 -20
  45. cidc_api/models/db/stage2/demographic_orm.py +3 -3
  46. cidc_api/models/db/stage2/disease_orm.py +4 -4
  47. cidc_api/models/db/stage2/exposure_orm.py +3 -3
  48. cidc_api/models/db/stage2/file_orm.py +6 -9
  49. cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +4 -4
  50. cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +4 -6
  51. cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +3 -3
  52. cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +3 -3
  53. cidc_api/models/db/stage2/institution_orm.py +7 -7
  54. cidc_api/models/db/stage2/medical_history_orm.py +9 -9
  55. cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +8 -12
  56. cidc_api/models/db/stage2/other_malignancy_orm.py +8 -10
  57. cidc_api/models/db/stage2/participant_orm.py +23 -24
  58. cidc_api/models/db/stage2/prior_treatment_orm.py +12 -13
  59. cidc_api/models/db/stage2/publication_orm.py +9 -11
  60. cidc_api/models/db/stage2/radiotherapy_dose_orm.py +8 -9
  61. cidc_api/models/db/stage2/response_by_system_orm.py +3 -3
  62. cidc_api/models/db/stage2/response_orm.py +3 -3
  63. cidc_api/models/db/stage2/shipment_orm.py +17 -17
  64. cidc_api/models/db/stage2/shipment_specimen_orm.py +4 -4
  65. cidc_api/models/db/stage2/specimen_orm.py +7 -6
  66. cidc_api/models/db/stage2/stem_cell_transplant_orm.py +6 -7
  67. cidc_api/models/db/stage2/surgery_orm.py +6 -7
  68. cidc_api/models/db/stage2/therapy_agent_dose_orm.py +7 -8
  69. cidc_api/models/db/stage2/treatment_orm.py +15 -15
  70. cidc_api/models/db/stage2/trial_orm.py +15 -17
  71. cidc_api/models/errors.py +7 -0
  72. cidc_api/models/files/facets.py +4 -0
  73. cidc_api/models/models.py +167 -11
  74. cidc_api/models/pydantic/base.py +109 -0
  75. cidc_api/models/pydantic/stage1/__init__.py +56 -0
  76. cidc_api/models/pydantic/stage1/additional_treatment.py +23 -0
  77. cidc_api/models/pydantic/stage1/adverse_event.py +127 -0
  78. cidc_api/models/pydantic/stage1/baseline_clinical_assessment.py +23 -0
  79. cidc_api/models/pydantic/stage1/comorbidity.py +43 -0
  80. cidc_api/models/pydantic/stage1/consent_group.py +30 -0
  81. cidc_api/models/pydantic/stage1/demographic.py +140 -0
  82. cidc_api/models/pydantic/stage1/disease.py +200 -0
  83. cidc_api/models/pydantic/stage1/exposure.py +38 -0
  84. cidc_api/models/pydantic/stage1/gvhd_diagnosis_acute.py +33 -0
  85. cidc_api/models/pydantic/stage1/gvhd_diagnosis_chronic.py +32 -0
  86. cidc_api/models/pydantic/stage1/gvhd_organ_acute.py +22 -0
  87. cidc_api/models/pydantic/stage1/gvhd_organ_chronic.py +23 -0
  88. cidc_api/models/pydantic/stage1/medical_history.py +43 -0
  89. cidc_api/models/pydantic/stage1/other_malignancy.py +55 -0
  90. cidc_api/models/pydantic/stage1/participant.py +63 -0
  91. cidc_api/models/pydantic/stage1/prior_treatment.py +45 -0
  92. cidc_api/models/pydantic/stage1/radiotherapy_dose.py +92 -0
  93. cidc_api/models/pydantic/stage1/response.py +84 -0
  94. cidc_api/models/pydantic/stage1/response_by_system.py +220 -0
  95. cidc_api/models/pydantic/stage1/specimen.py +31 -0
  96. cidc_api/models/pydantic/stage1/stem_cell_transplant.py +35 -0
  97. cidc_api/models/pydantic/stage1/surgery.py +57 -0
  98. cidc_api/models/pydantic/stage1/therapy_agent_dose.py +80 -0
  99. cidc_api/models/pydantic/stage1/treatment.py +64 -0
  100. cidc_api/models/pydantic/stage1/trial.py +45 -0
  101. cidc_api/models/pydantic/stage2/additional_treatment.py +2 -4
  102. cidc_api/models/pydantic/stage2/administrative_person.py +1 -1
  103. cidc_api/models/pydantic/stage2/administrative_role_assignment.py +2 -2
  104. cidc_api/models/pydantic/stage2/adverse_event.py +1 -1
  105. cidc_api/models/pydantic/stage2/arm.py +2 -2
  106. cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +1 -1
  107. cidc_api/models/pydantic/stage2/cohort.py +1 -1
  108. cidc_api/models/pydantic/stage2/comorbidity.py +1 -1
  109. cidc_api/models/pydantic/stage2/consent_group.py +2 -2
  110. cidc_api/models/pydantic/stage2/contact.py +1 -1
  111. cidc_api/models/pydantic/stage2/demographic.py +1 -1
  112. cidc_api/models/pydantic/stage2/disease.py +1 -1
  113. cidc_api/models/pydantic/stage2/exposure.py +1 -1
  114. cidc_api/models/pydantic/stage2/file.py +2 -2
  115. cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +1 -1
  116. cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +1 -1
  117. cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +1 -1
  118. cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +1 -1
  119. cidc_api/models/pydantic/stage2/institution.py +1 -1
  120. cidc_api/models/pydantic/stage2/medical_history.py +1 -1
  121. cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +1 -1
  122. cidc_api/models/pydantic/stage2/other_malignancy.py +1 -1
  123. cidc_api/models/pydantic/stage2/participant.py +6 -3
  124. cidc_api/models/pydantic/stage2/prior_treatment.py +6 -15
  125. cidc_api/models/pydantic/stage2/publication.py +2 -2
  126. cidc_api/models/pydantic/stage2/radiotherapy_dose.py +1 -1
  127. cidc_api/models/pydantic/stage2/response.py +2 -2
  128. cidc_api/models/pydantic/stage2/response_by_system.py +1 -1
  129. cidc_api/models/pydantic/stage2/shipment.py +2 -2
  130. cidc_api/models/pydantic/stage2/shipment_specimen.py +1 -1
  131. cidc_api/models/pydantic/stage2/specimen.py +6 -3
  132. cidc_api/models/pydantic/stage2/stem_cell_transplant.py +2 -2
  133. cidc_api/models/pydantic/stage2/surgery.py +1 -1
  134. cidc_api/models/pydantic/stage2/therapy_agent_dose.py +1 -1
  135. cidc_api/models/pydantic/stage2/treatment.py +1 -1
  136. cidc_api/models/pydantic/stage2/trial.py +8 -10
  137. cidc_api/models/types.py +30 -16
  138. cidc_api/shared/assay_handling.py +68 -0
  139. cidc_api/shared/auth.py +5 -5
  140. cidc_api/shared/file_handling.py +18 -4
  141. cidc_api/shared/gcloud_client.py +96 -16
  142. cidc_api/shared/utils.py +18 -9
  143. cidc_api/telemetry.py +101 -0
  144. {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/METADATA +25 -15
  145. nci_cidc_api_modules-1.2.53.dist-info/RECORD +167 -0
  146. {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/WHEEL +1 -1
  147. {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/top_level.txt +1 -0
  148. cidc_api/models/db/base_orm.py +0 -25
  149. cidc_api/models/pydantic/stage2/base.py +0 -48
  150. nci_cidc_api_modules-1.2.34.dist-info/RECORD +0 -109
  151. {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,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,
@@ -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
 
@@ -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
 
@@ -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: int | None = None
14
+ trial_id: str | None = None
15
15
 
16
16
  # The version number of the trial dataset
17
17
  version: str | 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 Contact(Base):
@@ -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,
@@ -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, ExposureType
7
7
 
8
8
 
@@ -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: int | None = None
11
+ trial_id: str | None = None
12
12
 
13
13
  # The version number of the trial dataset
14
14
  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 (
3
3
  GVHDDiagnosisAcuteAssessmentSystem,
4
4
  GVHDDiagnosisAcuteAssessmentSystemVersion,
@@ -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 (
3
3
  GVHDDiagnosisChronicAssessmentSystem,
4
4
  GVHDDiagnosisChronicAssessmentSystemVersion,
@@ -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 (
3
3
  GVHDOrgan,
4
4
  GVHDOrganAcuteStage,
@@ -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 (
3
3
  GVHDOrgan,
4
4
  GVHDOrganChronicScore,
@@ -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 Institution(Base):
@@ -2,7 +2,7 @@ from typing import Self
2
2
 
3
3
  from pydantic import NonNegativeInt, PositiveFloat, 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 TobaccoSmokingStatus
7
7
 
8
8
 
@@ -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 YNU, ResponseSystem, ResponseSystemVersion
3
3
 
4
4
 
@@ -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 | None = None
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: int | None = None
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 PriorTreatmentType, ConditioningRegimenType, StemCellDonorType
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 | None = None
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 the transplant
45
- # date to the start of the current treatment.
46
- prior_treatment_days_to_prior_transplant: NegativeInt | None = None
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: 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
@@ -2,7 +2,7 @@ from typing import Self
2
2
 
3
3
  from pydantic import NonNegativeInt, NonNegativeFloat, 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 (
7
7
  YNU,
8
8
  RadiotherapyProcedure,
@@ -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: int | None = None
15
+ trial_id: str | None = None
16
16
 
17
17
  # The version number of the trial dataset
18
18
  version: str | 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 ShipmentSpecimen(Base):
@@ -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 | None = None
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 | None = None
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
- stem_cells_source: StemCellSource
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
@@ -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 SurgicalProcedure, UberonAnatomicalTerm, YNU
7
7
 
8
8
 
@@ -2,7 +2,7 @@ from typing import Self
2
2
 
3
3
  from pydantic import NonNegativeInt, NonNegativeFloat, PositiveFloat, 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, TherapyAgentDoseUnits
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, OffTreatmentReason
7
7
 
8
8