chore: Remove obsolete test scripts and unused methods from the data manager

- Deleted test scripts for dose tracking, UI functionality, dynamic data, edit functionality, and final workflow.
- Removed the `add_medicine_dose` method from the DataManager class as it is no longer needed.
This commit is contained in:
William Valentin
2025-07-31 11:11:21 -07:00
parent 59251ced31
commit 00443a540f
25 changed files with 0 additions and 2301 deletions

View File

@@ -143,50 +143,6 @@ class DataManager:
self.logger.error(f"Error deleting entry: {str(e)}")
return False
def add_medicine_dose(self, date: str, medicine_name: str, dose: str) -> bool:
"""Add a medicine dose to today's entry."""
from datetime import datetime
try:
df: pd.DataFrame = self.load_data()
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
dose_entry = f"{timestamp}:{dose}"
# Find or create entry for the given date
if df.empty or date not in df["date"].values:
# Create new entry for today with default values
new_entry = {"date": date, "note": ""}
# Add pathology columns with default values
for pathology_key in self.pathology_manager.get_pathology_keys():
new_entry[pathology_key] = 0
# Add medicine columns dynamically
for medicine_key in self.medicine_manager.get_medicine_keys():
new_entry[medicine_key] = 0
new_entry[f"{medicine_key}_doses"] = ""
df = pd.concat([df, pd.DataFrame([new_entry])], ignore_index=True)
# Add dose to the appropriate medicine
dose_column = f"{medicine_name}_doses"
mask = df["date"] == date
current_doses = df.loc[mask, dose_column].iloc[0]
if current_doses:
df.loc[mask, dose_column] = current_doses + "|" + dose_entry
else:
df.loc[mask, dose_column] = dose_entry
# Mark medicine as taken (set to 1)
df.loc[mask, medicine_name] = 1
df.to_csv(self.filename, index=False)
return True
except Exception as e:
self.logger.error(f"Error adding medicine dose: {str(e)}")
return False
def get_today_medicine_doses(
self, date: str, medicine_name: str
) -> list[tuple[str, str]]: