exam-manager.app.api.result_api#
Definition of result API endpoints accessible through swagger UI.
Attributes#
Functions#
|
Create a task result. |
|
Get an existing result. |
|
Get all existing results of a certain task. |
|
Delete a task. |
|
Update an existing result. |
|
Serve a DICOM instance. |
|
Get MRD meta info. |
|
Get MRD as binary stream. |
Module Contents#
- exam-manager.app.api.result_api.result_router#
- async exam-manager.app.api.result_api.create_blank_result(task_id: str | uuid.UUID, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.ResultOut#
Create a task result.
Parameters#
- payload
Result pydantic input model
Returns#
Result pydantic output model
Raises#
- HTTPException
404: Creation unsuccessful
- async exam-manager.app.api.result_api.get_result(result_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.ResultOut#
Get an existing result.
Parameters#
- result_id
Id of the result to be returned
Returns#
Result pydantic output model
Raises#
- HTTPException
404: Not found
- async exam-manager.app.api.result_api.get_all_task_results(task_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) list[scanhub_libraries.models.ResultOut]#
Get all existing results of a certain task.
Parameters#
- task_id
Id of parental task
Returns#
List of task pydantic output model
- async exam-manager.app.api.result_api.delete_result(result_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) None#
Delete a task.
Parameters#
- task_id
Id of the task to be deleted
Raises#
- HTTPException
404: Not found
- async exam-manager.app.api.result_api.set_result(result_id: uuid.UUID | str, payload: scanhub_libraries.models.SetResult, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.ResultOut#
Update an existing result.
Parameters#
- result_id
Id of the result to be updated
- payload
Result pydantic base model/dict If this is the pydantic ResultBase model, only fields in the base model can be updated.
Returns#
Task pydantic output model
Raises#
- HTTPException
404: Not found
- async exam-manager.app.api.result_api.get_dicom(workflow_id: str, task_id: str, result_id: str, filename: str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) starlette.responses.Response#
Serve a DICOM instance.
If it’s already a DICOM Part-10 file → return FileResponse (supports HTTP Range).
Else → convert to Part-10 in memory and return StreamingResponse.
- Headers:
‘application/dicom’ content type
inline disposition (avoid forced download)
‘Cache-Control: no-transform’ to prevent proxies from gzipping (which breaks Range offsets)
- exam-manager.app.api.result_api.get_meta(workflow_id: str, task_id: str, result_id: str) scanhub_libraries.models.MRDMetaResponse#
Get MRD meta info.
- exam-manager.app.api.result_api.get_mrd_binary(workflow_id: str, task_id: str, result_id: str, ids: str = Query(..., description="IDs: '0,1,10-20,40-50:2'"), coil_idx: int = Query(0, ge=0, description='Coil index'), stride: int = Query(1, ge=1, description='Decimate samples by stride'))#
Get MRD as binary stream.