[英]HL7-Fhir : when posting a resource, is it allowed to reference to another resources by search criteria?
Creating a new resource (patient) can be done by a POST to the server. 可以通过对服务器的POST完成创建新资源(患者)的操作。
Example 1] 范例1]
Create a new Patient 'a' which is linked to Organization with id = 1 ) : 创建一个新的患者'a',该患者链接到id = 1的 Organization:
{
"resourceType": "Patient",
"name": "a",
"birthDate": "1974-12-25",
"organization": {
"reference": "Organization/1"
}
}
However, I was wondering if it's also allowed to create a new Patient with a link to an Organization based on a search field? 但是,我想知道是否还允许创建一个新患者,并根据搜索字段链接到组织的链接?
Example 2] 范例2]
Create a new Patient 'b' which is linked to an Organization with name = orgname . 创建一个新的患者'b',该患者链接到名称为orgname的组织。
{
"resourceType": "Patient",
"name": "b",
"birthDate": "1974-12-25",
"organization": {
"reference": "Organization?name=orgname"
}
}
A reference must point to a specific resource. 引用必须指向特定资源。 So what you've shown isn't allowed. 因此,您所显示的内容是不允许的。 However, if you were to post a bundle, your Patient resource could point to an Organization resource within the Bundle and the Bundle could have a conditional create (using If-None-Exist) based on the absence of any resource that has a specified name. 但是,如果要发布捆绑软件,则您的患者资源可能指向捆绑软件中的组织资源,并且捆绑软件可能会基于没有指定名称的任何资源而有条件创建(使用If-None-Exist) 。 But we haven't actually defined what happens to references in this circumstance. 但是,我们实际上还没有定义在这种情况下引用会发生什么。 (If you wouldn't mind, it'd be good to submit a change request on this.) (如果您不介意,最好对此提交更改请求。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.