From c74a50793d26b54a097a6796cb5b669eeda28577 Mon Sep 17 00:00:00 2001 From: sergei kasianenko Date: Sun, 30 Jun 2024 00:08:02 +0800 Subject: [PATCH 1/4] fix result --- results/laboratory_form.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/results/laboratory_form.py b/results/laboratory_form.py index 0535f48d1d..546103824b 100644 --- a/results/laboratory_form.py +++ b/results/laboratory_form.py @@ -588,9 +588,12 @@ def lab_form_1(fwb, interactive_text_field, pw, direction, styleSheet, directory if len(fraction_compare) > 0: fractions = fraction_compare + + if iss.api_app: laboratory_analyzer_data.append(iss.api_app.name) + fsli_data = [] if len(fractions) > 0: if len(fractions) == 1: tmp = [Paragraph('' + iss.research.title + "", styleSheet["BodyText"])] @@ -690,6 +693,9 @@ def lab_form_1(fwb, interactive_text_field, pw, direction, styleSheet, directory result_is_norm = [] for f in fractions: + if f.fsli in fsli_data: + continue + fsli_data.append(f.fsli) j += 1 tmp = [] From 88dff5e1d489dc055fcb6e6d7f77f955af33bec8 Mon Sep 17 00:00:00 2001 From: sergei kasianenko Date: Sun, 30 Jun 2024 00:10:29 +0800 Subject: [PATCH 2/4] fix result --- ftp_orders/main.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ftp_orders/main.py b/ftp_orders/main.py index ae4ab5b3de..635db33d38 100644 --- a/ftp_orders/main.py +++ b/ftp_orders/main.py @@ -425,14 +425,22 @@ def pull_result(self, file: str): if ref_str: ref_str = ref_str.replace('"', "'") ref_str = f'{{"Все": "{ref_str}"}}' - Result( - issledovaniye=iss, - fraction=fraction, - value=value, - units=units, - ref_f=ref_str, - ref_m=ref_str, - ).save() + if Result.objects.filter(issledovaniye=iss, fraction=fraction).first(): + update_result = Result.objects.filter(issledovaniye=iss, fraction=fraction).first() + update_result.value = value + update_result.units = units + update_result.ref_f = ref_str + update_result.ref_m=ref_str + update_result.save() + else: + Result( + issledovaniye=iss, + fraction=fraction, + value=value, + units=units, + ref_f=ref_str, + ref_m=ref_str, + ).save() else: iss.lab_comment = ("",) iss.time_confirmation = (None,) From b283ebe98bb9fa8983d548faa8259788b523656c Mon Sep 17 00:00:00 2001 From: Sergei Kasianenko <41939763+urchinpro@users.noreply.github.com> Date: Sun, 30 Jun 2024 00:12:18 +0800 Subject: [PATCH 3/4] Update ftp_orders/main.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- ftp_orders/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftp_orders/main.py b/ftp_orders/main.py index 635db33d38..602571eded 100644 --- a/ftp_orders/main.py +++ b/ftp_orders/main.py @@ -430,7 +430,7 @@ def pull_result(self, file: str): update_result.value = value update_result.units = units update_result.ref_f = ref_str - update_result.ref_m=ref_str + update_result.ref_m = ref_str update_result.save() else: Result( From 353ccaa96853a32888515fbfb396ea10ed680a99 Mon Sep 17 00:00:00 2001 From: Sergei Kasianenko <41939763+urchinpro@users.noreply.github.com> Date: Sun, 30 Jun 2024 00:12:23 +0800 Subject: [PATCH 4/4] Update results/laboratory_form.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- results/laboratory_form.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/results/laboratory_form.py b/results/laboratory_form.py index 546103824b..bdcdfbecc3 100644 --- a/results/laboratory_form.py +++ b/results/laboratory_form.py @@ -588,8 +588,6 @@ def lab_form_1(fwb, interactive_text_field, pw, direction, styleSheet, directory if len(fraction_compare) > 0: fractions = fraction_compare - - if iss.api_app: laboratory_analyzer_data.append(iss.api_app.name)