diff --git a/api/parse_file/views.py b/api/parse_file/views.py index 08b254dc8d..4dc940d264 100644 --- a/api/parse_file/views.py +++ b/api/parse_file/views.py @@ -33,6 +33,7 @@ from django.db.models import Q from django.db import transaction from django.utils import timezone +from utils.nsi_directories import NSI logger = logging.getLogger("IF") @@ -364,6 +365,15 @@ def auto_load_result(request, research, doc_profile): res = f'"code": "{tmp_val}", "title": "{diag.title}", "id": "{diag.id}"' res = "{" + res + "}" data_result[f.title] = res + if f.field_type == 28: + for nsi_key in NSI.values(): + if f.title == nsi_key.get("title"): + for key, val in nsi_key.get("values").items(): + if val == data_result[f.title].strip(): + res = f'"code": "{key}", "title": "{val}"' + res = "{" + res + "}" + data_result[f.title] = res + continue directions.ParaclinicResult(issledovaniye=iss, field=f, field_type=f.field_type, value=data_result.get(f.title)).save() except Exception as e: logger.exception(e) diff --git a/integration_framework/views.py b/integration_framework/views.py index 3e5f7f629a..00b6bc592c 100644 --- a/integration_framework/views.py +++ b/integration_framework/views.py @@ -1951,6 +1951,7 @@ def get_cda_data(pk): "gender": ind.sex.lower(), "birthdate": ind.birthday.strftime("%Y%m%d"), "oms": {"number": card.get_data_individual()["oms"]["polis_num"], "issueOrgName": smo_title, "issueOrgCode": insurer_full_code, "smoId": smo_id}, + "address": data_individual['main_address'], }, "organization": data["organization"], }, diff --git a/utils/nsi_directories.py b/utils/nsi_directories.py index 04c6e50c6c..6f223eebc8 100644 --- a/utils/nsi_directories.py +++ b/utils/nsi_directories.py @@ -936,4 +936,8 @@ '1003': 'Консультация врача по медицинской реабилитации', }, }, + '1.2.643.5.1.13.13.99.2.766': { + 'title': 'Группы здоровья', + 'values': {'1': 'I группа', '2': 'II группа', '3': 'IIIа группа', '4': 'IIIб группа', '5': 'III группа', '6': 'IV группа', '7': 'V группа'}, + }, }