-
Notifications
You must be signed in to change notification settings - Fork 528
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
Implementing $includes operation with paging. #4810
base: main
Are you sure you want to change the base?
Conversation
src/Microsoft.Health.Fhir.Shared.Api/Controllers/IncludesController.cs
Fixed
Show resolved
Hide resolved
src/Microsoft.Health.Fhir.Shared.Core/Features/Search/SearchOptionsFactory.cs
Fixed
Show resolved
Hide resolved
src/Microsoft.Health.Fhir.SqlServer/Features/Search/SqlServerSearchService.cs
Show resolved
Hide resolved
src/Microsoft.Health.Fhir.SqlServer/Features/Search/SqlServerSearchService.cs
Fixed
Show fixed
Hide fixed
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
src/Microsoft.Health.Fhir.SqlServer/Features/Search/IncludesContinuationToken.cs
Show resolved
Hide resolved
src/Microsoft.Health.Fhir.Shared.Core/Features/Search/SearchOptionsFactory.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Health.Fhir.Shared.Core/Features/Search/SearchOptionsFactory.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/IncludesOperationTestFixture.cs
Fixed
Show resolved
Hide resolved
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/IncludesOperationTestFixture.cs
Fixed
Show resolved
Hide resolved
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/IncludesOperationTestFixture.cs
Fixed
Show resolved
Hide resolved
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/IncludesOperationTestFixture.cs
Show resolved
Hide resolved
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/IncludesOperationTests.cs
Fixed
Show resolved
Hide resolved
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/IncludesOperationTestFixture.cs
Show resolved
Hide resolved
test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/Search/IncludesOperationTestFixture.cs
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been testing the $include feature, and it is looking good! I have a few points to ask about:
- if we have more than 500 included items, then in the first Bundle of results we do return any of the included items. After testing, this seems weird, when I request 1 resource and all _revincludes, and the included items are many, but the matched results are one or few. My initial Bundle is very small. Could we not include the first page of "included" results in the remaining space of the bundle?
- _count does not apply to "included" resources. I believe that is correct, but wanted to double check. If I am asking for a default _count of 10, and I get 4 or 5 matches, but hundreds of included items, the resulting bundle will be very large, and the client may not be expecting that.
- We include the observation outcome of "Include result was truncated" even in the pages of the $includes link. Once I am following the $include link, it seem like I should page through that, and the existence of a "next" link would indicate that I am not finished paging. The operation outcome seems out of place at that point.
...lth.Fhir.SqlServer/Features/Search/Expressions/Visitors/QueryGenerators/SqlQueryGenerator.cs
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets hold off on merging until we discuss/resolve any breaking behaviors
EnsureArg.IsNotNull(coreFeaturesConfiguration?.Value, nameof(coreFeaturesConfiguration)); | ||
|
||
_mediator = mediator; | ||
_coreFeaturesConfiguration = coreFeaturesConfiguration.Value; |
Check warning
Code scanning / CodeQL
Dereferenced variable may be null Warning
coreFeaturesConfiguration
this
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 10 hours ago
To fix the problem, we need to ensure that _coreFeaturesConfiguration
is not null before it is dereferenced. This can be done by adding a null check before accessing _coreFeaturesConfiguration.SupportsIncludes
in the Search
method. This will prevent a potential NullReferenceException
if _coreFeaturesConfiguration
is null.
-
Copy modified line R49
@@ -48,3 +48,3 @@ | ||
{ | ||
if (!_coreFeaturesConfiguration.SupportsIncludes) | ||
if (_coreFeaturesConfiguration == null || !_coreFeaturesConfiguration.SupportsIncludes) | ||
{ |
Description
The PR contains the implementation of the $includes operation (explained in the spec below) including UT/E2E tests.
[$includes operation spec]
https://microsoft.sharepoint.com/:w:/t/msh/EaYsMkWJsVxNpaHhokCQbQcBxHtWbL8u80sTsENnKYNnPA?e=O1gE7h
Related issues
Addresses [issue #138967].
User Story 138967: Implement a new $include operation.
Testing
Manually tested. Automated tests being added.
FHIR Team Checklist
Semver Change (docs)
Patch|Skip|Feature|Breaking (reason)