Skip to content

Commit

Permalink
Merge branch 'develop' into link-history-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wellheor1 authored Dec 18, 2024
2 parents 3afee7c + 8cb6764 commit 7c1a1a9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion laboratory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "2024.12.170714+6f7024"
__version__ = "2024.12.180556+a4c6ec"
VERSION = __version__
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ skip-string-normalization = true

[tool.poetry]
name = "l2"
version = "2024.12.170714+6f7024"
version = "2024.12.180556+a4c6ec"
description = ""
authors = ["Mikhail Privalov <[email protected]>"]
license = "MIT"
Expand Down
18 changes: 17 additions & 1 deletion results/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,15 +1010,28 @@ def table_part_result(value, width_max_table=None):
opinion = [[Paragraph(f"{t}", style) for t in table_titles]]

table_rows = value['rows']
space_symbol = "&nbsp;"
for t in table_rows:
temp_data = []
for value_raw in t:
result = ""
result_mkb_code = ""
result_mkb_title = ""
clinic_diag_text = ""
is_diag_table = False
try:
row_data = json.loads(value_raw)

if isinstance(row_data, list):
result = '<br/>'.join(row_data)
elif isinstance(row_data, dict):
temp_data = []
if row_data.get("code", None):
result_mkb_code = f"{row_data.get('code')}"
if row_data.get("title", None):
result_mkb_title = f"{row_data.get('title')}"
result = f"{result_mkb_title}; {clinic_diag_text}"
is_diag_table = True
else:
if row_data.get('fio', None):
result = f"{row_data.get('family')} {row_data.get('name')} {row_data.get('patronymic')}"
Expand All @@ -1028,7 +1041,10 @@ def table_part_result(value, width_max_table=None):
result = f"{result} ({position})"
except:
result = value_raw
temp_data.append(Paragraph(f"{result}", style))
if is_diag_table and result:
temp_data.append([Paragraph(f"<u>{result}</u>", style), Paragraph(f"код по МКБ {space_symbol * 3}<u>{result_mkb_code}</u>", style)])
else:
temp_data.append(Paragraph(f"{result}", style))
opinion.append(temp_data)

table_width = []
Expand Down

0 comments on commit 7c1a1a9

Please sign in to comment.