Motivation
- Rationale
- In the first lessons the OwS define statement has been used for defining a codesystem and its concepts. A concept hierarchy wes set up by nesting define statements.
- In this lesson you will learn how to use MS Word heading levels as an alternative and mor comfortable way to define hierarchies of OwS objects.
- What you need
- You should have worked through Lesson 1 of this tutorial in order to have a basic understanding of OwS objects. Beside this you need your MS Word with the OwS macro installed.
- Example
- This example builds upon the example introduced in Lesson 1 which again implements a simple story board:
- Storyboard: In order to foster semantic interoperability among its IT-systems a hospital wants to define unique terminologies for its clinics. Each clinic and each ward shall be assigned a unique code that shall be used throughout all IT-systems for referring to that clinic or ward.
The #heading Directive
As described in the previous lessons, each object definition has a defined definition scope. Everything defined within the definition scope of an object is associated to that object. E.g. defining a concept within the definition scope if another concept makes it a sub-concept to that concept.
MS Word chapters and sections have just the same behavior, e.g. placing a level-4 section into a level-3 section makes it a sub-section to the level-4 section. OwS makes use of this behavioral synchonicity by allowing you to match MS Word heading levels with OwS object definitions. The respective binding between a MS Word heading level and an object definition is done by the #heading directive which requires 3 arguments to be given:
- the heading level(s) that shall be linked to an object definiton (e.g. 1 for heading-1, 2 for heading-2, 1-2 for heading-1 and heading-2)
- the type of object that shall be created whenever a heading of the defined level is discovered (e.g. codesystem or concept)
- a mask that provides a mapping between the headline text and properties of the defined mapping (e.g. the mask .Name directs the interpreter to consider the full headline text as the name of the defined object)
The example below shows the use of the #heading directive to define the hierarchy of clinics and wards from lesson 1 of this tutorial.
| Style Sheet |
|
Text |
|
Translates to |
Comment
|
| OwS |
|
|
|
#heading 2 codesystem .Name
|
|
|
|
The OwS Macro interpreter is advised to generate codesystem definitions from level-2 headings. The text of the respective headlines shall be taken as the value of the codesystem's Name property (which is as well the name of the codesystem).
|
| OwS |
|
|
|
#heading 3-4 concept .Name
|
|
|
|
The OwS Macro interpreter is advised to generate concept definitions from level-3 and level-4 headings. The text of the respective headlines shall be taken as the value of the concept's Name property (which is as well the name of the concept).
|
| OwS |
|
|
|
|
|
| Überschrift 2 |
|
|
|
define codesystem (Clinics and Wards) { |
We are entering a level-2 chapter within the document. Everything within this chapter is part of the definition scope of the corresponding codesystem definition.
|
| Überschrift 3 |
|
|
|
define concept (cardiologic clinic) { |
We are entering a level-3 section within the document. Everything within this section is part of the definition scope of the concept named "cardiologic clinic".
|
| Überschrift 4 |
|
|
|
define concept (ward 51.1) { |
We are entering a level-4 section within the document. Everything within this section is part of the definition scope of the concept "ward 51.1". As the level-4 section is within the level-3 section the concept "51.1" is defined within the definition scope oft he concept "cardiologic clinic" which makes it a sub-concept of "cardiologic clinic".
|
| Überschrift 4 |
|
|
|
} define concept (ward 51.2) { |
The definiton scope of "ward 51.1" is closed due to the beginning of a new level-4 section. The concept "ward 51.2" is defined within the definition scope of the concept "cardiologic clinic" which makes it another sub-concept of this concept.
|
| Überschrift 3 |
|
|
|
} } define concept (orthopedic clinic) { |
While beginning a new level-3 section, the definition scopes associated to the open level-4 section ("ward 51.2") and level-3 section ("cardilogic clinic") are closed.
|
| Überschrift 4 |
|
|
|
define concept (ward 52.1) { |
|
| Standard |
|
|
|
} } } |
The text ends. All open definition scopes ("ward 52.1", "orthopedic clinic" and "Clinics and Wards") are closed.
|
Setting Multiple Properties from a Headline Text
In the example above the headline text was used as the name of the object that was newly created by the heading. This was because we advised the OwS macro interpreter by setting the mask argument to .Name to consider the whole headline text as the value of the property Name. The dot before Name tells the interpreter that the following phrase is a property name.
A mask may consist of any sequence of property names and delimiters, where a delimiter may be any phrase. The mask tells the OwS macro interpreter how property values are placed inside the headline text. E.g. the mask
#heading 3 concept .Display ( .Name )
would tell the interpreter that the headline text consists of the concept's display text and its name with the name put in parentheses. Using this mask, one may set both properties within a single headline:
| Style Sheet |
|
Text |
|
Translates to
|
| Überschrift 3 |
|
|
|
Cardiologic care ward for Women and Children (ward 51.1)
|
|
|
define concept (ward 51.1) {
| Display
|
($ Cardiologic care ward for Women and Children
|
|
Four important constraints must be considered with respect to masks:
- property names and delimiters must be alternating
- within the mask property names and delimiters must be separated by a space (in the headline text that space may be omitted)
- delimiters must not contain a dot (".")
- the mask must refer to a property that can act as the name for the defined object (e.g. for concepts both properties "Name" and "Code" would be allowed).
Full Example
| Style Sheet |
|
Text |
|
Comment
|
| OwS |
|
#heading 2 codesystem .Name ( .Version ) |
|
Comment
|
| OwS |
|
#heading 3-4 concept .Display ( .Name ) |
|
Comment
|
| Standard |
|
|
|
Comment
|
| Überschrift 2 |
|
Clinics and Wards (0.1) |
|
Comment
|
| OwS |
|
|
|
| URI
|
http://hospital.com/T03
|
| Description
|
This terminology lists all clinics and wards of the ABC-hospital. All internal IT-Systems shall dynamically load information about clinics and wards from this terminology.
|
| Group
|
EXA
|
|
|
|
Comment
|
| Überschrift 3 |
|
Cardiologic Clinic, Prof. Smyth (cardiologic clinic) |
|
Comment
|
| OwS |
|
|
|
| Designation[Language=de]
|
Kardiologische Klinik
|
| Definition
|
The Cardiologic Clinic (Head: Prof. Smyth) takes responsibility for all cardiologic interventions and acute care therapies.
|
|
|
|
Comment
|
| Überschrift 4 |
|
Cardiologic care ward for Women and Children (ward 51.1) |
|
Comment
|
| OwS |
|
|
|
| Designation[Language=de]
|
Kardiologische Station für Frauen und Kinder
|
|
|
|
Comment
|
| Überschrift 4 |
|
Cardiologic care ward for Intensive Care (ward 51.2) |
|
Comment
|
| OwS |
|
|
|
| Designation[Language=de]
|
Kardiologische Intensivstation
|
|
|
|
Comment
|
| Überschrift 3 |
|
Orthopedic Clinic, Prof. Miller (orthopedic clinic) |
|
Comment
|
| OwS |
|
|
|
| Designation[Language=de]
|
Orthopädische Klinik
|
| Definition
|
The Orthopedic Clinic (Head: Prof. Miller) takes responsibility for all interventions and therapies related to knee and hip problems.
|
|
|
|
Comment
|
| Überschrift 4 |
|
Orthopedic care ward for knee and hip patients (ward 52.1) |
|
Comment
|
| OwS |
|
|
|
| Designation[Language=de]
|
Orthopädische Station für Knie- und Hüft-Patienten
|
|
|
|
Comment
|