Difference between revisions of "Template:Chembox parametercheck"

From blackwiki
Jump to navigation Jump to search
imported>DePiep
(Changes in Chembox. (See talk, March 2017) add PubChem CID tracking)
imported>DePiep
(Chembox: add parameter sets "index_label" and "index_comment", listformatting, tracking, tech improvements. See talk)
Line 1: Line 1:
{{#ifexpr:{{{_hasCASnone|0}}} = 1 |[[Category:Chemicals that do not have a CAS registry number assigned]] }}<!--
+
<!--
 +
Supercountings (over 7 ID countings)
 +
-->{{#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 -->
 +
}}<!--
  
-->{{#ifexpr:{{{_hasPubChemCIDnone|0}}} = 1 |[[Category:Chemicals that do not have a PubChem CID assigned]] }}<!--
+
INDEX_LABEL needed?
 +
-->{{#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:
+
  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]]
 
|0=[[Category:Chemical articles without CAS registry number]]
Line 15: Line 36:
 
}}<!--
 
}}<!--
  
 +
PUBCHEM
 
-->{{#switch:{{{_countPubChemCID|-1}}}
 
-->{{#switch:{{{_countPubChemCID|-1}}}
|0=[[Category:Chemicals without a PubChem CID]]<!-- NEW; drugbox to follow -->
+
|0=[[Category:Chemicals without a PubChem CID]]<!-- new. drugbox to follow. Mar 2017 -->
 
|1=
 
|1=
 
|2=[[Category:Chemical articles with multiple PubChem CIDs|B]]
 
|2=[[Category:Chemical articles with multiple PubChem CIDs|B]]
Line 26: Line 48:
 
}}<!--
 
}}<!--
  
 +
CHEBI
 
-->{{#switch:{{{_countChEBI|-1}}}
 
-->{{#switch:{{{_countChEBI|-1}}}
 
|0|1=
 
|0|1=
Line 36: Line 59:
 
}}<!--
 
}}<!--
  
  positives:
+
  INCHI (skipped: StdInChI)
 +
cat:multiple INCHI's does not exist.
 +
-->{{#switch:{{{_countInChI|-1}}}
 +
|0=[[Category:Articles without InChI source]]
 +
|#default=
 +
}}<!--
 +
 
 +
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:{{{_hasJmol|}}} |[[Category:Chemical articles having Jmol set]]}}<!--
-->{{#if:{{{_hasChemSpiderIDnone|}}} |[[Category:Chemicals that do not have a ChemSpider ID assigned]]}}<!--
+
<!--
 +
 
 +
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]]}}<!--
  
  negatives:
+
  EMPTY ID HEADER? Check if any data to be shown (else: idle Identifiers header)
-->{{#if:{{{_hasChEBIChEMBL|unk}}} ||[[Category:Articles without EBI source]]}}<!--
+
-->{{#if:{{{_hasOtherInput|unk}}} |<!--ok1 -->|{{#ifexpr:({{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}>1)|<!--ok2 -->|{{#if:{{{_hasChEBIChEMBL|}}}{{{_hasKEGG|}}}{{{_hasUNII|}}}{{{_hasStdInChIorKey|}}} |<!--ok3 -->|<!-- idle header, to track -->[[Category:Chemical infoboxes with tracked parameters|I]]}}}}}}<!--
-->{{#if:{{{_hasChemSpiderID|unk}}} ||[[Category:Chemical pages without ChemSpiderID]]}}<!--
 
-->{{#if:{{{_hasKEGG|unk}}} ||[[Category:Articles without KEGG source]]}}<!--
 
-->{{#if:{{{_hasInChI|unk}}} ||[[Category:Articles without InChI source]]}}<!--
 
-->{{#if:{{{_hasUNII|unk}}} ||[[Category:Articles without UNII source]]}}<!--
 
  
  indexes:
+
  QIDs:
 
-->{{#if:{{{_hasQID|}}}|[[Category:Chemicals having QID set]]}}<!--
 
-->{{#if:{{{_hasQID|}}}|[[Category:Chemicals having QID set]]}}<!--
 
-->{{#ifexpr:{{{_countQIDindexed|0}}}>0 |[[Category:Chemicals (indexed) having QID set]]}}<!--
 
-->{{#ifexpr:{{{_countQIDindexed|0}}}>0 |[[Category:Chemicals (indexed) having QID set]]}}<!--
-->{{#ifexpr:{{{_countIndexlabel|0}}}>0 |[[Category:Chemicals using indexlabels]]}}<!--
 
  
 
--><noinclude>{{documentation}}</noinclude>
 
--><noinclude>{{documentation}}</noinclude>

Revision as of 22:07, 19 March 2017