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
Default Med Template
 
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)
 
(45 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{| 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
|+ style="font-size:120%; padding:0.4em;" | '''{{{generic|{{PAGENAME}}}}}'''
| generic={{{generic|}}}
{{#if:{{{structure|}}}|! colspan="2" style="padding:0.8em; text-align:center;" {{!}} [[File:{{{structure}}}|frameless|{{{structuresize|240px}}}|alt=Structure of {{{generic|{{PAGENAME}}}}}]]<br><small>'''Structure'''</small>
| brand={{{brand|}}}
{{!}}-
| structure={{{structure|}}}
}}! colspan="2" style="background:#2563eb; color:#fff; padding:0.4em; text-align:left;" | Summary
| classes={{{classes|}}}
{{#if:{{{brand|}}}|{{!}}-
| mechanism={{{mechanism|}}}
! style="text-align:left; width:9em;" {{!}} Brand name(s)
| uses={{{uses|}}}
{{!}} {{{brand}}}
| starting_dose={{{starting_dose|}}}
}}{{#if:{{{class|}}}|{{!}}-
| preparations={{{preparations|}}}
! style="text-align:left;" {{!}} Class
| fda_max={{{fda_max|}}}
{{!}} {{{class}}}
| pill_id={{{pill_id|}}}
}}{{#if:{{{mechanism|}}}|{{!}}-
| routes={{{routes|}}}
! style="text-align:left;" {{!}} Mechanism
| onset={{{onset|}}}
{{!}} {{{mechanism}}}
| duration={{{duration|}}}
}}{{#if:{{{uses|}}}|{{!}}-
| halflife={{{halflife|}}}
! style="text-align:left;" {{!}} Common uses
| bioavailability={{{bioavailability|}}}
{{!}} {{{uses}}}
| pregnancy={{{pregnancy|}}}
}}
| legal={{{legal|}}}
|-
}}<div class="med-grid"><div class="med-main">{{#if:{{{intro|}}}|
! colspan="2" style="background:#16a34a; color:#fff; padding:0.4em; text-align:left;" | Chemistry
{{{intro}}}
{{#if:{{{formula|}}}|{{!}}-
}}{{#if:{{{history|}}}|<div class="med-sec-head"><h2 class="sec-title" id="History">History</h2></div>
! style="text-align:left;" {{!}} Formula
{{{history}}}}}<div class="med-sec-head"><h2 class="sec-title" id="Experience">Experience</h2></div>
{{!}} {{{formula}}}
<pharmaExperience/>
}}{{#if:{{{mass|}}}|{{!}}-
<div class="med-sec-head"><h2 class="sec-title" id="Problems">Problems</h2></div>
! style="text-align:left;" {{!}} Molar mass
{{#if:{{{indications|}}}|{{{indications}}}|<p style="opacity:0.7; font-style:italic;">No problems yet. Be the first to suggest one.</p>}}
{{!}} {{{mass}}}
}}{{#if:{{{cas|}}}|{{!}}-
! style="text-align:left;" {{!}} CAS number
{{!}} {{{cas}}}
}}{{#if:{{{atc|}}}|{{!}}-
! style="text-align:left;" {{!}} ATC code
{{!}} {{{atc}}}
}}
|-
! colspan="2" style="background:#7c3aed; color:#fff; padding:0.4em; text-align:left;" | Pharmacology
{{#if:{{{routes|}}}|{{!}}-
! style="text-align:left;" {{!}} Routes
{{!}} {{{routes}}}
}}{{#if:{{{onset|}}}|{{!}}-
! style="text-align:left;" {{!}} Onset
{{!}} {{{onset}}}
}}{{#if:{{{duration|}}}|{{!}}-
! style="text-align:left;" {{!}} Duration
{{!}} {{{duration}}}
}}{{#if:{{{halflife|}}}|{{!}}-
! style="text-align:left;" {{!}} Half-life
{{!}} {{{halflife}}}
}}{{#if:{{{bioavailability|}}}|{{!}}-
! style="text-align:left;" {{!}} Bioavailability
{{!}} {{{bioavailability}}}
}}{{#if:{{{pregnancy|}}}|{{!}}-
! style="text-align:left;" {{!}} Pregnancy
{{!}} {{{pregnancy}}}
}}{{#if:{{{legal|}}}|{{!}}-
! style="text-align:left;" {{!}} Legal status
{{!}} {{{legal}}}
}}
|}{{#if:{{{intro|}}}|
{{{intro}}}}}{{#if:{{{pharmacology|}}}|


== Pharmacology ==
<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>
{{{pharmacology}}}}}{{#if:{{{pharmacokinetics|}}}|
{{#if:{{{dosing|}}}|{{{dosing}}}|<p style="opacity:0.7; font-style:italic;">No titration strategies yet. Be the first to suggest one.</p>}}


== Pharmacokinetics ==
<span class="pcp-titration-suggest-wrap">[[Special:SuggestTitration/{{FULLPAGENAME}}|+ Add a titration strategy]]</span>
{{{pharmacokinetics}}}}}{{#if:{{{indications|}}}|


== Indications ==
<div class="med-sec-head"><h2 class="sec-title" id="Effects">Effects</h2></div>
{{{indications}}}}}{{#if:{{{dosing|}}}|
{{#if:{{{effects|}}}{{{adverse|}}}|{{{effects|}}}{{#if:{{{adverse|}}}|


== Dosing and titration ==
{{{adverse}}}}}|<p style="opacity:0.7; font-style:italic;">No effects listed yet. Be the first to suggest one.</p>}}
{{{dosing}}}}}{{#if:{{{effects|}}}|


== Effects ==
<span class="pcp-effect-suggest-wrap">[[Special:SuggestEffect/{{FULLPAGENAME}}|+ Add an effect]]</span>
{{{effects}}}}}{{#if:{{{adverse|}}}|
{{#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>}}


== Adverse effects ==
<span class="pcp-anecdote-suggest-wrap">[[Special:SuggestAnecdote/{{FULLPAGENAME}}|+ Add an anecdote]]</span>
{{{adverse}}}}}{{#if:{{{contraindications|}}}|
<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
}}


== Contraindications ==
== Usage ==
{{{contraindications}}}}}{{#if:{{{interactions|}}}|
 
== Interactions ==
{{{interactions}}}}}{{#if:{{{pregnancy_details|}}}|
 
== Pregnancy and lactation ==
{{{pregnancy_details}}}}}{{#if:{{{monitoring|}}}|
 
== Monitoring ==
{{{monitoring}}}}}{{#if:{{{counseling|}}}|
 
== Patient counseling ==
{{{counseling}}}}}{{#if:{{{anecdotes|}}}|
 
== Personal experience ==
''The following are personal accounts and not medical advice.''


{{{anecdotes}}}}}{{#if:{{{seealso|}}}|
Medicine entry template. Fill in fields below; empty fields are auto-omitted.


== See also ==
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).
{{{seealso}}}}}{{#if:{{{references|}}}|


== References ==
{{{references}}}}}[[Category:Medications]]</includeonly><noinclude>
== Usage ==
<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": "Mechanism (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>