mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
feat(medications): record scheduled doses automatically
This commit is contained in:
1 parent
5919a93c29
commit
c94e109bf0
37 files changed
+1105
-15
No files matched your search
@@ -393,6 +393,10 @@ const medicationSchema = z
|
||||
// v1.39.1 (#1033) — absent in a backup written before the field existed;
|
||||
// the restore defaults it to tracking on, the behaviour those had.
|
||||
trackIntake: z.boolean().optional(),
|
||||
// v1.42.2 — absent in a backup written before the option existed; the
|
||||
// restore defaults it off, the behaviour those had.
|
||||
autoMarkTaken: z.boolean().optional(),
|
||||
autoMarkTakenSince: isoDateTime.nullable().optional(),
|
||||
// v1.39.4 — the clinical category. Absent in older files. A string, not
|
||||
// the enum: a file from a newer server may name a category this one does
|
||||
// not know, and the restore reads that as OTHER rather than refusing the
|
||||
@@ -448,6 +452,8 @@ const intakeEventSchema = z
|
||||
takenAt: isoDateTime.nullable().optional(),
|
||||
skipped: z.boolean().optional(),
|
||||
autoMissed: z.boolean().optional(),
|
||||
// v1.42.2 — absent in older files: every dose there was confirmed.
|
||||
autoRecorded: z.boolean().optional(),
|
||||
attributionSource: z.enum(IntakeAttributionSource).optional(),
|
||||
source: z.enum(IntakeSource).optional(),
|
||||
idempotencyKey: z.string().nullable().optional(),
|
||||
|
||||
@@ -83,6 +83,16 @@ const courseWindowFields = {
|
||||
.describe(
|
||||
"v1.39.1 — intake tracking. Default true. When false the medication keeps its dose, dates and schedules as information, but nothing is ever due: no reminder on any channel, no projected slot, no entry on the today list or the doses card, and no adherence figure anywhere. Existing intake history stays stored. Switching it back on resumes from that moment; the time it was off never counts as missed. Omitted on update leaves the current value. On a medication whose tracking is off, an update that does not name `trackIntake` leaves its stored schedule alone: `schedules`, `asNeeded` and `oneShot` in such a request are ignored (a client that does not know the field cannot have seen the stored schedule, which is served in `recordedSchedules`). Name `trackIntake` to change the schedule of such a medication.",
|
||||
),
|
||||
/**
|
||||
* v1.42.2 — record each scheduled dose as taken automatically once its
|
||||
* time has passed. Omitted leaves it as is.
|
||||
*/
|
||||
autoMarkTaken: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.describe(
|
||||
"v1.42.2 — record each scheduled dose as taken automatically. Default false. When true the server records a taken intake (`autoRecorded: true`) for every scheduled slot once its time has passed, from the moment the option was switched on (`autoMarkTakenSince`); slots before that are never filled. A slot the person already took, skipped or removed is left alone, and the person can still change or skip any dose by hand. While on, no medication reminder is sent for this medication on any channel; a client that arms local reminders should not arm them either. Has no effect on an as-needed medication or one whose intake tracking is off. Omitted on update leaves the current value.",
|
||||
),
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user