microsoft / microsoft/fhir-server

Concurrent conditional creates results in duplicate data

Open
#1,382 6 comments 0 reactions 0 assignees View on GitHub
Bug VSTS-Current
Dominant language
TSQL
Stars
1.4k
Forks
592
Avg merge
2d 7h
Merged PRs (30d)
41

Description

**Describe the bug**
When doing two conditional creates simultaneously (or near simultaneously) for the same resource, both are created, causing duplicate data to be stored in the system

**FHIR Version?**
Stu3/R4

**Data provider?**
CosmosDB/SQL Server

**To Reproduce**
Steps to reproduce the behavior:
Following are the steps the customer is following
1 Delete all existing patient data from their instance.
2. Make concurrent ‘Create Patient’ requests with ‘If-None-Exist:’ with a patient Identifier as a header parameter.

**Expected behavior**
Receive the 412 response for the 2nd create patient request that hits the Azure API for FHIR instance.

**Actual behavior**
2nd patient is created as a duplicate

Contributor guide

Open the contributing guide

Research direction

Begin with concurrent Create Patient requests using the If-None-Exist header against the Azure API for FHIR, testing both CosmosDB and SQL Server providers. Verify that one request receives a 412 response and that no duplicate patient is stored, covering the reported FHIR STU3/R4 versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
api, backend, databases
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.