Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support _type search parameter #2021

Closed
rahul1 opened this issue May 11, 2023 · 2 comments · Fixed by #4102
Closed

Support _type search parameter #2021

rahul1 opened this issue May 11, 2023 · 2 comments · Fixed by #4102
Assignees
Labels
search Features and fixes related to search

Comments

@rahul1
Copy link
Member

rahul1 commented May 11, 2023

The FHIR search spec allows for searching multiple resource types in a single query using the _type parameter. We have users that would like to support this in order to do unified sort / pagination across resource types. An example use case is building a "feed" of all resources related to a patient.

https://build.fhir.org/search.html#type

If no type is specified, the only search parameters that can be used in global search like this are the base parameters that apply to all resources.

If a single type is specified, all search parameters for that type are allowed.

If multiple types are specified, all search parameters that can be referenced commonly between resources can be used (e.g., listed with the same name in the CapabilityStatement, typically the value of SearchParameter.code) TU. For example, both Patient and Person define a search parameter referenced by name. Assuming a server implements both parameters and uses name to do so, the name parameter can be used to search across both Patient and Person resources. Note that this is allowed even though the search parameters do not share a common definition. If a request references multiple parameters that are not the same type (e.g., if one parameter is a number type and another is a token type, despite sharing the same name), this is an error and servers SHOULD return a 400 status TU.

@codyebberson
Copy link
Member

This would be possible using Postgres UNION queries: https://www.postgresql.org/docs/current/queries-union.html

@reshmakh reshmakh added the search Features and fixes related to search label May 12, 2023
@codyebberson
Copy link
Member

This would actually be a great implementation model for Patient/$everything requests, and ResourceTimeline requests as well.

@rahul1 rahul1 added this to the Milestone Quality milestone Sep 22, 2023
@rahul1 rahul1 assigned codyebberson and mattlong and unassigned codyebberson Feb 27, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 5, 2024
* Fixes #2021 - support _type search parameter

* Cleanup
medplumbot added a commit that referenced this issue Mar 6, 2024
IF-MATCH header for resource contention (#4088)
ci(autofix.ci): replace `prettier` action w/ `autofix.ci` (#4093)
Added initial key value API (#4041)
Bugfix: Read ClientApplication from Login resource (#4098)
Fixes #4084 - validate reference resource type (#4094)
fix(client): add check for `isInitialized` in `isLoading()` (#4097)
Removing warnings (#4095)
Fix - Added creatable prop to CodingInput in QuestionnaireChoiceSetInput at QuestionnaireFormItem. (#4089)
Implement terminology operations for validation (#4073)
Fixes #2021 - support _type search parameter (#4064)
Fixes #4086 - getExtensionValue all value types (#4087)
Copy update RE EHR (#4081)
Dependency upgrades (#4082)
Escape equals sign in CSV export (#4079)
Fixes #4069 - validate choice-of-type cardinality (#4080)
Remove faulty console.assert (#4070)
Fixes #4054 - update agent docs (#4078)
Add documentation on running docker without aws (#4077)
github-merge-queue bot pushed a commit that referenced this issue Mar 6, 2024
IF-MATCH header for resource contention (#4088)
ci(autofix.ci): replace `prettier` action w/ `autofix.ci` (#4093)
Added initial key value API (#4041)
Bugfix: Read ClientApplication from Login resource (#4098)
Fixes #4084 - validate reference resource type (#4094)
fix(client): add check for `isInitialized` in `isLoading()` (#4097)
Removing warnings (#4095)
Fix - Added creatable prop to CodingInput in QuestionnaireChoiceSetInput at QuestionnaireFormItem. (#4089)
Implement terminology operations for validation (#4073)
Fixes #2021 - support _type search parameter (#4064)
Fixes #4086 - getExtensionValue all value types (#4087)
Copy update RE EHR (#4081)
Dependency upgrades (#4082)
Escape equals sign in CSV export (#4079)
Fixes #4069 - validate choice-of-type cardinality (#4080)
Remove faulty console.assert (#4070)
Fixes #4054 - update agent docs (#4078)
Add documentation on running docker without aws (#4077)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
search Features and fixes related to search
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants