Skip to content

Commit 9cedf06

Browse files
committed
markdown, editorial updates
1 parent 30f56ec commit 9cedf06

File tree

3 files changed

+65
-64
lines changed

3 files changed

+65
-64
lines changed

articles/healthcare-apis/fhir/how-to-do-custom-search.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ms.author: kesheth
1010
---
1111
# Defining custom search parameters
1212

13-
The FHIR specification defines a set of search parameters that apply to all resources. Additionally, FHIR defines many search parameters that are specific to certain resources. There are scenarios, however, where you might want to search against an element in a resource that isn’t defined by the FHIR specification as a standard search parameter. This article describes how you can define your own custom [search parameters](https://www.hl7.org/fhir/searchparameter.html) for use in the FHIR service in Azure Health Data Services.
13+
The FHIR® specification defines a set of search parameters that apply to all resources. Additionally, FHIR defines many search parameters that are specific to certain resources. However, you might also want to search against an element in a resource that isn’t defined by the FHIR specification as a standard search parameter. This article describes how you can define your own custom [search parameters](https://www.hl7.org/fhir/searchparameter.html) for use in the FHIR service in Azure Health Data Services.
1414

1515
> [!NOTE]
16-
> Each time you create, update, or delete a search parameter, you’ll need to run a [reindex job](how-to-run-a-reindex.md) to enable the search parameter for live production. Below we will outline how you can test search parameters before reindexing the entire FHIR service database.
16+
> Each time you create, update, or delete a search parameter, you’ll need to run a [reindex job](how-to-run-a-reindex.md) to enable the search parameter for live production. We will outline how you can test search parameters before reindexing the entire FHIR service database following.
1717
1818
## Create new search parameter
1919

@@ -23,11 +23,11 @@ To create a new search parameter, you need to `POST` a `SearchParameter` resourc
2323
POST {{FHIR_URL}}/SearchParameter
2424
```
2525

26-
The examples below demonstrate creating new custom search parameter
26+
The following examples demonstrate creating a new custom search parameter.
2727

28-
### Create new search parameter per definition in Implementation Guide
28+
### Create new search parameter per definition in the Implementation Guide
2929

30-
The code example below shows how to add the [US Core Race search parameter](http://hl7.org/fhir/us/core/STU3.1.1/SearchParameter-us-core-race.html) to the `Patient` resource type in your FHIR service database.
30+
The following code example shows how to add the [US Core Race search parameter](http://hl7.org/fhir/us/core/STU3.1.1/SearchParameter-us-core-race.html) to the `Patient` resource type in your FHIR service database.
3131

3232

3333
```rest
@@ -73,7 +73,7 @@ The code example below shows how to add the [US Core Race search parameter](http
7373
```
7474
### Create new search parameter for resource attributes with reference type
7575

76-
The code example shows how to create a custom search parameter to search MedicationDispense resources based on the location where they were dispensed. This is an example of adding custom search parameter for a Reference type.
76+
The following code example shows how to create a custom search parameter to search MedicationDispense resources based on the location where they were dispensed. This is an example of adding a custom search parameter for a Reference type.
7777

7878
```rest
7979
{
@@ -94,25 +94,25 @@ The code example shows how to create a custom search parameter to search Medicat
9494
> [!NOTE]
9595
> The new search parameter will appear in the capability statement of the FHIR service after you `POST` the search parameter to the database **and** reindex your database. Viewing the `SearchParameter` in the capability statement is the only way to tell if a search parameter is supported in your FHIR service. If you cannot find the `SearchParameter` in the capability statement, then you still need to reindex your database to activate the search parameter. You can `POST` multiple search parameters before triggering a reindex operation.
9696
97-
Important elements of a `SearchParameter` resource:
97+
Important elements of a `SearchParameter` resource are:
9898

9999
* `url`: A unique key to describe the search parameter. Organizations such as HL7 use a standard URL format for the search parameters that they define, as shown above in the US Core Race search parameter.
100100

101-
* `code`: The value stored in the **code** element is the name used for the search parameter when it's included in an API call. For the example above with the "US Core Race" extension, you would search with `GET {{FHIR_URL}}/Patient?race=<code>` where `<code>` is in the value set from the specified coding system. This call would retrieve all patients of a certain race.
101+
* `code`: The value stored in the **code** element is the name used for the search parameter when it's included in an API call. For the preceding example with the "US Core Race" extension, you would search with `GET {{FHIR_URL}}/Patient?race=<code>` where `<code>` is in the value set from the specified coding system. This call would retrieve all patients of a certain race.
102102

103-
* `base`: Describes which resource type(s) the search parameter applies to. If the search parameter applies to all resources, you can use `Resource`; otherwise, you can list all the relevant resource types.
103+
* `base`: Describes which resource types the search parameter applies to. If the search parameter applies to all resources, you can use `Resource`; otherwise, you can list all the relevant resource types.
104104

105-
* `target`: Describes which resource type(s) the search parameter matches to.
105+
* `target`: Describes which resource types the search parameter matches to.
106106

107107
* `type`: Describes the data type for the search parameter. Type is limited by the support for data types in the FHIR service. This means that you can’t define a search parameter of type Special or define a [composite search parameter](overview-of-search.md) unless it's a supported combination.
108108

109109
* `expression`: Describes how to calculate the value for the search. When describing a search parameter, you must include the expression, even though it isn't required by the specification. This is because you need either the expression or the xpath syntax and the FHIR service ignores the xpath syntax.
110110

111111
## Test new search parameters
112112

113-
While you can’t use the new search parameters in production until you run a reindex job, there are a few ways to test your custom search parameters before reindexing the entire database.
113+
While you can’t use the new search parameters in production until you run a reindex job, there are ways to test your custom search parameters before reindexing the entire database.
114114

115-
First, you can test a new search parameter to see what values will be returned. By running the command below against a specific resource instance (by supplying the resource ID), you get back a list of value pairs with the search parameter name and the value stored in the corresponding element. This list includes all of the search parameters for the resource. You can scroll through to find the search parameter you created. Running this command won't change any behavior in your FHIR service.
115+
First, you can test a new search parameter to see what values are returned. By running the following command against a specific resource instance (by supplying the resource ID), you get back a list of value pairs with the search parameter name and the value stored in the corresponding element. This list includes all of the search parameters for the resource. You can scroll through to find the search parameter you created. Running this command won't change any behavior in your FHIR service.
116116

117117
```rest
118118
GET https://{{FHIR_URL}}/{{RESOURCE}}/{{RESOURCE_ID}}/$reindex
@@ -151,7 +151,7 @@ The result looks like this:
151151
...}
152152
```
153153

154-
Once you see that your search parameter is displaying as expected, you can reindex a single resource to test searching with your new search parameter. To reindex a single resource:
154+
Once you see that your search parameter is displaying as expected, you can reindex a single resource to test searching with your new search parameter. To reindex a single resource, use the following.
155155

156156
```rest
157157
POST https://{{FHIR_URL}/{{RESOURCE}}/{{RESOURCE_ID}}/$reindex
@@ -172,21 +172,23 @@ And then do a test search
172172
GET {{FHIR_URL}}/Patient?race=2028-9
173173
x-ms-use-partial-indices: true
174174
```
175+
175176
1. For Location (reference type):
176177
```rest
177178
{{fhirurl}}/MedicationDispense?location=<locationid referenced in MedicationDispense Resource>
178179
x-ms-use-partial-indices: true
179180
```
180-
After you've tested your new search parameter and confirmed that it's working as expected, run or schedule your reindex job so the new search parameter(s) can be used in live production.
181+
182+
After you've tested your new search parameter and confirmed that it's working as expected, run or schedule your reindex job so the new search parameters can be used in live production.
181183

182184
See [Running a reindex job](../fhir/how-to-run-a-reindex.md) for information on how to reindex your FHIR service database.
183185

184186
## Update a search parameter
185187

186-
To update a search parameter, use `PUT` to create a new version of the search parameter. You must include the search parameter ID in the `id` field in the body of the `PUT` request as well as the `PUT` request string.
188+
To update a search parameter, use `PUT` to create a new version of the search parameter. You must include the search parameter ID in the `id` field in the body of the `PUT` request and the `PUT` request string.
187189

188190
> [!NOTE]
189-
> If you don't know the ID for your search parameter, you can search for it using `GET {{FHIR_URL}}/SearchParameter`. This will return all custom as well as standard search parameters, and you can scroll through the list to find the search parameter you need. You could also limit the search by name. As shown in the example request below, the name of the custom `SearchParameter` resource instance is `USCoreRace`. You could search for this `SearchParameter` resource by name using `GET {{FHIR_URL}}/SearchParameter?name=USCoreRace`.
191+
> If you don't know the ID for your search parameter, you can search for it using `GET {{FHIR_URL}}/SearchParameter`. This will return all custom and standard search parameters. You can scroll through the list to find the search parameter you need. You could also limit the search by name. As shown in the following example request, the name of the custom `SearchParameter` resource instance is `USCoreRace`. You could search for this `SearchParameter` resource by name using `GET {{FHIR_URL}}/SearchParameter?name=USCoreRace`.
190192
191193
```rest
192194
PUT {{FHIR_URL}}/SearchParameter/{{SearchParameter_ID}}
@@ -237,11 +239,9 @@ The result of the above request will be an updated `SearchParameter` resource.
237239
> [!Warning]
238240
> Be careful when updating search parameters. Changing an existing search parameter could have impacts on the expected behavior. We recommend running a reindex job immediately.
239241
240-
241-
242242
## Delete a search parameter
243243

244-
If you need to delete a search parameter, use the following:
244+
If you need to delete a search parameter, use the following.
245245

246246
```rest
247247
DELETE {{FHIR_URL}}/SearchParameter/{{SearchParameter_ID}}
@@ -250,8 +250,6 @@ DELETE {{FHIR_URL}}/SearchParameter/{{SearchParameter_ID}}
250250
> [!Warning]
251251
> Be careful when deleting search parameters. Deleting an existing search parameter could have impacts on the expected behavior. We recommend running a reindex job immediately.
252252
253-
254-
255253
## Next steps
256254

257255
In this article, you’ve learned how to create a custom search parameter. Next you can learn how to reindex your FHIR service database.
@@ -260,4 +258,4 @@ For more information, see
260258
>[!div class="nextstepaction"]
261259
>[How to run a reindex job](how-to-run-a-reindex.md)
262260
263-
FHIR&#174; is a registered trademark of [HL7](https://hl7.org/fhir/) and is used with the permission of HL7.
261+
[!INCLUDE [FHIR trademark statement](../includes/healthcare-apis-fhir-trademark.md)]

articles/healthcare-apis/fhir/how-to-run-a-reindex.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ ms.author: kesheth
1010
---
1111
# Running a reindex job
1212

13-
There are scenarios where you may have search parameters in the FHIR service in Azure Health Data Services that haven't yet been indexed. This scenario is relevant when you define your own custom search parameters. Until the search parameter is indexed, it can't be used in live production. This article covers how to run a reindex job to index any custom search parameters that haven't yet been indexed in your FHIR service database.
13+
There are scenarios where you may have search parameters in the FHIR&reg; service in Azure Health Data Services that have yet to be indexed. This scenario is relevant when you define your own custom search parameters. Until a search parameter is indexed, it can't be used in live production. This article covers how to run a reindex job to index any custom search parameters in your FHIR service database.
1414

1515
> [!Warning]
1616
> It's important that you read this entire article before getting started. A reindex job can be very performance intensive. This article discusses options for how to throttle and control a reindex job.
1717
1818
## How to run a reindex job
1919

20-
Reindex job can be executed against entire FHIR service database and against specific custom search parameter.
20+
A reindex job can be executed against an entire FHIR service database, and against specific custom search parameters.
2121

22-
### Run reindex job on entire FHIR service database
23-
To run reindex job, use the following `POST` call with the JSON formatted `Parameters` resource in the request body:
22+
### Run a reindex job on entire FHIR service database
23+
To run a reindex job, use the following `POST` call with the JSON formatted `Parameters` resource in the request body.
2424

2525
```json
2626
POST {{FHIR_URL}}/$reindex
@@ -34,7 +34,7 @@ content-type: application/fhir+json
3434
}
3535
```
3636

37-
Leave the `"parameter": []` field blank (as shown) if you don't need to tweak the resources allocated to the reindex job.
37+
Leave the `"parameter": []` field blank (as shown) if you don't need to adjust the resources allocated to the reindex job.
3838

3939
If the request is successful, you receive a **201 Created** status code in addition to a `Parameters` resource in the response.
4040

@@ -92,8 +92,9 @@ Content-Location: https://{{FHIR URL}}/_operations/reindex/560c7c61-2c70-4c54-b8
9292
]
9393
}
9494
```
95-
### Run reindex job against specific custom search parameter
96-
To run reindex job against specific custom search parameter, use the following `POST` call with the JSON formatted `Parameters` resource in the request body:
95+
96+
### Run a reindex job against a specific custom search parameter
97+
To run a reindex job against a specific custom search parameter, use the following `POST` call with the JSON formatted `Parameters` resource in the request body.
9798

9899
```json
99100
POST {{FHIR_URL}}/$reindex
@@ -112,15 +113,15 @@ content-type: application/fhir+json
112113
}
113114
```
114115
> [!NOTE]
115-
> To check the status of a reindex job or to cancel the job, you'll need the reindex ID. This is the `"id"` carried in the `"parameter"` value returned in the response. In the example above, the ID for the reindex job would be `560c7c61-2c70-4c54-b86d-c53a9d29495e`.
116+
> To check the status of, or cancel a reindex job, you need the reindex ID. This is the `"id"` carried in the `"parameter"` value of the response. In the preceding example, the ID for the reindex job would be `560c7c61-2c70-4c54-b86d-c53a9d29495e`.
116117
117118
## How to check the status of a reindex job
118119

119-
Once you’ve started a reindex job, you can check the status of the job using the following call:
120+
Once you start a reindex job, you can check the status of the job using the following call.
120121

121122
`GET {{FHIR_URL}}/_operations/reindex/{{reindexJobId}}`
122123

123-
An example response:
124+
Here's an example response.
124125

125126
```json
126127
{
@@ -194,7 +195,7 @@ An example response:
194195
}
195196
```
196197

197-
The following information is shown in the above response:
198+
The following information is shown in the preceding response:
198199

199200
* `totalResourcesToReindex`: Includes the total number of resources that are being reindexed in this job.
200201

@@ -206,19 +207,19 @@ The following information is shown in the above response:
206207

207208
* `resources`: Lists all the resource types impacted by the reindex job.
208209

209-
* 'resourceReindexProgressByResource (CountReindexed of Count)': Provides reindexed count of the total count, per resource type. In cases where reindexing for a specific resource type is queued, only Count is provided.
210+
* 'resourceReindexProgressByResource (CountReindexed of Count)': Provides a reindexed count of the total count, per resource type. In cases where reindexing for a specific resource type is queued, only Count is provided.
210211

211212
* 'searchParams': Lists url of the search parameters impacted by the reindex job.
212213

213214
## Delete a reindex job
214215

215-
If you need to cancel a reindex job, use a `DELETE` call and specify the reindex job ID:
216+
If you need to cancel a reindex job, use a `DELETE` call and specify the reindex job ID.
216217

217218
`DELETE {{FHIR URL}}/_operations/reindex/{{reindexJobId}}`
218219

219220
## Performance considerations
220221

221-
A reindex job can be quite performance intensive. The FHIR service offers some throttling controls to help you manage how a reindex job run on your database.
222+
A reindex job can be quite performance intensive. The FHIR service offers throttling controls to help manage how a reindex job runs on your database.
222223

223224
> [!NOTE]
224225
> It is not uncommon on large datasets for a reindex job to run for days.
@@ -228,10 +229,10 @@ Below is a table outlining the available parameters, defaults, and recommended r
228229
| **Parameter** | **Description** | **Default** | **Available Range** |
229230
| --------------------------------- | ---------------------------- | ------------------ | ------------------------------- |
230231
| `QueryDelayIntervalInMilliseconds` | The delay between each batch of resources being kicked off during the reindex job. A smaller number speeds up the job while a larger number slows it down. | 500 MS (.5 seconds) | 50 to 500000 |
231-
| `MaximumResourcesPerQuery` | The maximum number of resources included in the batch of resources to be reindexed. | 100 | 1-5000 |
232+
| `MaximumResourcesPerQuery` | The maximum number of resources included in the batch to be reindexed. | 100 | 1-5000 |
232233
| `MaximumConcurrency` | The number of batches done at a time. | 1 | 1-10 |
233234

234-
If you want to use any of the parameters above, you can pass them into the `Parameters` resource when you send the initial `POST` request to start a reindex job.
235+
If you want to use any of the preceding parameters, you can pass them into the `Parameters` resource when you send the initial `POST` request to start a reindex job.
235236

236237
```json
237238

@@ -262,4 +263,4 @@ In this article, you've learned how to perform a reindex job in your FHIR servic
262263
>[!div class="nextstepaction"]
263264
>[Defining custom search parameters](how-to-do-custom-search.md)
264265
265-
FHIR&#174; is a registered trademark of [HL7](https://hl7.org/fhir/) and is used with the permission of HL7.
266+
[!INCLUDE [FHIR trademark statement](../includes/healthcare-apis-fhir-trademark.md)]

0 commit comments

Comments
 (0)