Skip to main content

Module health

Module health 

Source
Expand description

Health and well-being, for the window: the page (a day, or its week, at a glance: meals, naps, the night and the doses, each day’s own changes; the medicines and the prescriptions), its settings (the usual meals and nights, the pauses), and the minute tick that reminds a dose once, quietly, and turns refills and renewals into tasks in a list your phone has. The rest goes to no server, except sealed to your other computers when you share with them (docs/database.md).

Structs§

Around 🔒
What lies around the days: the week’s events, their times with margins, today’s planned steps.
ContextItem 🔒
An event or a planned step, for context only.
DayItem 🔒
A row of a day’s list: a meal, a nap, the night, or a dose.
DayView 🔒
One day: its list and what its column of the timeline draws.
DeviceRow 🔒
A device as Settings ▸ Your folder and sharing lists it (share::status).
DoseRow 🔒
ForProfessional 🔒
What a doctor or a pharmacist is shown, read-only, at arm’s length (qml/ShowMedicines.qml): a prescription’s medicines, or all those taken now.
Knowledge 🔒
What is known here of the doses marked elsewhere: this computer’s record, and each other device sharing with it (sioul_core::health::doubts).
Mark 🔒
What a device had said when you said it was off, or forgot it.
MedicineEdit 🔒
A medicine as its form gives it.
MedicineRow 🔒
A medicine as the page lists it, and as its form reads it.
OffButton 🔒
“This device is off”, under a doubt naming it: the device’s id, the button’s words.
PageView 🔒
The page: a week of days, the day shown one of them (week), and what only today says.
PeerSeen 🔒
Peers 🔒
What this computer saw of your other devices, for the doses: kept here only ($XDG_STATE_HOME/sioul/share/peers.json), never shared.
PorchDoses 🔒
The Porch’s doses (docs/health.md, “On the Porch”). due: today’s, from their time on, not marked yet, reminded or not (a notification can go unseen), each with “Taken” (past its half hour, when it was taken is asked) and the doubt when another device may know; until marked, the day’s end, or twelve hours after its time. closed: those due while Sioul ran nowhere, the question on the past, once your other devices were heard from (heard), so that a dose marked there is not asked about here. Whatever the hours: doses are not mail. None while you sleep with doses staying silent (silent): they come at waking.
PrescribedEdit 🔒
A medicine as a row of its prescription’s form gives it.
PrescriptionEdit 🔒
A prescription as its form gives it.
PrescriptionRow 🔒
A prescription as the page lists it, and as its form reads it.
RecordDoubt 🔒
The doses’ record found broken or gone here, kept on this computer only ($XDG_STATE_HOME/sioul/health-doubt.toml): the doses due before stay not known, for a day.
Segment 🔒
A part of the timeline’s column: from, to, in minutes from the column’s midnight (a night split at midnight, its morning part the day before’s).
SettingsView 🔒
The page’s settings (⚙), what is set once: the pauses, where the errands go (the usual meals and night: needs_page).
Shown 🔒
One medicine, for a professional.
WeekView 🔒
Monday to Sunday, the hours the timeline shows (minutes from midnight, whole hours, the same for every day: the lines stay put from day to day).

Enums§

Coming 🔒
What comes for a prescription, on a day.

Constants§

ALARMS_AHEAD_HOURS 🔒
How far ahead the coming doses are given to Android’s alarm clock.
GRACE_MINUTES 🔒
MISSED_HOURS 🔒
How far back a dose due while Sioul was closed is asked about, and the minutes a dose is reminded live before that.
SHOWN_EVERY 🔒
SHOWN_WATCH 🔒
How long a reminder shown on a phone is checked again (every quarter of an hour, the others’ news read first), so that a dose marked on another device takes it away: three hours after the dose’s time.
UNSURE_WAKE 🔒
The longest an opening’s news counts as late when this device cannot tell whether its own news came in time (a sync app carries the folder: paused, or stopped, unseen from here): a longer wait is as likely this device’s own outage, and would hold the doses of a closed device in doubt that long, for its next WAKES openings (review of 10 October 2026, R8).
WAIT_FOR_NEWS 🔒
How long a dose not known here waits for news from your other devices before it is reminded all the same, the doubt said.
WAKES 🔒
How many of a device’s openings are kept to time the next: an opening whose news came late once (a phone offline when picked up) holds the wait for this many more, then goes.

Statics§

ASKED 🔒
The question on doses due while Sioul was closed: asked once a session.
KNOWING 🔒
One look at a time at the others’ claims.
MOVED 🔒
When the pause to move was last offered, or Sioul started (Unix seconds).
REMINDED_THERE 🔒
“Reminders come on <computer>”, when another computer keeps them.
SENT 🔒
Doses reminded in this session: never twice, even when the record cannot be written.
SHOWN 🔒
The day the page shows (show_week): its week is made. None: today.
STATE 🔒
The doses’ state is read, changed and written by the minute’s tick, the page and the notifications’ buttons: one at a time, so that none writes back an older state over another’s mark (a dose shown untaken could be taken twice).
TICKING 🔒
One tick at a time: a slow one (a shared folder) is not overtaken by the next.

Functions§

alarm_again 🔒
When a dose’s alarm in doubt within the wait for news asks again: as soon as it may be known (known: a device closed before the dose, once the news of an opening had the time to come), a minute apart at least; known already by what was read (known now), in doubt only because no news came since the alarm began, nothing tells when news comes: at the end of the wait, as for a doubt that has no end in view, then reminded with the doubt said if none came (until 10 October 2026 it asked each minute, a pull each time: R9 of that day’s review).
alarm_decide 🔒
At a dose’s time, Android’s alarm asks what to say (alarms), maybe with nothing on the screen. What your other devices marked is read first (share::exchange_here: Sioul’s own pull from the server while it works, else the sync app asked to bring it; an exchange without notes and papers, which never holds a dose back); then, as the window would: taken, not taken said, or reminded already: nothing; kept by another device you use: its turn, asked again after the wait for news; not known: after that wait, reminded with the doubt said first; else the dose. Recorded reminded only when shown, so that another device still reminds what was not. JSON {show, title, body, again_at (Unix ms, 0: never)}.
alarm_taken 🔒
“Taken”, pressed on the phone’s reminder. More than half an hour late, when it was taken is asked in the window instead (open). JSON {done, open, line}.
alarms_coming 🔒
The coming doses, as Android’s alarm clock is given them (alarms::schedule): [{key, at (Unix milliseconds), title}], from half an hour ago to two days ahead, those marked or reminded left out. A record that does not read leaves none out: the decision at their time reads it again.
answer 🔒
apply_medicine 🔒
A medicine made (id empty) or changed in health, as its form gives it: its id, or what is wrong, nothing changed then.
apply_prescription 🔒
A prescription made (id empty) or changed in health, with its medicines as its rows give them: made, changed, taken out. Every row is read before anything changes: what does not save changes nothing. Its id, or what is wrong.
block_name 🔒
A block’s name: its own, else its usual one by its key (“meal:1”: lunch); one added for a day without a name of its own: “Meal”, “Rest”.
blocks_now 🔒
A day’s own blocks as they are: its changes, its meals pushed past its events.
capitalized 🔒
“Wednesday”: a word’s first letter in capitals, as a title starts.
card_doses 🔒
Today’s doses for the card on a phone’s home screen (homecard): those due and not marked, from their time on, as the Porch has them (due_today: until marked, the day’s end, or twelve hours after their time), and those still to come today; each with until when it is known not marked on another device, the Porch’s rule given ahead (doubts_now: every other device heard within five minutes), 0 when it is not known from its time on. A record that does not read is never read as empty: every dose is then not known. Whether doses show while you sleep or pause is the card’s frames’ to say.
card_known_until 🔒
Until when a dose due at due stays known not marked elsewhere, seen from from (doubts_now: each other device fresh five minutes after it was last heard in full): until when nothing ends it before; 0 when it is not known at from.
change 🔒
The record changed by change, under its lock; one that cannot be trusted is repaired first, then changed. Returns what went wrong, else “”.
change_day 🔒
change_health 🔒
The health file read, changed by change and written back, all under its lock, which the sharing takes too: a change is set over the medicines as the file holds them then (Health::change), never over a copy read earlier.
change_need 🔒
A day’s block changed, that day only, as the page asks (JSON: its date, “2026-10-07”, today when none, and sioul_core::needs::DayEdit: key, action, from, to…; Needs::change_day). The plan and the page follow; a block moved is not said again: moving it never brings a nag. Returns what went wrong, else “”.
change_records 🔒
The records changed by change, under their lock; ones that cannot be trusted repaired first, then changed. Returns what went wrong, else “”.
chat_minute 🔒
One more minute in a chat; returns whether chats are covered now.
chats_covered 🔒
Whether chats are covered now.
choose 🔒
You chose, seeing answers that differ (DoseRow::choose): taken (at the time the earliest “taken” said, else now), or not taken. Your answer here, every answer saying otherwise taken out, on purpose; the marks beside, for an older Sioul, as you chose; not taken after all, the doses its take moved go back. Returns what went wrong, else “”.
clock 🔒
at (Unix seconds) on the clock in zone: “12:30”.
coming 🔒
What comes for a prescription, the soonest first: the next visit to the pharmacy (a month back at most), and the day to renew it by.
covered 🔒
The medicines tied to a prescription, unless its title already names them all (“Levothyroxine 75 µg” for Levothyroxine).
day_view 🔒
One day: its list (blocks, those taken out that day, its doses) and what its column draws.
days 🔒
Each day’s own meals, naps and nights (sioul_core::needs::Days). The moves and skips of today an older Sioul kept on this device (needs-today.toml) are moved into them once, as times.
device_forget 🔒
A device silent for a week, forgotten: not listed until it says anything newer.
device_off 🔒
A device you say is off (off), or not any more: not counted for the doses until it says anything newer (a new start, a new export, a claim), said plainly meanwhile (shared_note, Settings). It never answers a dose for you. Returns what went wrong, else “”.
device_rows 🔒
Your other devices, as this one knows them, for Settings: nothing red, no counts. holders: the devices that hold the newer form of what travels back, or run an older Sioul once it travels (share::formats), with when each was last heard (seconds, 0 when nothing says it) and whether it holds it back; each is listed (holder_rows).
device_rows_of 🔒
device_start 🔒
A device named at a sentence’s start: “The phone”, “Another device of yours”, else its name as it is.
device_word 🔒
A device as a doubt names it: “the phone”, else its name; one whose name is not known (an older Sioul on a phone says “localhost”), “another device of yours”.
differ_sentence 🔒
Answers that differ, each said, the earliest first: “Marked taken on the phone at 08:02, skipped here at 08:10. Check which is right before taking it.” me: this device’s id, said “here”.
dose_info 🔒
What the late dose’s question shows, as JSON: {name, dose, due, now, hours}.
doses_for_card 🔒
card_doses, from what was read. A dose answered differently on two devices (doses::answered: taken on one, said not taken on another) is on the card too, never known: “check before taking it”, as the Porch asks you to choose.
doubt_now_with 🔒
A dose’s doubt as what stays in view says it (the Porch, the Health page, where a dose shows due hours after its time: as of now, health::doubts_now), and a “This device is off” for each device it names (one: “This device is off”; several: each by its name). None for a line that could not be read, nor a device that does not share its doses: its being off would lift neither.
doubt_of 🔒
A dose’s doubt as its reminder says it, at its time; “” when it is known.
doubt_unread 🔒
The same, at an alarm whose pull did not go through since it began (share::news_missed: when, and the devices whose entry or health claim says more since): any other known closed by what was read before is said in doubt, as last heard (sioul_core::health::doubts_unread).
drag_need 🔒
A day’s block moved by a drag on the page’s timeline (change_need’s JSON: “move”, or “times” for one of its ends), changed as “Move to…” and “Change its times…” change it, then “Undo” offered for ten seconds, which puts that day’s block back as it was. Dropped where it was: nothing changes, nothing to undo. Returns what went wrong, else “”.
due_of 🔒
When a dose is due, from its key (<medicine>@<Unix seconds>).
errands_list 🔒
The list the errands go to: the one chosen, else your usual list, else the first list on a server (so the phone has them), else one on this computer.
for_professional 🔒
“Show to a doctor or pharmacist”: a prescription’s medicines (its id), or all those taken now (“”), as JSON (ForProfessional).
for_professional_of 🔒
A prescription’s medicines (prescription, its id), or those taken now (“”: not paused, not past their last day), for a professional, in your language; the generic names as typed (international).
held_on 🔒
date‘s events’ held times: today’s from the minute’s cache, another day’s read now.
held_today 🔒
Today’s events’ held times (their margins counted), read again five minutes after at most: the needs’ tick runs every minute.
hhmm 🔒
“8:00” → “08:00”, as the day’s list writes its times; what does not read stays as written.
holder_rows 🔒
Every device holding the newer form back has its line, so that the window says which (docs/database.md, “The format of what travels”): one the rows do not list (known to the sharing alone, by what it shared before, or forgotten here while the sharing heard it since) is added, with “Forget this device”: it is not counted for your doses, so forgetting it makes no dose look known. One listed keeps its own line: forgotten only once silent for a week, as any device, since a device counted for your doses and forgotten could make a dose it took look not taken.
how_long 🔒
How long since since, in words: days, then weeks, months, years.
is_late 🔒
Whether a dose marked now is late: more than half an hour past its time.
is_zero 🔒
know 🔒
What this computer knows now: the others’ claims on the doses read (each says how far it wrote its records, and whether it closed), set against what was read of their records here.
later_minutes 🔒
The minutes “Later” moves a block by.
learn_with 🔒
The same, news saying whether this device’s own news was flowing now (share::Others::news), for timing the others’ openings.
listed 🔒
“Levothyroxine and Magnesium”, “A, B and C”.
load 🔒
load_peers 🔒
mark_device 🔒
marked_lately 🔒
The doses of the last day marked taken or not taken: their reminders, if shown on a phone, are taken away (alarms::schedule).
medicine_row 🔒
A medicine as the page and its forms read it.
medicine_rows 🔒
The medicines, in the order they were added (a row keeps its place).
midnight 🔒
Midnight of date in zone, Unix seconds.
missed 🔒
The Porch’s doses, as JSON (PorchDoses), made off the window’s thread.
missed_rows 🔒
Doses neither marked nor reminded: a question on the past, each saying when whether it was taken is not known here. Two questions, each its own heading: those due while Sioul ran nowhere, then those due while it ran but whose reminder could not be shown (no notification server: never said “while Sioul was closed”); by their time within each.
missed_title 🔒
The notification’s title for the question on doses neither marked nor reminded (missed): “While Sioul was closed” only when it was; “A reminder could not be shown” when Sioul ran; both kinds, a title true of both.
move_today 🔒
A block moved today only (the question, a notice’s “Later”): by minutes more (“Later”: by the minutes set, again and again), or to start at time (“13:30”). Returns what went wrong, else “”.
movement_minutes 🔒
Minutes of focus before the pause to move; 0 when off.
movement_tick 🔒
The pause to move and stretch, every so many minutes since Sioul started or since the last one, without waiting for a focus session; a session running offers its own (FocusWindow.qml). A desktop notification: it reaches you with the window hidden, from the computer you are at.
name_of 🔒
named 🔒
A dose as a reminder names it: “Levothyroxine · 75 µg”.
named_of 🔒
A device as a doubt names it, from what is known of it.
needs_page 🔒
The usual meals, naps and night as the page’s settings set them, as JSON: the settings, the usual names, the long gaps between meals.
needs_tick 🔒
Each minute, from the computer you are at: a block’s heads-up about the work, heads_up minutes before it (“No new big task”), with “Later”; then one at its time. Two at most, each once, only near its time; none while an event goes on, none for a block quiet or taken out that day. Its name and time only: safe to be read by someone else (docs/health.md).
needs_today 🔒
Today’s meals, naps and night as they are now, as JSON: [{key, kind, name, from, to, skipped, past}], for the question (Interruption.qml).
night_of 🔒
Which day a night is: the evening it starts, or, its bedtime after midnight, the evening before (Needs::kept_with’s rule).
not_taken 🔒
A dose not taken, said afterwards: asked no more. Returns what went wrong, else “”.
note_minute 🔒
What a minute of tick did, written in the doses’ record: the reminders shown, those that could not be (unshown, so that the question on the past says Sioul ran), and the errands’ tasks made.
note_wake 🔒
How late the news of a device’s opening came here, kept (PeerSeen::wakes), when this device’s own news was flowing then (news: its own pull went through lately; none when a sync app alone carries the folder, the delay then counted up to UNSURE_WAKE). Its own pull stale or failing: the delay is its own outage, not timed.
open_canaries 🔒
Each of keys opened here, not taken yet, unless a device opened or answered it already.
open_due 🔒
The doses due in the last hours (as far back as a dose is asked about), answered nowhere this device knows: their records opened, not taken yet (the canary), where no device opened them yet.
page 🔒
The health page, as JSON: the week of the day it shows, and what only today says.
peers_path 🔒
porch_doses 🔒
records and me (this device’s id): today’s doses whose answers differ on your devices come too, both answers said, until you choose.
prescription_rows 🔒
The prescriptions, in the order they were added, as the page lists them.
record 🔒
The doses’ record. One that cannot be trusted is never read as empty: it is repaired (repair), and the doses due before are said not known.
record_answer 🔒
Your answer for a dose, captured here (its time at), in the doses’ records, beside the marks: settle takes every other answer saying otherwise out (you chose, seeing them). Returns what went wrong, else “”.
record_doubt 🔒
record_doubt_path 🔒
records 🔒
The doses’ records (sioul_core::doses: each dose that fell due, and the answers your devices captured), as record reads the marks: records that cannot be trusted are never read as empty; they are repaired, and the doses due before are said not known for a day.
refilled 🔒
Fetched at the pharmacy today: the next refill is counted from now.
remove 🔒
A medicine or a prescription taken out; returns what went wrong, else “”.
removed_at 🔒
Where a list lost one block: the place taken out, when the rest is the same.
repair 🔒
A record that cannot be trusted: nothing it held may be taken out on your other devices, so the sharing forgets it first and reads it again from every device’s records at the next exchange; then it is kept aside and a new one starts. Sharing failing that, it is left as it is: never started again empty where the sharing could take marks out elsewhere.
repair_records 🔒
Records that cannot be trusted, as repair does the marks: the sharing first forgets holding them and reads them again from every device’s records; then they are kept aside and new ones start.
said 🔒
A message with its words given, in words’ language (say, for any translator).
save_medicine 🔒
A medicine made (id empty) or changed; returns {“id”} or {“error”}.
save_needs 🔒
The usual meals, naps and night saved as the settings give them; a meal or a nap taken out, the days’ changes of those after it follow them to their new place. Returns what went wrong, else “”.
save_peers 🔒
save_prescription 🔒
A prescription made (id empty) or changed, with its medicines; returns {“id”} or {“error”}.
set_setting 🔒
The pause to move and the chats’ limit: “movement.enabled”, “movement.minutes”, “chats.enabled”, “chats.minutes”, “chats.locked_minutes”.
set_taken 🔒
A dose marked taken, or not, as it happens: taken every few hours, the next doses come that many hours after now; a mark taken back puts them back. Returns what went wrong, else “”.
settings_view 🔒
The page’s settings (⚙), as JSON.
shared_note 🔒
Why the doses here may not be all: this computer alone, or what is not known of your other devices now; “” when all is known.
show_health 🔒
The Health page, the doses due while closed and today’s meals and naps, made on a thread (they read the doses’ record and the other devices’ claims, a shared folder that may be slow) and shown.
show_week 🔒
The page shows the week of day (“2026-10-07”); one that does not read: today’s.
skip_today 🔒
A block without notices today, or with them again: kept free all the same.
state_held 🔒
take_problem 🔒
Why takes could not be set, in words; with the medicine’s name in a prescription’s form, where several are.
taken_late 🔒
A dose taken late, at time (“09:30”, the last such time before now), as you say: marked then; for a medicine taken every few hours, the next doses that many hours after it. Returns what went wrong, else “”.
this_device 🔒
This device’s id in the sharing (“” before it has one).
tick 🔒
Each minute: a dose due is reminded once, quietly, with “Taken”; a refill or a renewal coming becomes a task in a list kept on this computer.
tied 🔒
The medicines tied to a prescription (Medicine::prescription), in the order they were added.
usual_name 🔒
A block’s usual name, in your language: breakfast, lunch, dinner, then “Meal 4”; a nap; winding down for the night.
week_events 🔒
The events of the week from monday, read again five minutes after at most: the page is made again each minute while it is open.
week_view 🔒
The week of day, Monday to Sunday: each day’s list and timeline, and the hours the timeline shows (the same each day).
when_of 🔒
What a medicine says of its takes: each with its amount when they differ (“08:00 · 1 tablet, 20:00 · 2 tablets”), else its times, or its schedule in words.
when_said 🔒
A moment as a doubt says it: “at 07:45” today, “on Monday 5 October at 07:45” before.
why 🔒
Why a dose is not known, in words: “your laptop: last heard at 07:52”.
why_in 🔒
The same, in words’ language (the tests give theirs).
words 🔒
When a medicine is taken: its times each day, “08:00 · 20:00”; every few days or hours, in words (“every other day at 08:00, from Sunday 4 October”).
words_of 🔒
When a medicine taken every few days or hours is taken, in words; at set times, its times.
write_record_doubt 🔒