Добавлено конвертирование xml результата в pdf
Some checks failed
Build And Push / publish (push) Failing after 55s

This commit is contained in:
2026-04-15 15:14:24 +03:00
parent 80badc38db
commit 2cb25e817c
3 changed files with 27 additions and 4 deletions

View File

@ -116,8 +116,9 @@ async def get_vaccs_report_download(
if file is None:
raise e.BadRequestException
file_bytes = base64.b64decode(file.content)
filename = f'vaccs_report_{resultId or user.vita_id}.doc'
xml_model = s.ClinicalDocument.from_xml(file.content.encode('utf-8'))
inner_base64 = xml_model.component.non_xml_body.text.content.strip()
temp_link_token = token_urlsafe(32)
await cache.set(
@ -125,8 +126,8 @@ async def get_vaccs_report_download(
dumps(
{
'filename': filename,
'content_type': 'application/msword',
'data': base64.b64encode(file_bytes).decode('utf-8'),
'content_type': 'application/pdf',
'data': inner_base64,
}
),
ex=600,