Skip to content

Commit fb26f19

Browse files
authored
Merge pull request #299129 from KendalBond007/RevIncludeUpdatesRedux_22Apr25
Rev include updates redux 22 apr25
2 parents 52ec198 + e38b2fa commit fb26f19

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

articles/healthcare-apis/fhir/overview-of-search.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,80 @@ Note:
144144

145145
By default, the FHIR service in Azure Health Data Services is set to lenient handling. This means that the server ignores any unknown or unsupported parameters. If you want to use strict handling, you can include the `Prefer` header and set `handling=strict`.
146146

147+
#### _include and _revinclude searches
148+
149+
The FHIR service support search queries using the `_include` and `_revinclude` parameters. These parameters allow for the retrieval of reference resources in the search results.
150+
151+
The `_include` search parameter enables the retrieval of a particular FHIR resource, as well as any other FHIR resources that are referenced by it. When used in a query, the `_include` parameter returns the specified resource and resources *it references*. The `_revinclude` search parameter operates in the reverse, allowing the retrieval of a resource, along with any other resources that *reference it*, providing a way to search for resources based on their relationships with other resources. For detailed information on include and revinclude in search parameters, refer to the [FHIR Search Documentation](https://www.hl7.org/fhir/R4/search.html#revinclude).
152+
153+
##### Request parameters
154+
155+
When executing a search request with `_include` and `_revinclude` parameters, the following optional parameters can be used to control the count.
156+
157+
| **Name** | **Value** | **Description** |
158+
| ------------------------- | -------------------- | ------------------------- |
159+
| `_count` | Default value: 10 Max value: 1000 | The value represents the number of targeted resources to be retrieved per request. The value can be set up to 1000. When the parameter is not provided, it is set to 10. |
160+
| `_includesCount` | Default value: 1000 | The value represents the number of matches resources referenced by target resources to be retrieved per request. |
161+
162+
A maximum of 1000 items are included in the response from `_include` and `_revinclude` searches. If there are more than 1,000 matched items, a link is provided allowing you to navigate the complete result set.
163+
164+
In the following example, a search request for Observations is made for Patient with Identifier 123.
165+
166+
```
167+
GET {{FHIR_URL}}/Observation?subject.identifier=123&_include=Observation:subject&_includesCount=10
168+
```
169+
170+
The response will have Observation data for Patient 123. The matched resources are provided 10 per page, with a link provided to navigate the complete result set.
171+
172+
```
173+
{
174+
175+
"resourceType": "Bundle",
176+
177+
"id": "b5491e39-8f8f-4405-a4cf-2a6716755d73",
178+
179+
"meta": {
180+
181+
"lastUpdated": "2025-04-10T21:09:42.6517693+00:00"
182+
183+
},
184+
185+
"type": "searchset",
186+
187+
" link": [
188+
189+
{
190+
191+
"relation": "next",
192+
193+
"url": "{{FHIR_URL}}/Observation?subject.identifier=123&_include=Observation:subject&_includesCount=10&ct=er97f5lRTbShgbGOqaGhgbGlsZGFmaWJiYWBgYGpSSwAAAD%2F%2Fw%3D%3D"
194+
195+
},
196+
197+
{
198+
199+
"relation": "related",
200+
201+
"url": "{{FHIR_URL}}/Observation/$include?subject.identifier=123&_include=Observation:subject&_includesCount=10&includesCt=er97f5lRTbShgbGOqaGhgbGlsZGFmaWJiYWBgYGhAaaYqYmOqQUWYaNYAAAAAP%2F%2F"
202+
203+
},
204+
205+
{
206+
207+
"relation": "self",
208+
209+
"url": "{{FHIR_URL}}/Observation?subject.identifier=123&_include=Observation:subject&_includesCount=10”
210+
211+
}
212+
213+
],
214+
215+
"entry": [….]
216+
217+
}
218+
```
219+
220+
147221
## Chained & reverse chained searching
148222

149223
A [chained search](https://www.hl7.org/fhir/search.html#chaining) allows you to perform fine-targeted queries for resources that have a reference to another resource. For example, if you want to find encounters where the patient’s name is Jane, use:

0 commit comments

Comments
 (0)