Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:MedTemplate: Difference between revisions

Template page
No edit summary
Common uses datasheet field: draw from the problems database (top 5 linked problems by rater count) via <pharmaCommonUses>, hand-entered uses kept as the empty-case fallback (designer-claude + parser-claude 2026-05-22)
 
(39 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><table class="wikitable" style="float:right; clear:right; max-width:28em; margin:0 0 1em 1em; font-size:92%;">
<includeonly><div class="medpage"><div class="titleblock"><div class="tb-eyebrow">{{{classes|}}}</div><div class="tb-row"><div class="tb-name">{{{generic|{{PAGENAME}}}}}</div>{{#if:{{{brand|}}}|<div class="tb-brand">{{{brand}}}</div>}}</div></div>{{#cargo_store:_table=Medicines
<caption style="font-size:120%; padding:0.4em; font-weight:bold;">{{{generic|{{PAGENAME}}}}}</caption>
| generic={{{generic|}}}
{{#if:{{{structure|}}}|<tr><td colspan="2" style="padding:0.8em; text-align:center;">[[File:{{{structure}}}|frameless|{{{structuresize|240px}}}|alt=Structure of {{{generic|{{PAGENAME}}}}}]]<br><small>'''Structure'''</small></td></tr>}}
| brand={{{brand|}}}
<tr><th colspan="2" style="background:#2563eb; color:#fff; padding:0.4em; text-align:left;">Summary</th></tr>
| structure={{{structure|}}}
{{#if:{{{brand|}}}|<tr><th style="text-align:left; width:9em;">Brand name(s)</th><td>{{{brand}}}</td></tr>}}
| classes={{{classes|}}}
{{#if:{{{class|}}}|<tr><th style="text-align:left;">Class</th><td>{{{class}}}</td></tr>}}
| mechanism={{{mechanism|}}}
{{#if:{{{mechanism|}}}|<tr><th style="text-align:left;">Purported mechanism(s)</th><td>{{{mechanism}}}</td></tr>}}
| uses={{{uses|}}}
{{#if:{{{uses|}}}|<tr><th style="text-align:left;">Common uses</th><td>{{{uses}}}</td></tr>}}
| starting_dose={{{starting_dose|}}}
<tr><th colspan="2" style="background:#16a34a; color:#fff; padding:0.4em; text-align:left;">Chemistry</th></tr>
| preparations={{{preparations|}}}
{{#if:{{{formula|}}}|<tr><th style="text-align:left;">Formula</th><td>{{{formula}}}</td></tr>}}
| fda_max={{{fda_max|}}}
{{#if:{{{mass|}}}|<tr><th style="text-align:left;">Molar mass</th><td>{{{mass}}}</td></tr>}}
| pill_id={{{pill_id|}}}
{{#if:{{{cas|}}}|<tr><th style="text-align:left;">CAS number</th><td>{{{cas}}}</td></tr>}}
| routes={{{routes|}}}
{{#if:{{{atc|}}}|<tr><th style="text-align:left;">ATC code</th><td>{{{atc}}}</td></tr>}}
| onset={{{onset|}}}
<tr><th colspan="2" style="background:#7c3aed; color:#fff; padding:0.4em; text-align:left;">Pharmacology</th></tr>
| duration={{{duration|}}}
{{#if:{{{routes|}}}|<tr><th style="text-align:left;">Routes</th><td>{{{routes}}}</td></tr>}}
| halflife={{{halflife|}}}
{{#if:{{{onset|}}}|<tr><th style="text-align:left;">Onset</th><td>{{{onset}}}</td></tr>}}
| bioavailability={{{bioavailability|}}}
{{#if:{{{duration|}}}|<tr><th style="text-align:left;">Duration</th><td>{{{duration}}}</td></tr>}}
| pregnancy={{{pregnancy|}}}
{{#if:{{{halflife|}}}|<tr><th style="text-align:left;">Half-life</th><td>{{{halflife}}}</td></tr>}}
| legal={{{legal|}}}
{{#if:{{{bioavailability|}}}|<tr><th style="text-align:left;">Bioavailability</th><td>{{{bioavailability}}}</td></tr>}}
}}<div class="med-grid"><div class="med-main">{{#if:{{{intro|}}}|
{{#if:{{{pregnancy|}}}|<tr><th style="text-align:left;">Pregnancy</th><td>{{{pregnancy}}}</td></tr>}}
{{#if:{{{legal|}}}|<tr><th style="text-align:left;">Legal status</th><td>{{{legal}}}</td></tr>}}
</table>{{#if:{{{intro|}}}|
{{{intro}}}
{{{intro}}}
}}{{#if:{{{pharmacology|}}}|<h2 id="Pharmacology">Pharmacology</h2>
}}{{#if:{{{history|}}}|<div class="med-sec-head"><h2 class="sec-title" id="History">History</h2></div>
{{{pharmacology}}}}}{{#if:{{{pharmacokinetics|}}}|<h2 id="Pharmacokinetics">Pharmacokinetics</h2>
{{{history}}}}}<div class="med-sec-head"><h2 class="sec-title" id="Experience">Experience</h2></div>
{{{pharmacokinetics}}}}}{{#if:{{{indications|}}}|<h2 id="Indications">Indications</h2>
<pharmaExperience/>
{{{indications}}}}}{{#if:{{{dosing|}}}|<h2 id="Dosing">Dosing and titration</h2>
<div class="med-sec-head"><h2 class="sec-title" id="Problems">Problems</h2></div>
{{{dosing}}}}}{{#if:{{{effects|}}}|<h2 id="Effects">Effects</h2>
{{#if:{{{indications|}}}|{{{indications}}}|<p style="opacity:0.7; font-style:italic;">No problems yet. Be the first to suggest one.</p>}}
{{{effects}}}}}{{#if:{{{adverse|}}}|<h2 id="Adverse">Adverse effects</h2>
{{{adverse}}}}}{{#if:{{{contraindications|}}}|<h2 id="Contraindications">Contraindications</h2>
{{{contraindications}}}}}{{#if:{{{interactions|}}}|<h2 id="Interactions">Interactions</h2>
{{{interactions}}}}}{{#if:{{{pregnancy_details|}}}|<h2 id="Pregnancy">Pregnancy and lactation</h2>
{{{pregnancy_details}}}}}{{#if:{{{monitoring|}}}|<h2 id="Monitoring">Monitoring</h2>
{{{monitoring}}}}}{{#if:{{{counseling|}}}|<h2 id="Counseling">Patient counseling</h2>
{{{counseling}}}}}{{#if:{{{anecdotes|}}}|<h2 id="Anecdotes">Personal experience</h2>
''The following are personal accounts and not medical advice.''


{{{anecdotes}}}}}{{#if:{{{seealso|}}}|<h2 id="SeeAlso">See also</h2>
<span class="pcp-problem-suggest-wrap">[[Special:SuggestProblem/{{FULLPAGENAME}}|+ Add a problem]]</span><div class="med-sec-head"><h2 class="sec-title" id="Titration">Titration strategies</h2></div>
{{{seealso}}}}}{{#if:{{{references|}}}|<h2 id="References">References</h2>
{{#if:{{{dosing|}}}|{{{dosing}}}|<p style="opacity:0.7; font-style:italic;">No titration strategies yet. Be the first to suggest one.</p>}}
{{{references}}}}}[[Category:Medications]]</includeonly><noinclude>
 
Usage docs and TemplateData go here — keep what you already have, or copy the TemplateData block from the earlier message if you want VisualEditor integration.
<span class="pcp-titration-suggest-wrap">[[Special:SuggestTitration/{{FULLPAGENAME}}|+ Add a titration strategy]]</span>
 
<div class="med-sec-head"><h2 class="sec-title" id="Effects">Effects</h2></div>
{{#if:{{{effects|}}}{{{adverse|}}}|{{{effects|}}}{{#if:{{{adverse|}}}|
 
{{{adverse}}}}}|<p style="opacity:0.7; font-style:italic;">No effects listed yet. Be the first to suggest one.</p>}}
 
<span class="pcp-effect-suggest-wrap">[[Special:SuggestEffect/{{FULLPAGENAME}}|+ Add an effect]]</span>
{{#if:{{{pharmacokinetics|}}}{{{pk_absorption|}}}{{{pk_distribution|}}}{{{pk_metabolism|}}}{{{pk_elimination|}}}|<div class="med-sec-head"><h2 class="sec-title" id="Pharmacokinetics">Pharmacokinetics</h2></div>
{{#if:{{{pk_absorption|}}}|<h3 class="med-subhead" id="Absorption">Absorption</h3>
{{{pk_absorption}}}
}}{{#if:{{{pk_distribution|}}}|<h3 class="med-subhead" id="Distribution">Distribution</h3>
{{{pk_distribution}}}
}}{{#if:{{{pk_metabolism|}}}|<h3 class="med-subhead" id="Metabolism">Metabolism</h3>
{{{pk_metabolism}}}
}}{{#if:{{{pk_elimination|}}}|<h3 class="med-subhead" id="Elimination">Elimination</h3>
{{{pk_elimination}}}
}}{{#if:{{{pharmacokinetics|}}}|
{{{pharmacokinetics}}}}}
}}{{#if:{{{pharmacodynamics|}}}|<div class="med-sec-head"><h2 class="sec-title" id="Pharmacodynamics">Pharmacodynamics</h2></div>
{{{pharmacodynamics}}}}}{{#if:{{{interactions|}}}|<div class="med-sec-head"><h2 class="sec-title" id="Interactions">Interactions</h2></div>
{{{interactions}}}}}{{#if:{{{pregnancy_details|}}}|<div class="med-sec-head"><h2 class="sec-title" id="Pregnancy">Pregnancy and lactation</h2></div>
{{{pregnancy_details}}}}}{{#if:{{{monitoring|}}}|<div class="med-sec-head"><h2 class="sec-title" id="Monitoring">Monitoring</h2></div>
{{{monitoring}}}}}{{#if:{{{counseling|}}}|<div class="med-sec-head"><h2 class="sec-title" id="Counseling">Patient counseling</h2></div>
{{{counseling}}}}}<div class="med-sec-head"><h2 class="sec-title" id="Anecdote">Relevant anecdote</h2></div>
{{#if:{{{anecdotes|}}}|{{{anecdotes}}}|<p style="opacity:0.7; font-style:italic;">No anecdotes yet. Share a relevant one.</p>}}
 
<span class="pcp-anecdote-suggest-wrap">[[Special:SuggestAnecdote/{{FULLPAGENAME}}|+ Add an anecdote]]</span>
<div class="med-sec-head"><h2 class="sec-title" id="Literature">Relevant Literature</h2></div>
<pharmaLiterature/>
{{#if:{{{seealso|}}}|<div class="med-sec-head"><h2 class="sec-title" id="SeeAlso">See also</h2></div>
{{{seealso}}}}}{{#if:{{{references|}}}|<div class="med-sec-head"><h2 class="sec-title" id="References">References</h2></div>
{{{references}}}}}</div><div class="med-rail"><div class="med-rail-inner">{{#if:{{{structure|}}}|<div class="med-structure">[[File:{{{structure}}}|frameless|{{{structuresize|240px}}}|alt=Structure of {{{generic|{{PAGENAME}}}}}]]</div>}}<div class="med-channel ch-summary"><div class="ch-head"><span class="ch-mark"></span><span class="ch-name">Summary</span></div>{{#if:{{{classes|}}}|<div class="med-field"><div class="fl">Classes</div><div class="fv">{{{classes}}}</div></div>}}<pharmaCommonUses>{{{uses|}}}</pharmaCommonUses></div><div class="med-channel ch-pharmacy"><div class="ch-head"><span class="ch-mark"></span><span class="ch-name">Pharmacy</span></div>{{#if:{{{starting_dose|}}}|<div class="med-field"><div class="fl">Starting dose</div><div class="fv">{{{starting_dose}}}</div></div>}}{{#if:{{{preparations|}}}|<div class="med-field"><div class="fl">Preparations</div><div class="fv">{{{preparations}}}</div></div>}}{{#if:{{{fda_max|}}}|<div class="med-field"><div class="fl">US FDA Max</div><div class="fv">{{{fda_max}}}</div></div>}}{{#if:{{{pill_id|}}}|<div class="med-field"><div class="fl">Pill ID</div><div class="fv"><div class="pcp-pill-id"><div class="mw-collapsible mw-collapsed" data-expandtext="Show pill identifiers" data-collapsetext="Hide pill identifiers">
{{{pill_id}}}
</div></div></div></div>}}</div><div class="med-channel ch-pharmacology"><div class="ch-head"><span class="ch-mark"></span><span class="ch-name">Pharmacology</span></div>{{#if:{{{routes|}}}|<div class="med-field"><div class="fl">Routes</div><div class="fv">{{{routes}}}</div></div>}}{{#if:{{{onset|}}}|<div class="med-field"><div class="fl">Onset</div><div class="fv">{{{onset}}}</div></div>}}{{#if:{{{duration|}}}|<div class="med-field"><div class="fl">Duration</div><div class="fv">{{{duration}}}</div></div>}}{{#if:{{{halflife|}}}|<div class="med-field"><div class="fl">Half-life</div><div class="fv">{{{halflife}}}</div></div>}}{{#if:{{{bioavailability|}}}|<div class="med-field"><div class="fl">Bioavailability</div><div class="fv">{{{bioavailability}}}</div></div>}}{{#if:{{{pregnancy|}}}|<div class="med-field"><div class="fl">Pregnancy</div><div class="fv">{{{pregnancy}}}</div></div>}}{{#if:{{{legal|}}}|<div class="med-field"><div class="fl">Legal status</div><div class="fv">{{{legal}}}</div></div>}}{{#if:{{{mechanism|}}}|<div class="med-field"><div class="fl">Purported mechanism</div><div class="fv">{{{mechanism}}}</div></div>}}</div></div></div></div>[[Category:Medicines]]</div></includeonly><noinclude>
{{#cargo_declare:_table=Medicines
| generic=String
| brand=String
| structure=File
| classes=List (,) of String
| mechanism=String
| uses=String
| starting_dose=String
| preparations=String
| fda_max=String
| pill_id=Text
| routes=List (,) of String
| onset=String
| duration=String
| halflife=String
| bioavailability=String
| pregnancy=String
| legal=String
}}


[[Category:Templates]]
</noinclude>
<noinclude>
== Usage ==
== Usage ==
Medicine entry template. Fill in fields below; empty fields are auto-omitted.
The <code>problems</code> parameter still uses the historical name in template wikitext to preserve compatibility with every existing medicine page; the rendered H2 heading on the page now reads "Problems" (see [[Special:Problems]] for the repository and [[Pharmacopedia:Citation needed]] adjacent context).
<pre>
<pre>
{{MedTemplate
{{MedTemplate
| generic          =  
| generic          =
| brand            =  
| brand            =
| structure        =  
| structure        =
| class            =
| classes          =
| mechanism        =  
| uses              =
| uses              =  
| starting_dose    =
| formula          =  
| preparations      =
| mass              =  
| fda_max          =
| cas              =  
| pill_id          =
| atc              =  
| routes            =
| routes            =  
| onset            =
| onset            =  
| duration          =
| duration          =  
| halflife          =
| halflife          =  
| bioavailability  =
| bioavailability  =  
| pregnancy        =
| pregnancy        =  
| legal            =
| legal            =  
| mechanism        =
| intro            =  
| intro            =
| pharmacology      =  
| history          =
| pharmacokinetics  =  
| indications      =
| indications      =  
| dosing            =
| dosing            =  
| effects          =
| effects          =  
| pk_absorption    =
| adverse          =  
| pk_distribution  =
| contraindications =  
| pk_metabolism    =
| interactions      =  
| pk_elimination    =
| pregnancy_details =  
| pharmacodynamics  =
| monitoring        =  
| interactions      =
| counseling        =  
| pregnancy_details =
| anecdotes        =  
| monitoring        =
| seealso          =  
| counseling        =
| references        =  
| anecdotes        =
| seealso          =
| references        =
}}
}}
</pre>
</pre>


Three groups of fields:
Notes:
 
* ''The'' <code>problems</code> ''parameter feeds the "Problems" H2 section on the rendered page. Content typically consists of'' <code>&lt;problem ref="..."/&gt;</code> ''tags (formerly'' <code>&lt;problem ref="..."/&gt;</code>'').'' ''Use'' <code>[[Special:SuggestProblem|SuggestProblem]]</code> ''or the per-page'' <code>+ Add a problem</code> ''link to propose new entries.''
* '''Infobox (right column)''': short, label-style values — name, brand, class, formula, half-life, etc.
* ''The'' <code>adverse</code> ''parameter is deprecated; its content is still rendered, but new pages should combine therapeutic and adverse effects into the single'' <code>effects</code> ''parameter.''
* '''Body sections''': prose; renders as full-width <code>== Section ==</code> headings only when filled.
* ''The'' <code>formula</code> ''parameter is deprecated and no longer rendered. It can be removed from existing pages.''
* '''Auto-omitted''' rows/sections: any empty parameter is skipped (no empty boxes or stray headings).
* ''The single'' <code>pharmacokinetics</code> ''parameter is deprecated; new pages should use'' <code>pk_absorption</code>'','' <code>pk_distribution</code>'','' <code>pk_metabolism</code>'', and'' <code>pk_elimination</code>''.''


<templatedata>
This template also populates the '''Medicines''' Cargo table. See [[Special:CargoTables/Medicines]].
{
  "description": "Full page template for a medicine entry. Renders a tri-section infobox (Summary / Chemistry / Pharmacology) plus auto-suppressed body sections.",
  "params": {
    "generic":          { "label": "Generic name(s)",  "description": "Comma-separated. Defaults to page name.", "type": "string" },
    "brand":            { "label": "Brand name(s)",    "type": "string" },
    "structure":        { "label": "Structure image",  "description": "Filename only, no 'File:' prefix.", "type": "wiki-file-name" },
    "structuresize":    { "label": "Structure size",    "description": "Defaults to 240px.", "type": "string", "default": "240px" },
    "class":            { "label": "Class",            "description": "Pharmacological class, e.g. SSRI.", "type": "string" },
    "mechanism":        { "label": "Purported Mechanism(s) (1 line)","description": "One-line summary for infobox; expand in 'Pharmacology' body section.", "type": "string" },
    "uses":              { "label": "Common uses",      "type": "string" },
    "formula":          { "label": "Chemical formula",  "type": "string" },
    "mass":              { "label": "Molar mass",        "type": "string" },
    "cas":              { "label": "CAS number",        "type": "string" },
    "atc":              { "label": "ATC code",          "type": "string" },
    "routes":            { "label": "Routes of administration", "type": "string" },
    "onset":            { "label": "Onset",            "type": "string" },
    "duration":          { "label": "Duration",          "type": "string" },
    "halflife":          { "label": "Half-life",        "type": "string" },
    "bioavailability":  { "label": "Bioavailability",  "type": "string" },
    "pregnancy":        { "label": "Pregnancy (short)", "description": "Short tag for infobox, e.g. 'Category C'. Detailed prose goes in 'pregnancy_details'.", "type": "string" },
    "legal":            { "label": "Legal status",      "description": "e.g. 'Rx-only', 'Schedule IV'.", "type": "string" },
    "intro":            { "label": "Intro paragraph",  "description": "Free wikitext above the first heading.", "type": "content" },
    "pharmacology":      { "label": "Pharmacology",      "type": "content" },
    "pharmacokinetics":  { "label": "Pharmacokinetics",  "description": "ADME — absorption, distribution, metabolism, excretion.", "type": "content" },
    "indications":      { "label": "Indications",      "type": "content" },
    "dosing":            { "label": "Dosing and titration", "type": "content" },
    "effects":          { "label": "Effects",          "description": "Therapeutic + common adverse effects.", "type": "content" },
    "adverse":          { "label": "Adverse effects",  "description": "Serious / less common adverse effects, warnings.", "type": "content" },
    "contraindications": { "label": "Contraindications", "type": "content" },
    "interactions":      { "label": "Interactions",      "description": "Medicine-medicine, medicine-food, etc.", "type": "content" },
    "pregnancy_details": { "label": "Pregnancy & lactation (body section)", "type": "content" },
    "monitoring":        { "label": "Monitoring",        "description": "Labs, vitals, or signs to watch.", "type": "content" },
    "counseling":        { "label": "Patient counseling","type": "content" },
    "anecdotes":        { "label": "Personal experience", "type": "content" },
    "seealso":          { "label": "See also",          "type": "content" },
    "references":        { "label": "References",        "type": "content" }
  },
  "paramOrder": [
    "generic", "brand", "structure", "structuresize",
    "class", "mechanism", "uses",
    "formula", "mass", "cas", "atc",
    "routes", "onset", "duration", "halflife", "bioavailability", "pregnancy", "legal",
    "intro", "pharmacology", "pharmacokinetics", "indications", "dosing",
    "effects", "adverse", "contraindications", "interactions",
    "pregnancy_details", "monitoring", "counseling", "anecdotes",
    "seealso", "references"
  ],
  "format": "block"
}
</templatedata>


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>