nci-cidc-api-modules 1.2.16__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 (91) hide show
  1. cidc_api/config/db.py +1 -3
  2. cidc_api/models/__init__.py +2 -0
  3. cidc_api/models/data.py +15 -0
  4. cidc_api/models/db/base_orm.py +25 -0
  5. cidc_api/models/db/stage2/__init__.py +78 -0
  6. cidc_api/models/db/stage2/additional_treatment_orm.py +22 -0
  7. cidc_api/models/db/stage2/administrative_person_orm.py +25 -0
  8. cidc_api/models/db/stage2/administrative_role_assignment_orm.py +28 -0
  9. cidc_api/models/db/stage2/adverse_event_orm.py +47 -0
  10. cidc_api/models/db/stage2/arm_orm.py +23 -0
  11. cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +23 -0
  12. cidc_api/models/db/stage2/cohort_orm.py +23 -0
  13. cidc_api/models/db/stage2/comorbidity_orm.py +24 -0
  14. cidc_api/models/db/stage2/consent_group_orm.py +31 -0
  15. cidc_api/models/db/stage2/contact_orm.py +32 -0
  16. cidc_api/models/db/stage2/demographic_orm.py +44 -0
  17. cidc_api/models/db/stage2/disease_orm.py +53 -0
  18. cidc_api/models/db/stage2/exposure_orm.py +21 -0
  19. cidc_api/models/db/stage2/file_orm.py +38 -0
  20. cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +33 -0
  21. cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +37 -0
  22. cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +20 -0
  23. cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +20 -0
  24. cidc_api/models/db/stage2/institution_orm.py +33 -0
  25. cidc_api/models/db/stage2/medical_history_orm.py +29 -0
  26. cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +28 -0
  27. cidc_api/models/db/stage2/other_malignancy_orm.py +30 -0
  28. cidc_api/models/db/stage2/participant_orm.py +79 -0
  29. cidc_api/models/db/stage2/prior_treatment_orm.py +28 -0
  30. cidc_api/models/db/stage2/publication_orm.py +31 -0
  31. cidc_api/models/db/stage2/radiotherapy_dose_orm.py +39 -0
  32. cidc_api/models/db/stage2/response_by_system_orm.py +28 -0
  33. cidc_api/models/db/stage2/response_orm.py +27 -0
  34. cidc_api/models/db/stage2/shipment_orm.py +47 -0
  35. cidc_api/models/db/stage2/shipment_specimen_orm.py +24 -0
  36. cidc_api/models/db/stage2/specimen_orm.py +100 -0
  37. cidc_api/models/db/stage2/stem_cell_transplant_orm.py +25 -0
  38. cidc_api/models/db/stage2/surgery_orm.py +27 -0
  39. cidc_api/models/db/stage2/therapy_agent_dose_orm.py +31 -0
  40. cidc_api/models/db/stage2/treatment_orm.py +39 -0
  41. cidc_api/models/db/stage2/trial_orm.py +60 -0
  42. cidc_api/models/files/facets.py +5 -0
  43. cidc_api/models/migrations.py +12 -39
  44. cidc_api/models/models.py +65 -14
  45. cidc_api/models/pydantic/stage2/__init__.py +78 -0
  46. cidc_api/models/pydantic/stage2/additional_treatment.py +23 -0
  47. cidc_api/models/pydantic/stage2/administrative_person.py +30 -0
  48. cidc_api/models/pydantic/stage2/administrative_role_assignment.py +16 -0
  49. cidc_api/models/pydantic/stage2/adverse_event.py +100 -0
  50. cidc_api/models/pydantic/stage2/arm.py +16 -0
  51. cidc_api/models/pydantic/stage2/base.py +30 -0
  52. cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +23 -0
  53. cidc_api/models/pydantic/stage2/cohort.py +16 -0
  54. cidc_api/models/pydantic/stage2/comorbidity.py +36 -0
  55. cidc_api/models/pydantic/stage2/consent_group.py +30 -0
  56. cidc_api/models/pydantic/stage2/contact.py +35 -0
  57. cidc_api/models/pydantic/stage2/demographic.py +114 -0
  58. cidc_api/models/pydantic/stage2/disease.py +144 -0
  59. cidc_api/models/pydantic/stage2/exposure.py +32 -0
  60. cidc_api/models/pydantic/stage2/file.py +44 -0
  61. cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +33 -0
  62. cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +32 -0
  63. cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +22 -0
  64. cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +23 -0
  65. cidc_api/models/pydantic/stage2/institution.py +10 -0
  66. cidc_api/models/pydantic/stage2/medical_history.py +36 -0
  67. cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +32 -0
  68. cidc_api/models/pydantic/stage2/other_malignancy.py +45 -0
  69. cidc_api/models/pydantic/stage2/participant.py +47 -0
  70. cidc_api/models/pydantic/stage2/prior_treatment.py +52 -0
  71. cidc_api/models/pydantic/stage2/publication.py +37 -0
  72. cidc_api/models/pydantic/stage2/radiotherapy_dose.py +79 -0
  73. cidc_api/models/pydantic/stage2/response.py +71 -0
  74. cidc_api/models/pydantic/stage2/response_by_system.py +109 -0
  75. cidc_api/models/pydantic/stage2/shipment.py +48 -0
  76. cidc_api/models/pydantic/stage2/shipment_specimen.py +15 -0
  77. cidc_api/models/pydantic/stage2/specimen.py +211 -0
  78. cidc_api/models/pydantic/stage2/stem_cell_transplant.py +35 -0
  79. cidc_api/models/pydantic/stage2/surgery.py +49 -0
  80. cidc_api/models/pydantic/stage2/therapy_agent_dose.py +67 -0
  81. cidc_api/models/pydantic/stage2/treatment.py +50 -0
  82. cidc_api/models/pydantic/stage2/trial.py +85 -0
  83. cidc_api/models/types.py +1439 -0
  84. cidc_api/shared/file_handling.py +37 -2
  85. cidc_api/shared/utils.py +4 -1
  86. {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/METADATA +6 -4
  87. nci_cidc_api_modules-1.2.25.dist-info/RECORD +104 -0
  88. nci_cidc_api_modules-1.2.16.dist-info/RECORD +0 -26
  89. {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/WHEEL +0 -0
  90. {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/licenses/LICENSE +0 -0
  91. {nci_cidc_api_modules-1.2.16.dist-info → nci_cidc_api_modules-1.2.25.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,36 @@
1
+ from typing import Self
2
+
3
+ from pydantic import NonNegativeInt, PositiveFloat, model_validator
4
+
5
+ from .base import Base
6
+ from cidc_api.models.types import TobaccoSmokingStatus
7
+
8
+
9
+ class MedicalHistory(Base):
10
+ __data_category__ = "medical_history"
11
+ __cardinality__ = "one"
12
+
13
+ # A unique internal identifier for the medical history
14
+ medical_history_id: int | None = None
15
+
16
+ # The unique identifier for the associated participant
17
+ participant_id: int | None = None
18
+
19
+ # Text representation of a person's status relative to smoking tobacco in the form of cigarettes,
20
+ # based on questions about current and former use of cigarettes.
21
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16333929%20and%20ver_nr=1
22
+ tobacco_smoking_status: TobaccoSmokingStatus | None = None
23
+
24
+ # Average number of packs of cigarettes smoked per day multiplied by number of years the participant has smoked.
25
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=6841869%20and%20ver_nr=1
26
+ pack_years_smoked: PositiveFloat | None = None
27
+
28
+ # Number of prior systemic therapies.
29
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16089302%20and%20ver_nr=1
30
+ num_prior_systemic_therapies: NonNegativeInt | None = None
31
+
32
+ @model_validator(mode="after")
33
+ def validate_pack_years_smoked_cr(self) -> Self:
34
+ if self.tobacco_smoking_status in ["Never Smoker", "Unknown", "Not reported"] and self.pack_years_smoked:
35
+ raise ValueError("If tobacco_smoking_status indicates non-smoker, please leave pack_years_smoked blank.")
36
+ return self
@@ -0,0 +1,32 @@
1
+ from .base import Base
2
+ from cidc_api.models.types import YNU, ResponseSystem, ResponseSystemVersion
3
+
4
+
5
+ class OtherClinicalEndpoint(Base):
6
+
7
+ # The unique internal identifier for the other clinical endpoint
8
+ other_clinical_endpoint_id: int | None = None
9
+
10
+ # The unique internal identifier for the associated participant
11
+ participant_id: int | None = None
12
+
13
+ # The name of the clinical endpoint. e.g. "iPFS"
14
+ name: str
15
+
16
+ # Whether the event that defines the clinical endpoint occurred
17
+ event: YNU
18
+
19
+ # The number of days to the occurrence of the event
20
+ days: int | None = None
21
+
22
+ # A description of this clinical endpoint
23
+ description: str | None = None
24
+
25
+ # The formula used to calculate the clinical endpoint criteria
26
+ calculation: str | None = None
27
+
28
+ # The response system used to define the clinical endpoint criteria. e.g. "RECIST"
29
+ response_system: ResponseSystem | None = None
30
+
31
+ # The version of the system used to define the clinical endpoint criteria.
32
+ response_system_version: ResponseSystemVersion | None = None
@@ -0,0 +1,45 @@
1
+ from typing import Self
2
+
3
+ from pydantic import NonPositiveInt, model_validator
4
+
5
+ from .base import Base
6
+ from cidc_api.models.types import UberonAnatomicalTerm, ICDO3MorphologicalCode, ICDO3MorphologicalTerm, MalignancyStatus
7
+
8
+
9
+ class OtherMalignancy(Base):
10
+ __data_category__ = "other_malignancy"
11
+ __cardinality__ = "many"
12
+
13
+ # The unique internal identifier for the OtherMalignancy record
14
+ other_malignancy_id: int | None = None
15
+
16
+ # The unique internal identifier for the associated MedicalHistory record
17
+ medical_history_id: int | None = None
18
+
19
+ # The location within the body from where the prior malignancy originated as captured in the Uberon anatomical term.
20
+ primary_disease_site: UberonAnatomicalTerm
21
+
22
+ # The ICD-O-3 code which identifies the specific appearance of cells and tissues (normal and abnormal) used
23
+ # to define the presence and nature of disease.
24
+ morphological_code: ICDO3MorphologicalCode | None = None
25
+
26
+ # The ICD-O-3 textual label which identifies the specific appearance of cells and tissues (normal and abnormal) used
27
+ # to define the presence and nature of disease.
28
+ morphological_term: ICDO3MorphologicalTerm | None = None
29
+
30
+ # Description of the cancer type as recorded in the trial.
31
+ malignancy_description: str | None = None
32
+
33
+ # Number of days since original diagnosis from the enrollment date. This may be a negative number.
34
+ days_since_diagnosis: NonPositiveInt | None = None
35
+
36
+ # Indicates the participant’s current clinical state regarding the cancer diagnosis.
37
+ malignancy_status: MalignancyStatus | None = None
38
+
39
+ @model_validator(mode="after")
40
+ def validate_code_or_term_or_description_cr(self) -> Self:
41
+ if not self.morphological_code and not self.morphological_term and not self.malignancy_description:
42
+ raise ValueError(
43
+ 'Please provide at least one of "morphological_code", "morphological_term" or "malignancy_description".'
44
+ )
45
+ return self
@@ -0,0 +1,47 @@
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 OffStudyReason
7
+
8
+
9
+ class Participant(Base):
10
+ __data_category__ = "participant"
11
+ __cardinality__ = "one"
12
+
13
+ # The unique internal identifier for the participant
14
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
15
+ participant_id: int | None = None
16
+
17
+ # The participant identifier assigned by the clinical trial team overseeing the study
18
+ native_participant_id: str
19
+
20
+ # The globally unique participant identifier assigned by the CIMAC network. e.g. C8P29A7
21
+ cimac_participant_id: str
22
+
23
+ # The unique identifier for the associated trial that the participant is participating in
24
+ trial_id: int | None = None
25
+
26
+ # Indicates if the individual is no longer actively participating in the clinical trial.
27
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14834973%20and%20ver_nr=1
28
+ off_study: bool
29
+
30
+ # An explanation describing why an individual is no longer participating in the clinical trial.
31
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13362265%20and%20ver_nr=1
32
+ off_study_reason: OffStudyReason | None = None
33
+
34
+ # Additional information if "Other" is selected for off_study_reason. e.g. "Transfer to another study"
35
+ off_study_reason_other: str | None = None
36
+
37
+ @model_validator(mode="after")
38
+ def off_study_reason_cr(self) -> Self:
39
+ if self.off_study and not self.off_study_reason:
40
+ raise ValueError('If "off_study" is "Yes" then "off_study_reason" is required.')
41
+ return self
42
+
43
+ @model_validator(mode="after")
44
+ def off_study_reason_other_cr(self) -> Self:
45
+ if self.off_study_reason == "Other" and not self.off_study_reason_other:
46
+ raise ValueError('If "off_study_reason" is "Other" then "off_study_reason_other" is required.')
47
+ return self
@@ -0,0 +1,52 @@
1
+ from typing import Self
2
+
3
+ from pydantic import NonPositiveInt, NonNegativeInt, model_validator
4
+
5
+ from .base import Base
6
+ from cidc_api.models.types import PriorTreatmentType, ConditioningRegimenType, StemCellDonorType
7
+
8
+
9
+ class PriorTreatment(Base):
10
+ __data_category__ = "prior_treatment"
11
+ __cardinality__ = "many"
12
+
13
+ # A unique internal identifier for the prior treatment record
14
+ prior_treatment_id: int | None = None
15
+
16
+ # A unique internal identifier for the associated participant record
17
+ participant_id: int | None = None
18
+
19
+ # Number of days from the enrollment date to the first recorded administration or occurrence of
20
+ # the treatment modality.
21
+ days_to_start: NonPositiveInt | None = None
22
+
23
+ # Number of days from the enrollment date to the last recorded administration or occurrence of
24
+ # the treatment modality.
25
+ days_to_end: NonPositiveInt | None = None
26
+
27
+ # Specifies the category or kind of prior treatment modality a participant received.
28
+ type: PriorTreatmentType
29
+
30
+ # Description of the prior treatment such as its full generic name if it is a type of therapy agent,
31
+ # radiotherapy procedure name and location, or surgical procedure name and location.
32
+ description: str | None = None
33
+
34
+ # Best response from any response assessment system to the prior treatment if available or applicable.
35
+ best_response: str | None = None
36
+
37
+ # If the prior treatment is "Conditioning therapy" received before a stem cell transplant, specifies what
38
+ # type of conditioning regimen used.
39
+ conditioning_regimen_type: ConditioningRegimenType | None = None
40
+
41
+ # If prior treatment is "Stem cell transplant", indicates what stem cell donor type used.
42
+ stem_cell_donor_type: StemCellDonorType | None = None
43
+
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
+ days_from_transplant_to_treatment_initiation: NonNegativeInt | None = None
47
+
48
+ @model_validator(mode="after")
49
+ def validate_description_cr(self) -> Self:
50
+ if self.type == "Other therapy" and not self.description:
51
+ raise ValueError('If type is "Other therapy", please provide description.')
52
+ return self
@@ -0,0 +1,37 @@
1
+ from .base import Base
2
+
3
+
4
+ class Publication(Base):
5
+ # The unique internal identifier for the Publication record
6
+ publication_id: int | None = None
7
+
8
+ # The unique internal identifier for the associated Trial record
9
+ trial_id: int | None = None
10
+
11
+ # The version number of the trial dataset
12
+ version: str | None = None
13
+
14
+ # The digital object identifier string. www.doi.org. e.g. 10.47366/sabia.v5n1a3
15
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15915370%20and%20ver_nr=1
16
+ digital_object_id: str
17
+
18
+ # The pubmed identifier string. pubmed.ncbi.nlm.nih.gov. e.g. 41135560
19
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15915377%20and%20ver_nr=1
20
+ pubmed_id: str | None = None
21
+
22
+ # The full title of the publication stated exactly as it appears on the published work.
23
+ # https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16078531%20and%20ver_nr=1
24
+ publication_title: str | None = None
25
+
26
+ # A list of authors for the cited work.
27
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16081468%20and%20ver_nr=1
28
+ authorship: str | None = None
29
+
30
+ # The year in which the cited work was published.
31
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16081475%20and%20ver_nr=1
32
+ year_of_publication: str | None = None
33
+
34
+ # The name of the journal in which the cited work was published, inclusive of the citation itself in terms of
35
+ # journal volume number, part number where applicable, and page numbers.
36
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16081476%20and%20ver_nr=1
37
+ journal_citation: str | None = None
@@ -0,0 +1,79 @@
1
+ from typing import Self
2
+
3
+ from pydantic import NonNegativeInt, NonNegativeFloat, model_validator
4
+
5
+ from .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
+ therapy_agent_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,71 @@
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 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: int | 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 | None = None
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 patient had follow-up.
47
+ days_to_last_follow_up: NonNegativeInt | None = None
48
+
49
+ @model_validator(mode="after")
50
+ def validate_overall_survival_cr(self) -> Self:
51
+ if self.survival_status != "Unknown" and not self.overall_survival:
52
+ raise ValueError('If survival_status is not "Unknown" then overall_survival is required.')
53
+ return self
54
+
55
+ @model_validator(mode="after")
56
+ def validate_cause_of_death_cr(self) -> Self:
57
+ if self.survival_status == "Dead" and not self.cause_of_death:
58
+ raise ValueError('If survival_status is "Dead" then cause_of_death is required.')
59
+ return self
60
+
61
+ @model_validator(mode="after")
62
+ def validate_cause_of_death_cr2(self) -> Self:
63
+ if self.survival_status == "Alive" and self.cause_of_death:
64
+ raise ValueError('If survival_status is "Alive", please leave cause_of_death blank.')
65
+ return self
66
+
67
+ @model_validator(mode="after")
68
+ def validate_days_to_death_cr(self) -> Self:
69
+ if self.survival_status in ["Alive", "Unknown"] and self.days_to_death:
70
+ raise ValueError("If survival_status does not indicate death, please leave days_to_death blank.")
71
+ return self
@@ -0,0 +1,109 @@
1
+ from typing import Self
2
+
3
+ from pydantic import PositiveInt, model_validator
4
+
5
+ from .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: int | 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
+ # Indicates whether a patient achieved a durable clinical benefit.
45
+ durable_clinical_benefit: bool | None = None
46
+
47
+ # Number of days between enrollment date and the date of first response to trial treatment.
48
+ days_to_first_response: PositiveInt | None = None
49
+
50
+ # Number of days between enrollment date and the date of the best response to trial treatment.
51
+ days_to_best_response: PositiveInt | None = None
52
+
53
+ # Indicates whether a participant's disease progressed.
54
+ progression: YNUNA
55
+
56
+ # Number of days between enrollment date and date of disease progression.
57
+ days_to_disease_progression: PositiveInt | None = None
58
+
59
+ # Indicator to identify whether a patient had a Progression-Free Survival (PFS) event.
60
+ progression_free_survival_event: YNUNA
61
+
62
+ # 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.
63
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=5143957%20and%20ver_nr=1
64
+ progression_free_survival: PositiveInt | None = None
65
+
66
+ @model_validator(mode="after")
67
+ def validate_response_duration_cr(self) -> Self:
68
+ if self.best_overall_response in negative_response_values and self.response_duration:
69
+ raise ValueError(
70
+ "If best_overall_response does not indicate a positive response, \
71
+ please leave response_duration blank."
72
+ )
73
+ return self
74
+
75
+ @model_validator(mode="after")
76
+ def validate_days_to_first_response_cr(self) -> Self:
77
+ if self.best_overall_response in negative_response_values and self.days_to_first_response:
78
+ raise ValueError(
79
+ "If best_overall_response does not indicate a positive response, \
80
+ please leave days_to_first_response blank."
81
+ )
82
+ return self
83
+
84
+ @model_validator(mode="after")
85
+ def validate_days_to_best_response_cr(self) -> Self:
86
+ if self.best_overall_response in negative_response_values and self.days_to_best_response:
87
+ raise ValueError(
88
+ "If best_overall_response does not indicate a positive response, \
89
+ please leave days_to_best_response blank."
90
+ )
91
+ return self
92
+
93
+ @model_validator(mode="after")
94
+ def validate_days_to_disease_progression_cr(self) -> Self:
95
+ if self.progression in ["No", "Unknown", "Not Applicable"] and self.days_to_disease_progression:
96
+ raise ValueError(
97
+ "If progression does not indicate confirmed progression of the disease, \
98
+ please leave days_to_disease_progress blank."
99
+ )
100
+ return self
101
+
102
+ @model_validator(mode="after")
103
+ def validate_progression_free_survival_cr(self) -> Self:
104
+ if self.progression_free_survival_event in ["Unknown", "Not Applicable"] and self.progression_free_survival:
105
+ raise ValueError(
106
+ "If progression_free_survival_event is not known, \
107
+ please leave progression_free_survival blank."
108
+ )
109
+ return self
@@ -0,0 +1,48 @@
1
+ from datetime import datetime
2
+
3
+ from .base import Base
4
+ from cidc_api.models.types import AssayPriority, AssayType, Courier, ShipmentCondition, ShipmentQuality
5
+
6
+
7
+ class Shipment(Base):
8
+ # The unique internal identifier for the shipment record.
9
+ shipment_id: int | None = None
10
+
11
+ # The unique internal identifier for the associated institution.
12
+ institution_id: int | None = None
13
+
14
+ # The unique internal identifier for the associated trial.
15
+ trial_id: int | None = None
16
+
17
+ # The version number of the trial dataset
18
+ version: str | None = None
19
+
20
+ # The identifier of the manifest used to ship this sample. e.g. "E4412_PBMC"
21
+ manifest_id: str
22
+
23
+ # Priority of the assay as it appears on the intake form. e.g. "10"
24
+ assay_priority: AssayPriority | None = None
25
+
26
+ # The type of assay used. e.g. "Olink"
27
+ assay_type: AssayType | None = None
28
+
29
+ # Courier utilized for shipment. e.g. "FedEx"
30
+ courier: Courier | None = None
31
+
32
+ # Air bill number assigned to shipment. e.g. "4567788343"
33
+ tracking_number: str | None = None
34
+
35
+ # The environmental conditions of the shipment. e.g. "Frozen Dry Ice"
36
+ condition: ShipmentCondition | None = None
37
+
38
+ # Details of shipping condition when condition is "Other"
39
+ condition_other: str | None = None
40
+
41
+ # Date the shipment was posted
42
+ date_shipped: datetime | None = None
43
+
44
+ # Date the shipment was received
45
+ date_received: datetime | None = None
46
+
47
+ # Indication of the quality/condition of the specimens after receipt. e.g. "Damaged"
48
+ quality: ShipmentQuality | None = None
@@ -0,0 +1,15 @@
1
+ from .base import Base
2
+
3
+
4
+ class ShipmentSpecimen(Base):
5
+ # The unique internal identifier of the associated specimen
6
+ specimen_id: int | None = None
7
+
8
+ # The unique internal identifier of the associated shipment
9
+ shipment_id: int | None = None
10
+
11
+ # Identifier if sample shipment container includes multiple boxes for each assay. e.g. "1", "X"
12
+ box_number: str
13
+
14
+ # Sample location within the shipping container. e.g. "A1"
15
+ sample_location: str