[英]Azure FHIR: Error when creating a Media Resource
I want to create a Media resource in my Azure FHIR, I follow the standard definition on https://www.hl7.org/fhir/media.html (In summary, there are only 2 mandatory fields: status and Content) but It did not work!.我想在我的 Azure FHIR 中创建一个媒体资源,我遵循https://www.hl7.org/fhir/media.html上的标准定义(总而言之,只有 2 个必填字段:状态和内容)但是它不工作!。
I try the simplest possible example: { "resourceType": "Media", "id": "", "status": "unknown", "content": { "id": "a1", "contentType": "audio/mpeg", "data": "" } }我尝试了最简单的例子:{ "resourceType": "Media", "id": "", "status": "unknown", "content": { "id": "a1", "contentType": "audio /mpeg", "数据": "" } }
But Server shows an error: "Type checking the data: Encountered unknown element 'status' at location 'Resource.status[0]' while parsing"但服务器显示错误:“类型检查数据:解析时在位置‘Resource.status[0]’处遇到未知元素‘状态’”
When remove the status field, the server shows a different error: "Element with min. cardinality 1 cannot be null".删除状态字段时,服务器显示不同的错误:“最小基数为 1 的元素不能为空”。
Can anybody tell me what is the correct syntax for creating a Media Resource?谁能告诉我创建媒体资源的正确语法是什么?
Thanks谢谢
I have just attempted to reproduce that but I cannot.我只是试图重现它,但我不能。 When I do a
当我做一个
POST https://<myservice>.azurehealthcareapis.com/Media
With a payload of:有效载荷为:
{ "resourceType": "Media", "id": "", "status": "unknown", "content": { "id": "a1", "contentType": "audio/mpeg", "data": "" } }
I get 201 CREATED
and return payload of:我得到
201 CREATED
并返回以下有效载荷:
{
"resourceType": "Media",
"id": "7140a11a-dc59-4766-83f9-027a56d69551",
"meta": {
"versionId": "1",
"lastUpdated": "2019-12-26T07:10:46.993+00:00"
},
"status": "unknown",
"content": {
"id": "a1",
"contentType": "audio/mpeg"
}
}
Could it be that your instance of the Azure API for FHIR is STU3, but you are using an R4 Media resource.可能是您的用于 FHIR 的 Azure API 实例是 STU3,但您使用的是 R4 媒体资源。 I believe the "status" element was added in R4.
我相信“状态”元素是在 R4 中添加的。
Thanks Michael!谢谢迈克尔! I mixed up STU3 and R4.
我混淆了 STU3 和 R4。
Followed correct version of Media: https://www.hl7.org/fhir/STU3/media.html , and it was solved!按照正确版本的媒体: https : //www.hl7.org/fhir/STU3/media.html ,它解决了!
{ "resourceType": "Media", "id": "d5af5eb3-1402-4249-987e-8ff1c09384b1", "meta": { "versionId": "1", "lastUpdated": "2019-12-27T03:41:16.288+00:00" }, "type": "photo", "content": { "id": "a1", "contentType": "audio/mpeg" } } { "resourceType": "Media", "id": "d5af5eb3-1402-4249-987e-8ff1c09384b1", "meta": { "versionId": "1", "lastUpdated": "2019-12-27T03:41 :16.288+00:00" }, "type": "photo", "content": { "id": "a1", "contentType": "audio/mpeg" } }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.