Medication reminder and pdr worker

This commit is contained in:
Corey Blais
2026-06-03 15:21:21 -04:00
committed by blaisadmin
parent b15861c856
commit fbb13561b0
10 changed files with 503 additions and 13 deletions
+28
View File
@@ -75,6 +75,7 @@ type Medication = {
startDate: string;
endDate: string | null;
notes: string | null;
remindersEnabled: boolean;
};
type MedicationFrequency = 'once_daily' | 'twice_daily' | 'every_8_hours' | 'every_6_hours' | 'as_needed';
@@ -1589,6 +1590,7 @@ function App() {
startDate: new Date().toISOString().slice(0, 10),
endDate: '',
notes: '',
remindersEnabled: false,
});
const [flockTransferForm, setFlockTransferForm] = useState({
birdId: '',
@@ -3653,6 +3655,7 @@ function App() {
startDate: new Date().toISOString().slice(0, 10),
endDate: '',
notes: '',
remindersEnabled: false,
});
setEditingMedicationId('');
} catch (submitError) {
@@ -3672,6 +3675,7 @@ function App() {
startDate: medication.startDate,
endDate: medication.endDate ?? '',
notes: medication.notes ?? '',
remindersEnabled: medication.remindersEnabled,
});
setError('');
};
@@ -3687,6 +3691,7 @@ function App() {
startDate: new Date().toISOString().slice(0, 10),
endDate: '',
notes: '',
remindersEnabled: false,
});
};
@@ -4988,6 +4993,7 @@ function App() {
<small>
{formatDate(medication.startDate)} to {formatDate(medication.endDate)}
</small>
<small>{medication.remindersEnabled ? 'Medication reminders enabled' : 'Medication reminders off'}</small>
<small>{medication.notes || 'No notes recorded.'}</small>
{latestAdministration ? (
<small>
@@ -5995,6 +6001,17 @@ function App() {
))}
</div>
</label>
<label className="checkbox-row wide-field">
<input
type="checkbox"
checked={medicationForm.remindersEnabled}
onChange={(event) => setMedicationForm({ ...medicationForm, remindersEnabled: event.target.checked })}
/>
<span>
<strong>Send medication reminders</strong>
<small>Uses the medication frequency, dose times, and start/end dates.</small>
</span>
</label>
<label className="wide-field">
Notes
<textarea
@@ -7965,6 +7982,17 @@ function App() {
))}
</div>
</label>
<label className="checkbox-row wide-field">
<input
type="checkbox"
checked={medicationForm.remindersEnabled}
onChange={(event) => setMedicationForm({ ...medicationForm, remindersEnabled: event.target.checked })}
/>
<span>
<strong>Send medication reminders</strong>
<small>Uses the medication frequency, dose times, and start/end dates.</small>
</span>
</label>
<label className="wide-field">
Notes
<textarea