app.api.routes#

Definition of patient endpoints.

Attributes#

Functions#

get_patient_out(→ scanhub_libraries.models.PatientOut)

Get pydantic output model from database ORM model.

create_patient(→ scanhub_libraries.models.PatientOut)

Create new patient database entry.

get_patient(→ scanhub_libraries.models.PatientOut)

Get a patient from database by id.

get_patient_list(...)

Get all patients endpoint.

delete_patient(→ None)

Delete patient from database.

update_patient(patient_id, payload)

Update existing patient endpoint.

Module Contents#

app.api.routes.router#
async app.api.routes.get_patient_out(data: app.api.db.Patient) scanhub_libraries.models.PatientOut#

Get pydantic output model from database ORM model.

Parameters#

data

Database ORM model

Returns#

Pydantic output model

async app.api.routes.create_patient(payload: scanhub_libraries.models.BasePatient) scanhub_libraries.models.PatientOut#

Create new patient database entry.

Parameters#

payload

Patient pydantic base model

Returns#

Patient pydantic output model

Raises#

HTTPException

404: Could not create patient

async app.api.routes.get_patient(patient_id: uuid.UUID) scanhub_libraries.models.PatientOut#

Get a patient from database by id.

Parameters#

patient_id

Id of the requested patient

Returns#

Patient pydantic output model

Raises#

HTTPException

404: Patient not found

async app.api.routes.get_patient_list() list[scanhub_libraries.models.PatientOut]#

Get all patients endpoint.

Returns#

List of patient pydantic output models

async app.api.routes.delete_patient(patient_id: uuid.UUID) None#

Delete patient from database.

Parameters#

patient_id

Id of patient to be deleted

Raises#

HTTPException

_description_

async app.api.routes.update_patient(patient_id: uuid.UUID, payload: scanhub_libraries.models.BasePatient)#

Update existing patient endpoint.

Parameters#

patient_id

Id of the patient to be updated

payload

Patient data to be updated

Returns#

Updated patient pydantic output model

Raises#

HTTPException

404: Patient not found