Skip to content

Commit

Permalink
Merge pull request #4488 from mikhailprivalov/fix_upload_result
Browse files Browse the repository at this point in the history
fix upload_result
  • Loading branch information
Wellheor1 authored Nov 26, 2024
2 parents eb6e370 + 81b7336 commit d49e751
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions api/parse_file/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
import simplejson as json

from api.patients.sql_func import search_cards_by_numbers
from api.patients.views import patients_search_card
from api.views import endpoint
from openpyxl import load_workbook
from appconf.manager import SettingManager
from contracts.models import PriceCoast, Company, MedicalExamination, CompanyDepartment, PriceName
from contracts.models import PriceCoast
import directions.models as directions
from directory.models import SetOrderResearch, Researches, ParaclinicInputGroups, ParaclinicInputField
from directory.sql_func import is_paraclinic_filter_research, is_lab_filter_research
Expand Down
9 changes: 9 additions & 0 deletions directions/management/commands/upload_desription_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.db.models import Q
from openpyxl import load_workbook
import clients.models as clients
from api.directions.views import eds_documents
from directory.models import ParaclinicInputGroups, ParaclinicInputField
from django.db import transaction
from django.utils import timezone
Expand All @@ -12,6 +13,8 @@
import directions.models as directions
from utils.dates import normalize_dots_date
from sys import stdout
from django.http import HttpRequest
import simplejson as json

logger = logging.getLogger("IF")

Expand Down Expand Up @@ -121,6 +124,12 @@ def handle(self, *args, **kwargs):
else:
value = cells[current_cells]
directions.ParaclinicResult(issledovaniye=iss, field=f, field_type=f.field_type, value=value).save()
eds_documents_data = json.dumps({"pk": direction.pk})
eds_documents_obj = HttpRequest()
eds_documents_obj._body = eds_documents_data
eds_documents_obj.user = doc_profile.user
eds_documents(eds_documents_obj)
stdout.write(f'Добавлено направление: {direction.pk}')

except Exception as e:
logger.exception(e)
Expand Down
2 changes: 1 addition & 1 deletion integration_framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def get_json_protocol_data(pk, is_paraclinic=False):
if not data.get("Состояние код"):
data["Состояние код"] = "1"
data["Состояние наименование"] = "Удовлетворительное"
if not data.get("Дата осмотра"):
if not data.get("Дата осмотра") and iss.medical_examination:
data["Дата осмотра"] = iss.medical_examination.strftime("%Y-%m-%d")
if data.get("Дата заключения"):
val = data.get("Дата заключения")
Expand Down

0 comments on commit d49e751

Please sign in to comment.