Tip:
Highlight text to annotate it
X
Hi! This is Sonja from B2i Healthcare.
Today I will show you how to use Snow Owl for semantic queries
in ESCG which is the Extended SNOMED CT Compositional Grammar.
We will run a few sample queries to get familiar with different kinds of
expressions and operators
and I will also show how to create query files
and use Content Assist to write script. Snow Owl includes an editor and
execution environment for ESCG expressions.
This is the editor. ESCG is a formal grammar
to compose expressions that include operators
and defined concept identifiers. You can see the operators here in red
here's one, this is one here
and in black these are the concept identifiers.
What you see in blue
with the green bars is optional text.
It means
it will not be processed when running the query but
in practice it's usually added
because it facilitates reading an expression.
All of the operators and grammar constructs
are supported as defined in the NHS Logical Record Architecture specification
which is itself an extension of the
HL7 TermInfo specification. ESCG expressions
are useful because you can query concepts by
their relationships as opposed to their human readable descriptions.
You can see, for example, in this query there is a relationship of a finding site
in the structure of the cardiovascular system,
so you can use it for semantic querying.
Here is an overview of the different operators
that we will be using today this is what
appears in red in the query script
and if you want to find more detailed information,
we have online help at our website
www.b2international.com - there's also a "Getting started with semantic
queries" tutorial there which guides you through a series of
sample queries.
Let's go back to Snow Owl.
Query files are located in the project explorer view.
I already prepared some
sample queries so this is a project folder and if I open it, you can see the
different queries,
they all have an ESCG extension.
If you want to create
a query file, you can either do it in
a folder that already exists or you
create a new project folder and then you create a query file in this folder.
So let me just show you how to create a folder.
Just right-click
on the view
and go to "New project"
and then enter project name, for example,
"My queries"
then click "Finish" and here's the new project folder
and if I right-click this folder, I can go to "New file"
and enter a name
for the file. It's important to always end with
.escg so that's the extension.
If you don't add this, it will also create a file but it's
not going to be
an escg file, so if I
open this here, I double-click it, I'll have the empty editor and here
I could type in a query script so it's just like a normal text editor
and you see there's already an error message because this is an incomplete query.
If you close it, you can either save it
or not so when you save queries you can rerun
them if you have a new release for example. If you import a new release and
if you want to rerun the queries,
it makes sense to save them.
Files can also be deleted.
Just right-click and go to "delete",
it's very easy. You can also
delete folders this way.
If you're using the free version
of Snow Owl, you will find a folder here
which is called "B2i examples" and it includes sample queries and some
explanation about the different expressions so it's a mini tutorial that
we already
included in the free version.
OK, so let's
look at a query. This is a pretty complicated one. Let's start with
an easier one. This one has only one
concept in it, you see in red - this is again the operator.
This operator retrieves
the concept behind it which is Clinical Finding
and all of its subtypes, all of its children.
After the operator you always need
the concept identifier here.
If I run this query, it will retrieve all Clinical Findings
which are almost 100,000. It's very easy to run the query, you just click this button here,
this is the execute button and
then it executes my query script
It takes a bit because it's a very big query
with lots of results and
these are the results - displayed in the search view.
You see I have 99,669
which are the children
of Clinical Finding plus the parent concept
Clinical Finding which is included as well. This is why it hasn't
extra match. You might already be familiar with the search view from other
videos.
There's a filter search here so you can
filter for a certain term.
If you double-click
on one of the matches, the editor opens up and you can
see information about
this particular concept. If you have a reference set open,
let me just open this one, you can also add
a search result to the reference set
or you can even add all of the results
to the reference set, add bookmarks here,
mark different results and add them
to the reference set so it's quite useful. There are a lot of actions you can do
from the search results.
Let's go back to our query.
I close this one here and
try to do this with a different concept since it's a editor text,
you can simply delete concepts here.
Whenever there's a problem you will see this little symbol here and if you
hover over it, it gives more information
so this is incomplete so I can
add a concept here.
There are different ways of adding a concept. You could simply
type in the concept ID,
or copy paste the concept ID, or
take a concept here from the view
and simply just drag it into the editor
and it automatically adds the ID and also the name of the concept.
So now this query will retrieve all Events
and the root concept Event as well,
so we should have
3664 results
exactly.
This is it here and if I open this, this is all
Events.
If you would like, let me just show you
the root. The parent concept is here as well, here it is
so this is "Event" and if you want to exclude
this, all you would have to do is delete one of those symbols so you have now
just the < subtype operator.
If I run the query again, I get one
result less and if I do filter for event
it's not there anymore, so the parent concept
is not part of the results anymore.
OK. If you have the symbol twice