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-ы #4012

Merged
merged 1 commit into from
Jun 29, 2024
Merged

fix-ы #4012

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
2 changes: 1 addition & 1 deletion ftp_orders/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def pull_result(self, file: str):
iss.save()

for res in result:
fraction = Fractions.objects.filter(fsli=res["fsli"]).first()
fraction = Fractions.objects.filter(fsli=res["fsli"], research__hide=False, research__podrazdeleniye__p_type=2).first()
if not fraction:
continue
value = res["value"]
Expand Down
21 changes: 17 additions & 4 deletions results/laboratory_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from reportlab.lib.styles import getSampleStyleSheet
from copy import deepcopy
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY, TA_LEFT
from operator import itemgetter


def default_lab_form(fwb, interactive_text_field, pw, direction, styleSheet, directory, show_norm, stl, print_vtype, get_r, result_normal):
Expand Down Expand Up @@ -575,16 +576,28 @@ def lab_form_1(fwb, interactive_text_field, pw, direction, styleSheet, directory
pks.append(iss.pk)
data = []
fractions = directory.Fractions.objects.filter(research=iss.research, hide=False, render_type=0).order_by("pk").order_by("sort_weight")
results_iss = Result.objects.filter(issledovaniye=iss).order_by("fraction__sort_weight") # Выборка результатов из базы

# проверить записанные результаты со справочником из Услуги названия
fractions_set = set([f.fraction for f in results_iss])
fractions_orders = [[fs.sort_weight, fs] for fs in fractions_set]
sorted_data = sorted(fractions_orders, key=itemgetter(0))
fractions_tmp = [s[1] for s in sorted_data]

fraction_compare = [el for el in fractions_tmp if el not in fractions]
if len(fraction_compare) > 0:
fractions = fraction_compare

if iss.api_app:
laboratory_analyzer_data.append(iss.api_app.name)

if fractions.count() > 0:
if fractions.count() == 1:
if len(fractions) > 0:
if len(fractions) == 1:
tmp = [Paragraph('<font face="FreeSans" size="8">' + iss.research.title + "</font>", styleSheet["BodyText"])]
norm = "none"
sign = RANGE_IN
if Result.objects.filter(issledovaniye=iss, fraction=fractions[0]).exists():
r = Result.objects.filter(issledovaniye=iss, fraction=fractions[0]).order_by("-pk")[0]
if len(fractions) > 0:
r = fractions[0]
ref = r.get_ref()
if show_norm:
norm, sign, ref_res = r.get_is_norm(recalc=True, with_ref=True)
Expand Down
Loading