Requesting the hierarchy of a SNOMED code using the Terminology Server?

I’m working on an application that contains an interface to search for and select SNOMED codes plus their child codes, but am struggling to do it in a simple way with the Terminology Server.

I can use $expand to generate a list of codes filtered by a search term.

When a user selects a specific code I’d like to then query the API and return a navigable tree view containing the children (and a flag if they have children so I can provide another expansion on the tree view). Upon clicking a child that is expandable, I’d then perform another query to get its children.

I’ve tried the $lookup function, but that doesn’t return the display names of the child properties, just their codes.

I’m going to blow through the rate limit pretty quickly if I have to then do a lookup for each child property to get their name, so I was hoping there’d be a way to include their names in a query.

I can see in the Terminology Browser that there’s a call to a /sct-browser-api endpoint that returns children plus information about their status as a leaf node (e.g. /sct-browser-api/snomed/uk-edition/v20241120/concepts/73211009/children), but as that’s not part of the FHIR spec, I’m guessing that’s a limited access endpoint purely for the browser application as I can’t find it documented anywhere.

Could anyone point me in the right direction to achieve this?

@les.cochrane can you please email information.standards@nhs.net who maybe able to help.

Sorry, rather late to the party here.

The Terminology Server fully supports SNOMED’s Expression Constraint Language (ECL), which is a querying language specifically for SNOMED. It is an easy language that can be used to get all descendants of a code, or all ancestors. Just be aware to limit the number of rows being returned.

The full specification of SNOMED is available here: Expression Constraint Language - Specification and Guide - Expression Constraint Language - SNOMED Confluence, with a quick reference of commands here: Appendix D - ECL Quick Reference - Expression Constraint Language - SNOMED Confluence

There are some Terminology Server Github examples , ECL statements in GET requests will need to be URL encoded. You can also pass the ECL queries in a POST body (which will not need URL encoding)
ECL curl example