Search



Versions Compared

Key

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

The following ABNF definition specifies the Long Syntax the SNOMED CT Expression Constraint Language. Please note that all keywords are case insensitive.
This ABNF syntax and the ANTLR syntax is maintained in the SNOMED Expression Constraint Language GitHub repository.

expressionConstraint = ws ( refinedExpressionConstraint / compoundExpressionConstraint / dottedExpressionConstraint / subExpressionConstraint ) ws
refinedExpressionConstraint = subExpressionConstraint ws ":" ws eclRefinement
compoundExpressionConstraint = conjunctionExpressionConstraint / disjunctionExpressionConstraint / exclusionExpressionConstraint
conjunctionExpressionConstraint = subExpressionConstraint 1*(ws conjunction ws subExpressionConstraint)
disjunctionExpressionConstraint = subExpressionConstraint 1*(ws disjunction ws subExpressionConstraint)
exclusionExpressionConstraint = subExpressionConstraint ws exclusion ws subExpressionConstraint
dottedExpressionConstraint = subExpressionConstraint 1*(ws dottedExpressionAttribute)
dottedExpressionAttribute = dot ws eclAttributeName
subExpressionConstraint= [constraintOperator ws] ( ( [memberOf ws] (eclFocusConcept / "(" ws expressionConstraint ws ")") *(ws memberFilterConstraint)) / (eclFocusConcept / "(" ws expressionConstraint ws ")") ) *(ws (descriptionFilterConstraint / conceptFilterConstraint)) [ws historySupplement]
eclFocusConcept = eclConceptReference / wildCard / altIdentifier
dot = "."
memberOf = ( "^" / ("

expressionConstraint = ws ( refinedExpressionConstraint / compoundExpressionConstraint / dottedExpressionConstraint / subExpressionConstraint ) ws

refinedExpressionConstraint = subExpressionConstraint ws ":" ws eclRefinement

compoundExpressionConstraint = conjunctionExpressionConstraint / disjunctionExpressionConstraint / exclusionExpressionConstraint

conjunctionExpressionConstraint = subExpressionConstraint 1*(ws conjunction ws subExpressionConstraint)

disjunctionExpressionConstraint = subExpressionConstraint 1*(ws disjunction ws subExpressionConstraint)

exclusionExpressionConstraint = subExpressionConstraint ws exclusion ws subExpressionConstraint

dottedExpressionConstraint = subExpressionConstraint 1*(ws dottedExpressionAttribute)

dottedExpressionAttribute = dot ws eclAttributeName

subExpressionConstraint = [constraintOperator ws] [memberOf ws] (eclFocusConcept / "(" ws expressionConstraint ws ")") *(ws filterConstraint ws)

eclFocusConcept = eclConceptReference / wildCard

dot = "."

memberOf = "^" / ("
m"/"M") ("e"/"E") ("m"/"M") ("b"/"B") ("e"/"E") ("r"/"R") ("o"/"O") ("f"/"F")

eclConceptReference = conceptId [ws "|" ws term ws "|"]

eclConceptReferenceSet = "(" ws eclConceptReference *(mws eclConceptReference) ws ")"

conceptId = sctId

term = 1*nonwsNonPipe *( 1*SP 1*nonwsNonPipe )

wildCard = "*" / ( ("a"/"A") ("n"/"N") ("y"/"Y") )

constraintOperator = childOf / childOrSelfOf / descendantOrSelfOf / descendantOf / parentOf / parentOrSelfOf / ancestorOrSelfOf / ancestorOf

descendantOf = "<" / ( ("d"/"D") ("e"/"E") ("s"/"S") ("c"/"C") ("e"/"E") ("
 ) [ ws "[" ws (refsetFieldNameSet / wildCard) ws "]" ]
refsetFieldNameSet = refsetFieldName *( ws "," ws refsetFieldName )
refsetFieldName = 1*alpha
eclConceptReference = conceptId [ws "|" ws term ws "|"]
eclConceptReferenceSet = "(" ws eclConceptReference 1*(mws eclConceptReference) ws ")"
conceptId = sctId
term = 1*nonwsNonPipe *( 1*SP 1*nonwsNonPipe )
altIdentifier = (QM altIdentifierSchemeAlias "#" altIdentifierCodeWithinQuotes QM / altIdentifierSchemeAlias "#" altIdentifierCodeWithoutQuotes) [ws "|" ws term ws "|"]
altIdentifierSchemeAlias = alpha *(dash / alpha / integerValue)
altIdentifierCodeWithinQuotes = 1*anyNonEscapedChar
altIdentifierCodeWithoutQuotes = 1*(alpha / digit / dash / "." / "_")
wildCard = "*" / ( ("a"/"A") ("n"/"N") ("
d
y"/"
D
Y")
("a"/"A") ("n"/"N") ("t"/"T") ("o"/"O") ("f"/"F") mws )descendantOrSelfOf = "<<" / (
 )
constraintOperator = childOf / childOrSelfOf / descendantOrSelfOf / descendantOf / parentOf / parentOrSelfOf / ancestorOrSelfOf / ancestorOf / top / bottom
descendantOf = "<" / ( ("d"/"D") ("e"/"E") ("s"/"S") ("c"/"C") ("e"/"E") ("n"/"N") ("d"/"D") ("a"/"A") ("n"/"N") ("t"/"T") ("o"/"O") ("
r
f"/"
R
F") mws )
descendantOrSelfOf = "<<" / ( ("
s
d"/"
S
D") ("e"/"E") ("
l
s"/"
L
S") ("
f
c"/"
F
C") ("
o
e"/"
O
E") ("
f
n"/"
F
N")
mws )childOf = "<!" / (("c
 ("d"/"
C
D") ("
h
a"/"
H
A") ("
i
n"/"
I
N") ("
l
t"/"
L
T")
("d
 ("o"/"O") ("r"/"R") ("s"/"S") ("e"/"E") ("l"/"L") ("f"/"
D
F") ("o"/"O") ("f"/"F") mws
)childOrSelfOf = "<<
 )
childOf = "<!" / (("c"/"C") ("h"/"H") ("i"/"I") ("l"/"L") ("d"/"D")
 
 ("o"/"O") ("
r
f"/"
R
F"
) ("s"/"S") ("e
) mws )
childOrSelfOf = "<<!" / (("c"/"
E
C") ("
l
h"/"
L
H") ("
f
i"/"
F
I") ("
o
l"/"
O
L") ("
f
d"/"
F
D")
mws )
ancestorOf = ">" / ( ("a
 ("o"/"
A
O") ("
n
r"/"
N
R") ("
c
s"/"
C
S") ("e"/"E") ("
s
l"/"
S
L") ("
t
f"/"
T
F") ("o"/"O")
("r"/"R") ("o"/"O") ("
 ("f"/"F") mws
)ancestorOrSelfOf = ">>" / (
 )
ancestorOf = ">" / ( ("a"/"A") ("n"/"N") ("c"/"C") ("e"/"E") ("s"/"S") ("t"/"T") ("o"/"O") ("r"/"R") ("o"/"O") ("
r
f"/"
R
F")
("s"/"S") ("e
 mws )
ancestorOrSelfOf = ">>" / ( ("a"/"
E
A") ("
l
n"/"
L
N") ("
f
c"/"
F
C") ("
o
e"/"
O
E") ("
f
s"/"
F
S")
mws )parentOf = ">!" / (("p
 ("t"/"
P
T") ("
a
o"/"
A
O") ("r"/"R") ("
e
o"/"
E
O") ("
n
r"/"
N
R") ("
t
s"/"
T
S") ("
o
e"/"
O
E") ("
f
l"/"L") ("f"/"F") ("o"/"O") ("f"/"F") mws
)parentOrSelfOf = ">>
 )
parentOf = ">!" / (("p"/"P") ("a"/"A") ("r"/"R") ("e"/"E") ("n"/"N") ("t"/"T")
 
 ("o"/"O") ("
r
f"/"
R
F") mws )
parentOrSelfOf = ">>!" / (("
s
p"/"
S
P") ("
e
a"/"
E
A") ("
l
r"/"
L
R") ("
f
e"/"
F
E") ("
o
n"/"
O
N") ("
f
t"/"
F
T")
mws )conjunction = (("a
 ("o"/"
A
O") ("
n
r"/"
N
R") ("
d
s"/"
D
S")
mws) / ","disjunction =
 ("
o
e"/"
O
E") ("
r
l"/"
R
L")
mwsexclusion =
 ("
m
f"/"
M
F") ("o"/"O") ("
i
f"/"
I
F") mws )
top = "!!>" / (("
n
t"/"
N
T") ("
u
o"/"
U
O") ("
s
p"/"
S
P")
mws

eclRefinement = subRefinement ws [conjunctionRefinementSet / disjunctionRefinementSet]

conjunctionRefinementSet = 1*(ws conjunction ws subRefinement)

disjunctionRefinementSet = 1*(ws disjunction ws subRefinement)

subRefinement = eclAttributeSet / eclAttributeGroup / "(" ws eclRefinement ws ")"

eclAttributeSet = subAttributeSet ws [conjunctionAttributeSet / disjunctionAttributeSet]

conjunctionAttributeSet = 1*(ws conjunction ws subAttributeSet)

disjunctionAttributeSet = 1*(ws disjunction ws subAttributeSet)

subAttributeSet = eclAttribute / "(" ws eclAttributeSet ws ")"

eclAttributeGroup = ["[" cardinality "]" ws] "{" ws eclAttributeSet ws "}"

eclAttribute = ["[" cardinality "]" ws] [reverseFlag ws] eclAttributeName ws (expressionComparisonOperator ws subExpressionConstraint / numericComparisonOperator ws "#" numericValue / stringComparisonOperator ws QM stringValue QM / booleanComparisonOperator ws booleanValue)

cardinality = minValue to maxValue

minValue = nonNegativeIntegerValue

to = ".." / (mws ("t"/"T") ("o"/"O") mws)

maxValue = nonNegativeIntegerValue / many

many = "*" / ( ("m"/"M") ("a"/"A") ("n"/"N") ("y"/"Y"))

reverseFlag = ( ("r"/"R") ("e"/"E") ("v"/"V") ("e"/"E") ("r"/"R") ("s"/"S")
 mws )
bottom = "!!<" / (("b"/"B") ("o"/"O") ("t"/"T") ("t"/"T") ("o"/"O") ("m"/"M") mws )
conjunction = (("a"/"A") ("n"/"N") ("d"/"D") mws) / ","
disjunction = ("o"/"O") ("r"/"R") mws
exclusion = ("m"/"M") ("i"/"I") ("n"/"N") ("u"/"U") ("s"/"S") mws
eclRefinement = subRefinement ws [conjunctionRefinementSet / disjunctionRefinementSet]
conjunctionRefinementSet = 1*(ws conjunction ws subRefinement)
disjunctionRefinementSet = 1*(ws disjunction ws subRefinement)
subRefinement = eclAttributeSet / eclAttributeGroup / "(" ws eclRefinement ws ")"
eclAttributeSet = subAttributeSet ws [conjunctionAttributeSet / disjunctionAttributeSet]
conjunctionAttributeSet = 1*(ws conjunction ws subAttributeSet)
disjunctionAttributeSet = 1*(ws disjunction ws subAttributeSet)
subAttributeSet = eclAttribute / "(" ws eclAttributeSet ws ")"
eclAttributeGroup = ["[" cardinality "]" ws] "{" ws eclAttributeSet ws "}"
eclAttribute = ["[" cardinality "]" ws] [reverseFlag ws] eclAttributeName ws (expressionComparisonOperator ws subExpressionConstraint / numericComparisonOperator ws "#" numericValue / stringComparisonOperator ws (typedSearchTerm / typedSearchTermSet) / booleanComparisonOperator ws booleanValue)
cardinality = minValue to maxValue
minValue = nonNegativeIntegerValue
to = ".." / (mws ("t"/"T") ("o"/"O") mws)
maxValue = nonNegativeIntegerValue / many
many = "*" / ( ("m"/"M") ("a"/"A") ("n"/"N") ("y"/"Y"))
reverseFlag = ( ("r"/"R") ("e"/"E") ("v"/"V") ("e"/"E") ("r"/"R") ("s"/"S") ("e"/"E") ("o"/"O") ("f"/"F")) / "R"
eclAttributeName = subExpressionConstraint
expressionComparisonOperator = "=" / "!=" / ("n"/"N") ("o"/"O") ("t"/"T") ws "=" / "<>"
numericComparisonOperator = "=" / "!=" / ("n"/"N") ("o"/"O") ("t"/"T") ws "=" / "<>" / "<=" / "<" / ">=" / ">"
timeComparisonOperator = "=" / "!=" / ("n"/"N") ("o"/"O") ("t"/"T") ws "=" / "<>" / "<=" / "<" / ">=" / ">"
stringComparisonOperator = "=" / "!=" / ("n"/"N") ("o"/"O") ("t"/"T") ws "=" / "<>"
booleanComparisonOperator = "=" / "!=" / ("n"/"N") ("o"/"O") ("t"/"T") ws "=" / "<>"
idComparisonOperator = "=" / "!=" / ("n"/"N") ("o"/"O") ("t"/"T") ws "=" / "<>"
descriptionFilterConstraint = "{{" ws [ "d" / "D" ] ws descriptionFilter *(ws "," ws descriptionFilter) ws "}}"
descriptionFilter = termFilter / languageFilter / typeFilter / dialectFilter / moduleFilter / effectiveTimeFilter / activeFilter / descriptionIdFilter
descriptionIdFilter = descriptionIdKeyword ws idComparisonOperator ws (descriptionId / descriptionIdSet)
descriptionIdKeyword = ("i"/"I") ("d"/"D")
descriptionId = sctId
descriptionIdSet = "(" ws descriptionId *(mws descriptionId) ws ")"
termFilter = termKeyword ws stringComparisonOperator ws (typedSearchTerm / typedSearchTermSet)
termKeyword = ("t"/"T") ("e"/"E") ("r"/"R") ("m"/"M")
typedSearchTerm = ( [ matchKeyword ws ":" ws ] matchSearchTermSet ) / ( wild ws ":" ws wildSearchTermSet )
typedSearchTermSet = "(" ws typedSearchTerm *(mws typedSearchTerm) ws ")"
wild = ("w"/"W") ("i"/"I") ("l"/"L") ("d"/"D")
matchKeyword = ("m"/"M") ("a"/"A") ("t"/"T") ("c"/"C") ("h"/"H")
matchSearchTerm = 1*(nonwsNonEscapedChar / escapedChar)
matchSearchTermSet = QM ws matchSearchTerm *(mws matchSearchTerm) ws QM
wildSearchTerm = 1*(anyNonEscapedChar / escapedWildChar)
wildSearchTermSet = QM wildSearchTerm QM
languageFilter = language ws booleanComparisonOperator ws (languageCode / languageCodeSet)
language = ("l"/"L") ("a"/"A") ("n"/"N") ("g"/"G") ("u"/"U") ("a"/"A") ("g"/"G") ("e"/"E")
languageCode = 2alpha
languageCodeSet = "(" ws languageCode *(mws languageCode) ws ")"
typeFilter = typeIdFilter / typeTokenFilter
typeIdFilter = typeId ws booleanComparisonOperator ws (subExpressionConstraint / eclConceptReferenceSet)
typeId = ("t"/"T") ("y"/"Y") ("p"/"P") ("e"/"E") ("i"/"I") ("d"/"D")
typeTokenFilter = type ws booleanComparisonOperator ws (typeToken / typeTokenSet)
type = ("t"/"T") ("y"/"Y") ("p"/"P") ("e"/"E")
typeToken = synonym / fullySpecifiedName / definition
typeTokenSet = "(" ws typeToken *(mws typeToken) ws ")"
synonym = ("s"/"S") ("y"/"Y") ("n"/"N") [ ("o"/"O") ("n"/"N") ("y"/"Y") ("m"/"M") ]
fullySpecifiedName = ( ("f"/"F") ("s"/"S") ("n"/"N") ) / ( ("f"/"F") ("u"/"U") ("l"/"L") ("l"/"L") ("y"/"Y") ("s"/"S") ("p"/"P") ("e"/"E") ("c"/"C") ("i"/"I") ("f"/"F") ("i"/"I") ("e"/"E") ("d"/"D") ("n"/"N") ("a"/"A") ("m"/"M") ("e"/"E") )
definition = ("d"/"D") ("e"/"E") ("f"/"F") [ ("i"/"I") ("n"/"N") ("i"/"I") ("t"/"T") ("i"/"I") ("o"/"O") ("n"/"N") ]
dialectFilter = (dialectIdFilter / dialectAliasFilter) [ ws acceptabilitySet ]
dialectIdFilter = dialectId ws booleanComparisonOperator ws (subExpressionConstraint / dialectIdSet)
dialectId = ("d"/"D") ("i"/"I") ("a"/"A") ("l"/"L") ("e"/"E") ("c"/"C") ("t"/"T") ("i"/"I") ("d"/"D")
dialectAliasFilter = dialect ws booleanComparisonOperator ws (dialectAlias / dialectAliasSet)
dialect = ("d"/"D") ("i"/"I") ("a"/"A") ("l"/"L") ("e"/"E") ("c"/"C") ("t"/"T")
dialectAlias = alpha *( dash / alpha / integerValue)
dialectAliasSet = "(" ws dialectAlias [ws acceptabilitySet] *(mws dialectAlias [ws acceptabilitySet]) ws ")"
dialectIdSet = "(" ws eclConceptReference [ws acceptabilitySet] *(mws eclConceptReference [ws acceptabilitySet] ) ws ")"
acceptabilitySet = acceptabilityConceptReferenceSet / acceptabilityTokenSet
acceptabilityConceptReferenceSet = "(" ws eclConceptReference *(mws eclConceptReference) ws ")"
acceptabilityTokenSet = "(" ws acceptabilityToken *(mws acceptabilityToken) ws ")"
acceptabilityToken = acceptable / preferred
acceptable = ("a"/"A") ("c"/"C") ("c"/"C") ("e"/"E") ("p"/"P") ("t"/"T") [ ("a"/"A") ("b"/"B") ("l"/"L") ("e"/"E") ]
preferred = ("p"/"P") ("r"/"R") ("e"/"E") ("
o
f"/"
O
F") ("
f
e"/"
F
E")
)
 ("r"/"R"

eclAttributeName = subExpressionConstraint

expressionComparisonOperator = "=
) [ ("r"/"
!=
R"
/
) ("
n
e"/"
N
E") ("
o
d"/"
O
D") ]
conceptFilterConstraint = "{{" ws ("
t
c" / "
T
C") ws
"=" / "<>"

numericComparisonOperator = "=" / "!=" / ("n"/"N") ("o"/"O") ("t"/"T") ws "=" / "<>" / "<=" / "<" / ">=" / ">"

stringComparisonOperator = "=" / "!=" /
 conceptFilter *(ws "," ws conceptFilter) ws "}}"
conceptFilter = definitionStatusFilter / moduleFilter / effectiveTimeFilter / activeFilter
definitionStatusFilter = definitionStatusIdFilter / definitionStatusTokenFilter
definitionStatusIdFilter = definitionStatusIdKeyword ws booleanComparisonOperator ws (subExpressionConstraint / eclConceptReferenceSet)
definitionStatusIdKeyword = ("d"/"D") ("e"/"E") ("f"/"F") ("i"/"I") ("n"/"N") ("
o
i"/"
O
I") ("t"/"T")
ws
 ("
=
i"/"
<>"booleanComparisonOperator = "=
I") ("o"/"
!=
O"
/
) ("n"/"N") ("
o
s"/"
O
S") ("t"/"T")
ws
 ("
=
a"/"
<>"

filterConstraint = "{{" ws filter *(ws "," ws filter) ws "}}"

filter = termFilter / languageFilter / typeFilter / dialectFilter

termFilter = termKeyword ws booleanComparisonOperator ws (typedSearchTerm / typedSearchTermSet)

termKeyword = ("t"/"T") ("e"/"E") ("r"/"R") ("m"/"M")

typedSearchTerm = ( [ match ws ":" ws ] matchSearchTermSet ) / ( wild ws ":" ws wildSearchTermSet )

typedSearchTermSet = "(" ws typedSearchTerm *(mws typedSearchTerm) ws ")"

wild = ("w"/"W")
A") ("t"/"T") ("u"/"U") ("s"/"S") ("i"/"I") ("d"/"D")
definitionStatusTokenFilter = definitionStatusKeyword ws booleanComparisonOperator ws (definitionStatusToken / definitionStatusTokenSet)
definitionStatusKeyword = ("d"/"D") ("e"/"E") ("f"/"F") ("i"/"I") ("
l
n"/"
L
N") ("
d
i"/"
D
I")
match =
 ("
m
t"/"
M
T") ("
a
i"/"
A
I") ("
t
o"/"
T
O") ("
c
n"/"
C
N") ("
h
s"/"
H
S")

matchSearchTerm = 1*(nonwsNonEscapedChar / escapedChar)

matchSearchTermSet = QM ws matchSearchTerm *(mws matchSearchTerm) ws QM

wildSearchTerm = 1*(anyNonEscapedChar / escapedWildChar)

wildSearchTermSet = QM wildSearchTerm QM

languageFilter = language ws booleanComparisonOperator ws (languageCode / languageCodeSet)

language = ("l"/"L") ("a"/"A") ("n"/"N") ("g"/"G") ("u"/"U") ("a"/"A") ("g"/"G") ("e"/"E")

languageCode = 2alpha

languageCodeSet = "(" ws languageCode *(mws languageCode) ws ")"

typeFilter = typeIdFilter / typeTokenFilter

typeIdFilter = typeId ws booleanComparisonOperator ws (eclConceptReference / eclConceptReferenceSet)

typeId = ("t"/"T") ("y"/"Y") ("p"/"P")
 ("t"/"T") ("a"/"A") ("t"/"T") ("u"/"U") ("s"/"S")
definitionStatusToken = primitiveToken / definedToken
definitionStatusTokenSet = "(" ws definitionStatusToken *(mws definitionStatusToken) ws ")"
primitiveToken = ("p"/"P") ("r"/"R") ("i"/"I") ("m"/"M") ("i"/"I") ("t"/"T") ("i"/"I") ("v"/"V") ("e"/"E")
definedToken = ("d"/"D") ("e"/"E") ("f"/"F") ("i"/"I") ("
d
n"/"
D
N")

typeTokenFilter = type ws booleanComparisonOperator ws (typeToken / typeTokenSet)

type = ("t"/"T") ("y"/"Y") ("p"/"P") ("e"/"E")

typeToken = synonym / fullySpecifiedName / definition

typeTokenSet = "(" ws typeToken *(mws typeToken) ws ")"

synonym = ("s"/"S") ("y"/"Y") ("n"/"N") [ ("o"/"O") ("n"/"N") ("y"/"Y") ("m"/"M") ]

fullySpecifiedName = ( (
 ("e"/"E") ("d"/"D")
moduleFilter = moduleIdKeyword ws booleanComparisonOperator ws (subExpressionConstraint / eclConceptReferenceSet)
moduleIdKeyword = ("m"/"M") ("o"/"O") ("d"/"D") ("u"/"U") ("l"/"L") ("e"/"E") ("i"/"I") ("d"/"D")
effectiveTimeFilter = effectiveTimeKeyword ws timeComparisonOperator ws ( timeValue / timeValueSet )
effectiveTimeKeyword = ("e"/"E") ("f"/"F") ("
s
f"/"
S
F") ("
n
e"/"
N
E")
) / ( 
 ("
f
c"/"
F
C")
 
 ("
u
t"/"
U
T")
 
 ("
l
i"/"
L
I")
 
 ("
l
v"/"
L
V")
 
 ("
y
e"/"
Y
E")
 
 ("
s
t"/"
S
T")
 
 ("
p
i"/"
P
I")
 
 ("
e
m"/"
E
M")
 
 ("
c
e"/"
C") ("i"/"I") ("f"/"F") ("i"/"I") ("e"/"E") ("d"/"D") ("n"/"N") ("a"/"A") ("m"/"M") ("e"/"E")  )

definition = ("d"/"D") ("e"/"E") ("f"/"F") [ ("i"/"I") ("n"/"N") ("i"/"I") ("t"/"T") ("i"/"I") ("o"/"O") ("n"/"N")  ]

dialectFilter = (dialectIdFilter / dialectAliasFilter) [ ws acceptabilitySet ]

dialectIdFilter = dialectId ws booleanComparisonOperator ws (eclConceptReference / dialectIdSet)

dialectId = ("d"/"D") ("i"/"I") ("a"/"A") ("l"/"L") ("e"/"E")
E")
timeValue = QM [ year month day ] QM
timeValueSet = "(" ws timeValue *(mws timeValue) ws ")"
year = digitNonZero digit digit digit
month = "01" / "02" / "03" / "04" / "05" / "06" / "07" / "08" / "09" / "10" / "11" / "12"
day = "01" / "02" / "03" / "04" / "05" / "06" / "07" / "08" / "09" / "10" / "11" / "12" / "13" / "14" / "15" / "16" / "17" / "18" / "19" / "20" / "21" / "22" / "23" / "24" / "25" / "26" / "27" / "28" / "29" / "30" / "31"
activeFilter = activeKeyword ws booleanComparisonOperator ws activeValue
activeKeyword = ("a"/"A") ("c"/"C") ("t"/"T") ("i"/"I") ("v"/"V") ("
d
e"/"
D
E")

dialectAliasFilter = dialect ws booleanComparisonOperator ws (dialectAlias / dialectAliasSet)

dialect = ("d"/"D") ("i"/"I") ("a"/"A") ("l"/"L") ("e"/"E") ("c"/"C") ("t"/"T")

dialectAlias = alpha *( dash / alpha / integerValue)

dialectAliasSet = "(" ws dialectAlias [ws acceptabilitySet] *(mws dialectAlias [ws acceptabilitySet]) ws ")"

dialectIdSet = "(" ws eclConceptReference [ws acceptabilitySet] *(mws eclConceptReference [ws acceptabilitySet] ) ws ")"

acceptabilitySet = acceptabilityIdSet / acceptabilityTokenSet

acceptabilityIdSet = eclConceptReferenceSet

acceptabilityTokenSet = "(" ws acceptabilityToken *(mws acceptabilityToken) ws ")"

acceptabilityToken = acceptable / preferred

acceptable = ("a"/"A") ("c"/"C") ("c"/"C") ("e"/"E") ("p"/"P") ("t"/"T") [ ("a"/"A") ("b"/"B") ("l"/"L") ("e"/"E")  ]

preferred = ("p"/"P") ("r"/"R") ("e"/"E") ("f"/"F") ("e"/"E") ("r"/"R") [ ("r"/"R") ("e"/"E") ("d"/"D")  ]

numericValue =

activeValue = activeTrueValue / activeFalseValue
activeTrueValue = "1" / "true"
activeFalseValue = "0" / "false"
memberFilterConstraint = "{{" ws ("m" / "M") ws memberFilter *(ws "," ws memberFilter) ws "}}"
memberFilter = moduleFilter / effectiveTimeFilter / activeFilter / memberFieldFilter
memberFieldFilter = refsetFieldName ws (expressionComparisonOperator ws subExpressionConstraint / numericComparisonOperator ws "#" numericValue / stringComparisonOperator ws (typedSearchTerm / typedSearchTermSet) / booleanComparisonOperator ws booleanValue / ws timeComparisonOperator ws (timeValue / timeValueSet) )
historySupplement = "{{" ws "+" ws historyKeyword [ historyProfileSuffix / ws historySubset ] ws "}}"
historyKeyword = ("h"/"H") ("i"/"I") ("s"/"S") ("t"/"T") ("o"/"O") ("r"/"R") ("y"/"Y")
historyProfileSuffix = historyMinimumSuffix / historyModerateSuffix / historyMaximumSuffix
historyMinimumSuffix = ("-"/"_") ("m"/"M") ("i"/"I") ("n"/"N")
historyModerateSuffix = ("-"/"_") ("m"/"M") ("o"/"O") ("d"/"D")
historyMaximumSuffix = ("-"/"_") ("m"/"M") ("a"/"A") ("x"/"X")
historySubset = "(" ws expressionConstraint ws ")"
numericValue = ["-"/"+"] (decimalValue / integerValue)

stringValue
 
 = 1*(anyNonEscapedChar / escapedChar)

integerValue
 
 =
 digitNonZero
 digitNonZero *digit / zero

decimalValue
 
 = integerValue "." 1*digit

booleanValue
 
 = true / false

true
 
 = ("t"/"T") ("r"/"R") ("u"/"U") ("e"/"E")

false
 
 = ("f"/"F") ("a"/"A") ("l"/"L") ("s"/"S") ("e"/"E")

nonNegativeIntegerValue
 
 = (digitNonZero *digit ) / zero

sctId
 
 = digitNonZero 5*17( digit )

ws
 
 = *( SP / HTAB / CR / LF / comment ) ; optional white space

mws
 
 = 1*( SP / HTAB / CR / LF / comment ) ; mandatory white space

comment
 
 = "/*" *(nonStarChar / starWithNonFSlash) "*/"

nonStarChar
 
 = SP / HTAB / CR / LF / %x21-29 / %x2B-7E /UTF8-2 / UTF8-3 / UTF8-4

starWithNonFSlash
 
 = %x2A nonFSlash

nonFSlash
 
 = SP / HTAB / CR / LF / %x21-2E / %x30-7E /UTF8-2 / UTF8-3 / UTF8-4

SP
 
 = %x20 ; space

HTAB
 
 = %x09 ; tab

CR
 
 = %x0D ; carriage return

LF
 
 = %x0A ; line feed

QM
 
 = %x22 ; quotation mark

BS
 
 = %x5C ; back slash

star
 
 =
%x2A 
 %x2A ; asterisk

digit
 
 = %x30-39

zero
 
 = %x30

digitNonZero
 
 = %x31-39

nonwsNonPipe
 
 = %x21-7B / %x7D-7E / UTF8-2 / UTF8-3 / UTF8-4

anyNonEscapedChar
 
 = SP / HTAB / CR / LF / %x20-21 / %x23-5B / %x5D-7E / UTF8-2 / UTF8-3 / UTF8-4

escapedChar
 
 = BS QM / BS BS

escapedWildChar
 
 = BS QM / BS BS / BS star

nonwsNonEscapedChar
 
 =
 %x21
 %x21 / %x23-5B / %x5D-7E / UTF8-2 / UTF8-3 / UTF8-4

alpha
 
 = %x41-5A / %x61-7A

dash
 
 = %x2D

UTF8-2
 
 = %xC2-DF UTF8-tail

UTF8-3
 
 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )

UTF8-4
 
 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / %xF4 %x80-8F 2( UTF8-tail )

UTF8-tail
 
 = %x80-BF