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

Case amb #3087

Merged
merged 42 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b348c32
.
urchinpro Sep 22, 2023
7379597
случай
urchinpro Sep 22, 2023
4c03c71
конструктор случай
urchinpro Sep 22, 2023
eaefd3f
fix
urchinpro Sep 22, 2023
b167f46
fix
urchinpro Sep 22, 2023
99e6b06
fix
urchinpro Sep 22, 2023
2046432
fix
urchinpro Sep 22, 2023
1667c99
fix
urchinpro Sep 22, 2023
e18ba81
fix
urchinpro Sep 23, 2023
7768dc5
Update directory/models.py
urchinpro Sep 23, 2023
b3b10d9
Update api/views.py
urchinpro Sep 23, 2023
7f393f4
fix
urchinpro Sep 23, 2023
0326357
Merge remote-tracking branch 'origin/caseAmb' into caseAmb
urchinpro Sep 23, 2023
1b0b7b2
Случаи в истории
urchinpro Sep 26, 2023
390a27d
.
urchinpro Sep 26, 2023
5a2412f
.
urchinpro Sep 26, 2023
f7f9ddc
Исключено требование создавать случай внутри истории болезни
urchinpro Sep 27, 2023
5486c79
fix
urchinpro Sep 27, 2023
e65f035
Update api/directions/views.py
urchinpro Sep 27, 2023
4d67e31
Update api/directions/views.py
urchinpro Sep 27, 2023
94c9bbb
fix
urchinpro Sep 27, 2023
5188f4e
Merge remote-tracking branch 'origin/caseAmb' into caseAmb
urchinpro Sep 27, 2023
07e1bd5
fix date in xlsx
urchinpro Sep 27, 2023
b132d1d
add fielt to Napravleniya "paren_case"
urchinpro Sep 28, 2023
5efedc2
fix
urchinpro Sep 28, 2023
62387f1
fix cda gen lab
urchinpro Sep 29, 2023
581414c
автосоздание случая
urchinpro Sep 30, 2023
d087a08
fix
urchinpro Sep 30, 2023
cd2b61b
fix
urchinpro Sep 30, 2023
2e86003
fix
urchinpro Sep 30, 2023
ae39ed9
вывод услуг случая в "Истории" случая
urchinpro Oct 1, 2023
ddafb37
fix
urchinpro Oct 1, 2023
6c60cd7
fix
urchinpro Oct 1, 2023
4745778
fix
urchinpro Oct 1, 2023
5014c6a
Роль для редактирвоания случая
urchinpro Oct 1, 2023
aa3cd89
получить случай не скрытый
urchinpro Oct 1, 2023
84c7594
initial case ui
Oct 6, 2023
7b5b773
Merge branch 'caseAmb' into case-ui
Oct 6, 2023
288c71a
History case link
mikhailprivalov Oct 7, 2023
80d83e4
case directions ui
mikhailprivalov Oct 8, 2023
44c2d2b
aggregate base
mikhailprivalov Oct 8, 2023
de5e490
Merge pull request #3110 from moodpulse/case-ui
mikhailprivalov Oct 8, 2023
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
8 changes: 6 additions & 2 deletions api/researches/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def get_researches(request, last_used=False):
"treatment": r.is_treatment,
"is_hospital": r.is_hospital,
"is_form": r.is_form,
"is_case": r.is_case,
"is_application": r.is_application,
"stom": r.is_stom,
"need_vich_code": r.need_vich_code,
Expand Down Expand Up @@ -257,7 +258,6 @@ def get_researches(request, last_used=False):
result = {"researches": deps, "cnts": cnts}
else:
result = json.loads(result)

if hasattr(request, 'plain_response') and request.plain_response:
return result
return JsonResponse(result)
Expand Down 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 @@ -455,7 +457,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]
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()):
department = None if desc else Podrazdeleniya.objects.filter(pk=department_pk)[0]
res = None
Expand Down Expand Up @@ -484,6 +486,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 +530,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
4 changes: 3 additions & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ def fill_settings():
)

for e in en:

urchinpro marked this conversation as resolved.
Show resolved Hide resolved
if e < 4 or not en[e] or e == 13:
continue

Expand Down Expand Up @@ -748,6 +749,7 @@ def fill_settings():
ret["extended_departments"][Podrazdeleniya.MORFOLOGY].append(
{"pk": Podrazdeleniya.MORFOLOGY + 3, "title": "Гистология", "type": Podrazdeleniya.MORFOLOGY, "extended": True, "e": Podrazdeleniya.MORFOLOGY}
)

try:
connections.close_all()
except Exception as e:
Expand Down Expand Up @@ -784,7 +786,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 appconf/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def l2_modules() -> dict:
"price_customer",
"price_externel_performer",
"ftp",
"case",
]
},
"consults_module": SettingManager.get("consults_module", default='false', default_type='b'),
Expand Down Expand Up @@ -214,6 +215,7 @@ def en():
12: SettingManager.get("directions_params", default='false', default_type='b'),
13: SettingManager.l2("applications"),
14: SettingManager.l2("monitorings"),
16: SettingManager.l2("case"),
}

cache.set(k, simplejson.dumps(result), 60 * 60 * 8)
Expand Down
1 change: 1 addition & 0 deletions directions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ def print_direction(c: Canvas, n, dir: Napravleniya, format_a6: bool = False):
-9: 'Формы',
-11: 'Заявления',
-12: 'Мониторинги',
-14: 'Случай',
}[rtp]
# if rtp == -6:
# has_micro = True
Expand Down
6 changes: 6 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, 'Мониторинги'),
(12, 'Случаи'),
)

site_type = models.SmallIntegerField(choices=TYPES, help_text="Тип раздела", db_index=True)
Expand Down Expand Up @@ -243,6 +244,7 @@ class Researches(models.Model):
is_monitoring = models.BooleanField(default=False, blank=True, help_text="Это мониторинг", db_index=True)
is_expertise = models.BooleanField(default=False, blank=True, help_text="Это экспертиза", db_index=True)
is_aux = models.BooleanField(default=False, blank=True, help_text="Это вспомогательный", db_index=True)
is_case = models.BooleanField(default=False, blank=True, help_text="Это случай", db_index=True)
site_type = models.ForeignKey(ResearchSite, default=None, null=True, blank=True, help_text='Место услуги', on_delete=models.SET_NULL, db_index=True)
need_vich_code = models.BooleanField(default=False, blank=True, help_text="Необходимость указания кода вич в направлении")
paraclinic_info = models.TextField(blank=True, default="", help_text="Если это параклиническое исследование - здесь указывается подготовка и кабинет")
Expand Down Expand Up @@ -330,6 +332,7 @@ def filter_type(t):
14: dict(is_application=True),
15: dict(is_monitoring=True),
16: dict(is_expertise=True),
17: dict(is_case=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change
17: dict(is_case=True)
17: dict(is_case=True),

urchinpro marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change
17: dict(is_case=True)
17: dict(is_case=True),

}
return ts.get(t + 1, {})

Expand Down Expand Up @@ -357,6 +360,8 @@ def reversed_type(self):
return -13
if self.is_microbiology or self.is_citology or self.is_gistology:
return 2 - Podrazdeleniya.MORFOLOGY
if self.is_case:
return -14
return self.podrazdeleniye_id or -2

@property
Expand All @@ -368,6 +373,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: 4 additions & 0 deletions l2-frontend/src/construct/ConstructParaclinic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ export default {
d.push({ value: -8, label: '– Гистология' });
}
}

if (this.modules.l2_case) {
d.push({ value: -14, label: 'Случаи' });
}
}

this.departments_of_type = d;
Expand Down
5 changes: 3 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"
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">
<template v-if="ex_dep !== 7 && ex_dep !== 16">
<div
v-for="(group, gi) in orderBy(groups, 'order')"
:key="gi"
Expand Down Expand Up @@ -1286,6 +1286,7 @@ export default {
'-11': 13,
'-12': 14,
'-13': 15,
'-14': 16,
}[this.department] || this.department
);
},
Expand Down
2 changes: 1 addition & 1 deletion l2-frontend/src/ui-cards/SelectedResearches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ export default {
for (const pk of this.researches) {
if (this.$store.getters.researches_obj[pk]) {
const res = this.$store.getters.researches_obj[pk];
const d = res.department_pk && !res.doc_refferal ? res.department_pk : -2;
const d = res.department_pk && !res.doc_refferal && !res.is_case ? res.department_pk : -2;
if (!(d in r)) {
r[d] = {
pk: d,
Expand Down
2 changes: 2 additions & 0 deletions podrazdeleniya/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Podrazdeleniya(models.Model): # Модель подразделений
DIRECTIONPARAMS = 12
APPLICATIONS = 13
MONITORINGS = 14
CASE = 16

TYPES = (
(HIDDEN, "Скрыто"),
Expand All @@ -31,6 +32,7 @@ class Podrazdeleniya(models.Model): # Модель подразделений
(DIRECTIONPARAMS, "Параметры для направления"),
(APPLICATIONS, "Заявления"),
(MONITORINGS, "Мониторинги"),
(CASE, "Случаи"),
)

ODII_TYPES = (
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ beren = "0.7.1"
transliterate = "1.10.2"
imgkit = "1.2.3"
astm = {git = "https://github.com/moodpulse/python-astm.git", rev = "v0.6"}
psycopg2-binary = "^2.9.4"
#psycopg2-binary = "^2.9.4"
boto3 = "^1.26.157"
prompt-toolkit = "^3.0.36"
pdf2docx = "^0.5.6"
Expand Down
Loading