Difference between revisions of "Template:ATC navboxes/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Berchanhimez
(subst to get it out of templates with errors category)
blackwiki>Berchanhimez
(fix and note which codes must be more specific)
Line 16: Line 16:
  
 
====Errors====
 
====Errors====
<code><nowiki>{{ATC navboxes|C01}}</nowiki></code> - this appears when a valid code is input, but the code has multiple sub-templates. The error is solved by using a more specific code, for example, replacing C01 with C01A.
+
=====Non-specific=====
{{navboxes
+
{{font|ATC code not specific enough - please use one further character (example: instead of M01, use M01A)|size=120%|color=red}}
|title = Related drugs by [[ATC code|Anatomical Therapeutic Chemical classification]] (ATC code)
+
 
|state = collapsed
+
This appears when a valid code is input, but the code has multiple sub-templates. The error is solved by using a more specific code, for example, replacing C01 with C01A. Expand the table below to see all codes that must be more specific than their top level code.
|list =
+
 
{{ #if: C01
+
{| class="wikitable mw-collapsible autocollapse" style="width:50%"
| {{#invoke:ATC code to template name|translate|C01}}
+
|+ List of ATC codes that are not specific enough to parse in this template
| No codes given[[Category:ATC navbox wrappers with no codes]]
+
|-
}}
+
! Non-specific<br />ATC code !! colspan=2| Alternative<br />more specific<br />codes
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{2}}}}}
+
| rowspan=2 |            A02 || A02A  || {{tl|Antacids}}
|
+
|-
}}
+
|                            | A02B  || {{tl|Drugs for peptic ulcer and GORD}}
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{3}}}}}
+
| rowspan=4 |           C01 || C01A  || {{tl|Cardiac glycosides}}
|
+
|-
}}
+
|                            | C01B  || {{tl|Antiarrhythmic agents}}
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{4}}}}}
+
|                            | C01C  || {{tl|Cardiac stimulants excluding cardiac glycosides}}
|
+
|-
}}
+
|                            | C01D  || {{tl|Vasodilators used in cardiac diseases}}
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{5}}}}}
+
| rowspan=5 |            G02 || G02A  || {{tl|Uterotonics}}
|
+
|-
}}
+
|                            | G02B  || {{tl|Birth control methods}} (with G03A)
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{6}}}}}
+
|                            | G02CA  || {{tl|Labor repressants}}
|
+
|-
}}
+
|                            | G02CB  || rowspan=2 | {{tl|Prolactin inhibitors and anti-inflammatory products for vaginal administration}}
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{7}}}}}
+
|                            | G02CC
|
+
|-
}}
+
| rowspan=3 |          G02C || G02CA  || {{tl|Labor repressants}}
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{8}}}}}
+
|                            | G02CB  || rowspan=2 | {{tl|Prolactin inhibitors and anti-inflammatory products for vaginal administration}}
|
+
|-
}}
+
|                            | G02CC
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{9}}}}}
+
| rowspan=3 |            G03 || G03A  || {{tl|Birth control methods}} (with G02B)
|
+
|-
}}
+
|                            | G03G  || {{tl|GnRH and gonadotropins}}
{{ #if:
+
|-
| {{#invoke:ATC code to template name|translate|{{{10}}}}}
+
|                            | G03X  || {{tl|Other sex hormones and modulators of the genital system}}
|
+
|-
}}
+
| rowspan=3 |            G04 || G04B  || {{tl|Urologicals, including antispasmodics}}, see also G04BE below.
}}
+
|-
 +
|                            | G04BE  || {{tl|Drugs for erectile dysfunction and premature ejaculation}}
 +
|-
 +
|                            | G04C  || {{tl|Drugs used in benign prostatic hypertrophy}}
 +
|-
 +
| rowspan=9 |            J01 || J01A  || rowspan=4 | {{tl|Protein synthesis inhibitor antibiotics}}
 +
|-
 +
|                            | J01B
 +
|-
 +
|                            | J01F
 +
|-
 +
|                            | J01G
 +
|-
 +
|                            | J01C  || rowspan=2 | {{tl|Cell wall disruptive antibiotics}}
 +
|-
 +
|                            | J01D
 +
|-
 +
|                            | J01E  || rowspan=2 | {{tl|Nucleic acid inhibitors}}
 +
|-
 +
|                            | J01M
 +
|-
 +
|                            | J01X  || {{tl|Other antibacterials}}
 +
|-
 +
| rowspan=2 |            M01 || M01A  || contained within {{tl|Anti-inflammatory products}}
 +
|-
 +
|                            | M01C  || {{tl|Antirheumatic products}}
 +
|-
 +
| rowspan=2 |            N01 || N01A  || {{tl|General anesthetics}}
 +
|-
 +
|                            | N01B  || {{tl|Local anesthetics}}
 +
|-
 +
| rowspan=3 |            N02 || N02A  || rowspan=2 | {{tl|Analgesics}}
 +
|-
 +
|                            | N02B
 +
|-
 +
|                            | N02C  || {{tl|Antimigraine preparations}}
 +
|-
 +
| rowspan=3 |            N05 || N05A  || {{tl|Antipsychotics}}
 +
|-
 +
|                            | N05B  || {{tl|Anxiolytics}}
 +
|-
 +
|                            | N05C  || {{tl|Hypnotics and sedatives}}
 +
|-
 +
| rowspan=3 |            N06 || N06A  || {{tl|Antidepressants}}
 +
|-
 +
|                            | N06B  || Contained within {{tl|Stimulants}}
 +
|-
 +
|                            | N06D  || {{tl|Anti-dementia drugs}}
 +
|-
 +
| rowspan=4 |            N07 || N07A  || Contained within {{tl|Cholinergics}}
 +
|-
 +
|                            | N07B  || {{tl|Drugs used in addictive disorders}}
 +
|-
 +
|                            | N07C  || {{tl|Antivertigo preparations}}
 +
|-
 +
|                            | N07X  || {{tl|Other nervous system drugs}}
 +
|-
 +
| rowspan=5 |            S01 || S01A  || {{tl|Ophthalmological anti-infectives}}
 +
|-
 +
|                            | S01E  || {{tl|Antiglaucoma preparations and miotics}}
 +
|-
 +
|                            | S01F  || {{tl|Mydriatics and cycloplegics}}
 +
|-
 +
|                            | S01H  || {{tl|Local anesthetics}}
 +
|-
 +
|                            | S01L  || {{tl|Ocular vascular disorder agents}}
 +
|-
 +
| rowspan=11 |      V03/V03A || V03AB || {{tl|Antidotes}}
 +
|-
 +
|                            | V03AC || {{tl|Chelating agents}}
 +
|-
 +
|                            | V03AE || {{tl|Drugs for treatment of hyperkalemia and hyperphosphatemia}}
 +
|-
 +
|                            | V03AF || {{tl|Detoxifying agents for antineoplastic treatment}}
 +
|-
 +
|                            | V03AG || rowspan=7 | {{tl|Other therapeutic products}} (needs expanding)
 +
|-
 +
|                            | V03AH
 +
|-
 +
|                            | V03AK
 +
|-
 +
|                            | V03AM
 +
|-
 +
|                            | V03AN
 +
|-
 +
|                            | V03AX
 +
|-
 +
|                            | V03AZ
 +
|}
 +
 
 +
 
 +
=====Invalid or no template exists=====
 +
{{font|Invalid ATC code (or the ATC code does not have a template matched to it)|size=120%|color=red}}
  
 
<code><nowiki>{{ATC navboxes|X99}}</nowiki></code> - this appears when an invalid ATC code is input, or there is no template associated with the code. This could be because there are very few items in the code (making a separate navbox unnecessary), or because the code is unused or has no items assigned to it.
 
<code><nowiki>{{ATC navboxes|X99}}</nowiki></code> - this appears when an invalid ATC code is input, or there is no template associated with the code. This could be because there are very few items in the code (making a separate navbox unnecessary), or because the code is unused or has no items assigned to it.
{{navboxes
+
 
|title = Related drugs by [[ATC code|Anatomical Therapeutic Chemical classification]] (ATC code)
 
|state = collapsed
 
|list =
 
{{ #if: X99
 
| {{#invoke:ATC code to template name|translate|X99}}
 
| No codes given[[Category:ATC navbox wrappers with no codes]]
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{2}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{3}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{4}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{5}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{6}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{7}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{8}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{9}}}}}
 
|
 
}}
 
{{ #if:
 
| {{#invoke:ATC code to template name|translate|{{{10}}}}}
 
|
 
}}
 
}}
 
  
 
==TemplateData==
 
==TemplateData==
Line 176: Line 224:
 
   }
 
   }
 
}}</templatedata>
 
}}</templatedata>
 
<includeonly>[[Category:Drug templates by ATC]]</includeonly>
 

Revision as of 09:19, 5 July 2020

{{ATC navboxes}} is used to provide a collapsed wrapper for articles about pharmaceutical products which are assigned more than one ATC code to enable each ATC code's navbox to be included without using a massive amount of space. It also enables users to include an ATC code navbox without having to look up the name of the template from the code.

This template can accept up to 10 ATC codes as unnamed parameters to be converted into navbox templates and wrapped. The ATC codes need not be in any particular order.

Examples

Single ATC code

{{ATC navboxes|A01}} Template:Navboxes

Multiple ATC codes

{{ATC navboxes|A01|B01|C01A|D01}} Template:Navboxes

Errors

Non-specific

ATC code not specific enough - please use one further character (example: instead of M01, use M01A)

This appears when a valid code is input, but the code has multiple sub-templates. The error is solved by using a more specific code, for example, replacing C01 with C01A. Expand the table below to see all codes that must be more specific than their top level code.

List of ATC codes that are not specific enough to parse in this template
Non-specific
ATC code
Alternative
more specific
codes
A02 A02A {{Antacids}}
A02B {{Drugs for peptic ulcer and GORD}}
C01 C01A {{Cardiac glycosides}}
C01B {{Antiarrhythmic agents}}
C01C {{Cardiac stimulants excluding cardiac glycosides}}
C01D {{Vasodilators used in cardiac diseases}}
G02 G02A {{Uterotonics}}
G02B {{Birth control methods}} (with G03A)
G02CA {{Labor repressants}}
G02CB {{Prolactin inhibitors and anti-inflammatory products for vaginal administration}}
G02CC
G02C G02CA {{Labor repressants}}
G02CB {{Prolactin inhibitors and anti-inflammatory products for vaginal administration}}
G02CC
G03 G03A {{Birth control methods}} (with G02B)
G03G {{GnRH and gonadotropins}}
G03X {{Other sex hormones and modulators of the genital system}}
G04 G04B {{Urologicals, including antispasmodics}}, see also G04BE below.
G04BE {{Drugs for erectile dysfunction and premature ejaculation}}
G04C {{Drugs used in benign prostatic hypertrophy}}
J01 J01A {{Protein synthesis inhibitor antibiotics}}
J01B
J01F
J01G
J01C {{Cell wall disruptive antibiotics}}
J01D
J01E {{Nucleic acid inhibitors}}
J01M
J01X {{Other antibacterials}}
M01 M01A contained within {{Anti-inflammatory products}}
M01C {{Antirheumatic products}}
N01 N01A {{General anesthetics}}
N01B {{Local anesthetics}}
N02 N02A {{Analgesics}}
N02B
N02C {{Antimigraine preparations}}
N05 N05A {{Antipsychotics}}
N05B {{Anxiolytics}}
N05C {{Hypnotics and sedatives}}
N06 N06A {{Antidepressants}}
N06B Contained within {{Stimulants}}
N06D {{Anti-dementia drugs}}
N07 N07A Contained within {{Cholinergics}}
N07B {{Drugs used in addictive disorders}}
N07C {{Antivertigo preparations}}
N07X {{Other nervous system drugs}}
S01 S01A {{Ophthalmological anti-infectives}}
S01E {{Antiglaucoma preparations and miotics}}
S01F {{Mydriatics and cycloplegics}}
S01H {{Local anesthetics}}
S01L {{Ocular vascular disorder agents}}
V03/V03A V03AB {{Antidotes}}
V03AC {{Chelating agents}}
V03AE {{Drugs for treatment of hyperkalemia and hyperphosphatemia}}
V03AF {{Detoxifying agents for antineoplastic treatment}}
V03AG {{Other therapeutic products}} (needs expanding)
V03AH
V03AK
V03AM
V03AN
V03AX
V03AZ


Invalid or no template exists

Invalid ATC code (or the ATC code does not have a template matched to it)

{{ATC navboxes|X99}} - this appears when an invalid ATC code is input, or there is no template associated with the code. This could be because there are very few items in the code (making a separate navbox unnecessary), or because the code is unused or has no items assigned to it.


TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for ATC navboxes

This template calls Module:ATC code to template name to translate raw ATC codes into their respective navbox templates, then wraps the navboxes in a collapsible wrapper to save space in articles.

Template parameters

ParameterDescriptionTypeStatus
11

First ATC code

Stringrequired
22

Second ATC code

Stringoptional
33

Third ATC code

Stringoptional
44

Fourth ATC code

Stringoptional
55

Fifth ATC code

Stringoptional
66

Sixth ATC code

Stringoptional
77

Seventh ATC code

Stringoptional
88

Eighth ATC code

Stringoptional
99

Ninth ATC code

Stringoptional
1010

Tenth ATC code

Stringoptional