Skip to content

Commit

Permalink
Merge pull request #4645 from mikhailprivalov/colorStationarPanelService
Browse files Browse the repository at this point in the history
color for spec hosp_slave service
  • Loading branch information
Wellheor1 authored Jan 20, 2025
2 parents 2cc8459 + 3325dc4 commit de7fe4a
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 17 deletions.
1 change: 1 addition & 0 deletions api/directions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3062,6 +3062,7 @@ def last_field_result(request):
field_pks = request_data["fieldPk"].split('|')
if request_data["fieldPk"].find('@') > -1:
logical_group_or = True
is_diag_table = request_data.get("isDiagTable")
elif request_data["fieldPk"].find("&") > -1:
field_is_link = True
logical_and = True
Expand Down
5 changes: 5 additions & 0 deletions api/researches/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ def researches_by_department(request):
"is_hospital_service": True,
"title": hospital_service.get_title(),
"hide": hospital_service.hide,
"another_color_in_stationar_panel": hospital_service.slave_research.another_color_in_stationar_panel,
}
)

Expand Down Expand Up @@ -471,6 +472,7 @@ def researches_update(request):
own_form_result = result_current_form > 0
info = request_data.get("info", "").strip()
hide = request_data.get("hide")
another_color_in_stationar_panel = request_data.get("another_color_in_stationar_panel")
templates_by_department = request_data.get("templatesByDepartment")
department_template_pk = request_data.get("departmentForTemplatesField")
site_type = request_data.get("site_type", None)
Expand Down Expand Up @@ -509,6 +511,7 @@ def researches_update(request):
is_paraclinic=not desc and department.p_type == 3,
paraclinic_info=info,
hide=hide,
another_color_in_stationar_panel=another_color_in_stationar_panel,
is_doc_refferal=department_pk == -2,
is_treatment=department_pk == -3,
is_stom=department_pk == -4,
Expand Down Expand Up @@ -580,6 +583,7 @@ def researches_update(request):
res.microbiology_tube_id = tube if department_pk == -6 else None
res.paraclinic_info = info
res.hide = hide
res.another_color_in_stationar_panel = another_color_in_stationar_panel
res.site_type_id = site_type
res.internal_code = internal_code
res.uet_refferal_doc = uet_refferal_doc
Expand Down Expand Up @@ -915,6 +919,7 @@ def hospital_service_details(request):
"hide": hs.hide,
"main_service_pk": hs.main_research_id,
"slave_service_pk": hs.slave_research_id,
"another_color_in_stationar_panel": hs.slave_research.another_color_in_stationar_panel,
}
)

Expand Down
5 changes: 5 additions & 0 deletions api/stationar/stationar_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def hosp_get_data_direction(main_direction, site_type=-1, type_service='None', l
"is_citology": i[26],
"is_gistology": i[27],
"is_form": i[28],
"another_color_in_stationar_panel": i[29],
}
)

Expand All @@ -103,6 +104,7 @@ def get_direction_attrs(direction, site_type=-1, type_service='None', level=-1):

for dir_attr in data_direction:
num_dir = dir_attr.get('direction')
another_color_in_stationar_panel = False
if dict_temp.get(num_dir):
dict_by_dir = dict_temp.get(num_dir)
dict_by_dir['researches'] = [*dict_by_dir['researches'], dir_attr.get('research_title')]
Expand All @@ -113,13 +115,15 @@ def get_direction_attrs(direction, site_type=-1, type_service='None', level=-1):
confirm = bool(dir_attr.get('date_confirm'))
if dir_attr.get('is_slave_hospital'):
type_dir = 'stationar'
another_color_in_stationar_panel = dir_attr.get('another_color_in_stationar_panel')
dict_temp[num_dir] = {
'type': type_dir,
'date_create': dir_attr.get('date_create'),
'confirm': confirm,
'researches': [dir_attr.get('research_title')],
'researches_short': [dir_attr.get('research_short_title')],
'podrazdeleniye': dir_attr.get('podrazdeleniye_title'),
'another_color_in_stationar_panel': another_color_in_stationar_panel,
}
short_week_days = {0: "ПН", 1: "ВТ", 2: "СР", 3: "ЧТ", 4: "ПТ", 5: "СБ", 6: "ВС"}
for k, v in dict_temp.items():
Expand All @@ -132,6 +136,7 @@ def get_direction_attrs(direction, site_type=-1, type_service='None', level=-1):
'researches': v['researches'],
'researches_short': v['researches_short'],
'podrazdeleniye': v['podrazdeleniye'],
'another_color': v['another_color_in_stationar_panel'],
}
data.append(dict_result)

Expand Down
5 changes: 1 addition & 4 deletions directions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,10 +819,7 @@ def visit_date_local(self):

@property
def services(self) -> List[directory.Researches]:
result = []
for iss in self.issledovaniya_set.all().order_by('research__title'):
result.append(iss.research)
return result
return [iss.research for iss in self.issledovaniya_set.all().order_by('research__title')]

def __str__(self):
return "%d для пациента %s (врач %s, выписал %s, %s, %s, %s, par: [%s])" % (
Expand Down
1 change: 1 addition & 0 deletions directory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ class Researches(models.Model):
count_volume_material_for_tube = models.FloatField(default=0, verbose_name="Количество материала для емкости в долях", blank=True)
templates_by_department = models.BooleanField(default=None, help_text="Искать шаблоны заполнения по подразделению", null=True, blank=True)
schema_pdf = models.FileField(upload_to=get_file_path_to_schemas, default=None, null=True, blank=True)
another_color_in_stationar_panel = models.BooleanField(default=None, help_text="Другой цвет на ленте стационарных услуг", null=True, blank=True)

@staticmethod
def save_plan_performer(tb_data):
Expand Down
7 changes: 6 additions & 1 deletion l2-frontend/src/construct/ParaclinicResearchEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,11 @@ export default {
required: false,
default: false,
},
another_color_in_stationar_panel: {
type: Boolean,
required: false,
default: false,
},
direction_forms: {
type: Array,
required: false,
Expand Down Expand Up @@ -1800,7 +1805,7 @@ export default {
simple: this.simple,
};
if (this.simple) {
props.push('main_service_pk', 'hide_main', 'hs_pk');
props.push('main_service_pk', 'hide_main', 'hs_pk', 'another_color_in_stationar_panel');
}
constructPoint
.updateResearch(this, props, moreData)
Expand Down
19 changes: 17 additions & 2 deletions l2-frontend/src/construct/StationarFormEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
</div>
<div class="right">
<div class="input-group">
<label
v-tippy
class="input-group-addon"
style="height: 34px;text-align: left;"
title="Другой цвет в ленте стационара"
>
<input
v-model="another_color_in_stationar_panel"
type="checkbox"
> Изм. цвет
</label>
<label
class="input-group-addon"
style="height: 34px;text-align: left;"
Expand All @@ -33,6 +44,7 @@
:hide_main="hide"
:pk="slave_service_pk"
:department="department"
:another_color_in_stationar_panel="another_color_in_stationar_panel"
/>
</div>
</div>
Expand Down Expand Up @@ -67,6 +79,7 @@ export default {
main_service_pk: -1,
slave_service_pk: -1,
researches_list: [],
another_color_in_stationar_panel: false,
};
},
watch: {
Expand All @@ -83,6 +96,7 @@ export default {
methods: {
async load() {
this.hide = false;
this.another_color_in_stationar_panel = false;
this.research = -1;
this.main_service_pk = -1;
this.slave_service_pk = -1;
Expand All @@ -95,6 +109,7 @@ export default {
this.main_service_pk = data.main_service_pk;
this.slave_service_pk = data.slave_service_pk;
this.hide = data.hide;
this.another_color_in_stationar_panel = data.another_color_in_stationar_panel;
this.loaded_pk = this.pk;
}
await this.$store.dispatch(actions.DEC_LOADING);
Expand All @@ -113,14 +128,14 @@ export default {
flex: 0 0 34px;
.left {
flex: 0 0 calc(100% - 100px);
flex: 0 0 calc(100% - 200px);
::v-deep .form-control {
width: 100%;
}
}
.right {
flex: 0 0 100px
flex: 0 0 200px
}
.input-group-addon {
Expand Down
12 changes: 11 additions & 1 deletion l2-frontend/src/pages/Stationar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
v-for="d in list_directions"
:key="d.pk"
class="top-block direction-block"
:class="{ confirmed: Boolean(d.confirm), active: opened_form_pk === d.pk }"
:class="{ confirmed: Boolean(d.confirm), another_color: Boolean(d.another_color), active: opened_form_pk === d.pk }"

Check warning on line 335 in l2-frontend/src/pages/Stationar/index.vue

View workflow job for this annotation

GitHub Actions / webpack_build_prod

Multiple spaces found before 'active'

Check warning on line 335 in l2-frontend/src/pages/Stationar/index.vue

View workflow job for this annotation

GitHub Actions / webpack_build_prod

Multiple spaces found before 'active'
@click="open_form(d)"
>
<span>
Expand Down Expand Up @@ -2035,10 +2035,20 @@ export default {
}
}
&.another_color {
border-color: #0583b0;
background: linear-gradient(to bottom, #bdecfd 0%, #0583b0ba 100%);
&:hover:not(.active) {
box-shadow: 0 7px 14px #0583b054, 0 5px 5px #0583b0ba;
}
}
&.active {
background-image: linear-gradient(#6c7a89, #56616c) !important;
color: #fff !important;
}
}
}
Expand Down
28 changes: 19 additions & 9 deletions utils/tree_directions.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,32 +201,41 @@ def hospital_get_direction(iss, main_research, hosp_site_type, hosp_is_paraclini
with connection.cursor() as cursor:
cursor.execute(
"""WITH RECURSIVE r AS (
SELECT nn.id,
SELECT
nn.id,
to_char(nn.data_sozdaniya AT TIME ZONE %(tz)s, 'DD.MM.YYYY') as date_create,
to_char(nn.data_sozdaniya AT TIME ZONE %(tz)s, 'HH24:MI') as time_create,
nn.parent_id, nn.cancel,
nn.parent_id,
nn.cancel,
ii.napravleniye_id,
ii.id as iss,
to_char(ii.time_confirmation AT TIME ZONE %(tz)s, 'DD.MM.YYYY') as date_confirm,
to_char(ii.time_confirmation AT TIME ZONE %(tz)s, 'HH24:MI') as time_confirm,
ii.research_id, ddrr.title, ddrr.short_title,
ii.diagnos, 1 AS level
ii.research_id,
ddrr.title,
ddrr.short_title,
ii.diagnos,
1 AS level
FROM directions_issledovaniya ii
LEFT JOIN directions_napravleniya nn
ON ii.napravleniye_id=nn.id
LEFT JOIN directory_researches ddrr
ON ii.research_id = ddrr.id
WHERE ii.id = %(num_issledovaniye)s
UNION ALL
SELECT n.id,
SELECT
n.id,
to_char(n.data_sozdaniya AT TIME ZONE %(tz)s, 'DD.MM.YYYY') as date_create,
to_char(n.data_sozdaniya AT TIME ZONE %(tz)s, 'HH24:MI') as time_create,
n.parent_id, n.cancel,
n.parent_id,
n.cancel,
i.napravleniye_id,
i.id,
to_char(i.time_confirmation AT TIME ZONE %(tz)s, 'DD.MM.YYYY') as date_confirm,
to_char(i.time_confirmation AT TIME ZONE %(tz)s, 'HH24:MI') as time_confirm,
i.research_id, dr.title, dr.short_title,
i.research_id,
dr.title,
dr.short_title,
i.diagnos,
r.level + 1 AS level
FROM directions_issledovaniya i
Expand All @@ -242,7 +251,7 @@ def hospital_get_direction(iss, main_research, hosp_site_type, hosp_is_paraclini
t_research AS (SELECT directory_researches.id as research_iddir, podrazdeleniye_id, is_paraclinic, is_doc_refferal,
is_stom, is_hospital, is_microbiology, is_slave_hospital, is_citology, is_gistology, t_podrazdeleniye.title as podr_title,
t_podrazdeleniye.p_type, is_form FROM directory_researches
t_podrazdeleniye.p_type, is_form, another_color_in_stationar_panel FROM directory_researches
LEFT JOIN t_podrazdeleniye ON t_podrazdeleniye.id = directory_researches.podrazdeleniye_id),
t_hospital_service AS (SELECT site_type, slave_research_id FROM directory_hospitalservice
Expand Down Expand Up @@ -281,7 +290,8 @@ def hospital_get_direction(iss, main_research, hosp_site_type, hosp_is_paraclini
SELECT DISTINCT "id", date_create, time_create, parent_id, napravleniye_id, iss, date_confirm, time_confirm, research_id, title,
diagnos, "level", research_iddir, podrazdeleniye_id, is_paraclinic, is_doc_refferal, is_stom, is_hospital,
is_microbiology, podr_title, p_type, site_type, slave_research_id, short_title, is_slave_hospital, cancel, is_citology, is_gistology, is_form FROM t_all WHERE
is_microbiology, podr_title, p_type, site_type, slave_research_id, short_title, is_slave_hospital, cancel, is_citology, is_gistology, is_form, another_color_in_stationar_panel
FROM t_all WHERE
CASE
WHEN %(hosp_level)s > -1 THEN
level = %(hosp_level)s
Expand Down

0 comments on commit de7fe4a

Please sign in to comment.