You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We're working to introduce a new $erase operation (#2304) for doing a hard delete on a specific logical resources (all versions).
For select use cases, it would be nice to be able to hard delete a specific historical version of a resource, while leaving the latest version of the resource in-tact.
There are two main use cases for this feature that I can think of:
Saving room in the database. Each historical version of a resource is stored as a gzip-compressed json blob in the database. If you are using the server as the target of a dumb scheduled batch job that performs updates on each resource, this can start to add up over time. Allowing admin users to hard delete unneeded historical versions could reclaim that space.
Removing resources due to data quality issues. For example, especially near the beginning of a project, integrators could churn through multiple versions of a resource before getting their ingestion pipeline "just right". If the customer does not want to expose these historical versions to the end user, but also does not want to "start fresh", then being able to selectively delete the historical versions could be useful.
Describe the solution you'd like
The$erase operation should take an optional argument so that you could invoke [base]/[ResourceType]/[id]/$erase with a version string that matches the version string of a particular version of this resource that you want to hard delete.
vread and resource history interactions which would read this version of this resource would need to return an appropriate error / warning.
If the user attempts to hard erase the latest version of a particular resource, I think we should reject that. That is, to delete the current version an end user would need to:
Update the resource instance to a new version; then
Delete the previous version
Describe alternatives you've considered
To support the user passing a version string to $erase, depending on the final design of $erase, its possible that we could support a pattern like this [base]/Patient/1234/_history/1/$erase, but I don't think that FHIR defines any resource version-specific operations like this.
To support erasure of the latest version of a resource, it would be possible to:
set the previous version as the latest (if there is one)
if there was one, then issue a reindex on it
Acceptance Criteria
1.
GIVEN [a precondition]
AND [another precondition]
WHEN [test step]
AND [test step]
THEN [verification step]
AND [verification step]
Additional context
Note: for Saving room in the database, my hope is that #2263 and #2284 will allow batch jobs to "stay dumb" (i.e. no state and no read-before-update) and still avoid producing lots of versions of the same resource with the same contents.
For Removing resources due to data quality issues, I think that most scenarios can be addressed by doing a hard delete of the whole resource, followed by a new ingestion run. One of the few cases I can think of where that might not be sufficient is if there are some appropriate and relevant historical versions of a resources, and then a "bad push". In this case, it would be nice to be able to update the resource back to a good state and then delete the historical version that had the bad data.
The only other way to address that particular scenario that I can think of would be to add support for posting history bundles (as described at https://www.hl7.org/fhir/http.html#other-bundles). If we had that, then a user could:
read the history of the resource
do a hard delete on the entire resource (all versions)
edit the history bundle from step one to omit the bad version
post the history bundle to the server to "restore" this resource with its proper history (including lastUpdated)
The text was updated successfully, but these errors were encountered:
- Issues resolved are:
- Add GDPR FHIR Operation Support - $erase #850
- FHIROperationContext inconsistently available to Batch.java #2297
- Support $erase (hard delete) for a specific historical version of a
resources #2304
- Remove the timeout and count parameters in lieu of the
version-specific erase
- Update the README with clarity on the parameters
- logicalId, version, patient, reason
- clarified the HTTP Method, Api Paths, Response Codes, and Responses
- Add Acceptance Criteria to explain VERSION delete
- Update the test harnesses for Db2 and Postgres to use the simple Erase
approach
- Clean up the DAO, JdbcEraseTest to move away from Timeout
- Removed patient/reason so we don't reflect illegal content.
- Change function/stored proc to use resource_type, logical_id only
- Refactor erase.json to support only specific values.
- Revert test.properties to logging false
- Improve IT/UT test coverage
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
Is your feature request related to a problem? Please describe.
We're working to introduce a new $erase operation (#2304) for doing a hard delete on a specific logical resources (all versions).
For select use cases, it would be nice to be able to hard delete a specific historical version of a resource, while leaving the latest version of the resource in-tact.
There are two main use cases for this feature that I can think of:
Describe the solution you'd like
The
$erase
operation should take an optional argument so that you could invoke[base]/[ResourceType]/[id]/$erase
with a version string that matches the version string of a particular version of this resource that you want to hard delete.vread
andresource history
interactions which would read this version of this resource would need to return an appropriate error / warning.If the user attempts to hard erase the latest version of a particular resource, I think we should reject that. That is, to delete the current version an end user would need to:
Describe alternatives you've considered
To support the user passing a version string to
$erase
, depending on the final design of$erase
, its possible that we could support a pattern like this[base]/Patient/1234/_history/1/$erase
, but I don't think that FHIR defines any resource version-specific operations like this.To support erasure of the latest version of a resource, it would be possible to:
Acceptance Criteria
1.
GIVEN [a precondition]
AND [another precondition]
WHEN [test step]
AND [test step]
THEN [verification step]
AND [verification step]
Additional context
Note: for
Saving room in the database
, my hope is that #2263 and #2284 will allow batch jobs to "stay dumb" (i.e. no state and no read-before-update) and still avoid producing lots of versions of the same resource with the same contents.For
Removing resources due to data quality issues
, I think that most scenarios can be addressed by doing a hard delete of the whole resource, followed by a new ingestion run. One of the few cases I can think of where that might not be sufficient is if there are some appropriate and relevant historical versions of a resources, and then a "bad push". In this case, it would be nice to be able to update the resource back to a good state and then delete the historical version that had the bad data.The only other way to address that particular scenario that I can think of would be to add support for posting history bundles (as described at https://www.hl7.org/fhir/http.html#other-bundles). If we had that, then a user could:
The text was updated successfully, but these errors were encountered: