Работа с медикаментами в приёме

This commit is contained in:
Роман Бородин 2020-05-07 17:11:05 +03:00
parent 78baf302c2
commit 898244f107
2 changed files with 19 additions and 1 deletions

View File

@ -267,12 +267,19 @@ def create_open_reception_win():
reception_observe_list.remove(row)
disable_widget([remove_observe_button])
reception_observe_list.show_all()
def remove_medicine(self, button):
row = reception_medicines_list.get_selected_row()
reception_medicines_list.remove(row)
disable_widget([remove_medicine_button])
reception_medicines_list.show_all()
def diagnosis_selected(self, *s):
enable_widget([remove_diag_button])
def anamnesis_selected(self, *a):
enable_widget([remove_anam_button])
def observe_selected(self, *a):
enable_widget([remove_observe_button])
def medicine_selected(self, *a):
enable_widget([remove_medicine_button])
def save(self, button):
# Диагнозы
diag_id_list = list(map(lambda x: x.props.db_id, reception_diag_list.get_children()))
@ -286,6 +293,9 @@ def create_open_reception_win():
observe_id_list = list(map(lambda x: x.props.db_id, reception_observe_list.get_children()))
save_reception_observe(reception, observe_id_list)
#######
# Медикаменты
medicine_id_list = list(map(lambda x: x.props.db_id, reception_medicines_list.get_children()))
save_reception_medicine(reception, medicine_id_list)
w.destroy()
b.add_from_file(open_reception_win_file)
b.connect_signals(OpenReceptionWinHandler())
@ -297,9 +307,11 @@ def create_open_reception_win():
reception_diag_list = b.get_object('diagnosis_list')
reception_anam_list = b.get_object('anamnesis_list')
reception_observe_list = b.get_object('observe_list')
reception_medicines_list = b.get_object('medicines_list')
remove_diag_button = b.get_object('remove_diag_button')
remove_anam_button = b.get_object('remove_anam_button')
remove_observe_button = b.get_object('remove_observe_button')
remove_medicine_button = b.get_object('remove_medicine_button')
# Анамнез
for ra in [x.anamnesis for x in get_reception_anamnesis_items(reception)]:
reception_anam_list.add(build_reception_anamnesis_row(ra))
@ -312,6 +324,10 @@ def create_open_reception_win():
for rd in [x.diagnosis for x in get_reception_diagnosis_items(reception)]:
reception_diag_list.add(build_reception_diagnosis_row(rd))
#
# Медикаменты
for rm in [x.medicine for x in get_reception_medicine_items(reception)]:
reception_medicines_list.add(build_reception_medicine_row(rm))
#
w = b.get_object('open_reception_window')
return w
def create_new_reception_win():

View File

@ -611,6 +611,7 @@
<object class="GtkListBox" id="medicines_list">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="row-selected" handler="medicine_selected" swapped="no"/>
</object>
</child>
</object>
@ -660,11 +661,12 @@
</packing>
</child>
<child>
<object class="GtkButton">
<object class="GtkButton" id="remove_medicine_button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="remove_medicine" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>