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

Matched resources should not also be _included #2448

Merged
merged 3 commits into from
Feb 4, 2022

Conversation

brendankowitz
Copy link
Member

@brendankowitz brendankowitz commented Jan 20, 2022

Description

Adds a filter so that if a resource is in the "matched" set of results, it should not also be there as an "include".

Limitation: this is only for the current page, it doesn't guarantee uniqueness across pages.

Related issues

Addresses #2037.

Testing

Adds E2E tests

FHIR Team Checklist

  • Update the title of the PR to be succinct and less than 50 characters
  • Add a milestone to the PR for the sprint that it is merged (i.e. add S47)
  • Tag the PR with the type of update: Bug, Dependencies, Enhancement, or New-Feature
  • Tag the PR with Azure API for FHIR if this will release to the Azure API for FHIR managed service (CosmosDB or common code related to service)
  • Tag the PR with Azure Healthcare APIs if this will release to the Azure Healthcare APIs managed service (Sql server or common code related to service)
  • CI is green before merge
  • Review squash-merge requirements

Semver Change (docs)

Patch (bug)

@brendankowitz brendankowitz changed the title Excludes matched resources from _include/_revinclude Matched resources should not also be _included Jan 24, 2022
@brendankowitz brendankowitz added Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug. labels Jan 24, 2022
@brendankowitz brendankowitz marked this pull request as ready for review January 24, 2022 21:32
@brendankowitz brendankowitz requested a review from a team as a code owner January 24, 2022 21:32
[InlineData("_include")]
[InlineData("_revinclude")]
[Theory]
public async Task GivenAnIncludeSearchExpressionWithLocationLinkedToItself_WhenSearched_ThenCorrectBundleShouldBeReturned(string includeType)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a test showing that this also works for cyclical references have value? IE: resource 1 references resource 2 and resource 2 references resource 1.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I think this can only be done with SQL (:iterate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure API for FHIR Label denotes that the issue or PR is relevant to the Azure API for FHIR Azure Healthcare APIs Label denotes that the issue or PR is relevant to the FHIR service in the Azure Healthcare APIs Bug Bug bug bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource returned multiple times if it meets both base criteria and _include criteria
2 participants