Skip to content

Commit

Permalink
генерация json для Диспансеризации (#3160)
Browse files Browse the repository at this point in the history
* генерация json для Диспансеризации

* Update utils/nsi_directories.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update integration_framework/views.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
urchinpro and github-actions[bot] authored Oct 25, 2023
1 parent b841ad0 commit 5754667
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/parse_file/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions integration_framework/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
Expand Down
4 changes: 4 additions & 0 deletions utils/nsi_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 группа'},
},
}

0 comments on commit 5754667

Please sign in to comment.