Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search by Semantic Tag #16

Closed
sidharthramesh opened this issue Apr 22, 2021 · 19 comments
Closed

Search by Semantic Tag #16

sidharthramesh opened this issue Apr 22, 2021 · 19 comments

Comments

@sidharthramesh
Copy link
Contributor

While showing a drug list for clinicians to pick from, I am trying to filter out the 'Clinical Drug' and 'Real Clinical Drug'. However, these seem to be semantic tags and not a part of the SNOMED CT hierarchy. Is it possible to include this information in an ECL? Or is there any way of including the semantic tag in a search?

This is only an issue with the clinical drugs and real clinical drugs semantic tags, since they don't seem to be a part of a hierarchy like Disorders, which can clearly be filtered using an ECL. Related issue.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

Is there a way to disambiguate based on relationships other that is-a?

@sidharthramesh
Copy link
Contributor Author

I mean there is this monstrosity

<<  373873005 |Pharmaceutical / biologic product (product)| : ( 732944001 |Has presentation strength numerator value (attribute)|  = * OR 733724008 |Has concentration strength numerator value (attribute)| = * )

But it slows down the search speeds significantly: About 20 seconds per search!! Usual simple searches on my system take <20ms

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

I guess naive answer would be a two pass approach in which you search FSNs for the tag and then use that denominator set to search. Alternatively perform a search and then do a quick fetch for the FSN and then filter.

@sidharthramesh
Copy link
Contributor Author

Yeah, both could work, but I could also just make a reference set with all the clinical drugs and real clinical drugs and index them in advance. And then do an ECL by ^reference set .

@sidharthramesh
Copy link
Contributor Author

sidharthramesh commented Apr 22, 2021

What really constitutes a "semantic tag"? Just the name in the brackets of an FSN?

If so, yes, the 2 approaches you mentioned will be easier to do while indexing, and you could expose that as a semantic tag parameter along with the ECL. However, if ECL somehow supports semantic tag, that would be much better.

I'm building open-source web components to be used in different situations, and this is how the search component looks like.
image

Having only ECL is elegant.

@sidharthramesh
Copy link
Contributor Author

How do you filter out clinical drugs in your EHR system? Or maybe you don't use SNOMED for drugs?

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

UK dm+d defines drugs using SNOMED relationships not arbitrary free text in parentheses in a text field.

@sidharthramesh
Copy link
Contributor Author

So what relationships do they establish for you to search only clinical drugs or real clinical drugs? What constraints do you use?

Cause if the Indian release centre is doing it wrong, I could point them to the UK dm+d and maybe they might change how they do it too.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

Definitely use drugs - see first video on https://wardle.org/patientcare/2018/02/19/so-I-built-an-EPR.html

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

Does the ECL standard provide for semantic tags or search within a FSN? I have a feeling I don't index FSNs by default as I never had the need.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

In clojure, I'd write a small utility to lazily process the concepts within a specific reference set and create two reference sets from that to disambiguate your drug classes. I'd then use those to drive the UI.

But if ECL standard has support for this, I'd be happy to look to implement.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

The UK drug extension specs are available online. They support a six class model - VTM, VMP, VMPP, AMP, AMPP and TF. The semantics aren't quite right either- based on the is-a hierarchies - but each type is in its own refset so you can disambiguate.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

Although they don't have concrete values - hence why I have built https://github.com/Wardle/dmd - to add a bit more to the base SNOMED drug extension for the UK.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

Have a look at the ECL filter options, specifically the description type. That looks as if it will give you concepts matching an FSN named something. You could use that in a conjunction to get what you need - maybe! Off the top of my head, I can't remember how much I implemented of this.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

It looks as if you should be able to use an FSN= filter but the best way is to get people to distribute releases with semantic information as part of the data and not as free text.

@sidharthramesh
Copy link
Contributor Author

It looks as if you should be able to use an FSN= filter but the best way is to get people to distribute releases with semantic information as part of the data and not as free text.

This seems to be the best approach. I'm writing a script that will quickly look at all of the concepts and add a parent relationship based on the semantic tag and output an extension. I will then index this extension as well. How do you do the indexing? Do I need to output Full, Snapshot and Delta folders? What's the least I can get away with?

@sidharthramesh
Copy link
Contributor Author

Does the ECL standard provide for semantic tags or search within a FSN? I have a feeling I don't index FSNs by default as I never had the need.

Not yet. But they are apparently planning to add that to the specification soon.

@wardle
Copy link
Owner

wardle commented Apr 22, 2021

You simply need to output a snapshot file - and just adopt the right filename standard - so have a look at that in the specification. The indexing simply walks the filesystem and looks for filenames that match - you should be able to recognise the regex even if you can't read clojure - and follow the specs linked in the comment in the source code. Then run your import against a directory containing your file and it will import.

@wardle wardle closed this as completed Apr 22, 2021
@wardle
Copy link
Owner

wardle commented Apr 22, 2021

My only other suggestion would be to add a "tag" option in your UI definition, and run the logic as an extra step in your UI code. If they add to ECL, I can see how it would be easy to extract the semantic tag from the FSN and stuff into each indexed document in Lucene and then query on that - so it would be trivial - except really they should push distributors to include semantic data in the data - not the free text of a description!

It would save you having to manage the reference set definitions - which will because a maintenance job that you will regret unless it is entirely automated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants