Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr Linda Bird, IHTSDO Implementation Specialist

Similar presentations


Presentation on theme: "Dr Linda Bird, IHTSDO Implementation Specialist"— Presentation transcript:

1 Dr Linda Bird, IHTSDO Implementation Specialist
SNOMED CT Queries Dr Linda Bird, IHTSDO Implementation Specialist

2 SNOMED CT Family of Languages
We need a consistent ‘family of languages’ that supports SNOMED CT related activities, including: Defining postcoordinated clinical meanings Binding SNOMED CT to information models & coding systems Defining intensional reference sets Querying SNOMED CT Representing the SNOMED CT concept model

3 SNOMED CT Languages Compositional Grammar
To define a SNOMED CT expression Expression Constraint Language To constrain the set of possible concepts or expressions Query Language To query over SNOMED CT RF2 content Template Syntax Incorporating ‘slots’ to be filled at a later time Slots added to expressions, constraints or queries SNOMED CT supports a number of predefined languages, which serve a variety of purposes – these include Compositional Grammar, Expression Constraint Language, Query Language and the Template Language. We briefly touched on this earlier, but now we’re going to explain them in a bit more detail, particularly in terms of their relevance to analytics.

4 Query Language To query over SNOMED CT RF2 content Use cases:
Querying SNOMED CT RF2 content Defining intensional reference sets Querying codes recorded in patient data The SNOMED CT Query Language, is a superset of the expression constraint language, which will also be available for comment shortly. The query language is used for quering SNOMED CT content, defining intensional reference sets, querying patient data and binding SNOMED CT to ICD-11 linearizations. The main difference between the expression constraint language and the query language is the introduction of filters, which allow the results to be further constrained based on various SNOMED CT specific characteristics. In the query language, you can filter on a specific version of SNOMED CT, restrict lexical searches to a specific language reference set, the preferred terms, the fully specified names, or the acceptable terms. You can filter on the effective time, the active status, or the module id. You can filter descriptions on their language, type, case significance, or the term itself. You can filter relationships on their characteristic type, and you can filter the members of a reference set based on specific reference set attribute values.

5 Filter Keywords Filter Operators Valid Values substrate = URI
id = sctId active = “0”, “1”, “any”, “yes”, “no” effectiveTime =, <, >, <=, >= ISO-8601 date (YYYYMMDD) moduleId = conceptReference module = {“core”, “modelComponent”, “preview”} Concept definitionStatusId = conceptReference definitionStatus = “defined”, “primitive” Relationship characteristicTypeId = conceptReference characteristicType = {“inferred”, “stated”, “additional”} The SNOMED CT Query Language, is a superset of the expression constraint language, which will also be available for comment shortly. The query language is used for quering SNOMED CT content, defining intensional reference sets, querying patient data and binding SNOMED CT to ICD-11 linearizations. The main difference between the expression constraint language and the query language is the introduction of filters, which allow the results to be further constrained based on various SNOMED CT specific characteristics. In the query language, you can filter on a specific version of SNOMED CT, restrict lexical searches to a specific language reference set, the preferred terms, the fully specified names, or the acceptable terms. You can filter on the effective time, the active status, or the module id. You can filter descriptions on their language, type, case significance, or the term itself. You can filter relationships on their characteristic type, and you can filter the members of a reference set based on specific reference set attribute values.

6 Filter Keywords and Valid Values
Filter Operators Valid Values Description languageCode = 2 char (ISO lang code) typeId = conceptReference type = {“synonym”, “fullySpecifiedName”, “definition”} term = [lexicalSearchType ":"] String preferredTerm = [lexicalSearchType ":"] String fullySpecifiedName = [lexicalSearchType ":"] String acceptableTerm = [lexicalSearchType ":"] String caseSignificanceId = conceptReference caseSignificance = {“sensitive”, “insensitive”, “initialCharInsensitive”} languageRefSetId = conceptReference languageRefSet = {“en-gb”, “en-us”, “es”} The SNOMED CT Query Language, is a superset of the expression constraint language, which will also be available for comment shortly. The query language is used for quering SNOMED CT content, defining intensional reference sets, querying patient data and binding SNOMED CT to ICD-11 linearizations. The main difference between the expression constraint language and the query language is the introduction of filters, which allow the results to be further constrained based on various SNOMED CT specific characteristics. In the query language, you can filter on a specific version of SNOMED CT, restrict lexical searches to a specific language reference set, the preferred terms, the fully specified names, or the acceptable terms. You can filter on the effective time, the active status, or the module id. You can filter descriptions on their language, type, case significance, or the term itself. You can filter relationships on their characteristic type, and you can filter the members of a reference set based on specific reference set attribute values.

7 Lexical Search Types Perl Regex term = regex:".*heart.*"
Word Prefix Any Order term = match:“hear att" Wild Card Match term = wild:"*heart*“ Default (wild card match) term = "*heart*“ The SNOMED CT Query Language, is a superset of the expression constraint language, which will also be available for comment shortly. The query language is used for quering SNOMED CT content, defining intensional reference sets, querying patient data and binding SNOMED CT to ICD-11 linearizations. The main difference between the expression constraint language and the query language is the introduction of filters, which allow the results to be further constrained based on various SNOMED CT specific characteristics. In the query language, you can filter on a specific version of SNOMED CT, restrict lexical searches to a specific language reference set, the preferred terms, the fully specified names, or the acceptable terms. You can filter on the effective time, the active status, or the module id. You can filter descriptions on their language, type, case significance, or the term itself. You can filter relationships on their characteristic type, and you can filter the members of a reference set based on specific reference set attribute values.

8 Filter Prefixes concept id, active, effectiveTime, moduleId, module
definitionStatusId, definitionStatus description id, active, effectiveTime, moduleId, module languageCode, typeId, term, caseSignificanceId, caseSignificance relationship id, active, effectiveTime, moduleId, module characteristicTypeId, characteristicType member id, active, effectiveTime, moduleId, module <reference set attributes> The SNOMED CT Query Language, is a superset of the expression constraint language, which will also be available for comment shortly. The query language is used for quering SNOMED CT content, defining intensional reference sets, querying patient data and binding SNOMED CT to ICD-11 linearizations. The main difference between the expression constraint language and the query language is the introduction of filters, which allow the results to be further constrained based on various SNOMED CT specific characteristics. In the query language, you can filter on a specific version of SNOMED CT, restrict lexical searches to a specific language reference set, the preferred terms, the fully specified names, or the acceptable terms. You can filter on the effective time, the active status, or the module id. You can filter descriptions on their language, type, case significance, or the term itself. You can filter relationships on their characteristic type, and you can filter the members of a reference set based on specific reference set attribute values.

9 Filter Conjunction and Disjunction
Filter Conjuction {{active = 1, moduleId = }} {{active = 1 AND moduleId = }} {{term = "*heart*" AND caseSignificance = initalCharInsensitive }} {{term = "*heart*" }} {{ term = "*cardiac*" }} {{term = ("*heart*" AND "*cardiac*") }} Filter Disjunction {{active = 1 OR moduleId = }} {{term = "*heart*" OR caseSignificance = initalCharInsensitive }} {{term = "*heart*" OR term = "*cardiac*"}} {{term = ("*heart*" OR "*cardiac*") }} {{term = ("*heart*", "*cardiac*") }}

10 Filter Exclusion Filter Exclusion {{active = 1, term != “*heart*” }}
No term on the concept = “*heart*” (i.e. Any term != …) {{ (active = 1 AND term= “*hear*”) MINUS term = “*card*”}} {{term = "*heart*" MINUS caseSignificance = initalCharInsensitive }} * {{term = "*heart*" }} MINUS * {{ term = "*cardiac*" }} * {{term = "*heart*" }} AND * {{ term = "*cardiac*" }} * {{term = "*heart*" }} OR * {{ term = "*cardiac*" }}

11 Query Examples substrate active effectiveTime moduleId
^ |example problem list subset| {{active = 1}} ^ |example problem list subset| {{active = yes}} ^ |example problem list subset| {{active = 0}} ^ |example problem list subset| {{active = no}} ^ |example problem list subset| {{active = any}} effectiveTime * {{ effectiveTime = }} moduleId * {{ moduleId = }} * {{ module = core }} Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

12 Query Examples definitionStatusId (concept) definitionStatus (concept)
<< |clinical finding| {{ definitionStatusId = |defined|}} definitionStatus (concept) << |clinical finding| {{ definitionStatus = defined}} << |clinical finding| {{ definitionStatus = primitive}} << |clinical finding| {{ definitionStatus = defined}} : |finding site| = << |heart structure| << |clinical finding|: |finding site| = (<< |heart structure| {{ definitionStatus = defined}}) (<< |clinical finding|: |finding site| = << |heart structure|) {{ definitionStatus = defined}}) << |clinical finding| OR ^ |example problem list subset| {{ definitionStatus = defined}} OR ^ |example problem list subset| (<< |clinical finding| OR ^ |example problem list subset|) Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

13 Query Examples characteristicTypeId, characteristicType (relationship)
<< |clinical finding| : * = * {{ characteristicType = additional }} << |clinical finding|: ( |finding site| = |heart structure| {{ characteristicType = stated }}), |associated morphology| = |infarct| << |clinical finding| {{ characteristicType = stated }}: |finding site| = |heart structure| << |clinical finding|: |finding site| = (< |heart structure| {{ term = “*heart*” }} ) {{ characteristicType = stated}} << |clinical finding|: |finding site| = < |heart structure| {{ term = “*heart*”, characteristicType = stated }} << |clinical finding|: |finding site| = |heart structure|, |associated morphology| = |infarct| {{ characteristicTypeId =   |stated relationship| }} << |clinical finding|: ( |finding site| = |heart structure|, |associated morphology| = |infarct| ) ( << |clinical finding|: |finding site| = |heart structure|, |associated morphology| = |infarct| ) Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

14 Query Examples term (description)
<< | disease | {{ term = “*heart*” }} << | disease | {{ term = regex:“.*heart.*” }} << | disease | {{ term = match:“heart” }} << |clinical finding| {{term = “*heart*” }} AND ^ |example problem list subset| {{ term = “*cardio*”}} (<< |clinical finding| AND ^ |example problem list subset|) {{ term = “*heart*”}} type, typeId (description) << | disease | {{term = “*heart*”, typeId = |synonym|}} {{term = “*heart*”, type = synonym}} Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

15 Query Examples languageCode (description)
<< | disease | {{term = “.* heart .*”, typeId = |synonym|, languageCode = “en”}} caseSignificanceId (description) << | disease | {{term = “.* HEART .*”, caseSignificanceId = |case sensitive|}} caseSignificance (description) << | disease | {{term = “* HEART*”, caseSignificance = sensitive}} Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

16 Query Examples id Filter Prefixes
* {{ Description.active = 1, Concept.active = 0}} * {{ Concept.id = }} NOTE: Please come back to this * {{ Description.id = }} * {{ Relationship.id = }} *: * {{ Relationship.id = }} = * *: R (* {{ Relationship.id = }}) = * definitionStatus (concept) << |clinical finding| {{ definitionStatusId = |defined|}} << |clinical finding| {{ definitionStatus = defined}} Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

17 Query Language languageRefSetId (description)
<< | disease | {{term = “*heart*”, type = synonym, languageRefSetId = | GB English|}} languageRefSet (description) LET en-gb = | GB English| IN << | disease | {{term = “*heart*”, type = synonym, languageRefSet = en-gb }} member (reference set) ^ |example problem list subset| {{member.active = 1}} ^ |example problem list subset| {{member.referencedComponentId.active = 1}} ^ |procedure frequency refset| {{ member |frequency| > #100 }} {{ member.xxxxx |order| > #100 }} Reference set attribute value – count and cardinality Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

18 Query Language preferredTerm (description) is a short form of . . .
<< | disease | {{preferredTerm = “*heart*”, languageRefSet = en-gb }} is a short form of . . . << | disease | {{term = “*heart*”, typeId = |synonym|, languageRefSet = en-gb, languageRefSet.member |acceptability| = |preferred| }} languageRefSet = en-gb {{ member |acceptability| = |preferred| }} }} Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

19 Query Language fullySpecifiedName (description)
<< | disease | {{fullySpecifiedName = “.* heart .*”, languageRefSet = en-gb }} is a short form of . . . << | disease | {{term = “*heart*”, typeId = |fully specified name|, languageRefSet = en-gb, languageRefSet.member |acceptability| = |preferred| }} languageRefSet = en-gb {{ member |acceptability| Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.

20 Query Language acceptableTerm (description) is a short form of . . .
<< | disease | {{acceptableTerm = “*heart*”, languageRefSet = en-gb }} is a short form of . . . << | disease | {{term = “*heart*”, typeId = |synonym|, languageRefSet = en-GB, (languageRefSet.member |acceptability| = |acceptable| OR languageRefSet.member |acceptability| = |preferred| }} Let’s look at some examples. The first query returns those diseases that have a term with the string “heart” somewhere inside. Notice that the filter condition is placed inside double braces and that the value uses a Regex expression. The second query returns only those diseases whose preferred term contains the string “heart”. In this case, the language reference set which the preferred term belongs to is assumed. If we want to make it explicit as to which language reference set we’re using, then we can use the ‘languageRefSet’ filter. In this case we have selected the Great Britain English language reference set – however we could have selected the Singapore language reference set, the Spanish language reference set, the Danish language reference set, or any other language reference set. In the next query, we actually define the substrate of the query – that is, the specific SNOMED CT edition over which the query should be executed. Often the substrate is assumed by using whichever edition is currently loaded in the tool. However, in some cases (for example, where there is more than one Edition that is available in a given country) it is important to be specific about which Edition is intended to be used. The value for version uses the SNOMED CT URI standard, in which the Edition is identified using the most dependent module and the effective time of the specific version of that edition. In the last example, the query uses a customized reference set called ‘procedure frequency refset’ which has an additional attribute column added called ‘frequency’. The query then selects those members of the reference set with a ‘frequency’ greater than 100.


Download ppt "Dr Linda Bird, IHTSDO Implementation Specialist"

Similar presentations


Ads by Google