nci-cidc-api-modules 1.2.18__py3-none-any.whl → 1.2.25__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. cidc_api/models/__init__.py +2 -0
  2. cidc_api/models/data.py +15 -0
  3. cidc_api/models/db/base_orm.py +25 -0
  4. cidc_api/models/db/stage2/__init__.py +78 -0
  5. cidc_api/models/db/stage2/additional_treatment_orm.py +22 -0
  6. cidc_api/models/db/stage2/administrative_person_orm.py +25 -0
  7. cidc_api/models/db/stage2/administrative_role_assignment_orm.py +28 -0
  8. cidc_api/models/db/stage2/adverse_event_orm.py +47 -0
  9. cidc_api/models/db/stage2/arm_orm.py +23 -0
  10. cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +23 -0
  11. cidc_api/models/db/stage2/cohort_orm.py +23 -0
  12. cidc_api/models/db/stage2/comorbidity_orm.py +24 -0
  13. cidc_api/models/db/stage2/consent_group_orm.py +31 -0
  14. cidc_api/models/db/stage2/contact_orm.py +32 -0
  15. cidc_api/models/db/stage2/demographic_orm.py +44 -0
  16. cidc_api/models/db/stage2/disease_orm.py +53 -0
  17. cidc_api/models/db/stage2/exposure_orm.py +21 -0
  18. cidc_api/models/db/stage2/file_orm.py +38 -0
  19. cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +33 -0
  20. cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +37 -0
  21. cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +20 -0
  22. cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +20 -0
  23. cidc_api/models/db/stage2/institution_orm.py +33 -0
  24. cidc_api/models/db/stage2/medical_history_orm.py +29 -0
  25. cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +28 -0
  26. cidc_api/models/db/stage2/other_malignancy_orm.py +30 -0
  27. cidc_api/models/db/stage2/participant_orm.py +79 -0
  28. cidc_api/models/db/stage2/prior_treatment_orm.py +28 -0
  29. cidc_api/models/db/stage2/publication_orm.py +31 -0
  30. cidc_api/models/db/stage2/radiotherapy_dose_orm.py +39 -0
  31. cidc_api/models/db/stage2/response_by_system_orm.py +28 -0
  32. cidc_api/models/db/stage2/response_orm.py +27 -0
  33. cidc_api/models/db/stage2/shipment_orm.py +47 -0
  34. cidc_api/models/db/stage2/shipment_specimen_orm.py +24 -0
  35. cidc_api/models/db/stage2/specimen_orm.py +100 -0
  36. cidc_api/models/db/stage2/stem_cell_transplant_orm.py +25 -0
  37. cidc_api/models/db/stage2/surgery_orm.py +27 -0
  38. cidc_api/models/db/stage2/therapy_agent_dose_orm.py +31 -0
  39. cidc_api/models/db/stage2/treatment_orm.py +39 -0
  40. cidc_api/models/db/stage2/trial_orm.py +60 -0
  41. cidc_api/models/files/facets.py +5 -0
  42. cidc_api/models/migrations.py +12 -39
  43. cidc_api/models/models.py +12 -0
  44. cidc_api/models/pydantic/stage2/__init__.py +78 -0
  45. cidc_api/models/pydantic/stage2/additional_treatment.py +23 -0
  46. cidc_api/models/pydantic/stage2/administrative_person.py +30 -0
  47. cidc_api/models/pydantic/stage2/administrative_role_assignment.py +16 -0
  48. cidc_api/models/pydantic/stage2/adverse_event.py +100 -0
  49. cidc_api/models/pydantic/stage2/arm.py +16 -0
  50. cidc_api/models/pydantic/stage2/base.py +30 -0
  51. cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +23 -0
  52. cidc_api/models/pydantic/stage2/cohort.py +16 -0
  53. cidc_api/models/pydantic/stage2/comorbidity.py +36 -0
  54. cidc_api/models/pydantic/stage2/consent_group.py +30 -0
  55. cidc_api/models/pydantic/stage2/contact.py +35 -0
  56. cidc_api/models/pydantic/stage2/demographic.py +114 -0
  57. cidc_api/models/pydantic/stage2/disease.py +144 -0
  58. cidc_api/models/pydantic/stage2/exposure.py +32 -0
  59. cidc_api/models/pydantic/stage2/file.py +44 -0
  60. cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +33 -0
  61. cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +32 -0
  62. cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +22 -0
  63. cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +23 -0
  64. cidc_api/models/pydantic/stage2/institution.py +10 -0
  65. cidc_api/models/pydantic/stage2/medical_history.py +36 -0
  66. cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +32 -0
  67. cidc_api/models/pydantic/stage2/other_malignancy.py +45 -0
  68. cidc_api/models/pydantic/stage2/participant.py +47 -0
  69. cidc_api/models/pydantic/stage2/prior_treatment.py +52 -0
  70. cidc_api/models/pydantic/stage2/publication.py +37 -0
  71. cidc_api/models/pydantic/stage2/radiotherapy_dose.py +79 -0
  72. cidc_api/models/pydantic/stage2/response.py +71 -0
  73. cidc_api/models/pydantic/stage2/response_by_system.py +109 -0
  74. cidc_api/models/pydantic/stage2/shipment.py +48 -0
  75. cidc_api/models/pydantic/stage2/shipment_specimen.py +15 -0
  76. cidc_api/models/pydantic/stage2/specimen.py +211 -0
  77. cidc_api/models/pydantic/stage2/stem_cell_transplant.py +35 -0
  78. cidc_api/models/pydantic/stage2/surgery.py +49 -0
  79. cidc_api/models/pydantic/stage2/therapy_agent_dose.py +67 -0
  80. cidc_api/models/pydantic/stage2/treatment.py +50 -0
  81. cidc_api/models/pydantic/stage2/trial.py +85 -0
  82. cidc_api/models/types.py +1439 -0
  83. cidc_api/shared/utils.py +4 -1
  84. {nci_cidc_api_modules-1.2.18.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/METADATA +6 -4
  85. nci_cidc_api_modules-1.2.25.dist-info/RECORD +104 -0
  86. nci_cidc_api_modules-1.2.18.dist-info/RECORD +0 -26
  87. {nci_cidc_api_modules-1.2.18.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/WHEEL +0 -0
  88. {nci_cidc_api_modules-1.2.18.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/licenses/LICENSE +0 -0
  89. {nci_cidc_api_modules-1.2.18.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,49 @@
1
+ from typing import Self
2
+
3
+ from pydantic import NonNegativeInt, model_validator
4
+
5
+ from .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 .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 .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: int | None = None
18
+
19
+ # The unique internal identifier for the associated Arm record
20
+ arm_id: int | None = None
21
+
22
+ # The unique internal identifier for the associated Cohort record
23
+ cohort_id: int | 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,85 @@
1
+ from datetime import datetime
2
+ from typing import List
3
+
4
+ from .base import Base
5
+ from cidc_api.models.types import TrialOrganization, TrialFundingAgency, TrialStatus, AssayType
6
+
7
+
8
+ class Trial(Base):
9
+ __data_category__ = "study"
10
+ __cardinality__ = None
11
+
12
+ # The unique identifier for the clinical trial. e.g. "GU16-287","BACCI"
13
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=5054234%20and%20ver_nr=1
14
+ trial_id: str
15
+
16
+ # The version number of the trial dataset. e.g. "1.0"
17
+ version: str | None = None
18
+
19
+ # ClinicalTrials.gov identifier. e.g. "NCT03731260"
20
+ # TODO need cde from janice, they will make one
21
+ nct_id: str | None = None
22
+
23
+ # NCI Trial Identifier. e.g. NCI22345
24
+ # TODO need cde from janice, they will make one
25
+ nci_id: str | None = None
26
+
27
+ # The short name for the trial
28
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11459810%20and%20ver_nr=4
29
+ trial_name: str | None = None
30
+
31
+ # The type of clinical trial conducted
32
+ trial_type: str | None = None
33
+
34
+ # The long description of the trial name and purpose. e.g. "BACCI: A Phase II Randomized, Double-Blind,
35
+ # Placebo-Controlled Study of Capecitabine Bevacizumab plus Atezolizumab versus Capecitabine Bevacizumab
36
+ # plus Placebo in Patients with Refractory Metastatic Colorectal Cancer"
37
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16188024%20and%20ver_nr=1
38
+ trial_description: str | None = None
39
+
40
+ # Name of the primary organization that oversees the clinical trial. e.g. "ECOG-ACRIN", "SWOG"
41
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3938773%20and%20ver_nr=2
42
+ trial_organization: TrialOrganization | None = None
43
+
44
+ # The primary organization providing grant funding and supporting the trial.
45
+ # e.g. "Duke University - Duke Cancer Institute LAO"
46
+ grant_or_affiliated_network: TrialFundingAgency | None = None
47
+
48
+ # What stage the trial is at in its process.
49
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15607838%20and%20ver_nr=1
50
+ trial_status: TrialStatus
51
+
52
+ # The id of the primary organization responsible for storing biospecimens from this study.
53
+ biobank_institution_id: int | None = None
54
+
55
+ # A description of the reasons why this study could provide insight into molecular biomarkers of immunotherapy.
56
+ justification: str | None = None
57
+
58
+ # The official day that study activity began
59
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16333702%20and%20ver_nr=1
60
+ dates_of_conduct_start: datetime
61
+
62
+ # The official day that study activity ended
63
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16333703%20and%20ver_nr=1
64
+ dates_of_conduct_end: datetime | None = None
65
+
66
+ # The image of the trial data schema
67
+ schema_file_id: int | None = None
68
+
69
+ # The description of the objectives and hypotheses for the proposed biomarkers.
70
+ biomarker_plan: str | None = None
71
+
72
+ # The description of the rules governing data sharing and publications.
73
+ data_sharing_plan: str | None = None
74
+
75
+ # The list of assays that CIDC expects to receive for this trial.
76
+ expected_assays: List[AssayType] = []
77
+
78
+ # Is the cancer studying a liquid tumor type?
79
+ is_liquid_tumor_trial: bool = False
80
+
81
+ # The dbgap study accession number associated with the trial.
82
+ dbgap_study_accession: str | None = None
83
+
84
+ # The internal version identifier for this specific trial dataset.
85
+ version: str