Skip to content

Let an existing pack be given its tablet size - #131

Merged
suskozaver merged 1 commit into
ArunNGun:betafrom
suskozaver:tablet-size-on-existing-pack
Sep 17, 2026
Merged

suskozaver merged 1 commit into
ArunNGun:betafrom
suskozaver:tablet-size-on-existing-pack

Conversation

@suskozaver

Copy link
Copy Markdown
Collaborator

Reported straight after the tablets feature went out: the Log a dose form shows Add the tablet size to the pack first, and there is nowhere to add it.

That is right. mgPerTablet was only ever written in one place, the add form, and only when the compound was already marked preparation: "tablet". Every other way a pack can exist arrives without it:

  • a pack added before the compound was described as tablets
  • a row entered as an ordinary vial and only later understood to be a box
  • anything imported

All of them are visible on the shelf, none of them can be counted, and the instruction to fix it points at a screen that does not offer it.

What this adds

A Set tablet size button on the Stock row, and a small form under it in the same shape as Reconstitute and Add diluent. Offered for a pack, and also for an ordinary row of a compound the library calls tablets, which is how such a row becomes a pack at all: it writes container: "pack" along with the size.

It asks for both numbers, the size and the tablets in the pack, because strengthMg on a pack is the mass of the whole pack and is the product of the two. Asking for the size alone would leave the mass saying whatever it said when the row was entered as a vial. The count means the pack as bought, not what is left in it, and the form says so by showing what the row will read once saved, tablets already taken included.

When Group identical vials is on it writes to every member of the group, unlike the buttons beside it. Those change one vial's state and the group is meant to split; this changes what the row has always been, and writing it to the oldest alone would leave one pack with a size beside a shelf of identical packs without one.

The hint, split

log_no_tablet_size was doing two jobs. No pack of the compound in stock at all, and a pack with no size recorded, both produced the same sentence, and in the first case it asked the reader to go and edit something that does not exist. Three states now say three things: no pack in stock, a pack with no size (pointing at Stock), or the size itself.

Checks

npx tsc --noEmit clean, npx next lint clean, 1684 tests pass. No new keys left untranslated: de, sl and pl are written, and the parity test would have failed otherwise.

The tablets feature shipped with one way to record how big a tablet
is: the add form, and only when the compound was already marked as
tablets. Everything else arrived without it. A pack added before the
compound was described that way, a row entered as an ordinary vial,
anything imported: all of them visible on the shelf, none of them
countable, and the Log a dose form saying "Add the tablet size to the
pack first" with nowhere to do it.

So the Stock row offers it. For a pack, and also for an ordinary row
of a compound the library calls tablets, which is how such a row
becomes a pack at all. It asks for both numbers, because a pack's
strengthMg is the mass of the whole pack and is the product of the
two, and it says what the row will read once saved, including any
dose already taken.

When identical vials are grouped it writes to every member, unlike
the buttons beside it. Those change one vial's state and the group is
meant to split; this changes what the row has always been, and
writing it to one member would leave a pack with a size beside a
shelf of identical packs without one.

The log hint also told two different stories with one sentence. No
pack in stock at all and a pack with no size recorded both read as an
instruction to go and edit a pack, which in the first case does not
exist. Three states, three sentences.
@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 1763414 into ArunNGun:beta Sep 17, 2026
1 of 2 checks passed
@suskozaver
suskozaver deleted the tablet-size-on-existing-pack branch September 17, 2026 17:19
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