79479561

Date: 2025-03-02 18:55:37
Score: 1.5
Natty:
Report link

Try splitting the medication scheduling into two main tables: one for the overall regimen and one for the individual reminders.

The Medication Regimen table captures static, schedule-level details—such as the user ID, medication ID, start time, dose frequency (e.g., “every 8 hours”), and total doses. This table defines the dosing plan without mixing in dynamic event details.

The Medication Reminder table handles each reminder event. It includes a foreign key linking to the regimen table, the scheduled time for the dose, a status field (e.g. pending, completed, missed, postponed), and optionally an actual timestamp for when the dose was taken. When a reminder is missed or the user opts to postpone, your application logic can update the current reminder (or mark it as postponed) and create a new entry with the scheduled time set to one hour later.

This two-table approach separates the static dosing plan from the dynamic reminders. Hope this guides you in your implementation.

Reasons:
  • Blacklisted phrase (1): this guide
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: adammak