# Medicine Dose Tracking Feature - Usage Guide ## Overview The medicine dose tracking feature allows you to record specific timestamps and doses when you take medications throughout the day. This provides detailed tracking beyond the simple daily checkboxes. ## How to Use ### 1. Recording Medicine Doses 1. **Open the application** - Run `make run` or `uv run python src/main.py` 2. **Find the medicine section** - Look for the "Treatment" section in the input form 3. **For each medicine, you'll see:** - Checkbox (existing daily tracking) - Dose entry field (new) - "Take [Medicine]" button (new) - Dose display area showing today's doses (new) ### 2. Taking a Dose 1. **Enter the dose amount** in the dose entry field (e.g., "150mg", "10mg", "25mg") 2. **Click the "Take [Medicine]" button** - This will: - Record the current timestamp - Save the dose amount - Update the display area - Mark the medicine checkbox as taken ### 3. Multiple Doses Per Day - You can take multiple doses of the same medicine - Each dose gets its own timestamp - All doses for the day are displayed in the dose area - The display shows: `YYYY-MM-DD HH:MM:SS: dose` ### 4. Viewing Dose History - **Today's doses** are shown in the dose display areas - **Historical doses** are stored in the CSV with columns: - `bupropion_doses`, `hydroxyzine_doses`, `gabapentin_doses`, `propranolol_doses` - Each dose entry format: `timestamp:dose` separated by `|` for multiple doses - **Edit entries** by double-clicking on table rows - dose information is preserved and displayed ### 5. Editing Entries and Doses When you double-click on an entry in the data table: - **Full data retrieval** - edit window loads complete entry including all dose data - **Editable dose fields** - modify recorded doses directly in the edit window - **Dose format**: Use `HH:MM: dose` format (one per line) - **Example dose editing**: ``` 09:00: 150mg 18:30: 150mg ``` - **Symptom and medicine checkboxes** can be modified - **Notes can be updated** while keeping dose history intact - **Save changes** preserves all dose information with proper timestamps ## CSV Format The new CSV structure includes dose tracking columns: ```csv date,depression,anxiety,sleep,appetite,bupropion,bupropion_doses,hydroxyzine,hydroxyzine_doses,gabapentin,gabapentin_doses,propranolol,propranolol_doses,note 07/28/2025,4,5,3,3,1,"2025-07-28 14:30:00:150mg|2025-07-28 18:30:00:150mg",0,"",0,"",1,"2025-07-28 12:30:00:10mg","Multiple doses today" ``` ## Features - ✅ **Timestamp recording** - Exact time when medicine is taken - ✅ **Dose amount tracking** - Record specific doses (150mg, 10mg, etc.) - ✅ **Multiple doses per day** - Take the same medicine multiple times - ✅ **Real-time display** - See today's doses immediately - ✅ **Data persistence** - All doses saved to CSV - ✅ **Backward compatibility** - Existing data migrated automatically - ✅ **Scrollable interface** - Vertical scrollbar for expanded UI ## User Interface The medicine tracking interface now includes: - **Scrollable input area** - Use mouse wheel or scrollbar to navigate - **Responsive design** - Interface adapts to window size - **Expanded medicine section** - Each medicine has dose tracking controls ## Migration Your existing data has been automatically migrated to the new format. A backup was created as `thechart_data.csv.backup_YYYYMMDD_HHMMSS`. ## Testing Run the dose tracking test: ```bash make test-dose-tracking ``` Test the scrollable interface: ```bash make test-scrollable-input ``` Test the dose editing functionality: ```bash make test-dose-editing ``` ## Troubleshooting 1. **Application won't start**: Check that migration completed successfully 2. **Doses not saving**: Ensure you enter a dose amount before clicking "Take" 3. **Data issues**: Restore from backup if needed 4. **UI layout issues**: The new interface may require resizing the window ## Technical Details - **Timestamp format**: `YYYY-MM-DD HH:MM:SS` - **Dose separator**: `|` (pipe) for multiple doses - **Dose format**: `timestamp:dose` - **Storage**: Additional columns in existing CSV file