Medication reminder and pdr worker
This commit is contained in:
@@ -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';
|
||||
@@ -1644,6 +1645,7 @@ function App() {
|
||||
startDate: new Date().toISOString().slice(0, 10),
|
||||
endDate: '',
|
||||
notes: '',
|
||||
remindersEnabled: false,
|
||||
});
|
||||
const [flockTransferForm, setFlockTransferForm] = useState({
|
||||
birdId: '',
|
||||
@@ -3927,6 +3929,7 @@ function App() {
|
||||
startDate: new Date().toISOString().slice(0, 10),
|
||||
endDate: '',
|
||||
notes: '',
|
||||
remindersEnabled: false,
|
||||
});
|
||||
setEditingMedicationId('');
|
||||
} catch (submitError) {
|
||||
@@ -3946,6 +3949,7 @@ function App() {
|
||||
startDate: medication.startDate,
|
||||
endDate: medication.endDate ?? '',
|
||||
notes: medication.notes ?? '',
|
||||
remindersEnabled: medication.remindersEnabled,
|
||||
});
|
||||
setError('');
|
||||
};
|
||||
@@ -3961,6 +3965,7 @@ function App() {
|
||||
startDate: new Date().toISOString().slice(0, 10),
|
||||
endDate: '',
|
||||
notes: '',
|
||||
remindersEnabled: false,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -5262,6 +5267,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>
|
||||
@@ -6499,6 +6505,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
|
||||
@@ -8490,6 +8507,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
|
||||
|
||||
Reference in New Issue
Block a user