Stream: implementers
Topic: where to read on Delete resource?
Nath (May 04 2020 at 01:23):
Hello,
As part of my app, medical history, family history, etc.. is collected in resources like condition, FamilyMemberHistory. The UI has CRUD(create, read, update, delete). I am looking for some guidance on delete. For example, assume multiple family member history is entered and I am deleting one of the family member history of a patient, will the familymemberhistory be deleted ?. I saw something like soft delete but not sure what that means. Could you please kindly point me where I can read about this or share some thoughts on this?. thanks for your help.
Lloyd McKenzie (May 04 2020 at 02:30):
The answer may vary from server to server. The general expectation is that if a record is deleted, it will no longer be returned in search results. However, if the server supports history, it should still be possible to look at old versions of the resource (if you happen to know the resource id). Even if history isn't supported, systems might still retain the record for audit purposes. They just wouldn't return it in queries any longer.
Nath (May 04 2020 at 05:48):
thanks @Lloyd McKenzie . I am using Hapi FHIR JPA version and the server supports history. So, if I issue a REST delete of the resource, it will not be available in search results. Can you please kindly elaborate a bit more about what change is done to the resource so it does not appear in search results ?. So, this is basically you call it as "Soft delete" ?. thanks again
Lloyd McKenzie (May 04 2020 at 05:54):
@James Agnew can probably comment a bit more about what happens at the database level, however essentially a new 'history' item is entered for the record that flags it as deleted. In fact, it's possible to 'undelete' a deleted record by submitting a PUT (update) with the id of the deleted record. All actions - including deletes - will show up in a history of the resource.
Nath (May 04 2020 at 05:58):
thanks @Lloyd McKenzie .
Last updated: Apr 12 2022 at 19:14 UTC