From 9b410e637e15f40452f03884ae2190ea842cac8f Mon Sep 17 00:00:00 2001 From: Lea Date: Mon, 7 Oct 2024 19:55:09 +0200 Subject: [PATCH] fix: filter for duplicates --- arztapi/APIHandler.py | 5 +++++ 1 file changed, 5 insertions(+) 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