简体   繁体   English

我们可以根据患者 ID 更新任何 fhir 资源吗?

[英]Can we update any fhir resource on the basis of patient id?

I am trying to update Encounter resource on the basis of patient id but it is only creating one new record of Encounter rather than updating the existing one.我正在尝试根据患者 ID 更新 Encounter 资源,但它只是创建 Encounter 的一条新记录,而不是更新现有记录。 But if i try to update Encounter on the basis of identifier ie unique value representing Encounter resource then it is able to update it.但是,如果我尝试根据标识符更新 Encounter,即代表 Encounter 资源的唯一值,那么它能够更新它。

Why is that?这是为什么? Can anyone explain?谁能解释一下?

One patient will potentially have many (even hundreds) of encounters.一名患者可能会遇到许多(甚至数百次)遭遇。 Updates are always driven by the record of the resource itself - every resource (Patient, Encounter, Observation, CarePlan, etc.) has an 'id' element that represents the identifier of that resource on that particular server - sort of like a primary key.更新始终由资源本身的记录驱动——每个资源(Patient、Encounter、Observation、CarePlan 等)都有一个“id”元素,表示该特定服务器上该资源的标识符——有点像主键. Updates are performed by making a RESTful PUT of the new record to a URL that includes that same identifier.通过对包含相同标识符的 URL 进行新记录的 RESTful PUT 来执行更新。

Ie an update of an Encounter MUST always be performed with a URL of the form:即,必须始终使用以下形式的 URL 执行 Encounter 的更新:

PUT [somebaseurl]/Encounter/[serverEncounterId]

The patient associated with the encounter will be referenced from within the Encounter object in the body of the RESTful call, but does not appear in the URL.与遭遇相关的患者将在 RESTful 调用正文中的 Encounter object 中引用,但不会出现在 URL 中。

As you have discovered, some FHIR servers will allow a 'conditional update':正如您所发现的,一些 FHIR 服务器将允许“有条件更新”:

PUT [somebaseurl]/Encounter?search_key=search_value&...

You will need to add search parameters that filter all Encounters and result in a unique one, which will then be updated.您将需要添加搜索参数来过滤所有遭遇并产生一个唯一的,然后将被更新。 Since, as Lloyd also indicated, a Patient can have multiple associated Encounters, the Patient id is not a suitable parameter for the conditional update.正如 Lloyd 还指出的那样,一个 Patient 可以有多个关联的 Encounter,因此 Patient id 不是条件更新的合适参数。 Your Encounter's identifier was unique enough, so that update succeeded.您的 Encounter 的标识符足够独特,因此更新成功。

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

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