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

Support Cascading Delete of Resources #1792

Open
SamShekhovtsov opened this issue Jun 11, 2024 · 2 comments
Open

Support Cascading Delete of Resources #1792

SamShekhovtsov opened this issue Jun 11, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@SamShekhovtsov
Copy link

it should be possible to cascade delete resources. For example, at our test environment we have a need to cascade delete a device, including all related/linked observations. I'm aware about the ENFORCE_REFERENTIAL_INTEGRITY environment variable, however it should do more than that - remove all linked resources whenever needed.

In order to support the cascade devete, the FHIR server should be configured accordingly, user have to have sufficient permissions and _delete=cascade query parameter should be set or, alternativelly, the HTTP header: 'X-Cascade': 'delete' should be set.

  1. First, the Cascading Deletes Enabled setting must be enabled on the FHIR Storage module.
  2. Then, the user performing the operation must have the FHIR_DELETE_CASCADE_ALLOWED permission, as well as a specific permission allowing the child resource to be deleted. For example, you might grant the user the FHIR_DELETE_CASCADE_ALLOWED and FHIR_ALL_DELETE permissions.
  3. DELETE /Patient/123?_cascade=delete or HTTP header set:
    DELETE /Patient/123 X-Cascade: delete
@alexanderkiel
Copy link
Member

Hi Sem, thanks for your issue. We decently will do more work regarding deletion and also #399. Did you especially refer to the way SmileCDR does Cascading Deletes?

@SamShekhovtsov
Copy link
Author

yep, I was talling specifically about cascading delete, for exampe, remove a patient or a device and all the related observations https://smilecdr.com/docs/fhir_repository/deleting_data.html#cascading-deletes

@alexanderkiel alexanderkiel changed the title deleting resources cascade Support Cascading Delete of Resources Jul 3, 2024
@alexanderkiel alexanderkiel self-assigned this Jul 3, 2024
@alexanderkiel alexanderkiel added the enhancement New feature or request label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants