Difference between revisions of "Template:Chembox parametercheck"

From blackwiki
Jump to navigation Jump to search
imported>DePiep
(fix bad colon-ised categorisation)
imported>DMacks
(separately look for Jmol=None (vs hardcoded to use))
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<!--
 
<!--
  without a CAS registry number (no CASNo''n'' input)
+
  Supercountings (over 7 ID countings)
-->{{#ifexpr:{{{_countCASNo|-1}}} + {{{_CASnone|-1}}} = 0 |[[Category:Chemical articles without CAS registry number]] }}<!--
+
-->{{#switch:{{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}
 +
|0=<!-- ~no identifiers... -->
 +
|1=
 +
|2=[[Category:Chemical articles with multiple compound IDs|B]]
 +
|3=[[Category:Chemical articles with multiple compound IDs|C]]
 +
|4=[[Category:Chemical articles with multiple compound IDs|D]]
 +
|5=[[Category:Chemical articles with multiple compound IDs|E]]
 +
|6=[[Category:Chemical articles with multiple compound IDs|F]]
 +
|#default=<!-- other/err = no tracking -->
 +
}}<!--
  
  CAS registry number = none
+
INDEX_LABEL needed?
-->{{#ifexpr:{{{_CASnone|-1}}} = 1 |[[Category:Chemicals that do not have a CAS registry number assigned]]}}<!--
+
-->{{#ifexpr:({{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}>1)
 +
|<!-- multiple IDs. Check: has indexes? (index_comments are ignored): -->{{#ifexpr:{{{_countIndex_label|-1}}}<=0
 +
|[[Category:Multiple chemicals in an infobox that need indexing]]
 +
|[[Category:Chemicals using indexlabels]]<!-- complementary cat -->}}}}<!--
  
  Counts >=2:
+
  NONE: Options 'none'
 +
<!-- now: option 'none' only checked for main params (not the indexed 1-5 ones), for now
 +
-->{{#if:{{{_hasCASnone|}}} |[[Category:Chemicals that do not have a CAS registry number assigned]] }}<!--
 +
-->{{#if:{{{_hasPubChemCIDnone|}}} |[[Category:Chemicals that do not have a PubChem CID assigned]] }}<!--
 +
-->{{#if:{{{_hasChemSpiderIDnone|}}} |[[Category:Chemicals that do not have a ChemSpider ID assigned]] }}<!--
 +
 
 +
CAS NUMBER
 
-->{{#switch:{{{_countCASNo|-1}}}
 
-->{{#switch:{{{_countCASNo|-1}}}
 +
|0=[[Category:Chemical articles without CAS registry number]]
 +
|1=
 
|2=[[Category:Chemical articles with multiple CAS registry numbers|B]]
 
|2=[[Category:Chemical articles with multiple CAS registry numbers|B]]
 
|3=[[Category:Chemical articles with multiple CAS registry numbers|C]]
 
|3=[[Category:Chemical articles with multiple CAS registry numbers|C]]
Line 13: Line 33:
 
|5=[[Category:Chemical articles with multiple CAS registry numbers|E]]
 
|5=[[Category:Chemical articles with multiple CAS registry numbers|E]]
 
|6=[[Category:Chemical articles with multiple CAS registry numbers|F]]
 
|6=[[Category:Chemical articles with multiple CAS registry numbers|F]]
|#default=<!-- |-1|0|1|other/err = no tracking -->
+
|#default=<!-- other/err = no tracking -->
 
}}<!--
 
}}<!--
  
-->{{#switch:{{{_countPubChem|-1}}}
+
PUBCHEM
|2=[[Category:Chemical articles with multiple PubChems|B]]
+
-->{{#switch:{{{_countPubChemCID|-1}}}
|3=[[Category:Chemical articles with multiple PubChems|C]]
+
|0=[[Category:Chemicals without a PubChem CID]]<!-- new. drugbox to follow. Mar 2017 -->
|4=[[Category:Chemical articles with multiple PubChems|D]]
+
|1=
|5=[[Category:Chemical articles with multiple PubChems|E]]
+
|2=[[Category:Chemical articles with multiple PubChem CIDs|B]]
|6=[[Category:Chemical articles with multiple PubChems|F]]
+
|3=[[Category:Chemical articles with multiple PubChem CIDs|C]]
|#default=<!-- |-1|0|1|other/err = no tracking -->
+
|4=[[Category:Chemical articles with multiple PubChem CIDs|D]]
 +
|5=[[Category:Chemical articles with multiple PubChem CIDs|E]]
 +
|6=[[Category:Chemical articles with multiple PubChem CIDs|F]]
 +
|#default=<!-- other/err = no tracking -->
 
}}<!--
 
}}<!--
  
 +
CHEBI
 
-->{{#switch:{{{_countChEBI|-1}}}
 
-->{{#switch:{{{_countChEBI|-1}}}
 +
|0|1=
 
|2=[[Category:Chemical articles with multiple ChEBIs|B]]
 
|2=[[Category:Chemical articles with multiple ChEBIs|B]]
 
|3=[[Category:Chemical articles with multiple ChEBIs|C]]
 
|3=[[Category:Chemical articles with multiple ChEBIs|C]]
Line 31: Line 56:
 
|5=[[Category:Chemical articles with multiple ChEBIs|E]]
 
|5=[[Category:Chemical articles with multiple ChEBIs|E]]
 
|6=[[Category:Chemical articles with multiple ChEBIs|F]]
 
|6=[[Category:Chemical articles with multiple ChEBIs|F]]
|#default=<!-- |-1|0|1|other/err = no tracking -->
+
|#default=<!-- other/err = no tracking -->
 +
}}<!--
 +
 
 +
INCHI (skipped: StdInChI)
 +
cat:multiple INCHI's does not exist.
 +
-->{{#switch:{{{_countInChI|-1}}}
 +
|0=[[Category:Articles without InChI source]]
 +
|#default=
 
}}<!--
 
}}<!--
  
--><noinclude>{{documentation}}</noinclude><!--
+
CHEMSPIDER
 +
cat: Multiple SPIDER IDs does not exist.
 +
-->{{#switch:{{{_countChemSpiderID|-1}}}
 +
|0=[[Category:Chemical pages without ChemSpiderID]]
 +
|#default=
 +
}}<!--
 +
 
 +
SMILES
 +
Not categorised, cats do not exist.
 +
 
 +
JMOL
 +
-->{{#if:{{{_hasJmol|}}} |[[Category:Chemical articles having Jmol set]]}}<!--
 +
-->{{#if:{{{_hasJmolnone|}}} |[[Category:Chemical articles having Jmol set/None|*]]}}<!--
 +
<!--
 +
 
 +
OTHER IDs
 +
-->{{#if:{{{_hasChEBIChEMBL|unk}}}  ||[[Category:Articles without EBI source]]}}<!--
 +
-->{{#if:{{{_hasKEGG|unk}}}      ||[[Category:Articles without KEGG source]]}}<!--
 +
-->{{#if:{{{_hasUNII|unk}}}      ||[[Category:Articles without UNII source]]}}<!--
 +
-->{{#if:{{{_hasStdInChI|unk}}}{{#ifexpr:{{{_countInChI|0}}}>=1|yes|}} ||[[Category:Articles without InChI source]]}}<!--
 +
 
 +
EMPTY ID HEADER? Check if any data to be shown (else: idle Identifiers header)
 +
 
 +
--><!--  incorrect so switch off Nov2017: {{#if:{{{_hasOtherInput|unk}}} |<!--ok1 -xxx->|{{#ifexpr:({{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}>1)|<!--ok2 -xxx->|{{#if:{{{_hasChEBIChEMBL|}}}{{{_hasKEGG|}}}{{{_hasUNII|}}}{{{_hasStdInChIorKey|}}} |<!--ok3 -xxx->|<!-- idle header, to track -xxx->[[Category:Chemical infoboxes with tracked parameters|I]]}}}}}}--><!--
 +
 
 +
QIDs:
 +
-->{{#if:{{{_hasQID|}}}|[[Category:Chemicals having QID set]]}}<!--
 +
-->{{#ifexpr:{{{_countQIDindexed|0}}}>0 |[[Category:Chemicals (indexed) having QID set]]}}<!--
  
TEST
+
--><noinclude>{{documentation}}</noinclude>
CAS:{{trim|1={{{_countCASNo|blank}}} }}
 
PubChem:{{{_countPubChem|blank}}}
 
ChEBI:{{{_countChEBI|blank}}}
 
max:{{#invoke:math|max|{{{_countCASNo|-1}}} |{{{_countPubChem|-1}}} |{{{_countChEBI|-1}}} }}<br/>-->
 

Latest revision as of 15:34, 7 December 2019