fix: filter for duplicates

This commit is contained in:
Lea 2024-10-07 19:55:09 +02:00
parent 66abe151b0
commit 9b410e637e

View File

@ -126,6 +126,7 @@ class APIHandler:
# Filter for the relevant therapy times before processing
self.filter_for_therapy_types(therapy_types)
self.filter_for_duplicates()
def get_list_of_doctors_from_api(self, lat, lon, req_val_base64, therapy_types, therapy_age,
therapy_setting) -> ArztPraxisDatas:
@ -204,6 +205,10 @@ class APIHandler:
# Update with relevant phone times
self.phone_times.arztPraxisDatas = relevant_phone_times
def filter_for_duplicates(self):
self.phone_times.arztPraxisDatas = [i for n, i in enumerate(self.phone_times.arztPraxisDatas)
if i not in self.phone_times.arztPraxisDatas[:n]]
def get_general_doctor_information(self) -> List[DoctorInformation]:
"""
Transform and filter data to more usable format: Check for phone times and collect general doctor information