简体   繁体   中英

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.

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. My server is a hapi dstu2 instance.

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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