app.api.routes#
Definition of patient endpoints.
Attributes#
Functions#
|
Get pydantic output model from database ORM model. |
|
Create new patient database entry. |
|
Get a patient from database by id. |
|
Get all patients endpoint. |
|
Delete patient from database. |
|
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