microsoft / microsoft/fhir-server
Display error message when trying to delete a referenced resource
Nobody has claimed this yet.
- Dominant language
- TSQL
- Stars
- 1.4k
- Forks
- 592
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 41
Description
Describe the bug
I have a Claim in FHIR Server which has a Patient , 2 Organizations and 1 Practitioner resources.
When I try to delete referenced Patient or Organizations, server deletes without warning.
FHIR Version?
R4
Data provider?
CosmosDB
To Reproduce
Steps to reproduce the behavior:
- Add a Patient
- Add 2 organizations
- Add a Practitioner
- Add a Claim referencing above Patient ID, Organization IDs and and Practitioner ID.
- Try to delete Patient
- Your Patient will be deleted
- Claim is still available even your Patient referencing is missing
- Same steps for
OrganizationandPractitioner
Expected behavior
When you try to delete Patient it should warn user to tell, it's already used by other resource type.
Actual behavior
You can delete Patient and your Claim remains even your Patient referencing is missing
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the deletion flow with FHIR R4 data in CosmosDB: create a Claim referencing a Patient, Organizations, and a Practitioner, then delete each referenced resource. Trace the server entry point handling resource deletion and reference checks. Done means referenced resources are not silently deleted and the user receives a warning for all three cases.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100