The Template Data Schema is an XML schema generated from a template OPT that has a tag set derived from a combination of RM and archetypes. The business value of a TDS is that:
- it functions as a schema definition for a single 'message', i.e. the data set of one template
- it is relatively easy to understand for a developer, since most 'interesting tags' are created from the template and archetypes, and are thus directly meaningful.
- XML data conforming to a TDS, which we call a Template Data Document (TDD) can be validated using industry-standard XSD tools
There are three things of interest to specify: the OPT to TDS transform; TDD to canonical RM transform; RM to TDD transform.
The information on this page will be used to create a new openEHR specification on TDS and TDD.
TDS3 (a new 2016 version of TDS) discussed during the SEC Feb 2016 Meeting:
Heath Frankel has developed a new more compact TDS format and associated transform. The plan is now to release the XSLT transform and some overview documentation of transform algorithms. (ADD JIRA PR/CR HERE WHEN AVAILABLE). Some notes from SEC meeting:
- A TDS-revision attribute (or element) needs to be added since a TDS might need new versions etc even if the template ID has not changed
- Marand has been using template annotations making it possible to override auto-generated id's
- Making it possible to use annotations to override value codes in value sets cam be useful (e.g. to replace at0023 with something meaningful for developers)
OPT to TDS Transform (TDS-XSD generation rules)
Informal specification:
- tagging:
- default tag for each node is from reference model (RM), and uses oe: namespace
- for any object node (AOM C_OBJECT) that is a child of a multiply-valued attribute (AOM C_ATTRIBUTE), use a tag generated from text the id-code (ADL1.4: at-code) of the node (default namespace)
- possible option: case where only a single object node is present under a container attribute - can use oe: tag.
- XML attributes:
- where an OPT C_OBJECT node has an rm_type_name value that is an abstract RM type, or the child of an abstract RM type, an XML tag is required of the form oe:type='XXXX' where XXXX is the rm_type_name of the node, e.g. 'DV_CODED_TEXT'.
- LOCATABLE.name override from template - or use a proper XML element?
- Root node
- TBD
TDS Tag Generation Algorithm
To convert from a text string in any language to a valid XML tag, use the the following algorithm.
TBD
TDD to Canonical RM Transform (TDD-XML consumption rules)
TBD
Canonical RM to TDD Transform (TDD-XML generation rules)
TBD