Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Filling in code predicates with SNOMED
@prefix : <> .
@prefix dcterms:<>.
# We start with a mixed bag:
# some problems have local code only
# some problems have snomed code only
# some problems have both
<http://pboth> a :Problem;
:code <>;
:snomedCode <>;
:startDate "2011-05-05".
<http://plocal> a :Problem;
:code <>;
:startDate "2011-05-05".
<http://psnomedonly> a :Problem;
:code <>;
:startDate "2011-05-05".
<> a :Code,:Diagnosis;
dcterms:title "Toxic effect of; carbon tetrachloride";
:system "";
:translation [
a :Translation;
:targetCode <> ;
:translationFidelity <>.
<> a :Code, :Diagnosis, :SNOMED;
dcterms:title "Toxic encephalopathy due to carbon tetrachloride";
:system "";
:identifier "74267005".
# this query implements some very basic
# rules-based reasoning, augmenting the
# graph by supplying a :snomedCode for each
# :Problem.
PREFIX rdf:<>
insert { ?p :snomedCode ?s. }
where {
?p a :Problem.
?p :code ?c.
?c (:translation/:targetCode)* ?s.
?s a :SNOMED.

When a client requests the problem list, it sees the augmented graph. And so a developer can easily query for SNOMED identifiers:


select * where {
 ?p a :Problem.
 ?p :snomedCode ?s.


@prefix : <> .
@prefix rdf: <> .

<http://pboth> :snomedCode <> .
<http://plocal> :snomedCode <> .
<http://psnomed> :snomedCode <> .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.