SNOMED Documentation Search


Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following ABNF definition specifies the SNOMED CT Template Syntaxtemplate syntax

templateSlot =  templateReplaceSlot / templateRemoveSlot=  templateReplacementSlot / templateInformationSlot

templateReplacementSlot = conceptReplacementSlot / expressionReplacementSlot / tokenReplacementSlot / concreteValueReplacementSlot

conceptReplacementSlot templateReplaceSlot = "[[" ws ws  "+" ws  "id" ws [ replaceInfo "(" ws expressionConstraint ws ")" ws] [slotInfo slotName ws] "]]"templateRemoveSlot = "[[" ws [slotInfo

expressionReplacementSlot  "[[" ws  "+" ws [ "scg" ws] [ "(" ws expressionConstraint ws ")" ws] [slotName ws] "]]"

replaceInfo = conceptReplaceInfo / expressionReplaceInfo / constraintReplaceInfo / stringReplaceInfo

conceptReplaceInfo = "id" [ ws tokenReplacementSlot "[[" ws  "+" ws  "tok" ws [ "(" ws expressionConstraint slotTokenSet ws ")" ]expressionReplaceInfo"scg" [ ws " ws] [slotName ws] "]]"

concreteValueReplacementSlot = stringReplacementSlot / integerReplacementSlot / decimalReplacementSlot

stringReplacementSlot  = "[[" ws "+" ws "str" ws [ "(" ws expressionConstraint slotStringSet ws ")" ]constraintReplaceInfo = "ecl"" ws] [slotName ws] "]]"

integerReplacementSlot   = "[[" ws "+" ws "int" ws [  [ ws "(" ws expressionConstraintTemplate slotIntegerSet ws ")" ]
stringReplaceInfo"str" " ws] [slotName ws] "]]"

decimalReplacementSlot = "[[" ws "+" ws "dec" ws [ [ ws "(" ws slotStringSet slotDecimalSet ws ")" ]

slotStringSet = slotString *(ws "," ws slotString)

slotInfo = [slotCardinality ws] [slotName ws] [slotReference ws]

slotCardinality  = nonNegativeInteger ".." (nonNegativeInteger / "*")

slotName = "@" slotString

slotReference = "$" slotString

slotString = *nonQuoteString / (doubleQM *nondoubleQuoteString doubleQM) /  (singleQM *nonsingleQuoteString singleQM)

nonQuoteString = %x21 / %x23 / %x25-26 / %x28-3F / %x41-5A / %x5C / %x5E-7E   ; no ws, quotes, at, or dollar

nondoubleQuoteString = %x21 / %x23 / %x25-3F / %x41-7E   ; no ws, double quotes, at or dollar

" ws] [slotName ws] "]]" 

slotTokenSet = slotToken *(mws slotToken)

slotStringSet  = slotString *(mws slotString)

slotIntegerSet = ( "#" integerValue / slotIntegerRange) *(mws ("#" integerValue / slotIntegerRange))

slotDecimalSet( "#" decimalValue / slotDecimalRange) *(mws ("#" decimalValue / slotDecimalRange))

slotIntegerRange = ( slotIntegerMinimum to [ slotIntegerMaximum ] ) / ( to slotIntegerMaximum )

slotIntegerMinimum = [ exclusiveMinimum ] "#" integerValue

slotIntegerMaximum = [ exclusiveMaximum ] "#" integerValue

slotDecimalRange = ( slotDecimalMinimum to [ slotDecimalMaximum ] ) / ( to slotDecimalMaximum )

slotDecimalMinimum = [ exclusiveMinimum ] "#" DecimalValue

slotDecimalMaximum = [ exclusiveMaximum ] "#" DecimalValue

exclusiveMinimum = ">"

exclusiveMaximum = "<"

slotName  = "@" (nonQuoteStringValue / slotString)

slotToken = definitionStatus / memberOf / constraintOperator / conjunction / disjunction / exclusion / reverseFlag / expressionComparisonOperator / numericComparisonOperator / stringComparisonOperator

slotString  = QM stringValue QM

nonQuoteStringValue  = *(%x21 / %x23nonsingleQuoteString = %x21-23 / %x25-26 / %x28-3F / %x41-7E   5A / %x5C / %x5E-7E)   ; string with no ws, single quotes, at  at or dollarsquare brackets

nonNegativeInteger =  (%x31-39 *(%x30-39) ) / %x30    ; (digitNonZero *digit) / zero

doubleQM = %x22   ; Double quotation mark

templateInformationSlot  = "[[" ws slotInformation ws "]]"

slotInformation = [cardinality ws] [slotName ws]singleQM = %x27   ; Single quotation mark


Please note that three some of the rules used referenced above are defined in other specificationselsewhere. In particular,

These rules must be combined with the Template Syntax defined above.definitionStatus is defined in SNOMED CT compositional grammar, and expressionConstraint, cardinality, to, QM, stringValue, integerValue, decimalValue, ws, mws, memberOf, constraintOperator, conjunction, disjunction, exclusion, reverseFlag, expressionComparisonOperator, numericComparisonOperator and stringComparisonOperator are all defined in the expression constraint language syntax. These rule definitions must therefore be combined with the above syntax before it can be used.