Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
urchinpro committed Jan 17, 2024
1 parent 96bcba5 commit 980943f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions forms/forms106.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,19 +881,19 @@ def form_02(request_data):

title_page.append(Paragraph(f"{bold_open}Диагноз окончательный при выписке из стационара:{bold_close}", style))
title_page.append(Paragraph("Основное заболевание:", style))
for i in hosp_extract_data["final_diagnos_mkb"]:
for i in hosp_extract_data["final_diagnos_mkb_dict"]:
title_page.append(Paragraph(f"{i.get('data')} {bold_open}код по МКБ:{bold_close} {i.get('code')} ", style))
title_page.append(Spacer(1, 2 * mm))
title_page.append(Paragraph("Осложнения основного заболевания:", style))
for i in hosp_extract_data["other_diagnos_mkb"]:
for i in hosp_extract_data["other_diagnos_mkb_dict"]:
title_page.append(Paragraph(f"{i.get('data')} {bold_open}код по МКБ:{bold_close} {i.get('code')} ", style))
title_page.append(Spacer(1, 2 * mm))
title_page.append(Paragraph("Внешняя причина при травмах, отравления:", style))
for i in hosp_extract_data["external_reason_mkb"]:
for i in hosp_extract_data["external_reason_mkb_dict"]:
title_page.append(Paragraph(f"{i.get('data')} {bold_open}код по МКБ:{bold_close} {i.get('code')} ", style))
title_page.append(Spacer(1, 2 * mm))
title_page.append(Paragraph("Сопутствующие заболевания", style))
for i in hosp_extract_data["near_diagnos_mkb"]:
for i in hosp_extract_data["near_diagnos_mkb_dict"]:
title_page.append(Paragraph(f"{i.get('data')} {bold_open}код по МКБ:{bold_close} {i.get('code')} ", style))
title_page.append(Spacer(1, 2 * mm))

Expand Down
13 changes: 9 additions & 4 deletions forms/forms_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ def hosp_extract_get_data(hosp_last_num):
final_diagnos, other_diagnos, near_diagnos, outcome, final_diagnos_mkb, other_diagnos_mkb, near_diagnos_mkb, additional_data_ill = '', '', '', '', '', '', '', ''
days_count, result_hospital, manager_depart, room_num, transfer_to = '', '', '', '', ''
ln_data, ln_vk_data, external_reason_mkb = '', '', ''
final_diagnos_mkb_dict, other_diagnos_mkb_dict, near_diagnos_mkb_dict, external_reason_mkb_dict = [], [], [], []

if list_values:
for i in list_values:
Expand Down Expand Up @@ -767,7 +768,7 @@ def hosp_extract_get_data(hosp_last_num):
final_diagnos_mkb_row = final_diagnos_mkb_details.get("rows", [])
final_diagnos_mkb = []
for rr in final_diagnos_mkb_row:
final_diagnos_mkb.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')} ({rr[1]})"})
final_diagnos_mkb_dict.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')} ({rr[1]})"})
if i[3] == "Осложнения основного заболевания код по МКБ":
other_diagnos_mkb_data = i[2]
other_diagnos_mkb_details = {}
Expand All @@ -779,7 +780,7 @@ def hosp_extract_get_data(hosp_last_num):
other_diagnos_mkb_row = other_diagnos_mkb_details.get("rows", [])
other_diagnos_mkb = []
for rr in other_diagnos_mkb_row:
other_diagnos_mkb.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')} ({rr[1]})"})
other_diagnos_mkb_dict.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')} ({rr[1]})"})
if i[3] == 'Сопутствующие заболевания код по МКБ':
near_diagnos_mkb_data = i[2]
near_diagnos_mkb_details = {}
Expand All @@ -791,7 +792,7 @@ def hosp_extract_get_data(hosp_last_num):
near_diagnos_mkb_row = near_diagnos_mkb_details.get("rows", [])
near_diagnos_mkb = []
for rr in near_diagnos_mkb_row:
near_diagnos_mkb.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')}. {rr[1] if len(rr) > 1 else '' }"})
near_diagnos_mkb_dict.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')}. {rr[1] if len(rr) > 1 else '' }"})
if i[3] == 'Внешняя причина при травмах, отравлениях код по МКБ':
external_reason_mkb_data = i[2]
external_reason_mkb_details = {}
Expand All @@ -805,7 +806,7 @@ def hosp_extract_get_data(hosp_last_num):
if len(external_reason_mkb_row) > 0:
for rr in external_reason_mkb_row:
adds_data = rr[1] if len(rr) > 1 else ""
external_reason_mkb.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')} ({adds_data})"})
external_reason_mkb_dict.append({"code": json.loads(rr[0]).get('code', ''), "data": f"{json.loads(rr[0]).get('title', '')} ({adds_data})"})
if i[3] == 'Дополнительные сведения о заболевании':
additional_data_ill = i[2]
if i[3] == 'Куда переведен':
Expand All @@ -827,6 +828,10 @@ def hosp_extract_get_data(hosp_last_num):
'other_diagnos_mkb': other_diagnos_mkb,
'near_diagnos_mkb': near_diagnos_mkb,
'external_reason_mkb': external_reason_mkb,
'final_diagnos_mkb_dict': final_diagnos_mkb_dict,
'other_diagnos_mkb_dict': other_diagnos_mkb_dict,
'near_diagnos_mkb_dict': near_diagnos_mkb_dict,
'external_reason_mkb_dict': external_reason_mkb_dict,
'extract_iss': hosp_extract_iss,
'days_count': days_count,
'result_hospital': result_hospital,
Expand Down

0 comments on commit 980943f

Please sign in to comment.