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

Add support for include to delete requests #4811

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LTA-Thinking
Copy link
Collaborator

Description

Adds support for _include and _revinclude to conditional and bulk delete requests. Singular deletes still do not support extra parameters.

Related issues

Addresses User Story 139073: Phase 1: Work needed for getting cascading delete to work

Testing

New E2E tests have been added

FHIR Team Checklist

  • 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.
  • CI is green before merge Build Status
  • Review squash-merge requirements

Semver Change (docs)

Patch

@LTA-Thinking LTA-Thinking added Enhancement Enhancement on existing functionality. 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 labels Feb 4, 2025
@LTA-Thinking LTA-Thinking added this to the 2Wk09 milestone Feb 4, 2025
@LTA-Thinking LTA-Thinking requested a review from a team as a code owner February 4, 2025 15:23
@@ -73,14 +73,14 @@

_contextAccessor.RequestContext = fhirRequestContext;
var result = new BulkDeleteResult();
long numDeleted;
IDictionary<string, long> resourcesDeleted = new Dictionary<string, long>();

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
resourcesDeleted
is useless, since its value is never read.
@@ -86,33 +92,47 @@ public async Task<DeleteResourceResponse> Handle(ConditionalDeleteResourceReques

private async Task<DeleteResourceResponse> DeleteSingleAsync(ConditionalDeleteResourceRequest request, CancellationToken cancellationToken)
{
var matchedResults = await _searchService.ConditionalSearchAsync(
var results = await _searchService.ConditionalSearchAsync(
Copy link
Member

Choose a reason for hiding this comment

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

Did we a limit on the number of included items coming back from ConditionalSearch? i.e. if we delete the primary resource and some of the included items, do some then become orphaned?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The limit is still there. On line 108 there is a check to see if we got the "include results truncated" issue. If we did it returns 408 and says there are too many included results.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I still need to add similar behavior to bulk delete. I'm debating how best to do that so it still deletes as many results as possible. Once we have pagination for include I'll just have it page through the results.

@LTA-Thinking
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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 Enhancement Enhancement on existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants