diff --git a/arztapi/APIHandler.py b/arztapi/APIHandler.py index dae758a..14f105c 100644 --- a/arztapi/APIHandler.py +++ b/arztapi/APIHandler.py @@ -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