-
Notifications
You must be signed in to change notification settings - Fork 14
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
Case amb #3087
Changes from 3 commits
b348c32
7379597
4c03c71
eaefd3f
b167f46
99e6b06
2046432
1667c99
e18ba81
7768dc5
b3b10d9
7f393f4
0326357
1b0b7b2
390a27d
5a2412f
f7f9ddc
5486c79
e65f035
4d67e31
94c9bbb
5188f4e
07e1bd5
b132d1d
5efedc2
62387f1
581414c
d087a08
cd2b61b
2e86003
ae39ed9
ddafb37
6c60cd7
4745778
5014c6a
aa3cd89
84c7594
7b5b773
288c71a
80d83e4
44c2d2b
de5e490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
|
||
|
@@ -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") | ||
|
@@ -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("попал") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [flake8] <201> reported by reviewdog 🐶 |
||
department = None if desc else Podrazdeleniya.objects.filter(pk=department_pk)[0] | ||
res = None | ||
if int(hospital_research_department_pk) > -1: | ||
|
@@ -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, | ||
|
@@ -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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -721,11 +721,15 @@ 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 | ||
|
||
t = e - 4 | ||
has_def = DResearches.objects.filter(hide=False, site_type__isnull=True, **DResearches.filter_type(e)).exists() | ||
if e == 16: | ||
print("has_def") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [flake8] <201> reported by reviewdog 🐶 |
||
print(has_def) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [flake8] <201> reported by reviewdog 🐶 |
||
|
||
if has_def and e != 12: | ||
d = [{"pk": None, "title": 'Общие', 'type': t, "extended": True}] | ||
|
@@ -748,6 +752,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: | ||
|
@@ -762,6 +767,8 @@ def fill_settings(): | |
t1.join() | ||
t2.join() | ||
|
||
print(ret) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [flake8] <201> reported by reviewdog 🐶 |
||
|
||
if hasattr(request, 'plain_response') and request.plain_response: | ||
return ret | ||
return JsonResponse(ret) | ||
|
@@ -784,7 +791,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', | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -82,6 +82,7 @@ class ResearchSite(models.Model): | |||||||||
(4, 'Микробиология'), | ||||||||||
(7, 'Формы'), | ||||||||||
(10, 'Мониторинги'), | ||||||||||
(12, 'Случаи'), | ||||||||||
) | ||||||||||
|
||||||||||
site_type = models.SmallIntegerField(choices=TYPES, help_text="Тип раздела", db_index=True) | ||||||||||
|
@@ -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="Если это параклиническое исследование - здесь указывается подготовка и кабинет") | ||||||||||
|
@@ -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) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
urchinpro marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [black-format] reported by reviewdog 🐶
Suggested change
|
||||||||||
} | ||||||||||
return ts.get(t + 1, {}) | ||||||||||
|
||||||||||
|
@@ -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 -16 | ||||||||||
return self.podrazdeleniye_id or -2 | ||||||||||
|
||||||||||
@property | ||||||||||
|
@@ -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 | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[flake8] <201> reported by reviewdog 🐶
print found.