I am working with FHIR Library with Asp .Net c# for eHealth4U project with University Of Cyprus.
I can see that FHIR has DeleteAsync method, however am worndering if that method actually deletes the record or it soft deletes it. if it completely deletes it, is there any other way to soft delete records ?
FHIR doesnât have a DeleteAsync method, though certain reference implementations might. Youâll have to investigate what the RI method does. The FHIR âdeleteâ interaction does not distinguish whether it performs a physical or logical delete - it simply defines what the behavior of the interface is - specifically that deleted records arenât returned when performing queries. If a server supports history for a resource, then deleting a resource instance doesnât remove historical versions - the history can still be retrieved and the âdeletionâ will simply be shown as one record within the overall history. In fact, itâs possible for a record to be deleted, then replaced using Update, then deleted again multiple times if a client chooses to do so.
âentered-in-errorâ isnât really the same as âdeletedâ. âentered-in-errorâ is specifically saying âthis record should never have existed, if you acted on it, revisit your actions because they were based on faulty dataâ. Itâs actually explicitly not deleting the record because you want it to remain visible that an error was made so users can understand the context for decisions made. As well, there are lots of reasons for deleting records (revocation of consent, de-duplication, expiry, storage management) where the âentered-in-errorâ assertion would not be accurate.
So we are saying that âlogicalâ or âphysicalâ delete is not in scope of FHIR spec, because it is a status of the record in the repository? You canât have the status " deleted" practically on anything. When we discussed status codes, the âentered-in-errorâ was the most common reason why someone would want to delete the record. Does it mean that the FHIR server needs to add an additional status field to keep that âlogicalâ delete info? For any other than in error deletions?
When a âdeleteâ occurs, it is up to the server whether to treat it as a physical or logical delete. Most servers will treat it as a âlogicalâ deletion and flag the record in some way. However, that flag isnât defined in FHIR because it is never surfaced over the FHIR interface. In a âhistoryâ entry, that particular version of the resource doesnât appear. In a GET or a search, there is no record to see.