nci-cidc-api-modules 1.2.34__py3-none-any.whl → 1.2.53__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boot.py +14 -0
- cidc_api/__init__.py +1 -0
- cidc_api/config/db.py +21 -1
- cidc_api/config/settings.py +5 -10
- cidc_api/models/__init__.py +0 -2
- cidc_api/models/data.py +15 -6
- cidc_api/models/db/stage1/__init__.py +56 -0
- cidc_api/models/db/stage1/additional_treatment_orm.py +22 -0
- cidc_api/models/db/stage1/adverse_event_orm.py +46 -0
- cidc_api/models/db/stage1/base_orm.py +7 -0
- cidc_api/models/db/stage1/baseline_clinical_assessment_orm.py +22 -0
- cidc_api/models/db/stage1/comorbidity_orm.py +23 -0
- cidc_api/models/db/stage1/consent_group_orm.py +32 -0
- cidc_api/models/db/stage1/demographic_orm.py +47 -0
- cidc_api/models/db/stage1/disease_orm.py +52 -0
- cidc_api/models/db/stage1/exposure_orm.py +22 -0
- cidc_api/models/db/stage1/gvhd_diagnosis_acute_orm.py +34 -0
- cidc_api/models/db/stage1/gvhd_diagnosis_chronic_orm.py +36 -0
- cidc_api/models/db/stage1/gvhd_organ_acute_orm.py +21 -0
- cidc_api/models/db/stage1/gvhd_organ_chronic_orm.py +21 -0
- cidc_api/models/db/stage1/medical_history_orm.py +30 -0
- cidc_api/models/db/stage1/other_malignancy_orm.py +29 -0
- cidc_api/models/db/stage1/participant_orm.py +77 -0
- cidc_api/models/db/stage1/prior_treatment_orm.py +29 -0
- cidc_api/models/db/stage1/radiotherapy_dose_orm.py +39 -0
- cidc_api/models/db/stage1/response_by_system_orm.py +30 -0
- cidc_api/models/db/stage1/response_orm.py +28 -0
- cidc_api/models/db/stage1/specimen_orm.py +46 -0
- cidc_api/models/db/stage1/stem_cell_transplant_orm.py +25 -0
- cidc_api/models/db/stage1/surgery_orm.py +27 -0
- cidc_api/models/db/stage1/therapy_agent_dose_orm.py +31 -0
- cidc_api/models/db/stage1/treatment_orm.py +38 -0
- cidc_api/models/db/stage1/trial_orm.py +35 -0
- cidc_api/models/db/stage2/additional_treatment_orm.py +6 -7
- cidc_api/models/db/stage2/administrative_person_orm.py +4 -4
- cidc_api/models/db/stage2/administrative_role_assignment_orm.py +4 -4
- cidc_api/models/db/stage2/adverse_event_orm.py +11 -13
- cidc_api/models/db/stage2/arm_orm.py +3 -3
- cidc_api/models/db/stage2/base_orm.py +7 -0
- cidc_api/models/db/stage2/baseline_clinical_assessment_orm.py +5 -7
- cidc_api/models/db/stage2/cohort_orm.py +3 -3
- cidc_api/models/db/stage2/comorbidity_orm.py +6 -8
- cidc_api/models/db/stage2/consent_group_orm.py +4 -4
- cidc_api/models/db/stage2/contact_orm.py +16 -20
- cidc_api/models/db/stage2/demographic_orm.py +3 -3
- cidc_api/models/db/stage2/disease_orm.py +4 -4
- cidc_api/models/db/stage2/exposure_orm.py +3 -3
- cidc_api/models/db/stage2/file_orm.py +6 -9
- cidc_api/models/db/stage2/gvhd_diagnosis_acute_orm.py +4 -4
- cidc_api/models/db/stage2/gvhd_diagnosis_chronic_orm.py +4 -6
- cidc_api/models/db/stage2/gvhd_organ_acute_orm.py +3 -3
- cidc_api/models/db/stage2/gvhd_organ_chronic_orm.py +3 -3
- cidc_api/models/db/stage2/institution_orm.py +7 -7
- cidc_api/models/db/stage2/medical_history_orm.py +9 -9
- cidc_api/models/db/stage2/other_clinical_endpoint_orm.py +8 -12
- cidc_api/models/db/stage2/other_malignancy_orm.py +8 -10
- cidc_api/models/db/stage2/participant_orm.py +23 -24
- cidc_api/models/db/stage2/prior_treatment_orm.py +12 -13
- cidc_api/models/db/stage2/publication_orm.py +9 -11
- cidc_api/models/db/stage2/radiotherapy_dose_orm.py +8 -9
- cidc_api/models/db/stage2/response_by_system_orm.py +3 -3
- cidc_api/models/db/stage2/response_orm.py +3 -3
- cidc_api/models/db/stage2/shipment_orm.py +17 -17
- cidc_api/models/db/stage2/shipment_specimen_orm.py +4 -4
- cidc_api/models/db/stage2/specimen_orm.py +7 -6
- cidc_api/models/db/stage2/stem_cell_transplant_orm.py +6 -7
- cidc_api/models/db/stage2/surgery_orm.py +6 -7
- cidc_api/models/db/stage2/therapy_agent_dose_orm.py +7 -8
- cidc_api/models/db/stage2/treatment_orm.py +15 -15
- cidc_api/models/db/stage2/trial_orm.py +15 -17
- cidc_api/models/errors.py +7 -0
- cidc_api/models/files/facets.py +4 -0
- cidc_api/models/models.py +167 -11
- cidc_api/models/pydantic/base.py +109 -0
- cidc_api/models/pydantic/stage1/__init__.py +56 -0
- cidc_api/models/pydantic/stage1/additional_treatment.py +23 -0
- cidc_api/models/pydantic/stage1/adverse_event.py +127 -0
- cidc_api/models/pydantic/stage1/baseline_clinical_assessment.py +23 -0
- cidc_api/models/pydantic/stage1/comorbidity.py +43 -0
- cidc_api/models/pydantic/stage1/consent_group.py +30 -0
- cidc_api/models/pydantic/stage1/demographic.py +140 -0
- cidc_api/models/pydantic/stage1/disease.py +200 -0
- cidc_api/models/pydantic/stage1/exposure.py +38 -0
- cidc_api/models/pydantic/stage1/gvhd_diagnosis_acute.py +33 -0
- cidc_api/models/pydantic/stage1/gvhd_diagnosis_chronic.py +32 -0
- cidc_api/models/pydantic/stage1/gvhd_organ_acute.py +22 -0
- cidc_api/models/pydantic/stage1/gvhd_organ_chronic.py +23 -0
- cidc_api/models/pydantic/stage1/medical_history.py +43 -0
- cidc_api/models/pydantic/stage1/other_malignancy.py +55 -0
- cidc_api/models/pydantic/stage1/participant.py +63 -0
- cidc_api/models/pydantic/stage1/prior_treatment.py +45 -0
- cidc_api/models/pydantic/stage1/radiotherapy_dose.py +92 -0
- cidc_api/models/pydantic/stage1/response.py +84 -0
- cidc_api/models/pydantic/stage1/response_by_system.py +220 -0
- cidc_api/models/pydantic/stage1/specimen.py +31 -0
- cidc_api/models/pydantic/stage1/stem_cell_transplant.py +35 -0
- cidc_api/models/pydantic/stage1/surgery.py +57 -0
- cidc_api/models/pydantic/stage1/therapy_agent_dose.py +80 -0
- cidc_api/models/pydantic/stage1/treatment.py +64 -0
- cidc_api/models/pydantic/stage1/trial.py +45 -0
- cidc_api/models/pydantic/stage2/additional_treatment.py +2 -4
- cidc_api/models/pydantic/stage2/administrative_person.py +1 -1
- cidc_api/models/pydantic/stage2/administrative_role_assignment.py +2 -2
- cidc_api/models/pydantic/stage2/adverse_event.py +1 -1
- cidc_api/models/pydantic/stage2/arm.py +2 -2
- cidc_api/models/pydantic/stage2/baseline_clinical_assessment.py +1 -1
- cidc_api/models/pydantic/stage2/cohort.py +1 -1
- cidc_api/models/pydantic/stage2/comorbidity.py +1 -1
- cidc_api/models/pydantic/stage2/consent_group.py +2 -2
- cidc_api/models/pydantic/stage2/contact.py +1 -1
- cidc_api/models/pydantic/stage2/demographic.py +1 -1
- cidc_api/models/pydantic/stage2/disease.py +1 -1
- cidc_api/models/pydantic/stage2/exposure.py +1 -1
- cidc_api/models/pydantic/stage2/file.py +2 -2
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_acute.py +1 -1
- cidc_api/models/pydantic/stage2/gvhd_diagnosis_chronic.py +1 -1
- cidc_api/models/pydantic/stage2/gvhd_organ_acute.py +1 -1
- cidc_api/models/pydantic/stage2/gvhd_organ_chronic.py +1 -1
- cidc_api/models/pydantic/stage2/institution.py +1 -1
- cidc_api/models/pydantic/stage2/medical_history.py +1 -1
- cidc_api/models/pydantic/stage2/other_clinical_endpoint.py +1 -1
- cidc_api/models/pydantic/stage2/other_malignancy.py +1 -1
- cidc_api/models/pydantic/stage2/participant.py +6 -3
- cidc_api/models/pydantic/stage2/prior_treatment.py +6 -15
- cidc_api/models/pydantic/stage2/publication.py +2 -2
- cidc_api/models/pydantic/stage2/radiotherapy_dose.py +1 -1
- cidc_api/models/pydantic/stage2/response.py +2 -2
- cidc_api/models/pydantic/stage2/response_by_system.py +1 -1
- cidc_api/models/pydantic/stage2/shipment.py +2 -2
- cidc_api/models/pydantic/stage2/shipment_specimen.py +1 -1
- cidc_api/models/pydantic/stage2/specimen.py +6 -3
- cidc_api/models/pydantic/stage2/stem_cell_transplant.py +2 -2
- cidc_api/models/pydantic/stage2/surgery.py +1 -1
- cidc_api/models/pydantic/stage2/therapy_agent_dose.py +1 -1
- cidc_api/models/pydantic/stage2/treatment.py +1 -1
- cidc_api/models/pydantic/stage2/trial.py +8 -10
- cidc_api/models/types.py +30 -16
- cidc_api/shared/assay_handling.py +68 -0
- cidc_api/shared/auth.py +5 -5
- cidc_api/shared/file_handling.py +18 -4
- cidc_api/shared/gcloud_client.py +96 -16
- cidc_api/shared/utils.py +18 -9
- cidc_api/telemetry.py +101 -0
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/METADATA +25 -15
- nci_cidc_api_modules-1.2.53.dist-info/RECORD +167 -0
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/WHEEL +1 -1
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/top_level.txt +1 -0
- cidc_api/models/db/base_orm.py +0 -25
- cidc_api/models/pydantic/stage2/base.py +0 -48
- nci_cidc_api_modules-1.2.34.dist-info/RECORD +0 -109
- {nci_cidc_api_modules-1.2.34.dist-info → nci_cidc_api_modules-1.2.53.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import ForeignKey, ForeignKeyConstraint
|
|
5
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
|
+
|
|
7
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
8
|
+
from cidc_api.models.types import OffStudyReason, YNU
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ParticipantORM(BaseORM):
|
|
12
|
+
__tablename__ = "participant"
|
|
13
|
+
__repr_attrs__ = ["participant_id", "native_participant_id", "cimac_participant_id"]
|
|
14
|
+
__table_args__ = (
|
|
15
|
+
ForeignKeyConstraint(
|
|
16
|
+
["trial_id", "version"], ["stage1.trial.trial_id", "stage1.trial.version"], ondelete="CASCADE"
|
|
17
|
+
),
|
|
18
|
+
)
|
|
19
|
+
__data_category__ = "participant"
|
|
20
|
+
|
|
21
|
+
participant_id: Mapped[int] = mapped_column(primary_key=True)
|
|
22
|
+
trial_id: Mapped[str]
|
|
23
|
+
version: Mapped[str]
|
|
24
|
+
|
|
25
|
+
native_participant_id: Mapped[str | None]
|
|
26
|
+
cimac_participant_id: Mapped[str | None]
|
|
27
|
+
consent_group_id: Mapped[int | None] = mapped_column(
|
|
28
|
+
ForeignKey("stage1.consent_group.consent_group_id", ondelete="CASCADE")
|
|
29
|
+
)
|
|
30
|
+
off_study: Mapped[YNU]
|
|
31
|
+
off_study_reason: Mapped[OffStudyReason | None]
|
|
32
|
+
off_study_reason_other: Mapped[str | None]
|
|
33
|
+
|
|
34
|
+
trial: Mapped[TrialORM] = relationship(back_populates="participants", cascade="all, delete")
|
|
35
|
+
demographic: Mapped[DemographicORM] = relationship(
|
|
36
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
37
|
+
)
|
|
38
|
+
prior_treatments: Mapped[List[PriorTreatmentORM]] = relationship(
|
|
39
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
40
|
+
)
|
|
41
|
+
treatments: Mapped[List[TreatmentORM]] = relationship(
|
|
42
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
43
|
+
)
|
|
44
|
+
diseases: Mapped[List[DiseaseORM]] = relationship(
|
|
45
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
46
|
+
)
|
|
47
|
+
response_by_systems: Mapped[List[ResponseBySystemORM]] = relationship(
|
|
48
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
49
|
+
)
|
|
50
|
+
response: Mapped[ResponseORM | None] = relationship(
|
|
51
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
52
|
+
)
|
|
53
|
+
adverse_events: Mapped[List[AdverseEventORM]] = relationship(
|
|
54
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
55
|
+
)
|
|
56
|
+
baseline_clinical_assessment: Mapped[BaselineClinicalAssessmentORM | None] = relationship(
|
|
57
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
58
|
+
)
|
|
59
|
+
medical_history: Mapped[MedicalHistoryORM | None] = relationship(
|
|
60
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
61
|
+
)
|
|
62
|
+
exposures: Mapped[List[ExposureORM]] = relationship(
|
|
63
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
64
|
+
)
|
|
65
|
+
gvhd_diagnosis_acutes: Mapped[List[GVHDDiagnosisAcuteORM]] = relationship(
|
|
66
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
67
|
+
)
|
|
68
|
+
gvhd_diagnosis_chronics: Mapped[List[GVHDDiagnosisChronicORM]] = relationship(
|
|
69
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
70
|
+
)
|
|
71
|
+
specimens: Mapped[List[SpecimenORM]] = relationship(
|
|
72
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
73
|
+
)
|
|
74
|
+
additional_treatments: Mapped[List[AdditionalTreatmentORM]] = relationship(
|
|
75
|
+
back_populates="participant", cascade="all, delete", passive_deletes=True
|
|
76
|
+
)
|
|
77
|
+
consent_group: Mapped[ConsentGroupORM] = relationship(back_populates="participants", cascade="all, delete")
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from pydantic import NonPositiveInt, NegativeInt
|
|
5
|
+
from sqlalchemy import ForeignKey
|
|
6
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
7
|
+
from sqlalchemy.types import JSON
|
|
8
|
+
|
|
9
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
10
|
+
from cidc_api.models.types import ConditioningRegimenType, StemCellDonorType
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PriorTreatmentORM(BaseORM):
|
|
14
|
+
__tablename__ = "prior_treatment"
|
|
15
|
+
__repr_attrs__ = ["prior_treatment_id", "type"]
|
|
16
|
+
__data_category__ = "prior_treatment"
|
|
17
|
+
|
|
18
|
+
prior_treatment_id: Mapped[int] = mapped_column(primary_key=True)
|
|
19
|
+
participant_id: Mapped[int] = mapped_column(ForeignKey("stage1.participant.participant_id", ondelete="CASCADE"))
|
|
20
|
+
|
|
21
|
+
prior_treatment_days_to_start: Mapped[NonPositiveInt | None]
|
|
22
|
+
prior_treatment_days_to_end: Mapped[NonPositiveInt | None]
|
|
23
|
+
prior_treatment_description: Mapped[str]
|
|
24
|
+
prior_treatment_best_response: Mapped[str | None]
|
|
25
|
+
prior_treatment_conditioning_regimen_type: Mapped[ConditioningRegimenType | None]
|
|
26
|
+
prior_treatment_stem_cell_donor_type: Mapped[StemCellDonorType | None]
|
|
27
|
+
prior_treatment_days_from_transplant_to_treatment_initiation: Mapped[NegativeInt | None]
|
|
28
|
+
|
|
29
|
+
participant: Mapped[ParticipantORM] = relationship(back_populates="prior_treatments", cascade="all, delete")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from pydantic import NonNegativeInt, NonNegativeFloat, PositiveFloat
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import ForeignKey
|
|
5
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
|
+
|
|
7
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
8
|
+
from cidc_api.models.types import (
|
|
9
|
+
RadiotherapyProcedure,
|
|
10
|
+
UberonAnatomicalTerm,
|
|
11
|
+
RadiotherapyDoseUnits,
|
|
12
|
+
YNU,
|
|
13
|
+
RadiationExtent,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RadiotherapyDoseORM(BaseORM):
|
|
18
|
+
__tablename__ = "radiotherapy_dose"
|
|
19
|
+
__repr_attrs__ = ["radiotherapy_dose_id", "procedure"]
|
|
20
|
+
__data_category__ = "radiotherapy_dose"
|
|
21
|
+
|
|
22
|
+
radiotherapy_dose_id: Mapped[int] = mapped_column(primary_key=True)
|
|
23
|
+
treatment_id: Mapped[int] = mapped_column(ForeignKey("stage1.treatment.treatment_id", ondelete="CASCADE"))
|
|
24
|
+
|
|
25
|
+
days_to_start: Mapped[NonNegativeInt]
|
|
26
|
+
days_to_end: Mapped[NonNegativeInt]
|
|
27
|
+
procedure: Mapped[RadiotherapyProcedure]
|
|
28
|
+
anatomical_location: Mapped[UberonAnatomicalTerm | None]
|
|
29
|
+
is_total_dose: Mapped[bool]
|
|
30
|
+
number_of_fractions: Mapped[NonNegativeInt | None]
|
|
31
|
+
received_dose: Mapped[NonNegativeFloat]
|
|
32
|
+
received_dose_units: Mapped[RadiotherapyDoseUnits]
|
|
33
|
+
planned_dose: Mapped[PositiveFloat | None]
|
|
34
|
+
planned_dose_units: Mapped[RadiotherapyDoseUnits | None]
|
|
35
|
+
dose_changes_delays: Mapped[YNU]
|
|
36
|
+
changes_delays_description: Mapped[str | None]
|
|
37
|
+
radiation_extent: Mapped[RadiationExtent]
|
|
38
|
+
|
|
39
|
+
treatment: Mapped[TreatmentORM] = relationship(back_populates="radiotherapy_doses", cascade="all, delete")
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from pydantic import PositiveInt
|
|
3
|
+
from sqlalchemy import ForeignKey, String
|
|
4
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
5
|
+
|
|
6
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
7
|
+
from cidc_api.models.types import ResponseSystem, ResponseSystemVersion, BestOverallResponse, YNUNA
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ResponseBySystemORM(BaseORM):
|
|
11
|
+
__tablename__ = "response_by_system"
|
|
12
|
+
__repr_attrs__ = ["response_by_system_id", "participant_id"]
|
|
13
|
+
__data_category__ = "response_by_system"
|
|
14
|
+
|
|
15
|
+
response_by_system_id: Mapped[int] = mapped_column(primary_key=True)
|
|
16
|
+
participant_id: Mapped[int] = mapped_column(ForeignKey("stage1.participant.participant_id", ondelete="CASCADE"))
|
|
17
|
+
response_system: Mapped[ResponseSystem] = mapped_column(String)
|
|
18
|
+
response_system_version: Mapped[ResponseSystemVersion] = mapped_column(String)
|
|
19
|
+
best_overall_response: Mapped[BestOverallResponse] = mapped_column(String)
|
|
20
|
+
response_duration: Mapped[PositiveInt | None]
|
|
21
|
+
duration_of_stable_disease: Mapped[PositiveInt | None]
|
|
22
|
+
durable_clinical_benefit: Mapped[bool | None]
|
|
23
|
+
days_to_first_response: Mapped[PositiveInt | None]
|
|
24
|
+
days_to_best_response: Mapped[PositiveInt | None]
|
|
25
|
+
progression: Mapped[YNUNA]
|
|
26
|
+
days_to_disease_progression: Mapped[PositiveInt | None]
|
|
27
|
+
progression_free_survival_event: Mapped[YNUNA]
|
|
28
|
+
progression_free_survival: Mapped[PositiveInt | None]
|
|
29
|
+
|
|
30
|
+
participant: Mapped[ParticipantORM] = relationship(back_populates="response_by_systems", cascade="all, delete")
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from pydantic import NonNegativeInt
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import ForeignKey
|
|
5
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
|
+
|
|
7
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
8
|
+
from cidc_api.models.types import SurvivalStatus, YNUNA, CauseOfDeath
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ResponseORM(BaseORM):
|
|
12
|
+
__tablename__ = "response"
|
|
13
|
+
__repr_attrs__ = ["response_id", "participant_id"]
|
|
14
|
+
__data_category__ = "response"
|
|
15
|
+
|
|
16
|
+
response_id: Mapped[int] = mapped_column(primary_key=True)
|
|
17
|
+
participant_id: Mapped[int] = mapped_column(ForeignKey("stage1.participant.participant_id", ondelete="CASCADE"))
|
|
18
|
+
survival_status: Mapped[SurvivalStatus]
|
|
19
|
+
overall_survival: Mapped[NonNegativeInt]
|
|
20
|
+
abscopal_response: Mapped[YNUNA | None]
|
|
21
|
+
pathological_complete_response: Mapped[YNUNA | None]
|
|
22
|
+
days_to_death: Mapped[NonNegativeInt | None]
|
|
23
|
+
cause_of_death: Mapped[CauseOfDeath | None]
|
|
24
|
+
evaluable_for_toxicity: Mapped[bool]
|
|
25
|
+
evaluable_for_efficacy: Mapped[bool]
|
|
26
|
+
days_to_last_vital_status: Mapped[NonNegativeInt | None]
|
|
27
|
+
|
|
28
|
+
participant: Mapped[ParticipantORM] = relationship(back_populates="response", cascade="all, delete")
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from sqlalchemy import ForeignKey
|
|
6
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
7
|
+
|
|
8
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
9
|
+
from cidc_api.models.types import (
|
|
10
|
+
UberonAnatomicalTerm,
|
|
11
|
+
ICDO3MorphologicalCode,
|
|
12
|
+
SpecimenType,
|
|
13
|
+
SpecimenDescription,
|
|
14
|
+
TumorType,
|
|
15
|
+
CollectionProcedure,
|
|
16
|
+
FixationStabilizationType,
|
|
17
|
+
PrimaryContainerType,
|
|
18
|
+
VolumeUnits,
|
|
19
|
+
ProcessedType,
|
|
20
|
+
ConcentrationUnits,
|
|
21
|
+
DerivativeType,
|
|
22
|
+
PBMCRestingPeriodUsed,
|
|
23
|
+
MaterialUnits,
|
|
24
|
+
MaterialStorageCondition,
|
|
25
|
+
QCCondition,
|
|
26
|
+
ReplacementRequested,
|
|
27
|
+
ResidualUse,
|
|
28
|
+
DiagnosisVerification,
|
|
29
|
+
AssayType,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class SpecimenORM(BaseORM):
|
|
34
|
+
__tablename__ = "specimen"
|
|
35
|
+
__repr_attrs__ = ["specimen_id", "participant_id", "cimac_id"]
|
|
36
|
+
__data_category__ = "specimen"
|
|
37
|
+
|
|
38
|
+
specimen_id: Mapped[int] = mapped_column(primary_key=True)
|
|
39
|
+
participant_id: Mapped[int] = mapped_column(ForeignKey("stage1.participant.participant_id", ondelete="CASCADE"))
|
|
40
|
+
|
|
41
|
+
cimac_id: Mapped[str]
|
|
42
|
+
collection_event_name: Mapped[str]
|
|
43
|
+
days_to_specimen_collection: Mapped[int]
|
|
44
|
+
organ_site_of_collection: Mapped[UberonAnatomicalTerm]
|
|
45
|
+
|
|
46
|
+
participant: Mapped[ParticipantORM] = relationship(back_populates="specimens", cascade="all, delete")
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from pydantic import NonNegativeInt
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import ForeignKey
|
|
5
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
|
+
|
|
7
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
8
|
+
from cidc_api.models.types import StemCellDonorType, AllogeneicDonorType, StemCellSource, ConditioningRegimenType
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class StemCellTransplantORM(BaseORM):
|
|
12
|
+
__tablename__ = "stem_cell_transplant"
|
|
13
|
+
__repr_attrs__ = ["stem_cell_transplant_id"]
|
|
14
|
+
__data_category__ = "stem_cell_transplant"
|
|
15
|
+
|
|
16
|
+
stem_cell_transplant_id: Mapped[int] = mapped_column(primary_key=True)
|
|
17
|
+
treatment_id: Mapped[int] = mapped_column(ForeignKey("stage1.treatment.treatment_id", ondelete="CASCADE"))
|
|
18
|
+
|
|
19
|
+
stem_cell_donor_type: Mapped[StemCellDonorType]
|
|
20
|
+
allogeneic_donor_type: Mapped[AllogeneicDonorType | None]
|
|
21
|
+
stem_cell_source: Mapped[StemCellSource]
|
|
22
|
+
days_to_transplant: Mapped[NonNegativeInt]
|
|
23
|
+
conditioning_regimen_type: Mapped[ConditioningRegimenType | None]
|
|
24
|
+
|
|
25
|
+
treatment: Mapped[TreatmentORM] = relationship(back_populates="stem_cell_transplants", cascade="all, delete")
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from pydantic import NonNegativeInt
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import ForeignKey
|
|
5
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
|
+
|
|
7
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
8
|
+
from cidc_api.models.types import SurgicalProcedure, UberonAnatomicalTerm, YNU
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SurgeryORM(BaseORM):
|
|
12
|
+
__tablename__ = "surgery"
|
|
13
|
+
__repr_attrs__ = ["surgery_id", "procedure"]
|
|
14
|
+
__data_category__ = "surgery"
|
|
15
|
+
|
|
16
|
+
surgery_id: Mapped[int] = mapped_column(primary_key=True)
|
|
17
|
+
treatment_id: Mapped[int] = mapped_column(ForeignKey("stage1.treatment.treatment_id", ondelete="CASCADE"))
|
|
18
|
+
|
|
19
|
+
procedure: Mapped[SurgicalProcedure]
|
|
20
|
+
procedure_other: Mapped[str | None]
|
|
21
|
+
days_to_procedure: Mapped[NonNegativeInt]
|
|
22
|
+
anatomical_location: Mapped[UberonAnatomicalTerm]
|
|
23
|
+
therapeutic: Mapped[YNU]
|
|
24
|
+
findings: Mapped[str | None]
|
|
25
|
+
extent_of_residual_disease: Mapped[str | None]
|
|
26
|
+
|
|
27
|
+
treatment: Mapped[TreatmentORM] = relationship(back_populates="surgeries", cascade="all, delete")
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from pydantic import NonNegativeInt, NonNegativeFloat, PositiveFloat
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import ForeignKey
|
|
5
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
|
+
|
|
7
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
8
|
+
from cidc_api.models.types import TherapyAgentDoseUnits, YNU
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TherapyAgentDoseORM(BaseORM):
|
|
12
|
+
__tablename__ = "therapy_agent_dose"
|
|
13
|
+
__repr_attrs__ = ["therapy_agent_dose_id", "therapy_agent_name"]
|
|
14
|
+
__data_category__ = "therapy_agent_dose"
|
|
15
|
+
|
|
16
|
+
therapy_agent_dose_id: Mapped[int] = mapped_column(primary_key=True)
|
|
17
|
+
treatment_id: Mapped[int] = mapped_column(ForeignKey("stage1.treatment.treatment_id", ondelete="CASCADE"))
|
|
18
|
+
|
|
19
|
+
course_number: Mapped[str | None]
|
|
20
|
+
therapy_agent_name: Mapped[str]
|
|
21
|
+
days_to_start: Mapped[NonNegativeInt]
|
|
22
|
+
days_to_end: Mapped[NonNegativeInt]
|
|
23
|
+
number_of_doses: Mapped[NonNegativeInt]
|
|
24
|
+
received_dose: Mapped[NonNegativeFloat]
|
|
25
|
+
received_dose_units: Mapped[TherapyAgentDoseUnits]
|
|
26
|
+
planned_dose: Mapped[PositiveFloat | None]
|
|
27
|
+
planned_dose_units: Mapped[TherapyAgentDoseUnits | None]
|
|
28
|
+
dose_changes_delays: Mapped[YNU]
|
|
29
|
+
changes_delays_description: Mapped[str | None]
|
|
30
|
+
|
|
31
|
+
treatment: Mapped[TreatmentORM] = relationship(back_populates="therapy_agent_doses", cascade="all, delete")
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from sqlalchemy import ForeignKey
|
|
5
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
|
+
|
|
7
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
8
|
+
from cidc_api.models.types import YNU, OffTreatmentReason
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TreatmentORM(BaseORM):
|
|
12
|
+
__tablename__ = "treatment"
|
|
13
|
+
__repr_attrs__ = ["treatment_id", "participant_id", "treatment_description"]
|
|
14
|
+
__data_category__ = "treatment"
|
|
15
|
+
|
|
16
|
+
treatment_id: Mapped[int] = mapped_column(primary_key=True)
|
|
17
|
+
participant_id: Mapped[int] = mapped_column(ForeignKey("stage1.participant.participant_id", ondelete="CASCADE"))
|
|
18
|
+
arm: Mapped[str | None]
|
|
19
|
+
cohort: Mapped[str | None]
|
|
20
|
+
|
|
21
|
+
treatment_description: Mapped[str]
|
|
22
|
+
off_treatment: Mapped[YNU]
|
|
23
|
+
off_treatment_reason: Mapped[OffTreatmentReason | None]
|
|
24
|
+
off_treatment_reason_other: Mapped[str | None]
|
|
25
|
+
|
|
26
|
+
participant: Mapped[ParticipantORM] = relationship(back_populates="treatments", cascade="all, delete")
|
|
27
|
+
adverse_events: Mapped[List[AdverseEventORM]] = relationship(back_populates="treatment", cascade="all, delete")
|
|
28
|
+
|
|
29
|
+
therapy_agent_doses: Mapped[List[TherapyAgentDoseORM]] = relationship(
|
|
30
|
+
back_populates="treatment", cascade="all, delete"
|
|
31
|
+
)
|
|
32
|
+
radiotherapy_doses: Mapped[List[RadiotherapyDoseORM]] = relationship(
|
|
33
|
+
back_populates="treatment", cascade="all, delete"
|
|
34
|
+
)
|
|
35
|
+
surgeries: Mapped[List[SurgeryORM]] = relationship(back_populates="treatment", cascade="all, delete")
|
|
36
|
+
stem_cell_transplants: Mapped[List[StemCellTransplantORM]] = relationship(
|
|
37
|
+
back_populates="treatment", cascade="all, delete"
|
|
38
|
+
)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import List
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from sqlalchemy import ForeignKey
|
|
6
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
7
|
+
from sqlalchemy.types import JSON
|
|
8
|
+
|
|
9
|
+
from cidc_api.models.db.stage1.base_orm import BaseORM
|
|
10
|
+
from cidc_api.models.types import PrimaryPurposeType, AgeGroup
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TrialORM(BaseORM):
|
|
14
|
+
__tablename__ = "trial"
|
|
15
|
+
__repr_attrs__ = ["trial_id", "version"]
|
|
16
|
+
__data_category__ = "study"
|
|
17
|
+
|
|
18
|
+
trial_id: Mapped[str] = mapped_column(primary_key=True)
|
|
19
|
+
version: Mapped[str] = mapped_column(primary_key=True)
|
|
20
|
+
|
|
21
|
+
primary_endpoint: Mapped[str | None]
|
|
22
|
+
age_group: Mapped[List[AgeGroup]] = mapped_column(JSON, nullable=True)
|
|
23
|
+
study_population: Mapped[str | None]
|
|
24
|
+
trial_type: Mapped[str | None]
|
|
25
|
+
dates_of_conduct_start: Mapped[datetime]
|
|
26
|
+
dates_of_conduct_end: Mapped[datetime | None]
|
|
27
|
+
primary_purpose_type: Mapped[PrimaryPurposeType]
|
|
28
|
+
dbgap_study_accession: Mapped[str]
|
|
29
|
+
|
|
30
|
+
participants: Mapped[List[ParticipantORM]] = relationship(
|
|
31
|
+
back_populates="trial", cascade="all, delete", passive_deletes=True
|
|
32
|
+
)
|
|
33
|
+
consent_groups: Mapped[List[ConsentGroupORM]] = relationship(
|
|
34
|
+
back_populates="trial", cascade="all, delete", passive_deletes=True
|
|
35
|
+
)
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from pydantic import NonNegativeInt
|
|
2
|
-
from typing import Optional
|
|
3
3
|
|
|
4
4
|
from sqlalchemy import ForeignKey
|
|
5
5
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
6
|
|
|
7
|
-
from cidc_api.models.db.base_orm import BaseORM
|
|
7
|
+
from cidc_api.models.db.stage2.base_orm import BaseORM
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class AdditionalTreatmentORM(BaseORM):
|
|
11
11
|
__tablename__ = "additional_treatment"
|
|
12
|
-
__repr_attrs__ = ["additional_treatment_id", "participant_id"
|
|
13
|
-
__table_args__ = {"schema": "stage2"}
|
|
12
|
+
__repr_attrs__ = ["additional_treatment_id", "participant_id"]
|
|
14
13
|
__data_category__ = "additional_treatment"
|
|
15
14
|
|
|
16
15
|
additional_treatment_id: Mapped[int] = mapped_column(primary_key=True)
|
|
17
16
|
participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
|
|
18
17
|
|
|
19
|
-
additional_treatment_days_to_start: Mapped[
|
|
20
|
-
additional_treatment_days_to_end: Mapped[
|
|
18
|
+
additional_treatment_days_to_start: Mapped[NonNegativeInt | None]
|
|
19
|
+
additional_treatment_days_to_end: Mapped[NonNegativeInt | None]
|
|
21
20
|
additional_treatment_description: Mapped[str]
|
|
22
21
|
|
|
23
|
-
participant: Mapped[
|
|
22
|
+
participant: Mapped[ParticipantORM] = relationship(back_populates="additional_treatments", cascade="all, delete")
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from typing import List
|
|
2
3
|
|
|
3
4
|
from sqlalchemy import ForeignKey
|
|
4
5
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
5
6
|
|
|
6
|
-
from cidc_api.models.db.base_orm import BaseORM
|
|
7
|
+
from cidc_api.models.db.stage2.base_orm import BaseORM
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class AdministrativePersonORM(BaseORM):
|
|
10
11
|
__tablename__ = "administrative_person"
|
|
11
12
|
__repr_attrs__ = ["first_name", "last_name"]
|
|
12
|
-
__table_args__ = {"schema": "stage2"}
|
|
13
13
|
|
|
14
14
|
administrative_person_id: Mapped[int] = mapped_column(primary_key=True)
|
|
15
15
|
institution_id: Mapped[int] = mapped_column(ForeignKey("stage2.institution.institution_id", ondelete="CASCADE"))
|
|
@@ -19,7 +19,7 @@ class AdministrativePersonORM(BaseORM):
|
|
|
19
19
|
email: Mapped[str | None]
|
|
20
20
|
phone_number: Mapped[str | None]
|
|
21
21
|
|
|
22
|
-
institution: Mapped[
|
|
23
|
-
administrative_role_assignments: Mapped[List[
|
|
22
|
+
institution: Mapped[InstitutionORM] = relationship(back_populates="administrative_people", cascade="all, delete")
|
|
23
|
+
administrative_role_assignments: Mapped[List[AdministrativeRoleAssignmentORM]] = relationship(
|
|
24
24
|
back_populates="administrative_person", cascade="all, delete", passive_deletes=True
|
|
25
25
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from sqlalchemy import ForeignKeyConstraint, ForeignKey
|
|
2
3
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
3
4
|
|
|
4
|
-
from cidc_api.models.db.base_orm import BaseORM
|
|
5
|
+
from cidc_api.models.db.stage2.base_orm import BaseORM
|
|
5
6
|
from cidc_api.models.types import AdministrativeRole
|
|
6
7
|
|
|
7
8
|
|
|
@@ -12,7 +13,6 @@ class AdministrativeRoleAssignmentORM(BaseORM):
|
|
|
12
13
|
ForeignKeyConstraint(
|
|
13
14
|
["trial_id", "version"], ["stage2.trial.trial_id", "stage2.trial.version"], ondelete="CASCADE"
|
|
14
15
|
),
|
|
15
|
-
{"schema": "stage2"},
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
trial_id: Mapped[str] = mapped_column(primary_key=True)
|
|
@@ -22,7 +22,7 @@ class AdministrativeRoleAssignmentORM(BaseORM):
|
|
|
22
22
|
)
|
|
23
23
|
administrative_role: Mapped[AdministrativeRole] = mapped_column(primary_key=True)
|
|
24
24
|
|
|
25
|
-
trial: Mapped[
|
|
26
|
-
administrative_person: Mapped[
|
|
25
|
+
trial: Mapped[TrialORM] = relationship(back_populates="administrative_role_assignments", cascade="all, delete")
|
|
26
|
+
administrative_person: Mapped[AdministrativePersonORM] = relationship(
|
|
27
27
|
back_populates="administrative_role_assignments", cascade="all, delete"
|
|
28
28
|
)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
1
|
+
from __future__ import annotations
|
|
3
2
|
from pydantic import NonNegativeInt
|
|
4
3
|
from sqlalchemy import ForeignKey
|
|
5
4
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
6
5
|
|
|
7
|
-
from cidc_api.models.db.base_orm import BaseORM
|
|
6
|
+
from cidc_api.models.db.stage2.base_orm import BaseORM
|
|
8
7
|
from cidc_api.models.types import (
|
|
9
8
|
CTCAEEventTerm,
|
|
10
9
|
CTCAEEventCode,
|
|
@@ -21,28 +20,27 @@ from cidc_api.models.types import (
|
|
|
21
20
|
class AdverseEventORM(BaseORM):
|
|
22
21
|
__tablename__ = "adverse_event"
|
|
23
22
|
__repr_attrs__ = ["adverse_event_id", "participant_id", "event_term"]
|
|
24
|
-
__table_args__ = {"schema": "stage2"}
|
|
25
23
|
__data_category__ = "adverse_event"
|
|
26
24
|
|
|
27
25
|
adverse_event_id: Mapped[int] = mapped_column(primary_key=True)
|
|
28
26
|
participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
|
|
29
|
-
treatment_id: Mapped[
|
|
27
|
+
treatment_id: Mapped[int | None] = mapped_column(ForeignKey("stage2.treatment.treatment_id", ondelete="CASCADE"))
|
|
30
28
|
|
|
31
|
-
event_term: Mapped[
|
|
32
|
-
event_code: Mapped[
|
|
29
|
+
event_term: Mapped[CTCAEEventTerm | None]
|
|
30
|
+
event_code: Mapped[CTCAEEventCode | None]
|
|
33
31
|
severity_grade_system: Mapped[SeverityGradeSystem]
|
|
34
32
|
severity_grade_system_version: Mapped[SeverityGradeSystemVersion]
|
|
35
33
|
severity_grade: Mapped[SeverityGrade]
|
|
36
|
-
event_other_specify: Mapped[
|
|
37
|
-
system_organ_class: Mapped[
|
|
34
|
+
event_other_specify: Mapped[str | None]
|
|
35
|
+
system_organ_class: Mapped[SystemOrganClass | None]
|
|
38
36
|
discontinuation_due_to_event: Mapped[bool]
|
|
39
37
|
days_to_onset_of_event: Mapped[NonNegativeInt]
|
|
40
|
-
days_to_resolution_of_event: Mapped[
|
|
38
|
+
days_to_resolution_of_event: Mapped[NonNegativeInt | None]
|
|
41
39
|
serious_adverse_event: Mapped[YNU]
|
|
42
40
|
dose_limiting_toxicity: Mapped[YNU]
|
|
43
41
|
attribution_cause: Mapped[AttributionCause]
|
|
44
42
|
attribution_likelihood: Mapped[AttributionLikelihood]
|
|
45
|
-
individual_therapy: Mapped[
|
|
43
|
+
individual_therapy: Mapped[str | None]
|
|
46
44
|
|
|
47
|
-
participant: Mapped[
|
|
48
|
-
treatment: Mapped[
|
|
45
|
+
participant: Mapped[ParticipantORM] = relationship(back_populates="adverse_events", cascade="all, delete")
|
|
46
|
+
treatment: Mapped[TreatmentORM] = relationship(back_populates="adverse_events", cascade="all, delete")
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from sqlalchemy import ForeignKey, ForeignKeyConstraint
|
|
2
3
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
3
4
|
|
|
4
|
-
from cidc_api.models.db.base_orm import BaseORM
|
|
5
|
+
from cidc_api.models.db.stage2.base_orm import BaseORM
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class ArmORM(BaseORM):
|
|
@@ -11,7 +12,6 @@ class ArmORM(BaseORM):
|
|
|
11
12
|
ForeignKeyConstraint(
|
|
12
13
|
["trial_id", "version"], ["stage2.trial.trial_id", "stage2.trial.version"], ondelete="CASCADE"
|
|
13
14
|
),
|
|
14
|
-
{"schema": "stage2"},
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
arm_id: Mapped[int] = mapped_column(primary_key=True)
|
|
@@ -20,4 +20,4 @@ class ArmORM(BaseORM):
|
|
|
20
20
|
|
|
21
21
|
name: Mapped[str]
|
|
22
22
|
|
|
23
|
-
trial: Mapped[
|
|
23
|
+
trial: Mapped[TrialORM] = relationship(back_populates="arms", cascade="all, delete")
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
1
|
+
from __future__ import annotations
|
|
3
2
|
from sqlalchemy import ForeignKey
|
|
4
3
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
5
4
|
|
|
6
|
-
from cidc_api.models.db.base_orm import BaseORM
|
|
5
|
+
from cidc_api.models.db.stage2.base_orm import BaseORM
|
|
7
6
|
from cidc_api.models.types import ECOGScore, KarnofskyScore
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class BaselineClinicalAssessmentORM(BaseORM):
|
|
11
10
|
__tablename__ = "baseline_clinical_assessment"
|
|
12
11
|
__repr_attrs__ = ["baseline_clinical_assessment_id", "participant_id"]
|
|
13
|
-
__table_args__ = {"schema": "stage2"}
|
|
14
12
|
__data_category__ = "baseline_clinical_assessment"
|
|
15
13
|
|
|
16
14
|
baseline_clinical_assessment_id: Mapped[int] = mapped_column(primary_key=True)
|
|
17
15
|
participant_id: Mapped[int] = mapped_column(ForeignKey("stage2.participant.participant_id", ondelete="CASCADE"))
|
|
18
16
|
|
|
19
|
-
ecog_score: Mapped[
|
|
20
|
-
karnofsky_score: Mapped[
|
|
17
|
+
ecog_score: Mapped[ECOGScore | None]
|
|
18
|
+
karnofsky_score: Mapped[KarnofskyScore | None]
|
|
21
19
|
|
|
22
|
-
participant: Mapped[
|
|
20
|
+
participant: Mapped[ParticipantORM] = relationship(
|
|
23
21
|
back_populates="baseline_clinical_assessment", cascade="all, delete"
|
|
24
22
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
from sqlalchemy import ForeignKeyConstraint
|
|
2
3
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
3
4
|
|
|
4
|
-
from cidc_api.models.db.base_orm import BaseORM
|
|
5
|
+
from cidc_api.models.db.stage2.base_orm import BaseORM
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class CohortORM(BaseORM):
|
|
@@ -11,7 +12,6 @@ class CohortORM(BaseORM):
|
|
|
11
12
|
ForeignKeyConstraint(
|
|
12
13
|
["trial_id", "version"], ["stage2.trial.trial_id", "stage2.trial.version"], ondelete="CASCADE"
|
|
13
14
|
),
|
|
14
|
-
{"schema": "stage2"},
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
cohort_id: Mapped[int] = mapped_column(primary_key=True)
|
|
@@ -20,4 +20,4 @@ class CohortORM(BaseORM):
|
|
|
20
20
|
|
|
21
21
|
name: Mapped[str]
|
|
22
22
|
|
|
23
|
-
trial: Mapped[
|
|
23
|
+
trial: Mapped[TrialORM] = relationship(back_populates="cohorts", cascade="all, delete")
|