FHIR Chat · Operation to get all child concepts · terminology

Stream: terminology

Topic: Operation to get all child concepts


view this post on Zulip Yunwei Wang (Aug 17 2021 at 19:46):

Can I use $lookup operation to get all child concept from a parent? For example on MESH code, given coding 'A', I would like to return codings for 'A01',...'A21'. I don't know if $lookup can do that or I have to define my own operation. image.png

view this post on Zulip Peter Jordan (Aug 17 2021 at 22:38):

child is a standard property for those code systems with a defined hierarchy and can be requested in a $lookup operation

view this post on Zulip Jim Steel (Aug 19 2021 at 23:27):

You could also POST a ValueSet to $expand with a filter saying parent = X

view this post on Zulip Yunwei Wang (Aug 20 2021 at 15:23):

There is no value set. The use case is that we are trying to build a viewer/browser for MeSH. Because MeSH has a tree structure, so the use case is that when clicking on one tree node (MeSH concept), the API returns the immediate children of that concept so the viewer can show them sub tree nodes. I think the $lookup operation that @Peter Jordan suggested is good. The only problem is that the property structure is too complicated. Because we need to return both the Unique ID (the concept code) and the Tree Number of child concept, we have to deal with parts inside parts.

view this post on Zulip Jim Steel (Aug 24 2021 at 22:55):

If you want to see how another terminology viewer/browser uses the API, you could have a look at https://ontoserver.csiro.au/shrimp (and snoop its network requests in your browser's developer console). It does an $expand of a dynamic (ie not pre-existing) ValueSet that includes the focus concept's ancestors and direct children, then does a batch $lookup of those concepts to retrieve the parent/child links to wire up the graph


Last updated: Apr 12 2022 at 19:14 UTC