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
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -47,7 +47,7 @@ htmlcov/
|
||||
.pylint.d/
|
||||
|
||||
# IDEs and editors
|
||||
.vscode/
|
||||
#.vscode/
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
.idea/
|
||||
|
||||
8
.vscode/tasks.json
vendored
8
.vscode/tasks.json
vendored
@@ -4,7 +4,13 @@
|
||||
{
|
||||
"label": "Run TheChart App",
|
||||
"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",
|
||||
"isBackground": false,
|
||||
"problemMatcher": []
|
||||
|
||||
@@ -108,9 +108,32 @@ class DataManager:
|
||||
return False
|
||||
|
||||
# Find the row to update using original_date as a unique identifier
|
||||
# Handle both old format (10 columns) and new format (14 columns)
|
||||
if len(values) == 14:
|
||||
# New format with dose columns
|
||||
# Handle both old format (10 columns) and new format (16 columns)
|
||||
if len(values) == 16:
|
||||
# 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["date"] == original_date,
|
||||
[
|
||||
@@ -192,6 +215,8 @@ class DataManager:
|
||||
"gabapentin_doses": "",
|
||||
"propranolol": 0,
|
||||
"propranolol_doses": "",
|
||||
"quetiapine": 0,
|
||||
"quetiapine_doses": "",
|
||||
"note": "",
|
||||
}
|
||||
df = pd.concat([df, pd.DataFrame([new_entry])], ignore_index=True)
|
||||
|
||||
Reference in New Issue
Block a user