简体   繁体   English

如何通过标识符搜索第一资源?

[英]How to search for a fhir resource by Identifier?

I've notice most if not all fhir resource types have a property 'identifier', which is of type identifier. 我注意到大多数(如果不是全部)三种资源类型都有一个属性'identifier',它是标识符类型。

I have set this on my resources to have a system, and a value, I'm wondering how I now search for resources with a given identifier? 我将其设置为具有系统和值的资源,我想知道现在如何搜索具有给定标识符的资源?

Ideally I would like to search for all resources of all types with a given identifier, but I don't think there's an easy way to specify a url which searches across all types, so for example, I have a patient resource with an identifier of system:www.mydomain.com value:1, and I want to find them. 理想情况下,我想搜索具有给定标识符的所有类型的所有资源,但是我认为没有一种简单的方法可以指定可搜索所有类型的url,因此,例如,我有一个患者资源,其标识符为系统:www.mydomain.com值:1,我想找到它们。 My server is a hapi dstu2 instance. 我的服务器是hapi dstu2实例。

You could perform a search for identifier with the standard search syntax: 您可以使用标准搜索语法执行标识符搜索:

  GET [base]/Patient?identifier=12345

or, if you also want to specify the system: 或者,如果您还想指定系统:

  GET [base]/Patient?identifier=www.mydomain.com|12345

and do that for each of the resource types you want to perform the search on. 并针对要执行搜索的每种资源类型执行此操作。

As of STU3 you can also search across multiple types that share a common search parameter. 从STU3开始,您还可以跨多个共享相同搜索参数的类型进行搜索。 Identifier is one of them. 标识符就是其中之一。 You still have to specify the types you want to search on, and can do that with this syntax - if the server supports it: 您仍然必须指定要搜索的类型,并可以使用以下语法来实现-如果服务器支持:

  GET [base]?_type=Patient,Organization&identifier=12345

and you can also search on identifiers with a specific system without the value: 并且您还可以搜索具有特定系统的标识符,但不使用以下值:

  GET [base]/Patient?identifier=www.mydomain.com|

Please take a look at the search page of the spec for more information and examples. 请查看规范的搜索页面以获取更多信息和示例。

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

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