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 16 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.
@LTA-Thinking
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

mikaelweave
mikaelweave previously approved these changes Feb 11, 2025
Copy link
Contributor

@mikaelweave mikaelweave left a comment

Choose a reason for hiding this comment

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

some comments, but good to merge as is

@@ -183,6 +195,12 @@ public async Task<long> DeleteMultipleAsync(ConditionalDeleteResourceRequest req
onlyIds: true,
logger: _logger);
}

if (CheckFhirContextIssues())
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT - could this function name be closer to what the function does?? - like CheckFhirContextTooManyIncludes. Here it seems like any context issue means tooManyIncludeResults

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fair, I had originally intended for the function to look for any context issues but the only one that is relevant right now is the too many include results warning.

{
CheckBulkDeleteEnabled();

var resourceTypes = new Dictionary<string, long>()
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to have multiple links / resource types in this test? Could make the test more robust.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you mean like having another include statement and a resource for it to find?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking (resource w/ reference) -> (two different resources).

Example is Encounter.participant[x].actor or Encounter.appointment.

If this doesn't add value - can be skipped - but my though was > 1 resource would be a more full test.

Robert Johnson added 2 commits February 11, 2025 14:08
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.

3 participants