-
Notifications
You must be signed in to change notification settings - Fork 0
Template Configuration Reference
The templates are stored in the folder
/SnomedTemplateService/SnomedTemplateService.Web/SnomedTemplates. For each
organisation that owns templates, a subfolder of this folder should be created.
Each template should be stored as an XML file in the folder that corresponds to
its owner. The XML format for these template files is described in this
document.
In addition to the organization folders the root of the templates folder
contains an XML file named tags.xml. In a template file one can assign tags to
a template that can be used in the frontend for searching templates. Each tag
that is used in the template files should be defined in tags.xml. The format
of this file is also described in this document.
In the /model folder of the repository one can find an example and an XML
schema for both the template files and the tags file. Some constraints are not
checked by the XML schema. When this is the case it will be explicitly mentioned
in this specification. The constraints for tags.xml and the template files are
also checked when the application is started.
The XML schemas can also be very useful when writing templates. For some XML editors (e.g. Visual Studio) specifying an XML schema adds support for autocomplete. (For Visual Studio see here)
Several elements in tags.xml and the template files consist of a dictionary of
translations of some string. The structure of the elements that are translated
is as follows:
<???>
<txt lang="[ISO 639-1 code #1]">
[TEXT]
</txt>
<txt lang="[ISO 639-1 code #2]">
[TEXT]
</txt>
...
</???>So the content of these multilingual elements consists of a list of <txt>
elements, each containing a translation of the string. The language of a
translation should be specified as a ISO 639-1 language code (This ISO 639-1
code isn't checked in the XML schema.) in the lang attribute of the <txt>
element. To specify an empty string for some language, leave the <txt> element
for that language out.
Languages that don't have a ISO 639-1 code are not supported.
The tags file is pretty simple: The root element is a <tags> element
containing a list of <tag> elements. These <tag>s are multilingual elements
and besides that they have an id attribute that is used when a tag is referred
to in a template file. The id of a tag must be unique so that it can be used for
these references.
When a translation isn't available, for some frontend language and some tag,
then a default language is used. For this purpose the root element <tags> has
a mandatory attribute defaultLang containing a ISO 639-1 language code (The
ISO 639-1 code isn't checked in the XML schema). For each tag a translation for
this language should exist (This constraint isn't checked in the XML schema).
A template file consists of the following elements:
The root element of the file should be a <template> element.
The authors of a template are specified in a collection <authors> that
contains one or more <author> elements of a complex type. The children of
<author> are <name> and <contact>.
This is a text element that contains the name of the author.
This is a text element that contains the mail address of the author.
This is a multilingual element that contains the translations for the title of the template.
This is a multilingual element that contains the translations for the description of the template.
This is a text element that contains the identifier of the SNOMED CT version.
This is a text element that contains the identifier of the SNOMED CT branch.
This element is a multilingual field and contains a format string for a
human-readable string that can be used to represent the expression. In this
string, place holders of the form [x/y] can be used. Each of these is
replaced by the preferred term of the concept that is entered in the
corresponding slot. [x/y] corresponds to the slot that is contained in
the attribute group with index y (0-based) and that has index x (also
0-based) within this group. So [0/1] is replaced by the preferred term for the
first slot in the second group.
Placeholders for attributes of nested expressions are not supported.
The <tag> elemements are references to the tags in the tags file and are used
in the frontend to search for templates. Tags are assigned by adding references
to the actual tags in the tags.xml file. A <tag> element in the template
file is an empty element which has a id attribute that refers to the tag in
tags.xml file having the same id.
This is the actual template specified as an ETL expression (see ETL specification). To check the syntax of an ETL expression one can use the SNOMED CT ETL Parser.
The XML element <items> contains item specific information associated with
fragments of the ETL expression (e.g. slots and constant attributes). Each
<item> in this collection has a required name attribute to associate a
fragment with its info. To specify the info for some fragment: 1) add a info slot
for it in the ETL (see ETL specification), 2) specify the
name for the info slot and 3) add an <item> element to the <items> collection
that has the same name as the info slot.
A multilingual field containing the translations for the title for the ETL fragment.
A multilingual field containing the translations for the description for the ETL fragment.
The ISO 639-1 language code of the default language (This ISO 639-1 code isn't
checked in the XML schema). The default language is used when the template
doesn't support the language requested in the frontend. To make this possible
the template must support the default Language. A template supports a language
when a non-empty translation exists for all mulilingual fields that have minimal
cardinality > 0 (I.e <title>, <stringFormat> and the <title> of all
<item>s). The constraint that the default language must be supported isn't
checked in the XML schema.