app.api.routes ============== .. py:module:: app.api.routes .. autoapi-nested-parse:: Definition of patient endpoints. Attributes ---------- .. autoapisummary:: app.api.routes.router Functions --------- .. autoapisummary:: app.api.routes.get_patient_out app.api.routes.create_patient app.api.routes.get_patient app.api.routes.get_patient_list app.api.routes.delete_patient app.api.routes.update_patient Module Contents --------------- .. py:data:: router .. py:function:: get_patient_out(data: app.api.db.Patient) -> scanhub_libraries.models.PatientOut :async: Get pydantic output model from database ORM model. Parameters ---------- data Database ORM model Returns ------- Pydantic output model .. py:function:: create_patient(payload: scanhub_libraries.models.BasePatient) -> scanhub_libraries.models.PatientOut :async: Create new patient database entry. Parameters ---------- payload Patient pydantic base model Returns ------- Patient pydantic output model Raises ------ HTTPException 404: Could not create patient .. py:function:: get_patient(patient_id: uuid.UUID) -> scanhub_libraries.models.PatientOut :async: 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 .. py:function:: get_patient_list() -> list[scanhub_libraries.models.PatientOut] :async: Get all patients endpoint. Returns ------- List of patient pydantic output models .. py:function:: delete_patient(patient_id: uuid.UUID) -> None :async: Delete patient from database. Parameters ---------- patient_id Id of patient to be deleted Raises ------ HTTPException _description_ .. py:function:: update_patient(patient_id: uuid.UUID, payload: scanhub_libraries.models.BasePatient) :async: 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