This pull request includes changes to the src/Microsoft.Health.Fhir.Shared.Api/Features/Resources/Bundle/BundleRouter.cs and test/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/BundleEdgeCaseTests.cs files. The changes in BundleRouter.cs involve adding new dependencies, modifying the constructor to accommodate these dependencies, and refactoring the RouteAsync method. The changes in BundleEdgeCaseTests.cs involve adding a new test case.
Changes to BundleRouter.cs:
Modified the BundleRouter constructor to include new parameters: TemplateBinderFactory parameterPolicies, IEnumerable<MatcherPolicy> matcherPolicies, and EndpointSelector endpointSelector. The constructor now also ensures these new parameters are not null.
Refactored the RouteAsync method: The method is now asynchronous and includes changes to the logic for routing. The refactoring involves changes to the way route candidates are handled, the way the route endpoint is selected, and the way the selected endpoint is processed.
Changes to BundleEdgeCaseTests.cs:
Added a new dependency: System.Net.
Added a new test case: WhenProcessingABundle_IfItContainsHistoryEndpointRequests_ThenReturnTheResourcesAsExpected which tests the scenario where a bundle contains history endpoint requests.
Update the title of the PR to be succinct and less than 65 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, Build, Dependencies, Enhancement, New-Feature or Documentation
Tag the PR with Open source, Azure API for FHIR (CosmosDB or common code) or Azure Healthcare APIs (SQL or common code) to specify where this change is intended to be released.
Tag the PR with Schema Version backward compatible or Schema Version backward incompatible or Schema Version unchanged if this adds or updates Sql script which is/is not backward compatible with the code.
Description
Fixes for Bundle Routing
This pull request includes changes to the
src/Microsoft.Health.Fhir.Shared.Api/Features/Resources/Bundle/BundleRouter.cs
andtest/Microsoft.Health.Fhir.Shared.Tests.E2E/Rest/BundleEdgeCaseTests.cs
files. The changes inBundleRouter.cs
involve adding new dependencies, modifying the constructor to accommodate these dependencies, and refactoring theRouteAsync
method. The changes inBundleEdgeCaseTests.cs
involve adding a new test case.Changes to
BundleRouter.cs
:BundleRouter
constructor to include new parameters:TemplateBinderFactory parameterPolicies
,IEnumerable<MatcherPolicy> matcherPolicies
, andEndpointSelector endpointSelector
. The constructor now also ensures these new parameters are not null.RouteAsync
method: The method is now asynchronous and includes changes to the logic for routing. The refactoring involves changes to the way route candidates are handled, the way the route endpoint is selected, and the way the selected endpoint is processed.Changes to
BundleEdgeCaseTests.cs
:System.Net
.WhenProcessingABundle_IfItContainsHistoryEndpointRequests_ThenReturnTheResourcesAsExpected
which tests the scenario where a bundle contains history endpoint requests.Related issues
Addresses #3821, AB#119362
Testing
Describe how this change was tested.
FHIR Team Checklist
Semver Change (docs)
Patch