Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix upload_result #4488

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading