microsoft / microsoft/fhir-server

Display error message when trying to delete a referenced resource

Open
#2,281 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Up for grabs
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:

  1. Add a Patient
  2. Add 2 organizations
  3. Add a Practitioner
  4. Add a Claim referencing above Patient ID, Organization IDs and and Practitioner ID.
  5. Try to delete Patient
  6. Your Patient will be deleted
  7. Claim is still available even your Patient referencing is missing
  8. Same steps for Organization and Practitioner

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.