Ещё часть...

This commit is contained in:
Роман Бородин 2020-05-06 19:26:35 +03:00
parent c67e4fb479
commit 78baf302c2
1 changed files with 7 additions and 0 deletions

View File

@ -152,6 +152,13 @@ def save_reception_observe(reception, observe_id_list):
to_add = list(new_symptoms - exist_symptoms)
delete_reception_observe_symptoms(reception, to_del)
add_reception_observe_symptoms(reception, to_add)
def save_reception_medicine(reception, medicine_id_list):
exist_medicines = set(map(lambda x: x.medicine.id, get_reception_medicine_items(reception)))
new_medicines = set(medicine_id_list)
to_del = list(exist_medicines - new_medicines)
to_add = list(new_medicines - exist_medicines)
delete_reception_medicines(reception, to_del)
add_reception_medicines(reception, to_add)
##################################################################################
def build_reception_row(reception_datetime):