Skip to content

Commit 2c4bad2

Browse files
authored
Merge pull request #195014 from SteveWohl/AHDS-bulk-import-docs
Created configure-import-data.md file and deleted bulk-importing-fhir…
2 parents dcfe02f + 90cd25a commit 2c4bad2

11 files changed

+253
-74
lines changed

.openpublishing.redirection.healthcare-apis.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,11 @@
486486
"source_path_from_root": "/articles/healthcare-apis/data-transformation/convert-data.md",
487487
"redirect_url": "/azure/healthcare-apis/fhir/convert-data",
488488
"redirect_document_id": true
489+
},
490+
{
491+
"source_path_from_root": "/articles/healthcare-apis/fhir/bulk-importing-fhir-data.md",
492+
"redirect_url": "/azure/healthcare-apis/fhir/configure-import-data",
493+
"redirect_document_id": true
489494
}
490495
]
491496
}

articles/healthcare-apis/fhir/bulk-importing-fhir-data.md

Lines changed: 0 additions & 70 deletions
This file was deleted.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Configure import settings in the FHIR service - Azure Health Data Services
3+
description: This article describes how to configure import settings in the FHIR service
4+
author: ginalee-dotcom
5+
ms.service: healthcare-apis
6+
ms.subservice: fhir
7+
ms.topic: how-to
8+
ms.date: 04/16/2022
9+
ms.author: ranku
10+
---
11+
12+
# Configure bulk import settings (Preview)
13+
14+
The FHIR service supports $import operation that allows you to import data into FHIR service account from a storage account.
15+
16+
The three steps below are used in configuring import settings in the FHIR service:
17+
18+
- Enable managed identity for the FHIR service.
19+
- Create an Azure storage account or use an existing storage account, and then grant permissions to the FHIR service to access it.
20+
- Set the import configuration in the FHIR service.
21+
22+
## Enable managed identity on the FHIR service
23+
24+
The first step in configuring the FHIR service for import is to enable system wide managed identity on the service, which will be used to grant the service to access the storage account. For more information about managed identities in Azure, see [About managed identities for Azure resources](../../active-directory/managed-identities-azure-resources/overview.md).
25+
26+
In this step, browse to your FHIR service in the Azure portal, and select the **Identity** blade. Select the **Status** option to **On** , and then select **Save**. The **Yes** and **No** buttons will display. Select **Yes** to enable the managed identity for FHIR service. After the system identity has been enabled, you'll see a system assigned GUID value.
27+
28+
[ ![Enable Managed Identity](media/export-data/fhir-mi-enabled.png) ](media/export-data/fhir-mi-enabled.png#lightbox)
29+
30+
31+
## Assign permissions to the FHIR service to access the storage account
32+
33+
Browse to the **Access Control (IAM)** in the storage account, and then select **Add role assignment**. If the add role assignment option is grayed out, you'll need to ask your Azure Administrator to assign you permission to perform this task.
34+
35+
For more information about assigning roles in the Azure portal, see [Azure built-in roles](../../role-based-access-control/role-assignments-portal.md).
36+
37+
Add the role [Storage Blob Data Contributor](../../role-based-access-control/built-in-roles.md#storage-blob-data-contributor) to the FHIR service, and then select **Save**.
38+
39+
[![Screen shot of the Add role assignment page.](media/bulk-import/add-role-assignment-page.png) ](media/bulk-import/add-role-assignment-page.png#lightbox)
40+
41+
Now you're ready to select the storage account in the FHIR service as a default storage account for import.
42+
43+
## Set import configuration of the FHIR service
44+
45+
The final step is to set the import configuration of the FHIR service, which contains specify storage account, enable import and enable initial import mode.
46+
47+
> [!NOTE]
48+
> If you haven't assigned storage access permissions to the FHIR service, the import operations ($import) will fail.
49+
50+
To specify the Azure Storage account, you need to use [Rest API](https://docs.microsoft.com/rest/api/healthcareapis/services/create-or-update) to update the FHIR service.
51+
52+
To get the request URL and body, browse to the Azure portal of your FHIR service. Select **Overview**, and then **JSON View**.
53+
54+
[ ![Screenshot of Get JSON View](media/bulk-import/fhir-json-view.png) ](media/bulk-import/fhir-json-view.png#lightbox)
55+
56+
Copy the URL as request URL and do following changes of the JSON as body:
57+
- Set enabled in importConfiguration to **true**
58+
- add or change the integrationDataStore with target storage account name
59+
- Set initialImportMode in importConfiguration to **true**
60+
- Drop off provisioningState.
61+
62+
[ ![Screenshot of the importer configuration code example](media/bulk-import/importer-url-and-body.png) ](media/bulk-import/importer-url-and-body.png#lightbox)
63+
64+
After you've completed this final step, you're ready to import data using $import.
65+
66+
## Next steps
67+
68+
In this article, you've learned the FHIR service supports $import operation and how it allows you to import data into FHIR service account from a storage account. You also learned about the three steps used in configuring import settings in the FHIR service. For more information about converting data to FHIR, exporting settings to set up a storage account, and moving data to Azure Synapse, see
69+
70+
>[!div class="nextstepaction"]
71+
>[Converting your data to FHIR](convert-data.md)
72+
73+
>[!div class="nextstepaction"]
74+
>[Configure export settings and set up a storage account](configure-export-data.md)
75+
76+
>[!div class="nextstepaction"]
77+
>[Copy data from FHIR service to Azure Synapse Analytics](copy-to-synapse.md)
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
title: Executing the import by invoking $import operation on FHIR service in Azure Health Data Services
3+
description: This article describes how to import FHIR data using $import
4+
author: ginalee-dotcom
5+
ms.service: healthcare-apis
6+
ms.subservice: fhir
7+
ms.topic: how-to
8+
ms.date: 04/16/2022
9+
ms.author: ranku
10+
---
11+
12+
# Bulk import FHIR data (Preview)
13+
14+
The Bulk import feature enables importing FHIR data to the FHIR server at high throughput using the $import operation. This feature is suitable for initial data load into the FHIR server.
15+
16+
## Current limitations
17+
18+
* Conditional references in resources aren't supported.
19+
* If multiple resources share the same resource ID, then only one of those resources will be imported at random and an error will be logged corresponding to the remaining resources sharing the ID.
20+
* The data to be imported must be in the same Tenant as that of the FHIR service.
21+
22+
## Using $import operation
23+
24+
To use $import, you'll need to configure the FHIR server using the instructions in the [Configure bulk import settings](configure-import-data.md) article and set the **initialImportMode** to *true*. Doing so also suspends write operations (POST and PUT) on the FHIR server. You should set the **initialImportMode** to *false* to reenable write operations after you have finished importing your data.
25+
26+
The FHIR data to be imported must be stored in resource specific files in FHIR NDJSON format on the Azure blob store. All the resources in a file must be of the same type. You may have multiple files per resource type.
27+
28+
### Calling $import
29+
30+
Make a ```POST``` call to ```<<FHIR service base URL>>/$import``` with the following required headers and body, which contains a FHIR [Parameters](http://hl7.org/fhir/parameters.html) resource.
31+
32+
As `$import` is an async operation, a **callback** link will be returned in the `Content-location` header of the response together with ```202-Accepted``` status code. You can use this callback link to check import status.
33+
34+
#### Request Header
35+
36+
```http
37+
Prefer:respond-async
38+
Content-Type:application/fhir+json
39+
```
40+
41+
#### Body
42+
43+
| Parameter Name | Description | Card. | Accepted values |
44+
| ----------- | ----------- | ----------- | ----------- |
45+
| inputFormat | String representing the name of the data source format. Currently only FHIR NDJSON files are supported. | 1..1 | ```application/fhir+ndjson``` |
46+
| mode | Import mode. Currently only initial load mode is supported. | 1..1 | ```InitialLoad``` |
47+
| input | Details of the input files. | 1..* | A JSON array with three parts described in the table below. |
48+
49+
| Input part name | Description | Card. | Accepted values |
50+
| ----------- | ----------- | ----------- | ----------- |
51+
| type | Resource type of input file | 1..1 | A valid [FHIR resource type](https://www.hl7.org/fhir/resourcelist.html) that match the input file. |
52+
|URL | Azure storage url of input file | 1..1 | URL value of the input file that can't be modified. |
53+
| etag | Etag of the input file on Azure storage used to verify the file content hasn't changed. | 0..1 | Etag value of the input file that can't be modified. |
54+
55+
**Sample body:**
56+
57+
```json
58+
{
59+
"resourceType": "Parameters",
60+
"parameter": [
61+
{
62+
"name": "inputFormat",
63+
"valueString": "application/fhir+ndjson"
64+
},
65+
{
66+
"name": "mode",
67+
"valueString": "InitialLoad"
68+
},
69+
{
70+
"name": "input",
71+
"part": [
72+
{
73+
"name": "type",
74+
"valueString": "Patient"
75+
},
76+
{
77+
"name": "url",
78+
"valueUri": "https://example.blob.core.windows.net/resources/Patient.ndjson"
79+
},
80+
{
81+
"name": "etag",
82+
"valueUri": "0x8D92A7342657F4F"
83+
}
84+
]
85+
},
86+
{
87+
"name": "input",
88+
"part": [
89+
{
90+
"name": "type",
91+
"valueString": "CarePlan"
92+
},
93+
{
94+
"name": "url",
95+
"valueUri": "https://example.blob.core.windows.net/resources/CarePlan.ndjson"
96+
}
97+
]
98+
}
99+
]
100+
}
101+
```
102+
103+
### Checking import status
104+
105+
Make the REST call with the ```GET``` method to the **callback** link returned in the previous step. You can interpret the response using the following table:
106+
107+
| Response code | Response body |Description |
108+
| ----------- | ----------- |----------- |
109+
| 202 Accepted | |The operation is still running.|
110+
| 200 OK |The response body doesn't contain any error.url entry|All resources were imported successfully.|
111+
| 200 OK |The response body contains some error.url entry|Error occurred while importing some of the resources. See the files located at error.url for the details. Rest of the resources were imported successfully.|
112+
| Other||A fatal error occurred and the operation has stopped. Successfully imported resources haven't been rolled back.|
113+
114+
Below are some of the important fields in the response body:
115+
116+
| Field | Description |
117+
| ----------- | ----------- |
118+
|transactionTime|Start time of the bulk import operation.|
119+
|output.count|Count of resources that were successfully imported|
120+
|error.count|Count of resources that weren't imported due to some error|
121+
|error.url|URL of the file containing details of the error. Each error.url is unique to an input URL. |
122+
123+
**Sample response:**
124+
125+
```json
126+
{
127+
"transactionTime": "2021-07-16T06:46:52.3873388+00:00",
128+
"request": "https://importperf.azurewebsites.net/$Import",
129+
"output": [
130+
{
131+
"type": "Patient",
132+
"count": 10000,
133+
"inputUrl": "https://example.blob.core.windows.net/resources/Patient.ndjson"
134+
},
135+
{
136+
"type": "CarePlan",
137+
"count": 199949,
138+
"inputUrl": "https://example.blob.core.windows.net/resources/CarePlan.ndjson"
139+
}
140+
],
141+
"error": [
142+
{
143+
"type": "OperationOutcome",
144+
"count": 51,
145+
"inputUrl": "https://example.blob.core.windows.net/resources/CarePlan.ndjson",
146+
"url": "https://example.blob.core.windows.net/fhirlogs/CarePlan06b88c6933a34c7c83cb18b7dd6ae3d8.ndjson"
147+
}
148+
]
149+
}
150+
```
151+
152+
## Next steps
153+
154+
In this article, you've learned about how the Bulk import feature enables importing FHIR data to the FHIR server at high throughput using the $import operation. For more information about converting data to FHIR, exporting settings to set up a storage account, and moving data to Azure Synapse, see
155+
156+
157+
>[!div class="nextstepaction"]
158+
>[Converting your data to FHIR](convert-data.md)
159+
160+
>[!div class="nextstepaction"]
161+
>[Configure export settings and set up a storage account](configure-export-data.md)
162+
163+
>[!div class="nextstepaction"]
164+
>[Copy data from Azure API for FHIR to Azure Synapse Analytics](copy-to-synapse.md)
54.1 KB
Loading
53 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
185 KB
Loading

0 commit comments

Comments
 (0)