patient_manager.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#
- patient_manager.api.routes.router#
- async patient_manager.api.routes.get_patient_out(data: patient_manager.api.db.Patient) scanhub_libraries.models.PatientOut#
Get pydantic output model from database ORM model.
- Parameters:
data – Database ORM model
- Return type:
Pydantic output model
- async patient_manager.api.routes.create_patient(payload: scanhub_libraries.models.BasePatient) scanhub_libraries.models.PatientOut#
Create new patient database entry.
- Parameters:
payload – Patient pydantic base model
- Return type:
Patient pydantic output model
- Raises:
HTTPException – 404: Could not create patient
- async patient_manager.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
- Return type:
Patient pydantic output model
- Raises:
HTTPException – 404: Patient not found
- async patient_manager.api.routes.get_patient_list() list[scanhub_libraries.models.PatientOut]#
Get all patients endpoint.
- Return type:
List of patient pydantic output models
- async patient_manager.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 patient_manager.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
- Return type:
Updated patient pydantic output model
- Raises:
HTTPException – 404: Patient not found