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

Loading concepts with embedded definitions #448

Open
DurandA opened this issue Oct 27, 2022 · 1 comment
Open

Loading concepts with embedded definitions #448

DurandA opened this issue Oct 27, 2022 · 1 comment
Assignees
Labels

Comments

@DurandA
Copy link

DurandA commented Oct 27, 2022

Is it possible to search for concepts (/{branch}/concepts?term=searchTerm endpoint) and to embed definitions in returned concepts?

We have a use-case where we need to find concepts according to a search term and to display the first definition. Making subqueries to /{branch}/concepts/{conceptId}/descriptions would be inefficient and too slow for real-time use. We could also do the reverse query and search for descriptions and aggregate by concept. However, the /{branch}/concepts/{conceptId}/descriptions do not offer much flexibility as we need to use an ECL query to filter the result by parent.

@kaicode kaicode self-assigned this Feb 22, 2023
@kaicode
Copy link
Member

kaicode commented Feb 22, 2023

Hi @DurandA, I'm very sorry no one got back to you about your query, I'm not sure how your question got missed.

It sounds like you would like to search SNOMED CT and filter the results by parent. Could I suggest that rather than fetching the definitions of the concept to do the filtering, I recommend using the Expression Constraint Language (ECL). This would allow you to specify a parent filter and text filter at the same time.

For example the ECL query <404684003 |Clinical finding| would filter for all the concepts that are a descendant of Clinical finding. In ECL the term between the pipes is optional so this ECL gives the same results: <404684003.

This can be used when searching concepts using the ecl parameter. For example: /{branch}/concepts?ecl=<404684003&termActive=true&term=searchTerm
I have also added the termActive parameter here so that no inactive descriptions are used in the search.

Also, rather than using the native Snowstorm API, it's possible to achieve the same thing using the standardised FHIR Terminology API: https://snowstorm.ihtsdotools.org/fhir/ValueSet/$expand?url=http://snomed.info/sct?fhir_vs=ecl/%3C404684003&filter=asthma

Does that help to answer your question?

Kind regards,
Kai Kewley


Please note that the public Snowstorm server is for light use and testing purposes only. If you need a production instance please set up your own Snowstorm instance.

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

No branches or pull requests

2 participants