I want to find all resource type list of specific patient using HL7 FHIR RESTFul API

308 views Asked by At

I want to show all resources type list like condition, immunization, patient. How can I find those endpoints? I did not get any end point which gets a list of resource types.

API end point: https://r4.smarthealthit.org

Official documentation: https://www.hl7.org/fhir/http.html#search Thanks in advance

I want a list of all response type by using the above API.

2

There are 2 answers

0
Mirjam Baltus On

You could ask for the CapabilityStatement with a GET [base]/metadata. This will have a .rest component that should list all the resource types the server supports, plus all the interactions, search parameters, operations etc. supported for those resource types. Each resource type that is supported will have its own endpoint [base]/[type] where you can do searches and retrieve the resources of that type.

Edit: on re-reading the question, it looks like you want a list of resources (instances) connected to a patient, instead of a list of resource types. If the server supports the $everything operation, you could do a GET [base]/Patient/[id]/$everything to get a Bundle with the Patient plus all the resources linked to that Patient.

0
Lloyd McKenzie On

There's no 'simple' way to do what you're asking. RESTful search returns resources, not data elements, so you're going to get back full-blown resources. You could define a custom operation, but it's unlikely you'd get any existing servers to support it. The simplest single-call mechanism to get the answer you want that will give you the lightest response is a 'batch' Bundle that contains a collection of searches - one per resource of potential interest, where the search specifies _summary=count. That will give you a bundle of search responses with the count of each type of resource.