Skip to content

onconova.interoperability.fhir.controllers.observation

ObservationController

Bases: FhirBaseController

create_observation(payload)

Source code in onconova/interoperability/fhir/controllers/observation.py
@route.post(
    path="",
    response={
        200: GenomicVariantProfile
        | TumorMarkerProfile
        | TumorMutationalBurdenProfile
        | MicrosatelliteInstabilityProfile
        | LossOfHeterozygosityProfile
        | HomologousRecombinationDeficiencyProfile
        | TumorNeoantigenBurdenProfile
        | AneuploidScoreProfile
        | ComorbiditiesProfile
        | LifestyleProfile
        | VitalsPanelProfile
        | ECOGPerformanceStatusProfile
        | KarnofskyPerformanceStatusProfile
        | ImagingDiseaseStatusProfile
        | LymphomaStageProfile
        | TNMStageGroupProfile
        | CancerStageProfile
        | CancerRiskAssessmentProfile
        | OperationOutcome
        | None,
        400: OperationOutcome,
        409: OperationOutcome,
    },
    permissions=[perms.CanManageCases],
    operation_id="createObservation",
    exclude_none=True,
    summary="Create a new resource",
)
def create_observation(
    self,
    payload: (
        GenomicVariantProfile
        | TumorMarkerProfile
        | TumorMutationalBurdenProfile
        | MicrosatelliteInstabilityProfile
        | LossOfHeterozygosityProfile
        | HomologousRecombinationDeficiencyProfile
        | TumorNeoantigenBurdenProfile
        | AneuploidScoreProfile
        | ComorbiditiesProfile
        | LifestyleProfile
        | VitalsPanelProfile
        | ECOGPerformanceStatusProfile
        | KarnofskyPerformanceStatusProfile
        | ImagingDiseaseStatusProfile
        | LymphomaStageProfile
        | TNMStageGroupProfile
        | CancerStageProfile
        | CancerRiskAssessmentProfile
    ),
):
    return self.create_fhir_resource(payload)

delete_observation(rid)

Source code in onconova/interoperability/fhir/controllers/observation.py
@route.delete(
    path="{rid}",
    response={
        204: None,
        404: OperationOutcome,
    },
    permissions=[perms.CanManageCases],
    operation_id="deleteObservation",
    exclude_none=True,
    summary="Delete the resource so that it no exists (no read, search etc)",
)
def delete_observation(self, rid: str):
    return self.delete_fhir_resource(
        rid,
        [
            TumorMarker,
            RiskAssessment,
            GenomicVariant,
            TumorMutationalBurden,
            MicrosatelliteInstability,
            LossOfHeterozygosity,
            HomologousRecombinationDeficiency,
            TumorNeoantigenBurden,
            AneuploidScore,
            ComorbiditiesAssessment,
            Lifestyle,
            PerformanceStatus,
            TreatmentResponse,
            FIGOStaging,
            BreslowDepth,
            RaiStaging,
            BinetStaging,
            ClarkStaging,
            ISSStaging,
            RISSStaging,
            INSSStage,
            INRGSSStage,
            GleasonGrade,
            RhabdomyosarcomaClinicalGroup,
            WilmsStage,
            TNMStaging,
            LymphomaStaging,
            Vitals,
        ],
    )

read_observation(rid)

Source code in onconova/interoperability/fhir/controllers/observation.py
@route.get(
    path="{rid}",
    response={
        200: GenomicVariantProfile
        | TumorMarkerProfile
        | TumorMutationalBurdenProfile
        | MicrosatelliteInstabilityProfile
        | LossOfHeterozygosityProfile
        | HomologousRecombinationDeficiencyProfile
        | TumorNeoantigenBurdenProfile
        | AneuploidScoreProfile
        | ComorbiditiesProfile
        | LifestyleProfile
        | VitalsPanelProfile
        | ECOGPerformanceStatusProfile
        | KarnofskyPerformanceStatusProfile
        | ImagingDiseaseStatusProfile
        | LymphomaStageProfile
        | TNMStageGroupProfile
        | CancerStageProfile
        | CancerRiskAssessmentProfile,
        **COMMON_READ_HTTP_ERRORS,
    },
    permissions=[perms.CanManageCases],
    operation_id="readObservation",
    exclude_none=True,
    summary="Read the current state of the resource",
)
def read_observation(self, rid: str):
    return self.read_fhir_resource(
        rid,
        [
            TumorMarker,
            RiskAssessment,
            GenomicVariant,
            TumorMutationalBurden,
            MicrosatelliteInstability,
            LossOfHeterozygosity,
            HomologousRecombinationDeficiency,
            TumorNeoantigenBurden,
            AneuploidScore,
            ComorbiditiesAssessment,
            Lifestyle,
            PerformanceStatus,
            TreatmentResponse,
            FIGOStaging,
            BreslowDepth,
            RaiStaging,
            BinetStaging,
            ClarkStaging,
            ISSStaging,
            RISSStaging,
            INSSStage,
            INRGSSStage,
            GleasonGrade,
            RhabdomyosarcomaClinicalGroup,
            WilmsStage,
            TNMStaging,
            LymphomaStaging,
            Vitals,
        ],
    )

update_observation(rid, payload)

Source code in onconova/interoperability/fhir/controllers/observation.py
@route.put(
    path="{rid}",
    response={
        200: GenomicVariantProfile
        | TumorMarkerProfile
        | TumorMutationalBurdenProfile
        | MicrosatelliteInstabilityProfile
        | LossOfHeterozygosityProfile
        | HomologousRecombinationDeficiencyProfile
        | TumorNeoantigenBurdenProfile
        | AneuploidScoreProfile
        | ComorbiditiesProfile
        | LifestyleProfile
        | VitalsPanelProfile
        | ECOGPerformanceStatusProfile
        | KarnofskyPerformanceStatusProfile
        | ImagingDiseaseStatusProfile
        | LymphomaStageProfile
        | TNMStageGroupProfile
        | CancerStageProfile
        | CancerRiskAssessmentProfile
        | OperationOutcome
        | None,
        **COMMON_UPDATE_HTTP_ERRORS,
    },
    permissions=[perms.CanManageCases],
    operation_id="updateObservation",
    exclude_none=True,
    summary="Update the current state of the resource",
)
def update_observation(
    self,
    rid: str,
    payload: (
        GenomicVariantProfile
        | TumorMarkerProfile
        | TumorMutationalBurdenProfile
        | MicrosatelliteInstabilityProfile
        | LossOfHeterozygosityProfile
        | HomologousRecombinationDeficiencyProfile
        | TumorNeoantigenBurdenProfile
        | AneuploidScoreProfile
        | ComorbiditiesProfile
        | LifestyleProfile
        | VitalsPanelProfile
        | ECOGPerformanceStatusProfile
        | KarnofskyPerformanceStatusProfile
        | ImagingDiseaseStatusProfile
        | LymphomaStageProfile
        | TNMStageGroupProfile
        | CancerStageProfile
        | CancerRiskAssessmentProfile
    ),
):
    return self.update_fhir_resource(rid, payload)
runner