app.dal.protocol_dal#

Data access layer (DAL) between fastapi endpoint and sql database.

Functions#

add_protocol_data(→ app.db.postgres.Protocol)

Create new protocol.

get_protocol_data(→ app.db.postgres.Protocol | None)

Get protocol by id.

get_all_protocol_data(→ list[app.db.postgres.Protocol])

Get all protocols assigned to a certain patient.

get_all_protocol_template_data(...)

Get all protocol templates.

delete_protocol_data(→ bool)

Delete protocol by id. Also deletes associated tasks.

update_protocol_data(→ app.db.postgres.Protocol | None)

Update existing protocol entry.

Module Contents#

async app.dal.protocol_dal.add_protocol_data(payload: scanhub_libraries.models.BaseProtocol, creator: str) app.db.postgres.Protocol#

Create new protocol.

async app.dal.protocol_dal.get_protocol_data(protocol_id: uuid.UUID) app.db.postgres.Protocol | None#

Get protocol by id.

async app.dal.protocol_dal.get_all_protocol_data(patient_id: uuid.UUID) list[app.db.postgres.Protocol]#

Get all protocols assigned to a certain patient.

async app.dal.protocol_dal.get_all_protocol_template_data() list[app.db.postgres.Protocol]#

Get all protocol templates.

async app.dal.protocol_dal.delete_protocol_data(protocol_id: uuid.UUID) bool#

Delete protocol by id. Also deletes associated tasks.

async app.dal.protocol_dal.update_protocol_data(protocol_id: uuid.UUID, payload: scanhub_libraries.models.BaseProtocol) app.db.postgres.Protocol | None#

Update existing protocol entry.