Template:MedicationDose: Difference between revisions
(Create MedicationDose template — single source of truth for non-antibiotic medication dosing with SMW subobjects) |
(Refine display format: route always shown without parens, onset/duration grouped in parens, cleaner reading flow) |
||
| Line 22: | Line 22: | ||
* '''indication''' (required): The page name where this dose is used (e.g., Rapid sequence intubation, Status epilepticus, Procedural sedation, Vasopressors). Must match the transcluding page name for SMW subobjects to be created. | * '''indication''' (required): The page name where this dose is used (e.g., Rapid sequence intubation, Status epilepticus, Procedural sedation, Vasopressors). Must match the transcluding page name for SMW subobjects to be created. | ||
* '''population''' (optional): "Adult" or "Pediatric". Defaults to "Adult". | * '''population''' (optional): "Adult" or "Pediatric". Defaults to "Adult". | ||
* '''route''' ( | * '''route''' (required): Route of administration (e.g., IV, IM, IN, IV drip, PO, PR) | ||
* '''onset''' (optional): Onset of action (e.g., 1 min, 45 sec) | * '''onset''' (optional): Onset of action (e.g., 1 min, 45 sec) | ||
* '''duration''' (optional): Duration of action (e.g., 10-20 min, 3-8 min) | * '''duration''' (optional): Duration of action (e.g., 10-20 min, 3-8 min) | ||
| Line 31: | Line 31: | ||
===Output=== | ===Output=== | ||
Renders as: <code>[[drug]] dose ( | Renders as: <code>[[drug]] dose route (onset X, duration Y) (max Z) — notes</code> | ||
Creates SMW subobject (only on the matching indication page in main namespace) with properties: | Creates SMW subobject (only on the matching indication page in main namespace) with properties: | ||
| Line 51: | Line 51: | ||
[[Category:Medication templates]] | [[Category:Medication templates]] | ||
</noinclude><includeonly>{{#ifeq:{{{link|yes}}}|no|{{{dose|}}}|[[{{{drug|}}}{{#if:{{{display|}}}|{{!}}{{{display|}}}}}]] {{{dose|}}}}}{{#if:{{{ | </noinclude><includeonly>{{#ifeq:{{{link|yes}}}|no|{{{dose|}}}|[[{{{drug|}}}{{#if:{{{display|}}}|{{!}}{{{display|}}}}}]] {{{dose|}}}}} {{{route|}}}{{#if:{{{onset|}}}|{{#if:{{{duration|}}}| (onset {{{onset|}}}, duration {{{duration|}}})| (onset {{{onset|}}})}}|{{#if:{{{duration|}}}| (duration {{{duration|}}})}}}}{{#if:{{{max_dose|}}}| (max {{{max_dose|}}})}}{{#if:{{{notes|}}}| — ''{{{notes|}}}''}}{{#ifeq:{{NAMESPACENUMBER}}|0|{{#ifeq:{{PAGENAME}}|{{{indication|{{PAGENAME}}}}}|{{#subobject:{{{drug|}}} {{{context|}}} {{{population|Adult}}} | ||
|Has DrugName={{{drug|}}} | |Has DrugName={{{drug|}}} | ||
|Has Indication={{{indication|{{PAGENAME}}}}} | |Has Indication={{{indication|{{PAGENAME}}}}} | ||
Revision as of 15:36, 20 March 2026
MedicationDose Template
This template creates a single source of truth for non-antibiotic medication dosing on WikEM. It displays the drug name and dose as visible text, and simultaneously creates an SMW subobject linking the medication to its clinical indication/context.
The SMW subobject is only created when:
- The template is used on a main namespace page (not on Template: pages)
- The current page name matches the indication parameter (prevents duplicates from aggregation pages)
For antibiotic dosing, use {{AntibioticDose}} instead.
Usage
*{{MedicationDose|drug=Ketamine|dose=1-2 mg/kg IV|route=IV|context=Induction|indication=Rapid sequence intubation|population=Adult|onset=1 min|duration=10-20 min}}
*{{MedicationDose|drug=Lorazepam|dose=0.1 mg/kg (max 4 mg)|route=IV|context=1st line benzodiazepine|indication=Status epilepticus|population=Adult|max_dose=4 mg}}
*{{MedicationDose|drug=Norepinephrine|dose=0.01-2 mcg/kg/min|route=IV drip|context=1st line vasopressor|indication=Vasopressors|population=Adult|notes=1st line for septic shock (SSC 2021)}}
Parameters
- drug (required): The medication page name (e.g., Ketamine, Propofol, Norepinephrine)
- dose (required): The dosing text (e.g., 1-2 mg/kg IV, 0.3 mg/kg bolus)
- context (required): Clinical context/role (e.g., Induction, Paralytic, 1st line benzodiazepine, Premedication)
- indication (required): The page name where this dose is used (e.g., Rapid sequence intubation, Status epilepticus, Procedural sedation, Vasopressors). Must match the transcluding page name for SMW subobjects to be created.
- population (optional): "Adult" or "Pediatric". Defaults to "Adult".
- route (required): Route of administration (e.g., IV, IM, IN, IV drip, PO, PR)
- onset (optional): Onset of action (e.g., 1 min, 45 sec)
- duration (optional): Duration of action (e.g., 10-20 min, 3-8 min)
- max_dose (optional): Maximum dose (e.g., 4 mg, 300 mg)
- display (optional): Custom display text for the drug link. If omitted, uses the drug name.
- link (optional): Set to "no" to show only the dose text without the drug link.
- notes (optional): Brief clinical note displayed in italics after the dose.
Output
Renders as: drug dose route (onset X, duration Y) (max Z) — notes
Creates SMW subobject (only on the matching indication page in main namespace) with properties: Has DrugName, Has Dose, Has Context, Has Indication, Has Population, Has Route, Has Onset, Has Duration, Has MaxDose
SMW Queries
On a drug page, to show all indications where the drug is used:
{{#ask:[[Has DrugName::Ketamine]]
|?Has Indication
|?Has Dose
|?Has Context
|?Has Population
|?Has Route
|format=broadtable
|headers=plain
}}
