FHIR的批量导入请求

问题描述 投票:0回答:1

https:/github.comsmart-on-fhirbulk-importblobmasterimport.md。

我使用了上面的链接作为参考,并尝试使用下面的代码来运行导入。

import requests

url = "https://<fhir-server-name>.azurehealthcareapis.com/$import"

payload = "{\r\n\t\"inputFormat\": \"application/fhir+ndjson\",\r\n\t\"inputSource\": \"https://localhost\",\r\n\t\"storageDetail\": { \"type\": \"https\" },\r\n\t\"input\": [\r\n\t{\r\n\t\t\"type\": \"Patient\",\r\n\t\t\"url\": \"https://localhost/patient_ndjson.ndjson\"\r\n\t}\r\n\t]\r\n}"
headers = {
  'Accept': 'application/fhir+json',
  'Prefer': 'respond-async',
  'Content-Type': 'application/json',
  'Authorization': 'Bearer <Auth Token>'
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

我收到了400个坏的请求.我试着在这两个地方发帖

url = "https://<fhir-server-name>.azurehealthcareapis.com/$import"
url = "https://<fhir-server-name>.azurehealthcareapis.com/Patient/$import"

我用apache托管文件,文件可以用http和https访问。有什么办法可以直接指向我的本地ndjson文件,而不是用http服务器导入。 ?

patient_ndjson.ndjson包含了

{"resourceType":"Patient","id":"8c76dfe7-2b94-497b-9837-8315b150ac0e","meta":{"versionId":"1","lastUpdated":"2020-04-27T11:08:10.611+00:00"},"active":true,"name":[{"use":"official","family":"p000001"}],"gender":"female","birthDate":"2020-04-27T11:00:00+05:30"}
{"resourceType":"Patient","id":"bfab05c7-d36a-4b5a-a0d6-6efb1da0fb3d","meta":{"versionId":"1","lastUpdated":"2020-04-27T11:34:43.83+00:00"},"active":true,"name":[{"use":"official","family":"p000001"}],"gender":"female","birthDate":"2020-04-27T11:00:00+05:30"}
{"resourceType":"Patient","id":"4c314eb1-6309-424b-affc-197fb0131cf6","meta":{"versionId":"1","lastUpdated":"2020-04-27T12:09:20.777+00:00"},"active":true,"name":[{"use":"official","family":"p000002"}],"gender":"female","birthDate":"2020-04-27T03:00:00+05:30"}

能否请你提供一些示例请求.这将是有帮助的。

hl7-fhir fhir-server-for-azure
1个回答
1
投票

$import 是一个草拟的规范,它还不支持(还)Azure API for FHIR。

© www.soinside.com 2019 - 2024. All rights reserved.