Skip to content

Commit

Permalink
случай
Browse files Browse the repository at this point in the history
  • Loading branch information
urchinpro committed Sep 22, 2023
1 parent b348c32 commit 7379597
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion api/researches/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ 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:
q = DResearches.objects.filter(is_case=True).order_by("title")
else:
q = DResearches.objects.filter(podrazdeleniye__pk=department_pk).order_by("title")

Expand Down Expand Up @@ -405,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")
Expand Down Expand Up @@ -455,8 +458,9 @@ 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]
desc = stationar_slave or department_pk in [-2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -16]
if len(title) > 0 and (desc or Podrazdeleniya.objects.filter(pk=department_pk).exists()):
print("попал")
department = None if desc else Podrazdeleniya.objects.filter(pk=department_pk)[0]
res = None
if int(hospital_research_department_pk) > -1:
Expand Down Expand Up @@ -484,6 +488,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_slave_hospital=stationar_slave,
microbiology_tube_id=tube if department_pk == -6 else None,
site_type_id=site_type,
Expand Down Expand Up @@ -527,6 +532,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.microbiology_tube_id = tube if department_pk == -6 else None
res.paraclinic_info = info
res.hide = hide
Expand Down
2 changes: 1 addition & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def directive_from(request):
data = []
hospital = request.user.doctorprofile.hospital
for dep in (
Podrazdeleniya.objects.filter(p_type__in=(Podrazdeleniya.DEPARTMENT, Podrazdeleniya.HOSP, Podrazdeleniya.PARACLINIC), hospital__in=(hospital, None))
Podrazdeleniya.objects.filter(p_type__in=(Podrazdeleniya.DEPARTMENT, Podrazdeleniya.HOSP, Podrazdeleniya.PARACLINIC, Podrazdeleniya.CASE), hospital__in=(hospital, None))
.prefetch_related(
Prefetch(
'doctorprofile_set',
Expand Down
2 changes: 2 additions & 0 deletions directory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class ResearchSite(models.Model):
(4, 'Микробиология'),
(7, 'Формы'),
(10, 'Мониторинги'),
(16, 'Случаи'),
)

site_type = models.SmallIntegerField(choices=TYPES, help_text="Тип раздела", db_index=True)
Expand Down Expand Up @@ -371,6 +372,7 @@ def desc(self):
or self.is_paraclinic
or self.is_microbiology
or self.is_hospital
or self.is_case
or self.is_citology
or self.is_gistology
or self.is_form
Expand Down
4 changes: 2 additions & 2 deletions l2-frontend/src/construct/ParaclinicResearchEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@
</div>
</template>
<div
v-if="ex_dep === 7 || ex_dep === 16"
v-if="ex_dep === 7 || ex_dep ===16"
class="department-select"
>
<Treeselect
Expand All @@ -480,7 +480,7 @@
>
</div>
</div>
<template v-if="ex_dep !== 7 || ex_dep !== 16">
<template v-if="ex_dep !== 7 && ex_dep !== 16">
<div
v-for="(group, gi) in orderBy(groups, 'order')"
:key="gi"
Expand Down

0 comments on commit 7379597

Please sign in to comment.