From 1b0b7b2bdb6e58c664e817fe5fa118200dbed8d7 Mon Sep 17 00:00:00 2001 From: Sergei Kasianenko Date: Tue, 26 Sep 2023 21:43:29 +0800 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BB=D1=83=D1=87=D0=B0=D0=B8=20=D0=B2?= =?UTF-8?q?=20=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/directions/sql_func.py | 4 +- api/directions/views.py | 11 ++++-- api/researches/views.py | 9 +++-- api/views.py | 5 ++- .../construct/ParaclinicResearchEditor.vue | 4 +- .../src/ui-cards/DirectionsHistory/index.vue | 1 + .../src/ui-cards/SelectedResearches.vue | 39 +++++++++++++++++++ 7 files changed, 61 insertions(+), 12 deletions(-) diff --git a/api/directions/sql_func.py b/api/directions/sql_func.py index 92ec4848fd..db1679c8d4 100644 --- a/api/directions/sql_func.py +++ b/api/directions/sql_func.py @@ -21,6 +21,7 @@ def get_history_dir(d_s, d_e, card_id, who_create_dir, services, is_serv, iss_pk directory_researches.is_paraclinic, directory_researches.is_form, directory_researches.is_microbiology, + directory_researches.is_case, directory_researches.podrazdeleniye_id, directions_napravleniya.parent_id as dir_parent_id, directions_napravleniya.data_sozdaniya as dir_data_sozdaniya, @@ -106,7 +107,8 @@ def get_history_dir(d_s, d_e, card_id, who_create_dir, services, is_serv, iss_pk ud.patronymic, directions_napravleniya.visit_date, directions_napravleniya.time_microbiology_receive, - directions_napravleniya.time_gistology_receive + directions_napravleniya.time_gistology_receive, + is_case FROM t_iss_tubes LEFT JOIN t_recive ON t_iss_tubes.tubesregistration_id = t_recive.id_t_recive diff --git a/api/directions/views.py b/api/directions/views.py index dc2792893d..7a3ea9645e 100644 --- a/api/directions/views.py +++ b/api/directions/views.py @@ -310,7 +310,7 @@ def directions_history(request): # status: 4 - выписано пользователем, 0 - только выписанные, 1 - Материал получен лабораторией. 2 - результат подтвержден, 3 - направления пациента, -1 - отменено, if req_status == 4: user_creater = request.user.doctorprofile.pk - if req_status in [0, 1, 2, 3, 5]: + if req_status in [0, 1, 2, 3, 5, 7]: patient_card = pk if req_status == 5: @@ -459,6 +459,10 @@ def directions_history(request): continue elif type_service == 'is_lab' and (i[11] or i[14] or i[15] or i[16] or i[17] or i[18] or i[19]): continue + elif req_status == 7 and not i[36]: + continue + elif i[36] and req_status != 7: + continue if i[0] != last_dir: status = min(status_set) if len(lab) > 0: @@ -470,7 +474,7 @@ def directions_history(request): if aux_researches_obj.exists(): aux_researches = [{"pk": i.aux_research.pk, "title": i.aux_research.title} for i in aux_researches_obj] has_aux = True - if (req_status == 2 and status == 2) or (req_status in [3, 4] and status != -2) or (req_status == 1 and status == 1) or (req_status == 0 and status == 0): + if (req_status == 2 and status == 2) or (req_status in [3, 4, 7] and status != -2) or (req_status == 1 and status == 1) or (req_status == 0 and status == 0): final_result.append( { 'pk': dir, @@ -581,7 +585,7 @@ def directions_history(request): if aux_researches_obj.exists(): aux_researches = [{"pk": i.aux_research.pk, "title": i.aux_research.title} for i in aux_researches_obj] has_aux = True - if (req_status == 2 and status == 2) or (req_status in [3, 4] and status != -2) or (req_status == 1 and status == 1) or (req_status == 0 and status == 0): + if (req_status == 2 and status == 2) or (req_status in [3, 4, 7] and status != -2) or (req_status == 1 and status == 1) or (req_status == 0 and status == 0): final_result.append( { 'pk': dir, @@ -1442,6 +1446,7 @@ def directions_paraclinic_form(request): | Q(research__is_monitoring=True) | Q(research__is_expertise=True) | Q(research__is_aux=True) + | Q(research__is_case=True) ) ) .select_related('research', 'research__microbiology_tube', 'research__podrazdeleniye') diff --git a/api/researches/views.py b/api/researches/views.py index 5566455641..70ca8ccc71 100644 --- a/api/researches/views.py +++ b/api/researches/views.py @@ -361,7 +361,7 @@ def researches_by_department(request): q = DResearches.objects.filter(is_monitoring=True).order_by("title") elif department_pk == -13: q = DResearches.objects.filter(is_expertise=True).order_by("title") - elif department_pk == -16: + elif department_pk == -14: q = DResearches.objects.filter(is_case=True).order_by("title") else: q = DResearches.objects.filter(podrazdeleniye__pk=department_pk).order_by("title") @@ -407,6 +407,7 @@ def researches_params(request): def researches_update(request): response = {"ok": False} request_data = json.loads(request.body) + print(request_data) pk = request_data.get("pk", -2) if pk > -2: department_pk = request_data.get("department") @@ -457,7 +458,7 @@ def researches_update(request): if tube == -1: tube = None stationar_slave = is_simple and -500 >= department_pk > -600 and main_service_pk != 1 - desc = stationar_slave or department_pk in [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -16] + desc = stationar_slave or department_pk in [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -16] if len(title) > 0 and (desc or Podrazdeleniya.objects.filter(pk=department_pk).exists()): department = None if desc else Podrazdeleniya.objects.filter(pk=department_pk)[0] res = None @@ -486,7 +487,7 @@ def researches_update(request): is_application=department_pk == -11, is_monitoring=department_pk == -12, is_expertise=department_pk == -13, - is_case=department_pk == -16, + is_case=department_pk == -14, is_slave_hospital=stationar_slave, microbiology_tube_id=tube if department_pk == -6 else None, site_type_id=site_type, @@ -530,7 +531,7 @@ def researches_update(request): res.is_application = department_pk == -11 res.is_monitoring = department_pk == -12 res.is_expertise = department_pk == -13 - res.is_case = department_pk == -16 + res.is_case = department_pk == -14 res.microbiology_tube_id = tube if department_pk == -6 else None res.paraclinic_info = info res.hide = hide diff --git a/api/views.py b/api/views.py index fbb7826695..3f1d5cc28b 100644 --- a/api/views.py +++ b/api/views.py @@ -513,7 +513,7 @@ def departments(request): data = { "departments": deps, "can_edit": can_edit, - "types": [*[{"pk": str(x[0]), "title": x[1]} for x in Podrazdeleniya.TYPES if x[0] not in [8, 12] and en.get(x[0], True)], *more_types], + "types": [*[{"pk": str(x[0]), "title": x[1]} for x in Podrazdeleniya.TYPES if x[0] not in [8, 12, 16] and en.get(x[0], True)], *more_types], } if hasattr(request, 'plain_response') and request.plain_response: return data @@ -2635,6 +2635,7 @@ def get_price_data(request): @group_required('Конструктор: Настройка организации') def update_price(request): request_data = json.loads(request.body) + print(request_data) current_price = None if request_data["id"] == -1: if request_data.get("typePrice") == "Работодатель": @@ -2658,7 +2659,7 @@ def update_price(request): current_price.title = request_data["title"] current_price.date_start = request_data["start"] current_price.date_end = request_data["end"] - if request_data.get("typePrice") == "Профосмотр": + if request_data.get("typePrice") == "Заказчик" or request_data.get("typePrice") == "Работодатель": current_price.company_id = request_data["company"] else: hospital = Hospitals.objects.filter(pk=int(request_data["company"])).first() diff --git a/l2-frontend/src/construct/ParaclinicResearchEditor.vue b/l2-frontend/src/construct/ParaclinicResearchEditor.vue index 00d9aca0b3..2fc8327985 100644 --- a/l2-frontend/src/construct/ParaclinicResearchEditor.vue +++ b/l2-frontend/src/construct/ParaclinicResearchEditor.vue @@ -461,7 +461,7 @@
-