简体   繁体   English

FHIR 的批量导入请求

[英]Bulk Import Request for FHIR

https://github.com/smart-on-fhir/bulk-import/blob/master/import.md https://github.com/smart-on-fhir/bulk-import/blob/master/import.md

I used above link for reference and tried to run import using the following code我使用上面的链接作为参考,并尝试使用以下代码运行导入

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'))

i am receiving 400 Bad Request.我收到 400 错误请求。 i tried posting to both我尝试同时发布

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

I used apache for hosting the file and the file is accessible with both http and https.. Instead of importing it using http server, is there any way to directly point to my local ndjson file ? I used apache for hosting the file and the file is accessible with both http and https.. Instead of importing it using http server, is there any way to directly point to my local ndjson file ?

patient_ndjson.ndjson contains 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"}

Can you please provide some sample request.你能提供一些样品要求吗? it would be helpful.这会很有帮助。

$import is a draft spec and it is not supported (yet) on the Azure API for FHIR. $import是一个草案规范,它在 FHIR 的 Azure API 上不受支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM