Tablets, because a pack is a container like any other - #129
Merged
suskozaver merged 1 commit intoSep 17, 2026
Merged
Conversation
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.
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Vialwithcontainer: "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.strengthMgis the whole pack andmgPerTabletis 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.
spraysForDoserounds to whole presses because a pump delivers its volume or it fails.tabletsForDosekeeps 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
oralalso covers a solution somebody swallows out of a syringe, and that one does want a barrel.DoseLoggainstablets, recorded rather than recomputed, for the reasonpressesis: 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
tabletscolumn appended rather than slotted in besidepresses.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 testandTZ=America/New_York npm test: 64 files, 1666 tests, no warnings. Fifteen of them new, on the arithmetic. Twenty-four keys in four languages.