Stream: snomed
Topic: Snomed
Naveen Mallela (Feb 24 2020 at 19:36):
Naveen Mallela2:09 PM
Hello everyone,
Please help me with the snomed CT API query if you have implemented the same for Fhir.
http://hl7.org/fhir/R4/valueset-clinical-findings.html
I'm trying to fetch Fhir Snomed CT Clinical Findings grammatically by calling the Restful API (Snomstorm).
The URI for the API call is https://snowstorm.ihtsdotools.org/snowstorm/snomed-ct/MAIN%2F2020-01-31/concepts/404684003/descendants?stated=false&offset=0&limit=10000
The issue i'm facing is the max limit we can fetch Concepts is 10,000. How do we fetch records from 10,001 to 20,000 and so on until we get all the concepts?
Thanks, Naveen
Peter Jordan (Feb 24 2020 at 21:40):
That's not a FHIR API call. Maybe @Peter Williams of SNOMED International can help you with that particular API.
Michael Lawley (Feb 25 2020 at 06:47):
The FHIR way would be [base]/$expand?url=http://hl7.org/fhir/ValueSet/clinical-findings&count=10000&offset=10000
Peter Williams (Feb 25 2020 at 14:29):
Yes, internally our server would have difficulty returning more than 10K concepts with a count/offset approach. The Snowstorm API allows for using "searchAfter", but as @Peter Jordan says this is not the FHIR API we're talking about here. @Naveen Mallela has been in contact with our helpdesk directly. Thanks all!
Naveen Mallela (Feb 28 2020 at 17:03):
Thanks a lot Peter. Rory helped me getting on the call and showing me how to do it. He suggested me to install a local version of Snomstorm and we were able to make it work. Thanks a lot again.
Naveen Mallela (Feb 28 2020 at 17:05):
@Peter Williams Thanks a lot Peter. Rory helped me getting on the call and showing me how to do it. He suggested me to install a local version of Snomstorm and we were able to make it work. Thanks a lot again.
Peter Williams (Feb 28 2020 at 17:10):
Awesome!
Naveen Mallela (Feb 28 2020 at 17:28):
Thank you @Michael Lawley
The correct way to fetch records for more than 10,000 is to use the endpoint "concepts" instead of "descendents". The < should be append to the code we are searching and it will return all the descendents.
Example below "<404684003" as the concept ID.
1) The first query will return the first 10,000 using the URL
http://localhost:8080/MAIN/concepts?ecl=%3C404684003&offset=0&limit=10000
2) If we scroll to the end of the response we can find the properties total, limit, searchAfter and searchAfterArray.
"total":113597,"limit":500,"searchAfter":"WzE1Njg1MjAxMDAwMTE5MTAwXQ==","searchAfterArray":[15685201000119100]
So we take the value of searchAfter and add a new URL request header "searchAfter" and use the value of searchAfter=.
Since its url, we need to replace = value as "%3D". So the actual url looks like below.
for the next 10K we follow the same process.
Thanks, Naveen
Last updated: Apr 12 2022 at 19:14 UTC