Template:GHS phrases/doc

The templates GHS phrases (/tests), H-phrases and P-phrases all format and present GHS hazard and precaution statements as defined by the UN.

The template requires one or more phrase codes as input:
 * &rarr;
 * &rarr;
 * &rarr;
 * &rarr; -- (Predefined combination, recognised)

Pages with errors or warnings show a message. Articles are then listed in,.

Usage

 * While one can use GHS phrases stand-alone in text, more common use is in Chembox, section Chembox Hazards:

Synonyms:
For ease of working in, the templates have synonyms (redirects) same as the Chembox parameter name:

Parameters

 * The number of phrase code one can enter is practically unlimited. The codes are ordered alphanumeric.
 * Best practice: add prefix H or P to the number: H220, not 220.
 * One template call can only show one prefix set. That is, H- and P-phrases cannot be mixed.


 * setid (H or P) can be set to prevent ambiguity in generic.

For backward compatability, the code prefix "H" or "P" is not required. So  equals   &rarr;. However. Since GHS phrases covers both H and P, adding the prefix is better.

Omit Rules

 * GHS phrases/list omit rules
 * true (default)


 * &rarr;

Remove Doubles
Repeated phrase codes are removed (hidden):
 * &rarr;

Other functions

 * GHS phrases/inline -- inline, with full phrase text
 * GHS phrases/list_all -- table, by H, P
 * GHS phrases/number of phrases -- by H, P
 * GHS phrases/list omit rules -- table, documentation
 * list -- See

List options

 * Using list, GHS phrases can be presented in various list formats:
 * list


 * abbr (default)


 * inline


 * bulleted


 * unbulleted


 * horizontal


 * ordered


 * horizontal_ordered


 * Except for abbr, inline, these list formats are defined in Module:List

Errors and warnings
Phrase codes that are unknown get an inline marker like [?], give a warning in and are categorised in  when in article space.

For example (One can see the warning when previewing this page or section):
 * &rarr;

H-phrases

 * &rarr;
 * &rarr;

P-phrases

 * &rarr;
 * &rarr;

GHS phrases

 * &rarr;
 * &rarr;

GHS inline

 * GHS phrases/inline lists the phrases inline, to be used in regular sentences.
 * &rarr;
 * &rarr;


 * See also.

Errors and warnings

 * Unknown phrase code
 * &rarr;


 * Set id missing
 * Set id is entered as &lt;H, P>, (default in, ) , or when setid is absent, is sought in the code list entered: H from   &rarr;


 * &rarr;


 * Could not find a set id
 * &rarr; -- (missing prefix H/P may leave undecided results (ambiguity))

Overview
Some settings are available to present an overview of the phrases. They are article-ready.

Number of phrases

 * &rarr;
 * &rarr;

Complete list (table)

 * GHS phrases/list_all returns a wikitable that lists all available phrase codes per prefix.
 * setid. Required.
 * title Optional. Default is: see.
 * collapsed Optional. Default is: uncollapsed.

Tracking

 * Help/documentation page: Template:GHS phrases

Template data
{	"params": { "1": {			"description": "Phrase code", "example": "H220, P431", "type": "string", "suggested": true },		"2": {},		"3": {},		"4": {},		"5": {},		"6": {},		"7": {},		"8": {},		"9": {},		"10": {},		"setid": { "label": "set ID", "description": "Defined plain numbers to be \"H\" or \"P\"; better add prefix to number: \"H220\"", "type": "string", "suggestedvalues": [ "H, P"			] },		"omit": { "label": "Omit Rules", "description": "Apply Omit Rules like \"omit (remove) P203 when P103 is present\"", "example": "yes", "type": "boolean", "default": "true" },		"listtype": { "label": "List type", "description": "List format of the result", "example": "listtype=bulleted", "type": "string", "suggestedvalues": [ "abbr, inline, bulleted, unbulleted, horizontal, ordered, horizontal ordered" ],			"default": "abbr" }	},	"description": "Formats and presents predefined GHS hazard statements.", "paramOrder": [ "1",		"2",		"3",		"4",		"5",		"6",		"7",		"8",		"9",		"10",		"setid", "omit", "listtype" ] }

Errors and warnings (newdoc)

 * Errors
 * All errors show a preview-message in.
 * Categorisation is in, articles only (mainspace).


 * H, P, &lt;blank> missing
 * XYZ not recognised
 * When entered: in, a setid check is enforced. Is present by default in etc.
 * When setid is missing, any first setid in the codes-list is used. So 310 &rarr; H.
 * This also occurs when setid=H and a P-phrase is entered.
 * In certain listings, like, a blank setid returns the full list (all H- and P-phrases). No error.
 * Catsort: H, P,


 * Phase codes that are not in the list (like H999) generate an error &rarr; error


 * Parameter unknown foo: catsort under U


 * Warnings
 * All warnings show a preview-message in.
 * Categorisation in, articles only (mainspace).


 * When is applied, a warning is made mentioning the two involved phrase codes. Catsort=O
 * When is present,  a warning is made mentioning the involved phrase code. Catsort=D

dev links

 * Subtemplates:
 * GHS phrases/list all
 * GHS phrases/inline
 * GHS phrases/number of phrases
 * GHS phrases/list omit rules -- documentation
 * GHS2021 --
 * Source:


 * Chembox
 * Definition of phrases
 * Module:GHS phrases/data
 * de:Vorlage:H-Sätze, de:Vorlage:P-Sätze

Developments

 * Chembox
 * Chembox Hazards
 * GHS phrases
 * GHS phrases
 * GHS phrases


 * GHSPictograms =
 * GHSSignalWord =
 * HPhrases     =
 * PPhrases     =
 * GHS_ref      =

See also
 * H-phrases
 * P-phrases