exam-manager.app.api.exam_api#

Definition of exam API endpoints accessible through swagger UI.

Attributes#

Functions#

create_exam(], access_token, ...)

Create a new exam.

create_exam_from_template(], access_token, ...)

Create a new exam from template.

get_exam(]) → scanhub_libraries.models.ExamOut)

Get exam endpoint.

get_all_patient_exams(...)

Get all exams of a certain patient.

get_all_exam_templates(...)

Get all exam templates.

exam_delete(]) → None)

Delete an exam by id. Cascade deletes the associated workflow and tasks.

update_exam(], access_token, ...)

Update an existing exam.

Module Contents#

exam-manager.app.api.exam_api.PREFIX_PATIENT_MANAGER = 'http://patient-manager:8100/api/v1/patient'#
exam-manager.app.api.exam_api.exam_router#
async exam-manager.app.api.exam_api.create_exam(payload: scanhub_libraries.models.BaseExam, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)], access_token: Annotated[str, Depends(oauth2_scheme)]) scanhub_libraries.models.ExamOut#

Create a new exam.

Parameters#

payload

Exam pydantic input model.

Returns#

Exam pydantic output moddel.

Raises#

HTTPException

404: Creation unsuccessful

async exam-manager.app.api.exam_api.create_exam_from_template(payload: scanhub_libraries.models.BaseExam, template_id: uuid.UUID, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)], access_token: Annotated[str, Depends(oauth2_scheme)]) scanhub_libraries.models.ExamOut#

Create a new exam from template.

Parameters#

payload

The potentially modified exam to create.

template_id

ID of the template, the exam is created from

Returns#

Exam pydantic output model.

Raises#

HTTPException

404: Creation unsuccessful

async exam-manager.app.api.exam_api.get_exam(exam_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) scanhub_libraries.models.ExamOut#

Get exam endpoint.

Parameters#

exam_id

Id of requested exam entry

Returns#

Exam pydantic output model.

Raises#

HTTPException

404: Not found

async exam-manager.app.api.exam_api.get_all_patient_exams(patient_id: uuid.UUID, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) list[scanhub_libraries.models.ExamOut]#

Get all exams of a certain patient.

Parameters#

patient_id

Id of parent

Returns#

List of exam pydantic output models

async exam-manager.app.api.exam_api.get_all_exam_templates(user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) list[scanhub_libraries.models.ExamOut]#

Get all exam templates.

Returns#

List of exam pydantic output models

async exam-manager.app.api.exam_api.exam_delete(exam_id: uuid.UUID | str, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)]) None#

Delete an exam by id. Cascade deletes the associated workflow and tasks.

Parameters#

exam_id

Id of the exam to be deleted

Raises#

HTTPException

404: Not found

async exam-manager.app.api.exam_api.update_exam(exam_id: uuid.UUID | str, payload: scanhub_libraries.models.BaseExam, user: Annotated[scanhub_libraries.models.User, Depends(get_current_user)], access_token: Annotated[str, Depends(oauth2_scheme)]) scanhub_libraries.models.ExamOut#

Update an existing exam.

Parameters#

exam_id

Id of the exam to be updated

payload

Exam pydantic input model

Returns#

Exam pydantic output model

Raises#

HTTPException

404: Not found