feat: Update DataManager to support new quetiapine medication format and adjust VSCode task command
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled

This commit is contained in:
William Valentin
2025-07-29 14:00:33 -07:00
parent 188fb542be
commit ce986db27b
3 changed files with 36 additions and 5 deletions

2
.gitignore vendored
View File

@@ -47,7 +47,7 @@ htmlcov/
.pylint.d/ .pylint.d/
# IDEs and editors # IDEs and editors
.vscode/ #.vscode/
!.vscode/tasks.json !.vscode/tasks.json
!.vscode/launch.json !.vscode/launch.json
.idea/ .idea/

8
.vscode/tasks.json vendored
View File

@@ -4,7 +4,13 @@
{ {
"label": "Run TheChart App", "label": "Run TheChart App",
"type": "shell", "type": "shell",
"command": "cd /home/will/Code/thechart && python -m src.main", "command": "/home/will/Code/thechart/.venv/bin/python",
"args": [
"src/main.py"
],
"options": {
"cwd": "/home/will/Code/thechart"
},
"group": "build", "group": "build",
"isBackground": false, "isBackground": false,
"problemMatcher": [] "problemMatcher": []

View File

@@ -108,9 +108,32 @@ class DataManager:
return False return False
# Find the row to update using original_date as a unique identifier # Find the row to update using original_date as a unique identifier
# Handle both old format (10 columns) and new format (14 columns) # Handle both old format (10 columns) and new format (16 columns)
if len(values) == 14: if len(values) == 16:
# New format with dose columns # New format with all dose columns including quetiapine
df.loc[
df["date"] == original_date,
[
"date",
"depression",
"anxiety",
"sleep",
"appetite",
"bupropion",
"bupropion_doses",
"hydroxyzine",
"hydroxyzine_doses",
"gabapentin",
"gabapentin_doses",
"propranolol",
"propranolol_doses",
"quetiapine",
"quetiapine_doses",
"note",
],
] = values
elif len(values) == 14:
# Format without quetiapine
df.loc[ df.loc[
df["date"] == original_date, df["date"] == original_date,
[ [
@@ -192,6 +215,8 @@ class DataManager:
"gabapentin_doses": "", "gabapentin_doses": "",
"propranolol": 0, "propranolol": 0,
"propranolol_doses": "", "propranolol_doses": "",
"quetiapine": 0,
"quetiapine_doses": "",
"note": "", "note": "",
} }
df = pd.concat([df, pd.DataFrame([new_entry])], ignore_index=True) df = pd.concat([df, pd.DataFrame([new_entry])], ignore_index=True)