Stream: implementers
Topic: FHIR Resource count query
Sarankumar (Feb 13 2020 at 06:02):
how to get message count of each resources in fhir server?
Do we have any query to get each resources count from FHIR server?
Lloyd McKenzie (Feb 13 2020 at 06:27):
A search will always return a count of the matches in the first page. If all you want is the count for the search, use _summary=count
sandeep nani (Feb 13 2020 at 06:29):
can you elaborate the above point please ....?
Lloyd McKenzie (Feb 13 2020 at 06:40):
@sandeep nani you asked this on a thread that wasn't a question you asked - I'm not sure if you're asking for elaboration on the FHIR resource count question or something else. Make sure you have selected the thread you want to respond to before responding. Also "please elaborate" isn't a very helpful question. Please explain in more detail what parts of the answer are confusing to you so that the answerer can focus on what you need, rather than just writing volumes of text that might not cover what you're looking for.
Lloyd McKenzie (Feb 13 2020 at 06:41):
(Also, when given an answer, before asking further questions, it's always best to dig into the documentation that covers the area mentioned in the answer before asking further questions - asking questions should never be a way to skip reading the documentation.)
Sarankumar (Feb 13 2020 at 06:52):
A search will always return a count of the matches in the first page. If all you want is the count for the search, use _summary=count
thanks @Lloyd McKenzie
Aritra Kundu (Feb 13 2020 at 06:58):
A search will always return a count of the matches in the first page. If all you want is the count for the search, use _summary=count
thanks Lloyd McKenzie
Sure Lyod, I got that. However, is there a way we can get the total count of all the resources stored in any FHIR server. Example: If I want to know how many patient, Encounter, Care Plan, Allergy resources etc. are available in a FHIR server using one search query.
Regards,
Aritra
Lloyd McKenzie (Feb 13 2020 at 14:57):
You can perform a search against the base endpoint with no filters. (That said, few servers will give most clients permission to perform that operation - even if all they're asking for is a count.)
Alexander Kiel (Feb 13 2020 at 15:12):
@Aritra Kundu If you want the resource counts by resource, you can create a batch bundle containing individual count queries for each resource of interest and send it to the batch/transaction endpoint. This way you get the counts with a single HTTP interaction. I implemented this in my blazectl command line tool. Please look under "Count Resources".
Last updated: Apr 12 2022 at 19:14 UTC