OwS Statement: set

Aus CTS2-LE
Version vom 21. September 2016, 20:56 Uhr von Caumanns (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== Syntax == <font face="courier"> {|border="0" |- style="vertical-align:top" | style="width:10em" | ''SetStatement'' | style="width:3em" | := | style="wid…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Syntax

SetStatement := set InternalReference = SetModeQualifier* AssignedValue  
AssignedValue := InternalReference
| QualifiedConcept
| { FullDefinition* } can only be used for properties with a custom type. Requires the InlineSource property of the type to be set to a codesystem object.
| ($? Text The prefix "($" advises the OwS interpreter to consider the provided text as a string (which will not be further processed)
SetModeQualifer :=  [ Mode = QualiferValueMode ] controls the overall behavior of the set-statement (see below)
|  [ Copy = QualiferValueCopy ] copy-by-value vs. copy-by-reference
|  [ Delimiter = Name ] for Mode=concat: insert a demiter between the concatenated strings
QualifierValueMode := overwrite | no-overwrite | concat | append | add
QualifierValueCopy := value | reference


Semantics of the set modes

Mode Sematics a=string
b=string
a=object
b=object
a=empty collection a=collection
b=string
a=collection
b=object
concat If a and b are strings, the result is a concatenation of both string. If a is a collection of strings, b will be appended to each element of the collection. Collection elements may be filtered by qualifiers (e.g.
set me.Designation[Language=de] =[Mode=concat] ($ (German)
appends the text "(German)" to all German designations in the collection.

ab error { b } {a1b, .. , anb} error
add a and b must be strings representing a numeric value. The result is a string holding the arithmetic sum of a and b. If a is a collection of numeric strings, b will be added to each number element of the collection. a+b error { b } {a1+b, .. , an+b} error
no-overwrite The set operation is only performed if a is empty. If a already carries a value or is a non-empty collection, the value of a will not be altered. a a { b } { a } { a }
overwrite The value of a is overwritten by b. In case a is a collection, b will be set as the only element of the collection. Collection elements may be filtered by qualifiers (e.g.
set me.Designation[Language=de] =[Mode=overwrite] NULL
removes all German language designation from the list).
b b { b } { b } { b }
append If a is a collection, b will be appended to that collection. error error { b } { a1, .., an, b } { a1, .., an, b }
default The default behavior is Overwrite for single strings/objects and Append to List for collections b b { b } { a1, .., an, b } { a1, .., an, b }

If no Mode qualifier is given, the behavior of the set-statement is like [Mode=default].