From 9b25cfac2319c74f7b3c8a611905a9619cce32cb Mon Sep 17 00:00:00 2001 From: Miwory Date: Mon, 13 Apr 2026 16:31:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=8D=D0=BD=D0=B4=D0=BF=D0=BE=D0=B8=D0=BD=D1=82=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20=D1=81=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=82=D0=B0=D0=BC?= =?UTF-8?q?=D0=B8=20=D0=B2=D0=B0=D0=BA=D1=86=D0=B8=D0=BD=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- src/apps/users/v1/router.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 614fe8b..8166a51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "HospitalAssistantBackend" -version = "1.3.0" +version = "1.4.0" description = "Backend for Hospital Assistant" readme = "README.md" requires-python = ">=3.13,<3.14" diff --git a/src/apps/users/v1/router.py b/src/apps/users/v1/router.py index 73af599..fa59106 100644 --- a/src/apps/users/v1/router.py +++ b/src/apps/users/v1/router.py @@ -101,6 +101,28 @@ async def get_vaccs_report( return await c.vitacore_api.getVaccsReport(user.vita_id) +@router.get('/getVaccsReport/download') +async def get_vaccs_report_download( + user: Annotated[User, Depends(login)], resultId: str | None = None +): + """ + Get report of vaccinations for user by id. + """ + if resultId is not None: + model = await c.vitacore_api.getDiagResultFile(resultId) + else: + model = await c.vitacore_api.getVaccsReport(user.vita_id) + + file_bytes = base64.b64decode(model.content) + filename = f'vaccs_report_{resultId or user.vita_id}.doc' + + return Response( + content=file_bytes, + media_type='application/msword', + headers={'Content-Disposition': f'attachment; filename="{filename}"'}, + ) + + @router.get('/getMedExamDict') async def get_med_exam_dict(user: Annotated[User, Depends(login)]): """