IHTSDO / snowstorm

Scalable SNOMED CT Terminology Server using Elasticsearch
Other
204 stars 80 forks source link

Extract all child concepts of Parent #416

Closed johnson-cloud closed 2 years ago

johnson-cloud commented 2 years ago

Dear All,

Which REST API I can use in order to find all child concepts of 404684003 - Clinical finding - along with which parameter do I need to pass and get json results

(I want to get all child concepts / terms of All clinical findings)

kaicode commented 2 years ago

Hi. I would use an ECL query (Expression Constraint) for this.

We can select all descendants of 404684003 |Clinical finding (finding)| using this ECL: < 404684003

The ecl param should be URL encoded.

You can load the first 1K results from the 2022 March International release as json like this: https://snowstorm.ihtsdotools.org/snowstorm/snomed-ct/MAIN/2022-05-31/concepts?ecl=%3C%20404684003&limit=1000

The subsequent requests should use the searchAfter value from the previous page.. like this: https://snowstorm.ihtsdotools.org/snowstorm/snomed-ct/MAIN/2022-05-31/concepts?ecl=%3C%20404684003&limit=1000&searchAfter=WzE2MDA4NzUxMDAwMTE5MTA4XQ==

The public server is for reference purposes and has rate limiting.

Kind regards.

johnson-cloud commented 2 years ago

Hey kaicode,

that was perfect. great help.