nci-cidc-api-modules 1.2.29__py3-none-any.whl → 1.2.34__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 (51) hide show
  1. cidc_api/models/data.py +4 -0
  2. cidc_api/models/db/stage2/additional_treatment_orm.py +4 -3
  3. cidc_api/models/db/stage2/adverse_event_orm.py +1 -0
  4. cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +1 -0
  5. cidc_api/models/db/stage2/comorbidity_orm.py +1 -0
  6. cidc_api/models/db/stage2/consent_group_orm.py +1 -0
  7. cidc_api/models/db/stage2/demographic_orm.py +8 -5
  8. cidc_api/models/db/stage2/disease_orm.py +9 -10
  9. cidc_api/models/db/stage2/exposure_orm.py +2 -1
  10. cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +1 -0
  11. cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +1 -0
  12. cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +1 -0
  13. cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +1 -0
  14. cidc_api/models/db/stage2/medical_history_orm.py +1 -0
  15. cidc_api/models/db/stage2/other_malignancy_orm.py +7 -6
  16. cidc_api/models/db/stage2/participant_orm.py +5 -4
  17. cidc_api/models/db/stage2/prior_treatment_orm.py +12 -10
  18. cidc_api/models/db/stage2/radiotherapy_dose_orm.py +1 -0
  19. cidc_api/models/db/stage2/response_by_system_orm.py +2 -0
  20. cidc_api/models/db/stage2/response_orm.py +3 -2
  21. cidc_api/models/db/stage2/stem_cell_transplant_orm.py +1 -0
  22. cidc_api/models/db/stage2/surgery_orm.py +1 -0
  23. cidc_api/models/db/stage2/therapy_agent_dose_orm.py +1 -0
  24. cidc_api/models/db/stage2/treatment_orm.py +1 -0
  25. cidc_api/models/db/stage2/trial_orm.py +20 -17
  26. cidc_api/models/models.py +1 -0
  27. cidc_api/models/pydantic/stage2/additional_treatment.py +6 -4
  28. cidc_api/models/pydantic/stage2/adverse_event.py +1 -1
  29. cidc_api/models/pydantic/stage2/base.py +19 -1
  30. cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +1 -1
  31. cidc_api/models/pydantic/stage2/demographic.py +26 -17
  32. cidc_api/models/pydantic/stage2/disease.py +32 -18
  33. cidc_api/models/pydantic/stage2/exposure.py +2 -2
  34. cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +1 -1
  35. cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +1 -1
  36. cidc_api/models/pydantic/stage2/medical_history.py +1 -1
  37. cidc_api/models/pydantic/stage2/other_malignancy.py +11 -7
  38. cidc_api/models/pydantic/stage2/participant.py +6 -5
  39. cidc_api/models/pydantic/stage2/prior_treatment.py +12 -12
  40. cidc_api/models/pydantic/stage2/radiotherapy_dose.py +1 -1
  41. cidc_api/models/pydantic/stage2/response.py +4 -10
  42. cidc_api/models/pydantic/stage2/response_by_system.py +9 -6
  43. cidc_api/models/pydantic/stage2/specimen.py +2 -2
  44. cidc_api/models/pydantic/stage2/treatment.py +1 -1
  45. cidc_api/models/pydantic/stage2/trial.py +13 -7
  46. cidc_api/models/types.py +18 -29
  47. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.34.dist-info}/METADATA +6 -4
  48. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.34.dist-info}/RECORD +51 -51
  49. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.34.dist-info}/WHEEL +0 -0
  50. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.34.dist-info}/licenses/LICENSE +0 -0
  51. {nci_cidc_api_modules-1.2.29.dist-info → nci_cidc_api_modules-1.2.34.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,14 @@
1
- from pydantic import NonPositiveInt, model_validator
2
- from typing import List, Self
1
+ from pydantic import NonPositiveInt, model_validator, BeforeValidator
2
+ from typing import List, Self, Annotated, get_args
3
3
 
4
4
  from .base import Base
5
5
  from cidc_api.models.types import (
6
- PrimaryDiagnosisDiseaseGroup,
7
6
  TumorGrade,
8
7
  CancerStageSystem,
9
8
  CancerStageSystemVersion,
9
+ CancerStageSystemVersionAJCC,
10
+ CancerStageSystemVersionRISS,
11
+ CancerStageSystemVersionFIGO,
10
12
  CancerStage,
11
13
  TCategory,
12
14
  NCategory,
@@ -27,12 +29,7 @@ class Disease(Base):
27
29
 
28
30
  # The unique internal identifier for the associated participant
29
31
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
30
- participant_id: int | None = None
31
-
32
- # A term describing the main condition for evaluation and treatment as captured in the Disease or Diagnosis (C2991)
33
- # branch of the National Cancer Institute Thesaurus (NCIt) hierarchy tree. e.g. "Melanoma"
34
- # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14905532%20and%20ver_nr=1
35
- primary_diagnosis_disease_group: PrimaryDiagnosisDiseaseGroup
32
+ participant_id: str | None = None
36
33
 
37
34
  # The location within the body from where the disease of interest originated as captured in the Uberon identifier. e.g. "lung"
38
35
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=14883047%20and%20ver_nr=1
@@ -40,18 +37,18 @@ class Disease(Base):
40
37
 
41
38
  # The ICD-O-3 morphology code that describes the tumor's histology, behavior, and grade-differentiation. e.g. "8480/6"
42
39
  # CDE: TBD
43
- morphological_code: ICDO3MorphologicalCode
40
+ morphological_code: ICDO3MorphologicalCode | None
44
41
 
45
42
  # The ICD-O-3 morphology term that describes the tumor's type. e.g. "Mucinous adenoma"
46
43
  # CDE: TBD
47
- morphological_term: ICDO3MorphologicalTerm
44
+ morphological_term: ICDO3MorphologicalTerm | None
48
45
 
49
46
  # Words that broadly describe the cancer's characteristics and type. e.g. "Inflitrating Ductal Carcinoma"
50
47
  # CDE: TBD
51
48
  cancer_type_description: str | None = None
52
49
 
53
50
  # The number of days elapsed since the participant was first diagnosed with this condition.
54
- days_since_original_diagnosis: NonPositiveInt
51
+ days_since_original_diagnosis: NonPositiveInt | None
55
52
 
56
53
  # Words that express the degree of abnormality of cancer cells as a measure of differentiation and aggressiveness. e.g. "G1 Low Grade"
57
54
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11325685%20and%20ver_nr=2
@@ -68,32 +65,32 @@ class Disease(Base):
68
65
  # CDE(AJCC): https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440332%20and%20ver_nr=1
69
66
  # CDE(FIGO): TBD
70
67
  # CDE(RISS): TBD
71
- cancer_stage: CancerStage
68
+ cancer_stage: CancerStage | None = None
72
69
 
73
70
  # Extent of the primary cancer based on evidence obtained from clinical assessment parameters determined prior to treatment. e.g. "T0"
74
71
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440328%20and%20ver_nr=1
75
72
  # TODO: Verify this CDE
76
- t_category: TCategory
73
+ t_category: TCategory | None = None
77
74
 
78
75
  # Extent of the regional lymph node involvement for the cancer based on evidence obtained from clinical assessment parameters
79
76
  # determined prior to treatment. e.g. "N0"
80
77
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=3440330%20and%20ver_nr=1
81
78
  # TODO: Verify this CDE
82
- n_category: NCategory
79
+ n_category: NCategory | None = None
83
80
 
84
81
  # Extent of the distant metastasis for the cancer based on evidence obtained from clinical assessment parameters determined
85
82
  # prior to treatment. e.g. "M0"
86
83
  # CDE: https://teams.microsoft.com/l/message/19:1c292b63-5df1-4f29-b177-86aed53f393d_f224ae83-209b-4cd9-a7ef-83d9d2120a27@unq.gbl.spaces/1758827414202?context=%7B%22contextType%22%3A%22chat%22%7D
87
84
  # TODO: Verify this CDE
88
- m_category: MCategory
85
+ m_category: MCategory | None = None
89
86
 
90
87
  # The organ site where a tumor develops outside of the bone marrow as specified in the Uberon antatomical term.
91
- metastatic_organ: List[UberonAnatomicalTerm] = []
88
+ metastatic_organ: Annotated[List[UberonAnatomicalTerm] | None, BeforeValidator(Base.split_list)] = []
92
89
 
93
90
  # Indicates if participant has a hematological malignancy that is only extramedullary. e.g. "Yes"
94
91
  solely_extramedullary_disease: YNU
95
92
 
96
- extramedullary_organ: List[UberonAnatomicalTerm] = []
93
+ extramedullary_organ: Annotated[List[UberonAnatomicalTerm] | None, BeforeValidator(Base.split_list)] = []
97
94
 
98
95
  @model_validator(mode="after")
99
96
  def validate_code_or_term_or_description_cr(self) -> Self:
@@ -103,6 +100,23 @@ class Disease(Base):
103
100
  )
104
101
  return self
105
102
 
103
+ @model_validator(mode="after")
104
+ def validate_cancer_stage_system_version(self) -> Self:
105
+ msg = f"{self.cancer_stage_system_version} is not applicable to {self.cancer_stage_system}"
106
+ if self.cancer_stage_system == "AJCC" and self.cancer_stage_system_version not in get_args(
107
+ CancerStageSystemVersionAJCC
108
+ ):
109
+ raise ValueError(msg)
110
+ elif self.cancer_stage_system == "RISS" and self.cancer_stage_system_version not in get_args(
111
+ CancerStageSystemVersionRISS
112
+ ):
113
+ raise ValueError(msg)
114
+ elif self.cancer_stage_system == "FIGO" and self.cancer_stage_system_version not in get_args(
115
+ CancerStageSystemVersionFIGO
116
+ ):
117
+ raise ValueError(msg)
118
+ return self
119
+
106
120
  @model_validator(mode="after")
107
121
  def validate_cancer_stage_system_version_cr(self) -> Self:
108
122
  if self.cancer_stage_system != "Not Applicable" and not self.cancer_stage_system_version:
@@ -14,7 +14,7 @@ class Exposure(Base):
14
14
  exposure_id: int | None = None
15
15
 
16
16
  # The unique identifier for the associated participant
17
- participant_id: int | None = None
17
+ participant_id: str | None = None
18
18
 
19
19
  # An indication of whether the subject was exposed to any chemical, biological or physical agents
20
20
  # that increase the risk of neoplasms in humans or animals.
@@ -23,7 +23,7 @@ class Exposure(Base):
23
23
 
24
24
  # The type of potentially harmful environmental agents to which an individual was exposed.
25
25
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=15753203%20and%20ver_nr=1
26
- exposure_type: ExposureType
26
+ exposure_type: ExposureType | None = None
27
27
 
28
28
  @model_validator(mode="after")
29
29
  def validate_exposure_type_cr(self) -> Self:
@@ -15,7 +15,7 @@ class GVHDDiagnosisAcute(Base):
15
15
  gvhd_diagnosis_acute_id: int | None = None
16
16
 
17
17
  # The unique internal identifier for the associated participant
18
- participant_id: int | None = None
18
+ participant_id: str | None = None
19
19
 
20
20
  # The clinical grading system used to stage involvement of affected organs (skin, liver, GI tract)
21
21
  # in acute GVHD and assign an overall severity grade (I–IV) based on predefined criteria.
@@ -15,7 +15,7 @@ class GVHDDiagnosisChronic(Base):
15
15
  gvhd_diagnosis_chronic_id: int | None = None
16
16
 
17
17
  # The unique internal identifier for the associated participant
18
- participant_id: int | None = None
18
+ participant_id: str | None = None
19
19
 
20
20
  # The standardized clinical system used to evaluate and grade the extent and severity
21
21
  # of organ involvement in chronic GVHD, resulting in an overall disease severity score.
@@ -14,7 +14,7 @@ class MedicalHistory(Base):
14
14
  medical_history_id: int | None = None
15
15
 
16
16
  # The unique identifier for the associated participant
17
- participant_id: int | None = None
17
+ participant_id: str | None = None
18
18
 
19
19
  # Text representation of a person's status relative to smoking tobacco in the form of cigarettes,
20
20
  # based on questions about current and former use of cigarettes.
@@ -17,28 +17,32 @@ class OtherMalignancy(Base):
17
17
  medical_history_id: int | None = None
18
18
 
19
19
  # The location within the body from where the prior malignancy originated as captured in the Uberon anatomical term.
20
- primary_disease_site: UberonAnatomicalTerm
20
+ other_malignancy_primary_disease_site: UberonAnatomicalTerm
21
21
 
22
22
  # The ICD-O-3 code which identifies the specific appearance of cells and tissues (normal and abnormal) used
23
23
  # to define the presence and nature of disease.
24
- morphological_code: ICDO3MorphologicalCode | None = None
24
+ other_malignancy_morphological_code: ICDO3MorphologicalCode | None = None
25
25
 
26
26
  # The ICD-O-3 textual label which identifies the specific appearance of cells and tissues (normal and abnormal) used
27
27
  # to define the presence and nature of disease.
28
- morphological_term: ICDO3MorphologicalTerm | None = None
28
+ other_malignancy_morphological_term: ICDO3MorphologicalTerm | None = None
29
29
 
30
30
  # Description of the cancer type as recorded in the trial.
31
- malignancy_description: str | None = None
31
+ other_malignancy_description: str | None = None
32
32
 
33
33
  # Number of days since original diagnosis from the enrollment date. This may be a negative number.
34
- days_since_diagnosis: NonPositiveInt | None = None
34
+ other_malignancy_days_since_diagnosis: NonPositiveInt | None = None
35
35
 
36
36
  # Indicates the participant’s current clinical state regarding the cancer diagnosis.
37
- malignancy_status: MalignancyStatus | None = None
37
+ other_malignancy_status: MalignancyStatus | None = None
38
38
 
39
39
  @model_validator(mode="after")
40
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:
41
+ if (
42
+ not self.other_malignancy_morphological_code
43
+ and not self.other_malignancy_morphological_term
44
+ and not self.other_malignancy_description
45
+ ):
42
46
  raise ValueError(
43
47
  'Please provide at least one of "morphological_code", "morphological_term" or "malignancy_description".'
44
48
  )
@@ -3,6 +3,7 @@ from typing import Self
3
3
  from pydantic import model_validator
4
4
 
5
5
  from .base import Base
6
+ from cidc_api.models.types import YNU
6
7
  from cidc_api.models.types import OffStudyReason
7
8
 
8
9
 
@@ -12,20 +13,20 @@ class Participant(Base):
12
13
 
13
14
  # The unique internal identifier for the participant
14
15
  # 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
+ participant_id: str | None = None
16
17
 
17
18
  # The participant identifier assigned by the clinical trial team overseeing the study
18
- native_participant_id: str
19
+ native_participant_id: str | None = None
19
20
 
20
21
  # The globally unique participant identifier assigned by the CIMAC network. e.g. C8P29A7
21
- cimac_participant_id: str
22
+ cimac_participant_id: str | None = None
22
23
 
23
24
  # The unique identifier for the associated trial that the participant is participating in
24
25
  trial_id: int | None = None
25
26
 
26
27
  # Indicates if the individual is no longer actively participating in the clinical trial.
27
28
  # 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
+ off_study: YNU
29
30
 
30
31
  # An explanation describing why an individual is no longer participating in the clinical trial.
31
32
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13362265%20and%20ver_nr=1
@@ -36,7 +37,7 @@ class Participant(Base):
36
37
 
37
38
  @model_validator(mode="after")
38
39
  def off_study_reason_cr(self) -> Self:
39
- if self.off_study and not self.off_study_reason:
40
+ if self.off_study == "Yes" and not self.off_study_reason:
40
41
  raise ValueError('If "off_study" is "Yes" then "off_study_reason" is required.')
41
42
  return self
42
43
 
@@ -1,6 +1,6 @@
1
- from typing import Self
1
+ from typing import Self, Annotated, List
2
2
 
3
- from pydantic import NonPositiveInt, NonNegativeInt, model_validator
3
+ from pydantic import NonPositiveInt, NegativeInt, model_validator, BeforeValidator
4
4
 
5
5
  from .base import Base
6
6
  from cidc_api.models.types import PriorTreatmentType, ConditioningRegimenType, StemCellDonorType
@@ -14,39 +14,39 @@ class PriorTreatment(Base):
14
14
  prior_treatment_id: int | None = None
15
15
 
16
16
  # A unique internal identifier for the associated participant record
17
- participant_id: int | None = None
17
+ participant_id: str | None = None
18
18
 
19
19
  # Number of days from the enrollment date to the first recorded administration or occurrence of
20
20
  # the treatment modality.
21
- days_to_start: NonPositiveInt | None = None
21
+ prior_treatment_days_to_start: NonPositiveInt | None = None
22
22
 
23
23
  # Number of days from the enrollment date to the last recorded administration or occurrence of
24
24
  # the treatment modality.
25
- days_to_end: NonPositiveInt | None = None
25
+ prior_treatment_days_to_end: NonPositiveInt | None = None
26
26
 
27
27
  # Specifies the category or kind of prior treatment modality a participant received.
28
- type: PriorTreatmentType
28
+ prior_treatment_type: Annotated[List[PriorTreatmentType], BeforeValidator(Base.split_list)]
29
29
 
30
30
  # Description of the prior treatment such as its full generic name if it is a type of therapy agent,
31
31
  # radiotherapy procedure name and location, or surgical procedure name and location.
32
- description: str | None = None
32
+ prior_treatment_description: str | None = None
33
33
 
34
34
  # Best response from any response assessment system to the prior treatment if available or applicable.
35
- best_response: str | None = None
35
+ prior_treatment_best_response: str | None = None
36
36
 
37
37
  # If the prior treatment is "Conditioning therapy" received before a stem cell transplant, specifies what
38
38
  # type of conditioning regimen used.
39
- conditioning_regimen_type: ConditioningRegimenType | None = None
39
+ prior_treatment_conditioning_regimen_type: ConditioningRegimenType | None = None
40
40
 
41
41
  # If prior treatment is "Stem cell transplant", indicates what stem cell donor type used.
42
- stem_cell_donor_type: StemCellDonorType | None = None
42
+ prior_treatment_stem_cell_donor_type: StemCellDonorType | None = None
43
43
 
44
44
  # If prior treatment is "Stem cell transplant", indicates the number of days from the transplant
45
45
  # date to the start of the current treatment.
46
- days_from_transplant_to_treatment_initiation: NonNegativeInt | None = None
46
+ prior_treatment_days_to_prior_transplant: NegativeInt | None = None
47
47
 
48
48
  @model_validator(mode="after")
49
49
  def validate_description_cr(self) -> Self:
50
- if self.type == "Other therapy" and not self.description:
50
+ if "Other therapy" in self.prior_treatment_type and not self.prior_treatment_description:
51
51
  raise ValueError('If type is "Other therapy", please provide description.')
52
52
  return self
@@ -17,7 +17,7 @@ class RadiotherapyDose(Base):
17
17
  __cardinality__ = "many"
18
18
 
19
19
  # The unique internal identifier for the radiotherapy dose record
20
- therapy_agent_dose_id: int | None = None
20
+ radiotherapy_dose_id: int | None = None
21
21
 
22
22
  # The unique internal identifier for the associated treatment record
23
23
  treatment_id: int | None = None
@@ -15,14 +15,14 @@ class Response(Base):
15
15
 
16
16
  # The unique internal identifier for the associated participant
17
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
18
+ participant_id: str | None = None
19
19
 
20
20
  # The response to a question that describes a participant's survival status.
21
21
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=2847330%20and%20ver_nr=1
22
22
  survival_status: SurvivalStatus
23
23
 
24
24
  # Number of days from enrollment date to death date.
25
- overall_survival: NonNegativeInt | None = None
25
+ overall_survival: NonNegativeInt
26
26
 
27
27
  # Indicator for whether there was an abscopal effect on disease after local therapy.
28
28
  abscopal_response: YNUNA | None = None
@@ -43,14 +43,8 @@ class Response(Base):
43
43
  # Indicates whether participant was evaluable for efficacy (for example, response, PFS, OS, etc.) overall.
44
44
  evaluable_for_efficacy: bool
45
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
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
54
48
 
55
49
  @model_validator(mode="after")
56
50
  def validate_cause_of_death_cr(self) -> Self:
@@ -1,6 +1,6 @@
1
1
  from typing import Self
2
2
 
3
- from pydantic import PositiveInt, model_validator
3
+ from pydantic import PositiveInt, model_validator, NonNegativeInt
4
4
 
5
5
  from .base import Base
6
6
  from cidc_api.models.types import ResponseSystem, ResponseSystemVersion, BestOverallResponse, YNUNA
@@ -26,7 +26,7 @@ class ResponseBySystem(Base):
26
26
 
27
27
  # The unique internal identifier for the associated participant
28
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
29
+ participant_id: str | None = None
30
30
 
31
31
  # A standardized method used to evaluate and categorize the participant’s clinical response to treatment based on predefined criteria.
32
32
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=13381490%20and%20ver_nr=1
@@ -41,6 +41,9 @@ class ResponseBySystem(Base):
41
41
  # Days from first response to progression.
42
42
  response_duration: PositiveInt | None = None
43
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
+
44
47
  # Indicates whether a patient achieved a durable clinical benefit.
45
48
  durable_clinical_benefit: bool | None = None
46
49
 
@@ -67,8 +70,8 @@ class ResponseBySystem(Base):
67
70
  def validate_response_duration_cr(self) -> Self:
68
71
  if self.best_overall_response in negative_response_values and self.response_duration:
69
72
  raise ValueError(
70
- "If best_overall_response does not indicate a positive response, \
71
- please leave response_duration blank."
73
+ "If best_overall_response does not indicate a positive response, "
74
+ "please leave response_duration blank."
72
75
  )
73
76
  return self
74
77
 
@@ -76,8 +79,8 @@ class ResponseBySystem(Base):
76
79
  def validate_days_to_first_response_cr(self) -> Self:
77
80
  if self.best_overall_response in negative_response_values and self.days_to_first_response:
78
81
  raise ValueError(
79
- "If best_overall_response does not indicate a positive response, \
80
- please leave days_to_first_response blank."
82
+ "If best_overall_response does not indicate a positive response, "
83
+ "please leave days_to_first_response blank."
81
84
  )
82
85
  return self
83
86
 
@@ -26,7 +26,7 @@ from cidc_api.models.types import (
26
26
 
27
27
 
28
28
  class Specimen(Base):
29
- __data_category__ = "specimen"
29
+ # __data_category__ = "specimen"
30
30
  __cardinality__ = "many"
31
31
 
32
32
  # The unique internal identifier for the specimen record
@@ -34,7 +34,7 @@ class Specimen(Base):
34
34
 
35
35
  # The unique internal identifier for the associated participant
36
36
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=12220014%20and%20ver_nr=1
37
- participant_id: int | None = None
37
+ participant_id: str | None = None
38
38
 
39
39
  # The unique specimen identifier assigned by the CIMAC-CIDC Network.
40
40
  # Formatted as CTTTPPPSS.AA for trial code TTT, participant PPP, sample SS, and aliquot AA.
@@ -14,7 +14,7 @@ class Treatment(Base):
14
14
  treatment_id: int | None = None
15
15
 
16
16
  # The unique internal identifier for the associated Participant record
17
- participant_id: int | None = None
17
+ participant_id: str | None = None
18
18
 
19
19
  # The unique internal identifier for the associated Arm record
20
20
  arm_id: int | None = None
@@ -1,8 +1,9 @@
1
1
  from datetime import datetime
2
- from typing import List
2
+ from pydantic import BeforeValidator
3
+ from typing import List, Annotated
3
4
 
4
5
  from .base import Base
5
- from cidc_api.models.types import TrialOrganization, TrialFundingAgency, TrialStatus, AssayType
6
+ from cidc_api.models.types import TrialOrganization, TrialFundingAgency, AssayType, AgeGroup
6
7
 
7
8
 
8
9
  class Trial(Base):
@@ -11,11 +12,20 @@ class Trial(Base):
11
12
 
12
13
  # The unique identifier for the clinical trial. e.g. "GU16-287","BACCI"
13
14
  # 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
+ trial_id: str | None = None # TODO: Fix stage2 trial_id to not be nullable, once stage 1 models are complete
15
16
 
16
17
  # The version number of the trial dataset. e.g. "1.0"
17
18
  version: str | None = None
18
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
+
19
29
  # ClinicalTrials.gov identifier. e.g. "NCT03731260"
20
30
  # TODO need cde from janice, they will make one
21
31
  nct_id: str | None = None
@@ -45,10 +55,6 @@ class Trial(Base):
45
55
  # e.g. "Duke University - Duke Cancer Institute LAO"
46
56
  grant_or_affiliated_network: TrialFundingAgency | None = None
47
57
 
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
58
  # The id of the primary organization responsible for storing biospecimens from this study.
53
59
  biobank_institution_id: int | None = None
54
60
 
cidc_api/models/types.py CHANGED
@@ -20,6 +20,12 @@ from cidc_api.reference.gvhd import is_gvhd_organ
20
20
  # As python Enums are rather cumbersome when we only want a list of permissible values for a string, use Literal instead
21
21
 
22
22
 
23
+ AgeGroup = Literal[
24
+ "Adolescent and Young Adult",
25
+ "Adult",
26
+ "Pediatric",
27
+ ]
28
+
23
29
  TrialOrganization = Literal[
24
30
  "ECOG-ACRIN",
25
31
  "SWOG",
@@ -53,13 +59,6 @@ TrialFundingAgency = Literal[
53
59
  ]
54
60
 
55
61
 
56
- TrialStatus = Literal[
57
- "Active Study",
58
- "Completed Study",
59
- "Provisional Study",
60
- ]
61
-
62
-
63
62
  AssayType = Literal[
64
63
  "Olink",
65
64
  "WES",
@@ -217,24 +216,6 @@ FileFormat = Literal[
217
216
  ]
218
217
 
219
218
 
220
- PrimaryDiagnosisDiseaseGroup = Literal[
221
- "Ovarian epithelial cancer",
222
- "Esophageal cancer, NOS",
223
- "Primary peritoneal carcinoma",
224
- "Gastric cancer, NOS",
225
- "Fallopian tube carcinoma",
226
- "Invasive breast carcinoma",
227
- "Small cell lung cancer",
228
- "Prostate cancer, NOS",
229
- "Non-small cell lung cancer, NOS",
230
- "Myeloma, NOS",
231
- "Melanoma",
232
- "Adenocarcinoma of the gastroesophageal junction",
233
- "Acute myeloid leukemia, NOS",
234
- "Colorectal cancer, NOS",
235
- ]
236
-
237
-
238
219
  TumorGrade = Literal[
239
220
  "G1 Low Grade",
240
221
  "G2 Intermediate Grade",
@@ -255,12 +236,20 @@ CancerStageSystem = Literal[
255
236
  ]
256
237
 
257
238
 
258
- CancerStageSystemVersionAJCC = Literal["8",]
239
+ CancerStageSystemVersionAJCC = Literal["8th Edition",]
259
240
 
260
- CancerStageSystemVersionRISS = Literal["2"]
241
+ CancerStageSystemVersionRISS = Literal["10.1200/JCO.2015.61.2267"]
261
242
 
262
-
263
- CancerStageSystemVersionFIGO = Literal["2021"]
243
+ CancerStageSystemVersionFIGO = Literal[
244
+ "10.1002/ijgo.14923",
245
+ "10.1002/ijgo.13881",
246
+ "10.1002/ijgo.13867",
247
+ "10.1002/ijgo.13865",
248
+ "10.1002/ijgo.13866",
249
+ "10.1002/ijgo.13878",
250
+ "10.1002/ijgo.13877",
251
+ "10.1002/ijgo.12613",
252
+ ]
264
253
 
265
254
  CancerStageSystemVersion = CancerStageSystemVersionAJCC | CancerStageSystemVersionFIGO | CancerStageSystemVersionRISS
266
255
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nci_cidc_api_modules
3
- Version: 1.2.29
3
+ Version: 1.2.34
4
4
  Summary: SQLAlchemy data models and configuration tools used in the NCI CIDC API
5
5
  Home-page: https://github.com/NCI-CIDC/cidc-api-gae
6
6
  License: MIT license
@@ -12,25 +12,27 @@ Requires-Dist: cloud-sql-python-connector[pg8000]>=1.18.5
12
12
  Requires-Dist: flask>=3.1.2
13
13
  Requires-Dist: flask-migrate>=4.1.0
14
14
  Requires-Dist: flask-sqlalchemy>=3.1.1
15
+ Requires-Dist: flask-talisman>=0.7.0
15
16
  Requires-Dist: google-auth==2.43.0
16
- Requires-Dist: google-api-python-client>=2.185.0
17
+ Requires-Dist: google-api-python-client>=2.187.0
17
18
  Requires-Dist: google-cloud-bigquery>=3.38.0
18
19
  Requires-Dist: google-cloud-pubsub>=2.33.0
19
20
  Requires-Dist: google-cloud-secret-manager>=2.25.0
20
21
  Requires-Dist: google-cloud-storage>=3.6.0
21
22
  Requires-Dist: jinja2>=3.1.6
23
+ Requires-Dist: joserfc>=1.5.0
22
24
  Requires-Dist: marshmallow>=4.1.0
23
25
  Requires-Dist: marshmallow-sqlalchemy>=1.4.2
24
26
  Requires-Dist: numpy>=2.3.5
25
27
  Requires-Dist: packaging>=25.0
26
28
  Requires-Dist: pandas>=2.3.3
27
29
  Requires-Dist: pyarrow>=22.0.0
28
- Requires-Dist: pydantic~=2.12.4
30
+ Requires-Dist: pydantic~=2.12.5
29
31
  Requires-Dist: python-dotenv>=1.2.1
30
32
  Requires-Dist: requests>=2.32.5
31
33
  Requires-Dist: sqlalchemy>=2.0.44
32
34
  Requires-Dist: sqlalchemy-mixins~=2.0.5
33
- Requires-Dist: werkzeug>=3.1.3
35
+ Requires-Dist: werkzeug>=3.1.4
34
36
  Requires-Dist: nci-cidc-schemas==0.28.10
35
37
  Dynamic: description
36
38
  Dynamic: description-content-type