nci-cidc-api-modules 1.2.38__py3-none-any.whl → 1.2.40__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 (141) hide show
  1. cidc_api/__init__.py +1 -1
  2. cidc_api/config/db.py +21 -1
  3. cidc_api/models/__init__.py +0 -2
  4. cidc_api/models/db/stage1/__init__.py +56 -0
  5. cidc_api/models/db/stage1/additional_treatment_orm.py +23 -0
  6. cidc_api/models/db/stage1/adverse_event_orm.py +47 -0
  7. cidc_api/models/db/stage1/base_orm.py +7 -0
  8. cidc_api/models/db/stage1/baseline_clinical_assessment_orm.py +23 -0
  9. cidc_api/models/db/stage1/comorbidity_orm.py +24 -0
  10. cidc_api/models/db/stage1/consent_group_orm.py +33 -0
  11. cidc_api/models/db/stage1/demographic_orm.py +48 -0
  12. cidc_api/models/db/stage1/disease_orm.py +53 -0
  13. cidc_api/models/db/stage1/exposure_orm.py +23 -0
  14. cidc_api/models/db/stage1/gvhd_diagnosis_acute_orm.py +35 -0
  15. cidc_api/models/db/stage1/gvhd_diagnosis_chronic_orm.py +37 -0
  16. cidc_api/models/db/stage1/gvhd_organ_acute_orm.py +22 -0
  17. cidc_api/models/db/stage1/gvhd_organ_chronic_orm.py +22 -0
  18. cidc_api/models/db/stage1/medical_history_orm.py +31 -0
  19. cidc_api/models/db/stage1/other_malignancy_orm.py +30 -0
  20. cidc_api/models/db/stage1/participant_orm.py +78 -0
  21. cidc_api/models/db/stage1/prior_treatment_orm.py +31 -0
  22. cidc_api/models/db/stage1/radiotherapy_dose_orm.py +40 -0
  23. cidc_api/models/db/stage1/response_by_system_orm.py +31 -0
  24. cidc_api/models/db/stage1/response_orm.py +29 -0
  25. cidc_api/models/db/stage1/specimen_orm.py +46 -0
  26. cidc_api/models/db/stage1/stem_cell_transplant_orm.py +26 -0
  27. cidc_api/models/db/stage1/surgery_orm.py +28 -0
  28. cidc_api/models/db/stage1/therapy_agent_dose_orm.py +32 -0
  29. cidc_api/models/db/stage1/treatment_orm.py +39 -0
  30. cidc_api/models/db/stage1/trial_orm.py +36 -0
  31. cidc_api/models/db/stage2/additional_treatment_orm.py +5 -5
  32. cidc_api/models/db/stage2/administrative_person_orm.py +4 -3
  33. cidc_api/models/db/stage2/administrative_role_assignment_orm.py +4 -3
  34. cidc_api/models/db/stage2/adverse_event_orm.py +11 -12
  35. cidc_api/models/db/stage2/arm_orm.py +3 -2
  36. cidc_api/models/db/stage2/base_orm.py +7 -0
  37. cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +5 -6
  38. cidc_api/models/db/stage2/cohort_orm.py +3 -2
  39. cidc_api/models/db/stage2/comorbidity_orm.py +6 -7
  40. cidc_api/models/db/stage2/consent_group_orm.py +4 -3
  41. cidc_api/models/db/stage2/contact_orm.py +16 -19
  42. cidc_api/models/db/stage2/demographic_orm.py +3 -2
  43. cidc_api/models/db/stage2/disease_orm.py +4 -3
  44. cidc_api/models/db/stage2/exposure_orm.py +3 -2
  45. cidc_api/models/db/stage2/file_orm.py +6 -8
  46. cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +4 -3
  47. cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +4 -5
  48. cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +3 -2
  49. cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +3 -2
  50. cidc_api/models/db/stage2/institution_orm.py +7 -6
  51. cidc_api/models/db/stage2/medical_history_orm.py +9 -8
  52. cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +8 -11
  53. cidc_api/models/db/stage2/other_malignancy_orm.py +8 -9
  54. cidc_api/models/db/stage2/participant_orm.py +23 -23
  55. cidc_api/models/db/stage2/prior_treatment_orm.py +11 -10
  56. cidc_api/models/db/stage2/publication_orm.py +8 -9
  57. cidc_api/models/db/stage2/radiotherapy_dose_orm.py +8 -8
  58. cidc_api/models/db/stage2/response_by_system_orm.py +3 -2
  59. cidc_api/models/db/stage2/response_orm.py +3 -2
  60. cidc_api/models/db/stage2/shipment_orm.py +17 -16
  61. cidc_api/models/db/stage2/shipment_specimen_orm.py +4 -3
  62. cidc_api/models/db/stage2/specimen_orm.py +7 -5
  63. cidc_api/models/db/stage2/stem_cell_transplant_orm.py +5 -5
  64. cidc_api/models/db/stage2/surgery_orm.py +6 -6
  65. cidc_api/models/db/stage2/therapy_agent_dose_orm.py +7 -7
  66. cidc_api/models/db/stage2/treatment_orm.py +15 -14
  67. cidc_api/models/db/stage2/trial_orm.py +15 -16
  68. cidc_api/models/models.py +4 -0
  69. cidc_api/models/pydantic/{stage2/base.py → base.py} +1 -1
  70. cidc_api/models/pydantic/stage1/__init__.py +56 -0
  71. cidc_api/models/pydantic/stage1/additional_treatment.py +23 -0
  72. cidc_api/models/pydantic/stage1/adverse_event.py +100 -0
  73. cidc_api/models/pydantic/stage1/baseline_clinical_assessment.py +23 -0
  74. cidc_api/models/pydantic/stage1/comorbidity.py +36 -0
  75. cidc_api/models/pydantic/stage1/consent_group.py +30 -0
  76. cidc_api/models/pydantic/stage1/demographic.py +123 -0
  77. cidc_api/models/pydantic/stage1/disease.py +158 -0
  78. cidc_api/models/pydantic/stage1/exposure.py +32 -0
  79. cidc_api/models/pydantic/stage1/gvhd_diagnosis_acute.py +33 -0
  80. cidc_api/models/pydantic/stage1/gvhd_diagnosis_chronic.py +32 -0
  81. cidc_api/models/pydantic/stage1/gvhd_organ_acute.py +22 -0
  82. cidc_api/models/pydantic/stage1/gvhd_organ_chronic.py +23 -0
  83. cidc_api/models/pydantic/stage1/medical_history.py +36 -0
  84. cidc_api/models/pydantic/stage1/other_malignancy.py +49 -0
  85. cidc_api/models/pydantic/stage1/participant.py +51 -0
  86. cidc_api/models/pydantic/stage1/prior_treatment.py +52 -0
  87. cidc_api/models/pydantic/stage1/radiotherapy_dose.py +79 -0
  88. cidc_api/models/pydantic/stage1/response.py +65 -0
  89. cidc_api/models/pydantic/stage1/response_by_system.py +112 -0
  90. cidc_api/models/pydantic/stage1/specimen.py +52 -0
  91. cidc_api/models/pydantic/stage1/stem_cell_transplant.py +35 -0
  92. cidc_api/models/pydantic/stage1/surgery.py +49 -0
  93. cidc_api/models/pydantic/stage1/therapy_agent_dose.py +67 -0
  94. cidc_api/models/pydantic/stage1/treatment.py +50 -0
  95. cidc_api/models/pydantic/stage1/trial.py +45 -0
  96. cidc_api/models/pydantic/stage2/additional_treatment.py +2 -4
  97. cidc_api/models/pydantic/stage2/administrative_person.py +1 -1
  98. cidc_api/models/pydantic/stage2/administrative_role_assignment.py +2 -2
  99. cidc_api/models/pydantic/stage2/adverse_event.py +1 -1
  100. cidc_api/models/pydantic/stage2/arm.py +2 -2
  101. cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +1 -1
  102. cidc_api/models/pydantic/stage2/cohort.py +1 -1
  103. cidc_api/models/pydantic/stage2/comorbidity.py +1 -1
  104. cidc_api/models/pydantic/stage2/consent_group.py +2 -2
  105. cidc_api/models/pydantic/stage2/contact.py +1 -1
  106. cidc_api/models/pydantic/stage2/demographic.py +1 -1
  107. cidc_api/models/pydantic/stage2/disease.py +1 -1
  108. cidc_api/models/pydantic/stage2/exposure.py +1 -1
  109. cidc_api/models/pydantic/stage2/file.py +2 -2
  110. cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +1 -1
  111. cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +1 -1
  112. cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +1 -1
  113. cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +1 -1
  114. cidc_api/models/pydantic/stage2/institution.py +1 -1
  115. cidc_api/models/pydantic/stage2/medical_history.py +1 -1
  116. cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +1 -1
  117. cidc_api/models/pydantic/stage2/other_malignancy.py +1 -1
  118. cidc_api/models/pydantic/stage2/participant.py +6 -3
  119. cidc_api/models/pydantic/stage2/prior_treatment.py +4 -4
  120. cidc_api/models/pydantic/stage2/publication.py +2 -2
  121. cidc_api/models/pydantic/stage2/radiotherapy_dose.py +1 -1
  122. cidc_api/models/pydantic/stage2/response.py +2 -2
  123. cidc_api/models/pydantic/stage2/response_by_system.py +1 -1
  124. cidc_api/models/pydantic/stage2/shipment.py +2 -2
  125. cidc_api/models/pydantic/stage2/shipment_specimen.py +1 -1
  126. cidc_api/models/pydantic/stage2/specimen.py +6 -3
  127. cidc_api/models/pydantic/stage2/stem_cell_transplant.py +2 -2
  128. cidc_api/models/pydantic/stage2/surgery.py +1 -1
  129. cidc_api/models/pydantic/stage2/therapy_agent_dose.py +1 -1
  130. cidc_api/models/pydantic/stage2/treatment.py +1 -1
  131. cidc_api/models/pydantic/stage2/trial.py +8 -10
  132. cidc_api/models/types.py +29 -1
  133. cidc_api/shared/gcloud_client.py +2 -2
  134. cidc_api/shared/utils.py +1 -0
  135. {nci_cidc_api_modules-1.2.38.dist-info → nci_cidc_api_modules-1.2.40.dist-info}/METADATA +14 -14
  136. nci_cidc_api_modules-1.2.40.dist-info/RECORD +165 -0
  137. cidc_api/models/db/base_orm.py +0 -25
  138. nci_cidc_api_modules-1.2.38.dist-info/RECORD +0 -112
  139. {nci_cidc_api_modules-1.2.38.dist-info → nci_cidc_api_modules-1.2.40.dist-info}/WHEEL +0 -0
  140. {nci_cidc_api_modules-1.2.38.dist-info → nci_cidc_api_modules-1.2.40.dist-info}/licenses/LICENSE +0 -0
  141. {nci_cidc_api_modules-1.2.38.dist-info → nci_cidc_api_modules-1.2.40.dist-info}/top_level.txt +0 -0
@@ -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,7 +2,7 @@ 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
5
+ from cidc_api.models.pydantic.base import Base
6
6
  from cidc_api.models.types import PriorTreatmentType, ConditioningRegimenType, StemCellDonorType
7
7
 
8
8
 
@@ -41,9 +41,9 @@ class PriorTreatment(Base):
41
41
  # If prior treatment is "Stem cell transplant", indicates what stem cell donor type used.
42
42
  prior_treatment_stem_cell_donor_type: StemCellDonorType | None = None
43
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
- prior_treatment_days_to_prior_transplant: NegativeInt | None = None
44
+ # If prior treatment is "Stem cell transplant", indicates the number of days from enrollment
45
+ # to the prior transplant. This must be a negative number.
46
+ prior_treatment_days_from_transplant_to_treatment_initiation: NegativeInt | None = None
47
47
 
48
48
  @model_validator(mode="after")
49
49
  def validate_description_cr(self) -> Self:
@@ -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
 
@@ -2,8 +2,8 @@ from datetime import datetime
2
2
  from pydantic import BeforeValidator
3
3
  from typing import List, Annotated
4
4
 
5
- from .base import Base
6
- from cidc_api.models.types import TrialOrganization, TrialFundingAgency, AssayType, AgeGroup
5
+ from cidc_api.models.pydantic.base import Base
6
+ from cidc_api.models.types import TrialOrganization, TrialFundingAgency, AssayType, AgeGroup, PrimaryPurposeType
7
7
 
8
8
 
9
9
  class Trial(Base):
@@ -12,7 +12,7 @@ class Trial(Base):
12
12
 
13
13
  # The unique identifier for the clinical trial. e.g. "GU16-287","BACCI"
14
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 # TODO: Fix stage2 trial_id to not be nullable, once stage 1 models are complete
15
+ trial_id: str | None = None
16
16
 
17
17
  # The version number of the trial dataset. e.g. "1.0"
18
18
  version: str | None = None
@@ -69,6 +69,10 @@ class Trial(Base):
69
69
  # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=16333703%20and%20ver_nr=1
70
70
  dates_of_conduct_end: datetime | None = None
71
71
 
72
+ # A classification of the study based upon the primary intent of the study's activities.
73
+ # CDE: https://cadsr.cancer.gov/onedata/dmdirect/NIH/NCI/CO/CDEDD?filter=CDEDD.ITEM_ID=11160683%20and%20ver_nr=1
74
+ primary_purpose_type: PrimaryPurposeType
75
+
72
76
  # The image of the trial data schema
73
77
  schema_file_id: int | None = None
74
78
 
@@ -81,11 +85,5 @@ class Trial(Base):
81
85
  # The list of assays that CIDC expects to receive for this trial.
82
86
  expected_assays: List[AssayType] = []
83
87
 
84
- # Is the cancer studying a liquid tumor type?
85
- is_liquid_tumor_trial: bool = False
86
-
87
88
  # The dbgap study accession number associated with the trial.
88
- dbgap_study_accession: str | None = None
89
-
90
- # The internal version identifier for this specific trial dataset.
91
- version: str
89
+ dbgap_study_accession: str
cidc_api/models/types.py CHANGED
@@ -26,6 +26,7 @@ AgeGroup = Literal[
26
26
  "Pediatric",
27
27
  ]
28
28
 
29
+
29
30
  TrialOrganization = Literal[
30
31
  "ECOG-ACRIN",
31
32
  "SWOG",
@@ -59,6 +60,34 @@ TrialFundingAgency = Literal[
59
60
  ]
60
61
 
61
62
 
63
+ PrimaryPurposeType = Literal[
64
+ "Adverse Effect Mitigation Study",
65
+ "Ancillary Study",
66
+ "Basic Science Research ",
67
+ "Correlative Study",
68
+ "Cure Study",
69
+ "Device Feasibility Study",
70
+ "Diagnosis Study",
71
+ "Disease Modifying Treatment Study",
72
+ "Early Detection Study",
73
+ "Education Training Clinical Study",
74
+ "Epidemiology Research ",
75
+ "Genomics Research",
76
+ "Health Services Research",
77
+ "Imaging Research",
78
+ "Interventional Study",
79
+ "Observational Study",
80
+ "Outcomes Research",
81
+ "Prevention Study",
82
+ "Proteomic Research",
83
+ "Rehabilitation Clinical Study ",
84
+ "Screening Study",
85
+ "Supportive Care Study",
86
+ "Transcriptomics Research",
87
+ "Treatment Study",
88
+ ]
89
+
90
+
62
91
  AssayType = Literal[
63
92
  "Olink",
64
93
  "WES",
@@ -285,7 +314,6 @@ CancerStageAJCC = Literal[
285
314
 
286
315
 
287
316
  CancerStageFIGO = Literal[
288
- "value",
289
317
  "Stage I",
290
318
  "Stage IA",
291
319
  "Stage IA1",
@@ -449,9 +449,9 @@ def gcs_xlsx_or_csv_file_to_pandas_dataframe(bucket_name: str, blob_name: str):
449
449
 
450
450
  # TODO: specify sheet in xlsx file and/or accept tsv and xls files
451
451
  if blob_name[-3:] == "csv":
452
- return strip_whitespaces(pd.read_csv(temp_file))
452
+ return strip_whitespaces(pd.read_csv(temp_file, dtype=str, keep_default_na=False))
453
453
  elif blob_name[-4:] == "xlsx":
454
- return strip_whitespaces(pd.read_excel(temp_file))
454
+ return strip_whitespaces(pd.read_excel(temp_file, dtype=str, keep_default_na=False))
455
455
  else:
456
456
  raise Exception("Can only read csv or xlsx files")
457
457
 
cidc_api/shared/utils.py CHANGED
@@ -15,5 +15,6 @@ def strip_whitespaces(df, sheet=None):
15
15
 
16
16
  df.rename(columns=_stripper, inplace=True)
17
17
  df = df.map(_stripper)
18
+ df.replace("", None, inplace=True)
18
19
 
19
20
  return df
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nci_cidc_api_modules
3
- Version: 1.2.38
3
+ Version: 1.2.40
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
@@ -8,34 +8,34 @@ Requires-Python: >=3.13
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
10
  Requires-Dist: certifi>=2025.11.12
11
- Requires-Dist: cloud-sql-python-connector[pg8000]>=1.18.5
11
+ Requires-Dist: cloud-sql-python-connector[pg8000]>=1.19.0
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
15
  Requires-Dist: flask-talisman>=0.7.0
16
- Requires-Dist: google-auth==2.43.0
16
+ Requires-Dist: google-auth==2.45.0
17
17
  Requires-Dist: google-api-python-client>=2.187.0
18
- Requires-Dist: google-cloud-bigquery>=3.38.0
19
- Requires-Dist: google-cloud-pubsub>=2.33.0
20
- Requires-Dist: google-cloud-secret-manager>=2.25.0
21
- Requires-Dist: google-cloud-storage>=3.6.0
18
+ Requires-Dist: google-cloud-bigquery>=3.39.0
19
+ Requires-Dist: google-cloud-pubsub>=2.34.0
20
+ Requires-Dist: google-cloud-secret-manager>=2.26.0
21
+ Requires-Dist: google-cloud-storage>=3.7.0
22
22
  Requires-Dist: jinja2>=3.1.6
23
- Requires-Dist: joserfc>=1.5.0
24
- Requires-Dist: marshmallow>=4.1.0
23
+ Requires-Dist: joserfc>=1.6.0
24
+ Requires-Dist: marshmallow>=4.1.2
25
25
  Requires-Dist: marshmallow-sqlalchemy>=1.4.2
26
- Requires-Dist: numpy>=2.3.5
26
+ Requires-Dist: numpy>=2.4.0
27
27
  Requires-Dist: packaging>=25.0
28
28
  Requires-Dist: pandas>=2.3.3
29
29
  Requires-Dist: pyarrow>=22.0.0
30
30
  Requires-Dist: pydantic~=2.12.5
31
31
  Requires-Dist: python-dotenv>=1.2.1
32
32
  Requires-Dist: requests>=2.32.5
33
- Requires-Dist: sqlalchemy>=2.0.44
33
+ Requires-Dist: sqlalchemy>=2.0.45
34
34
  Requires-Dist: sqlalchemy-mixins~=2.0.5
35
35
  Requires-Dist: werkzeug>=3.1.4
36
- Requires-Dist: opentelemetry-api>=1.38.0
37
- Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.38.0
38
- Requires-Dist: opentelemetry-sdk>=1.38.0
36
+ Requires-Dist: opentelemetry-api>=1.39.1
37
+ Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.39.1
38
+ Requires-Dist: opentelemetry-sdk>=1.39.1
39
39
  Requires-Dist: opentelemetry-instrumentation-flask>=0.59b0
40
40
  Requires-Dist: opentelemetry-instrumentation-requests>=0.59b0
41
41
  Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.59b0