diff --git a/forms/forms_func.py b/forms/forms_func.py index 32c1ce7d5c..129c0ce052 100644 --- a/forms/forms_func.py +++ b/forms/forms_func.py @@ -458,22 +458,11 @@ def primary_reception_get_data(hosp_first_num, site_type=0): 'Время установления диагноза', 'Кому доверяю', ] - cda_dict_title = {} - result_by_cda = {} - if CDA_TITLES_FIELDS_PRIMARY_RESEARCH: - cda_ids_data = cda_data_by_title(tuple(CDA_TITLES_FIELDS_PRIMARY_RESEARCH)) - cda_ids = [i.id for i in cda_ids_data] - cda_dict_title = {i.id: i.title for i in cda_ids_data} - fields_data = get_title_fields_by_cda_relation(primary_research_id, tuple(cda_ids)) - titles_field = [i.title for i in fields_data] list_values = None if titles_field and hosp_primary_receptions: list_values = get_result_value_iss(hosp_primary_iss, primary_research_id, titles_field) - if CDA_TITLES_FIELDS_PRIMARY_RESEARCH: - result_by_cda = {cda_dict_title.get(value[4]): value[2] for value in list_values} - date_entered_value, time_entered_value, type_transport, medicament_allergy = '', '', '', '' who_directed, plan_hospital, extra_hospital, type_hospital = '', '', '', '' time_start_ill, diagnos_who_directed, diagnos_entered = '', '', '' @@ -694,7 +683,6 @@ def primary_reception_get_data(hosp_first_num, site_type=0): 'date_diagnosis': date_diagnosis, 'time_diagnosis': time_diagnosis, 'whom_transfer_health_data': whom_transfer_health_data, - 'result_by_cda': result_by_cda, } @@ -721,7 +709,7 @@ def primary_reception_get_data_by_cda(hosp_first_num, site_type=0): if titles_field and hosp_primary_receptions: list_values = get_result_value_iss(hosp_primary_iss, primary_research_id, titles_field) - if CDA_TITLES_FIELDS_PRIMARY_RESEARCH: + if CDA_TITLES_FIELDS_PRIMARY_RESEARCH and list_values: result_by_cda = {cda_dict_title.get(value[4]): value[2] for value in list_values} return {