LanguageValues and typesStandard typesHealth
DosageInstruction
On this page
How to take a medicine: a dose, a route and how often.
Use it for a prescription's directions, shown as 500 mg, Oral use, 2 times per 1 day. For the amount alone, use Dose.
Shape
| Field | Type | Required? |
|---|---|---|
dose |
Dose |
Yes |
route |
RouteOfAdministration |
Yes |
times |
Int |
Yes |
per |
Duration |
Yes |
as_needed |
Bool |
Yes |
Example
DosageInstruction { dose: Dose.mass { amount: 500mg } route: RouteOfAdministration.oral times: 2 per: 1d as_needed: false}
Good to know
timesmust be at least 1, andperabove nothing.==tells you whether two are the same.<andlist.sort_bydon't take it, so sort by one of its parts instead.
In JSON
An object of its parts, in a request, a response or json.write:
{"dose":{"tag":"mass","amount":{"value":"0.0005","unit":"kg"}},"route":"oral","times":2,"per":"PT24H","as_needed":false}{"dose":{"tag":"volume","amount":{"value":"0.00001","unit":"cubic_metre"}},"route":"oral","times":1,"per":"PT6H","as_needed":true}{"dose":{"tag":"mass","amount":{"value":"0.00004","unit":"kg"}},"route":"subcutaneous","times":1,"per":"PT168H","as_needed":false}
Details
Text form, storage, how it is shown, and operations
DosageInstruction is in the group Health, and has been in Jadpo since 0.1.0.
Text form
It has no single text form, so text.from and text.parse don't take it.
How it is stored
It is stored in 6 columns, each named for the field, _ and its suffix. This is {"dose":{"tag":"volume","amount":{"value":"0.00001","unit":"cubic_metre"}},"route":"oral","times":1,"per":"PT6H","as_needed":true}:
| Column | Type | Holds |
|---|---|---|
<field>_dose_kind |
text |
'volume' |
<field>_dose_amount |
numeric(38, 9) |
0.00001 |
<field>_route |
text |
'oral' |
<field>_times |
integer |
1 |
<field>_per |
bigint |
21600000 |
<field>_as_needed |
boolean |
TRUE |
How it is shown to people
text.format(value, locale:) shows it to people in their locale.
With locale: Locale.en_gb:
| Value | Shown |
|---|---|
{"dose":{"tag":"mass","amount":{"value":"500","unit":"mg"}},"route":"oral","times":2,"per":"PT24H","as_needed":false} |
500 mg, Oral use, 2 times per 1 day |
{"dose":{"tag":"volume","amount":{"value":"10","unit":"ml"}},"route":"oral","times":1,"per":"PT6H","as_needed":true} |
10 ml, Oral use, 1 time per 6 hours, when needed |
{"dose":{"tag":"mass","amount":{"value":"40","unit":"mg"}},"route":"subcutaneous","times":1,"per":"PT168H","as_needed":false} |
40 mg, Subcutaneous use, 1 time per 7 days |
Operations
It also takes text.format, json.read, json.write and ==. How every standard type behaves says how they work.
Markdown for agents: /docs/types/type-dosage-instruction.md.Built from Jadpo main at aee2e8f.