Kia ora
We recently had the opportunity to address an inquiry that touches on a fundamental aspect of utilizing SNOMED CT - processing hierarchical relationships within this comprehensive clinical terminology system. We thought it might be beneficial to share our response and insights on this matter with the broader community here, given its relevance and potential interest to many of you.
The query was finding a systematic way to identify all codes that are children of a given code within SNOMED CT, and by extension, the children of those codes, and so on.
To illustrate, the inquiry specifically asked for a method to programmatically find all descendant codes of the âDiabetes Mellitusâ concept, a task that needs navigating the hierarchical structure of SNOMED CT to capture not just direct children but all subsequent generations.
Our response highlighted two approaches to tackle this requirement, emphasizing both the technical aspects of using ECL querying SNOMED CT hierarchies and the available tools that facilitate such operations:
Running ECL(Expression Constraint Language) Queries in the SNOMED Browser
-
Navigate to the official NZ edition of SNOMED CT Browser.
-
On your right handside of the screen, click âExpression Constraint Queriesâ. This allows you to enter an ECL query directly.
-
Enter your ECL query(e.g. < 73211009 |Diabetes mellitus (disorder)| ) in the provided field and press âExecuteâ to execute the query.
-
The browser will display the results based on the specified constraints in your ECL query.
Running ECL Queries via NZHTS FHIR Interface
To execute ECL queries through the NZHTS FHIR interface, youâll insert the ECL query directly into the query string of your API request. This method requires an API key for authentication. Please feel free to let me know if you do not have an API key, and I can assist further.
Assuming you have the API key:
1.Construct your API request by embedding the ECL query into the query string.
In general, the API request looks like this: https://nzhts.digital.health.nz/fhir/ValueSet/$expand?url=http://snomed.info/sct?fhir_vs=ecl/{ECL-Query} and you can always replace {ECL-Query} with your actual ECL query
e.g. For the specific needs, the complete API request should look like this:
-
Use a tool like Postman or a simple curl command in the terminal to send the request to the NZHTS FHIR interface
-
The response will include the results of your ECL query as interpreted and executed by the NZHTS FHIR interface.
Hope this insight proves useful to you in your work with SNOMED CT. Should you have any questions, or if thereâs a specific aspect of SNOMED CT youâre keen to explore further, feel free to engage in the discussion here.
Warm regrds
