Skip to content

Tablets, because a pack is a container like any other - #129

Merged
suskozaver merged 1 commit into
ArunNGun:betafrom
suskozaver:feat/tablets-are-a-container-too
Sep 17, 2026
Merged

suskozaver merged 1 commit into
ArunNGun:betafrom
suskozaver:feat/tablets-are-a-container-too

Conversation

@suskozaver

Copy link
Copy Markdown
Collaborator

Asked for directly: SLU-PP-332 is not in the library and comes as tablets. The library half already worked, since you can add your own compound from any picker. Stock had nowhere to put it: a vial is a mass optionally dissolved in a volume, and a pack of tablets is a mass in a count.

The shape

A pack is a Vial with container: "pack", which is what the nasal spray bottle established and for the same reason. Mass remaining, doses left, cost per dose, days of supply and the dates are all arithmetic about a mass in a container, and none of them care what the container is.

strengthMg is the whole pack and mgPerTablet is the unit it is counted in. Sixty tablets of 10 mg is one pack of 600 mg, so nothing downstream learns that tablets exist.

Two deliberate differences from the spray beside it

No default tablet size. A pump has a conventional 0.1 mL, so a bottle with nothing recorded can still be counted. Tablets come in whatever the manufacturer chose, so a pack with no size counts as nothing and the row says the size is missing, which is true, rather than showing a count that is not.

A tablet can be halved. spraysForDose rounds to whole presses because a pump delivers its volume or it fails. tabletsForDose keeps the fraction, because a scored tablet really is half a dose and 15 mg out of 10 mg tablets is one and a half; rounding it to two would be a fifth more drug than the plan says. What is floored is the count left in the pack, since half a tablet you have not cut is not one you can take.

The rest of it

The log sheet stands the syringe half down for tablets exactly as it does for a nasal dose, and on a different test. A nasal dose is known by its route; a tablet is known by how the compound is sold, because oral also covers a solution somebody swallows out of a syringe, and that one does want a barrel.

DoseLog gains tablets, recorded rather than recomputed, for the reason presses is: the pack can be replaced by one with a different tablet size, and a count worked out later would answer a question about last Tuesday with today's arithmetic. Fractions are kept.

The schedule and the log read in tablets, the add form asks for the tablet size and how many are in the pack, a pack is never offered reconstitution, and the CSV gains a tablets column appended rather than slotted in beside presses.

One more untranslated string fell out on the way: the nasal hint was a template literal reading "a press, ... mL in total" in every language.

Checks

npx tsc --noEmit, npx next lint, npm test and TZ=America/New_York npm test: 64 files, 1666 tests, no warnings. Fifteen of them new, on the arithmetic. Twenty-four keys in four languages.

Asked for directly: SLU-PP-332 is not in the library and comes as
tablets. The library half already worked, you add your own compound
from any picker. Stock had nowhere to put it: a vial is a mass
optionally dissolved in a volume, and a pack of tablets is a mass in a
count.

A pack is a Vial with container: "pack", which is the shape the nasal
spray bottle established and for the same reason. Mass remaining, doses
left, cost per dose, days of supply and the dates are all arithmetic
about a mass in a container, and none of them care what the container
is. strengthMg is the whole pack and mgPerTablet is the unit it is
counted in: sixty tablets of 10 mg is one pack of 600 mg. Nothing
downstream learns that tablets exist.

Two deliberate differences from the spray beside it, both tested.

There is no default tablet size. A pump has a conventional 0.1 mL, so a
bottle with nothing recorded can still be counted. Tablets come in
whatever the manufacturer chose, so a pack with no size counts as
nothing and the row says the size is missing, which is true, rather
than showing a count that is not.

And a tablet can be halved. spraysForDose rounds to whole presses
because a pump delivers its volume or it fails; tabletsForDose keeps
the fraction, because a scored tablet really is half a dose and 15 mg
from a 10 mg tablet is one and a half. What is floored is the count
left in the pack, since half a tablet you have not cut is not one you
can take.

The log sheet stands the syringe half down for tablets exactly as it
does for a nasal dose, and on a different test: a nasal dose is known
by its route, a tablet by how the compound is sold, because "oral" also
covers a solution somebody swallows out of a syringe and that one does
want a barrel. DoseLog gains tablets, recorded rather than recomputed,
for the same reason presses are: the pack can be replaced by one with a
different tablet size.

The schedule and the log read in tablets, the add form asks for the
tablet size and how many are in the pack, a pack is never offered
reconstitution, and the CSV gains a tablets column appended rather than
slotted in.

Fifteen tests on the arithmetic. Twenty-three keys in four languages.
One more untranslated string fell out on the way: the nasal hint was a
template literal saying "a press, ... mL in total" in every language.
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Arun's projects Team on Vercel.

A member of the Team first needs to authorize it.

@suskozaver
suskozaver merged commit 26fe42b into ArunNGun:beta Sep 17, 2026
1 of 2 checks passed
@suskozaver
suskozaver deleted the feat/tablets-are-a-container-too branch September 17, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant