Duplicate Resource/Data added in FHIR Repository
If I add the same patient data with a different unique ID then it inserts as new data using a POST request.
So, In the FHIR server How can I prevent this kind of thing by using POST requests?
Note:- I don't want to use a PUT request for the same. The main thing is I want to get a unique patient record.
Que:- Is there any way to check data duplication on each FHIR resource?
Thanks & Regards,
Harshdeep Acharya
Product version: IRIS 2021.1
Probably the best way to avoid these duplicate POSTs is to use conditional update.
The conditional update interaction allows a client to update an existing resource based on some identification criteria, rather than by logical id. To accomplish this, the client issues a
PUT
as shown:When the server processes this update, it performs a search using its standard search facilities for the resource type, with the goal of resolving a single logical id for this request. The action it takes depends on how many matches are found:
400
Bad Request error indicating the client id specification was a problem preferably with an OperationOutcome412
Precondition Failed error indicating the client's criteria were not selective enough preferably with an OperationOutcomeYou can read about this operation type here: https://www.hl7.org/fhir/http.html#update