Skip to content

onconova.interoperability.fhir.controllers.condition

ConditionController

Bases: FhirBaseController

create_condition(payload)

Source code in onconova/interoperability/fhir/controllers/condition.py
@route.post(
    path="",
    response={
        200: PrimaryCancerConditionProfile
        | SecondaryCancerConditionProfile
        | OperationOutcome
        | None,
        400: OperationOutcome,
        409: OperationOutcome,
    },
    permissions=[perms.CanManageCases],
    operation_id="createCondition",
    exclude_none=True,
    summary="Create a new resource",
)
def create_condition(
    self, payload: PrimaryCancerConditionProfile | SecondaryCancerConditionProfile
):
    return self.create_fhir_resource(payload)

delete_condition(rid)

Source code in onconova/interoperability/fhir/controllers/condition.py
@route.delete(
    path="{rid}",
    response={
        204: None,
        404: OperationOutcome,
    },
    permissions=[perms.CanManageCases],
    operation_id="deleteCondition",
    exclude_none=True,
    summary="Delete the resource so that it no exists (no read, search etc)",
)
def delete_condition(self, rid: str):
    return self.delete_fhir_resource(rid, NeoplasticEntity)

read_condition(rid)

Source code in onconova/interoperability/fhir/controllers/condition.py
@route.get(
    path="{rid}",
    response={
        200: PrimaryCancerConditionProfile | SecondaryCancerConditionProfile,
        **COMMON_READ_HTTP_ERRORS,
    },
    permissions=[perms.CanManageCases],
    operation_id="readCondition",
    exclude_none=True,
    summary="Read the current state of the resource",
)
def read_condition(self, rid: str):
    return self.read_fhir_resource(rid, NeoplasticEntity)

update_condition(rid, payload)

Source code in onconova/interoperability/fhir/controllers/condition.py
@route.put(
    path="{rid}",
    response={
        200: PrimaryCancerConditionProfile
        | SecondaryCancerConditionProfile
        | OperationOutcome
        | None,
        **COMMON_UPDATE_HTTP_ERRORS,
    },
    permissions=[perms.CanManageCases],
    operation_id="updateCondition",
    exclude_none=True,
    summary="Update the current state of the resource",
)
def update_condition(
    self,
    rid: str,
    payload: PrimaryCancerConditionProfile | SecondaryCancerConditionProfile,
):
    return self.update_fhir_resource(rid, payload)
runner