Template:AntibioticDose: Difference between revisions

(Improve documentation: add when to use, examples, important rules, troubleshooting, and common drug name mappings)
(Fix: Remove newline between </noinclude> and <includeonly> that was breaking bullet list formatting on disease pages)
 
Line 109: Line 109:


[[Category:Miscellaneous]]
[[Category:Miscellaneous]]
</noinclude>
</noinclude><includeonly>{{#ifeq:{{{link|yes}}}|no|{{{dose|}}}|[[{{{drug|}}}{{#if:{{{display|}}}|{{!}}{{{display|}}}}}]] {{{dose|}}}}}{{#ifeq:{{NAMESPACENUMBER}}|0|{{#ifeq:{{PAGENAME}}|{{{disease|{{PAGENAME}}}}}|{{#subobject:{{{drug|}}} {{{context|}}} {{{population|Adult}}} |Has DrugName={{{drug|}}} |Treats disease={{{disease|{{PAGENAME}}}}} |Has Dose={{{dose|}}} |Has Context={{{context|}}} |Has Population={{{population|Adult}}} }}}}|}}</includeonly>
<includeonly>{{#ifeq:{{{link|yes}}}|no|{{{dose|}}}|[[{{{drug|}}}{{#if:{{{display|}}}|{{!}}{{{display|}}}}}]] {{{dose|}}}}}{{#ifeq:{{NAMESPACENUMBER}}|0|{{#ifeq:{{PAGENAME}}|{{{disease|{{PAGENAME}}}}}|{{#subobject:{{{drug|}}} {{{context|}}} {{{population|Adult}}} |Has DrugName={{{drug|}}} |Treats disease={{{disease|{{PAGENAME}}}}} |Has Dose={{{dose|}}} |Has Context={{{context|}}} |Has Population={{{population|Adult}}} }}}}|}}</includeonly>

Latest revision as of 13:45, 20 March 2026

AntibioticDose Template

This template is the single source of truth for antibiotic and medication dosing on WikEM. When you add dosing to a disease page using this template, it does two things:

  1. Displays the drug name (as a link) and dose on the disease page
  2. Automatically populates the drug's page with that dosing information via a dynamic table

This means you only need to enter or update a dose in one place (the disease page), and it will appear on both the disease page and the drug page.

When to Use This Template

Use {{AntibioticDose}} whenever you are listing a specific medication dose on a disease or condition page. It replaces manually typing something like:

*[[Ceftriaxone]] 1-2g IV daily

with:

*{{AntibioticDose|drug=Ceftriaxone|dose=1-2g IV daily|context=Inpatient CAP|disease=Pneumonia (main)|population=Adult}}

Both display the same thing on the disease page, but the template version also makes the dose appear in the dynamic table on the Ceftriaxone page.

Basic Usage

{{AntibioticDose|drug=Ceftriaxone|dose=1-2g IV daily|context=Inpatient, CAP Non-ICU|disease=Pneumonia (main)|population=Adult}}
{{AntibioticDose|drug=Ceftriaxone|dose=50-100mg/kg/day IV|context=CAP|disease=Pneumonia (main)|population=Pediatric}}

Parameters

Parameter Required? Description Example
drug Yes The exact page name of the drug on WikEM. Must match the drug's wiki page title. Ceftriaxone, Amoxicillin/Clavulanate
dose Yes The dosing text exactly as you want it displayed. Include dose, route, frequency, and duration when applicable. 1-2g IV daily, 500mg PO BID x 10 days
context Yes Clinical context describing when this dose applies. Helps differentiate the same drug used for different scenarios. Outpatient, Inpatient Non-ICU, First-line, PCN allergy alternative, Prophylaxis
disease Yes The exact page name of the disease on WikEM. Must match the disease's wiki page title (use the canonical name, not a redirect). Pneumonia (main), Acute cystitis, Pelvic inflammatory disease
population No "Adult" or "Pediatric". Defaults to "Adult" if omitted. Adult, Pediatric
display No Custom display text for the drug link, if different from the page name. TMP-SMX (instead of Trimethoprim-Sulfamethoxazole DS)
link No Set to "no" to show only the dose text without a drug link. Useful when the drug name is already shown nearby. no

Examples

Adding an antibiotic to a disease page

On the Pharyngitis page, in the Management section:

===First-line===
*{{AntibioticDose|drug=Amoxicillin|dose=500mg PO TID x 10 days|context=First-line|disease=Pharyngitis|population=Adult}}
*{{AntibioticDose|drug=Amoxicillin|dose=50mg/kg/day divided BID-TID x 10 days (max 1g/day)|context=First-line|disease=Pharyngitis|population=Pediatric}}

===Alternative (PCN allergy)===
*{{AntibioticDose|drug=Azithromycin|dose=500mg day 1, then 250mg daily x 4 days|context=PCN allergy|disease=Pharyngitis|population=Adult}}

Using inside an antibiotic sub-template

Many disease pages use an antibiotic sub-template (e.g., {{Pharyngitis antibiotics}}). Place the AntibioticDose calls inside that template. The disease parameter must still match the disease page name where the template is transcluded:

<!-- Inside Template:PID antibiotics -->
*{{AntibioticDose|drug=Ceftriaxone|dose=500mg IM x1|context=First-line with doxycycline|disease=Pelvic inflammatory disease|population=Adult}}

Using display and link parameters

<!-- Show TMP-SMX instead of the full page name -->
*{{AntibioticDose|drug=Trimethoprim-Sulfamethoxazole DS|dose=1 DS tab PO BID x 3 days|context=First-line|disease=Acute cystitis|display=TMP-SMX|population=Adult}}

<!-- Show dose only, no drug link (when drug name is already listed above) -->
*{{AntibioticDose|drug=Vancomycin|dose=15-20mg/kg IV q8-12h|context=MRSA coverage|disease=Septic arthritis|link=no|population=Adult}}

Important Rules

  1. Drug names must be exact page names. Use the canonical (non-redirect) page name. For example, use Amoxicillin/Clavulanate not "Augmentin", and Trimethoprim-Sulfamethoxazole DS not "TMP-SMX" or "Bactrim". You can use the display parameter to show a shorter name.
  2. Disease names must be exact page names. Use the canonical page name. For example, use Acute cystitis not "UTI", and Neisseria gonorrhoeae not "Gonorrhea". If unsure, search WikEM for the disease and check what the page title is.
  3. The disease parameter must match the page the template lives on. If you put an AntibioticDose call on the Pneumonia (main) page (or a template transcluded there), the disease parameter must be disease=Pneumonia (main). This is how the system prevents duplicate entries when templates are shared across pages.
  4. One dose per template call. If a drug has different doses for different scenarios (e.g., outpatient vs inpatient), use separate AntibioticDose calls with different context values.
  5. Always specify population for pediatric doses. Adult is the default, so you must explicitly set population=Pediatric for any pediatric dosing.
  6. Purge after editing. After adding or changing AntibioticDose entries, you may need to purge the drug page to refresh the dynamic table. To purge, add ?action=purge to the end of the drug page URL and reload.

How It Works

Each AntibioticDose call creates a Semantic MediaWiki (SMW) subobject with five properties: Has DrugName, Treats disease, Has Dose, Has Context, and Has Population.

Drug pages (like Ceftriaxone) use an {{#ask}} query to dynamically pull all entries referencing that drug, creating an auto-updating "Indications by Disease" table. This means:

  • Updating a dose on the disease page automatically updates it on the drug page - no need to edit both pages
  • Adding a new indication only requires editing the disease page
  • Removing an indication only requires removing the AntibioticDose call from the disease page

Troubleshooting

  • Drug page table is empty or not updating: Purge the disease page first (?action=purge), then purge the drug page. SMW sometimes needs both pages refreshed.
  • Dose shows on the disease page but not on the drug page: Check that the disease parameter exactly matches the disease page name (case-sensitive, including parentheses). Also check that the template is not inside <translate> tags, which block SMW.
  • Duplicate entries on drug page: The same AntibioticDose call may be transcluded from multiple pages. Ensure the disease parameter matches only one page name.
  • Red link for drug name: The drug parameter does not match any existing WikEM page. Check the spelling and use the exact page title.

Common Drug Name Mappings

If the commonly used name differs from the WikEM page title, use the page title for drug and the common name for display:

Common Name WikEM Page Name (use for drug=)
Augmentin Amoxicillin/Clavulanate
Unasyn Ampicillin/Sulbactam
Zosyn Piperacillin/Tazobactam
Bactrim, TMP-SMX Trimethoprim-Sulfamethoxazole DS
Primaxin Imipenem/Cilastatin