Does Medplum implement Update with No Changes? I...
# dev
j
Does Medplum implement Update with No Changes? It's an interesting feature of Smile CDR: https://smilecdr.com/docs/fhir_standard/fhir_crud_operations.html#no-op
@reshma we can maybe put this one on our agenda, we have a use case here and could probably come up with a similar design I think the loose idea would to add a column to each resource table that stores a sha256 hash of the resource content Then, in Repository, check if the value matches on writes
r
@joshua_kelly - interesting, yeah - let's discuss.
we do not currently support that - interesting to note that it is in use elsewhere
r
@joshua_kelly what is the intended behavior for this feature? If you PUT a resource without changing it, we do not add an entry to the history.
e.g.
medplum get Patient/:id | xargs -0 -n 1 medplum put 'Patient/:id'
Is there another functionality we should be implementing?
j
@rahul1 Oh, interesting - so, behaviourally, it actually is implemented? A no-op OperationOutcome would be nice (but not necessary for our use case)
Is there a sameness check in Repository or a deeper layer?
The behavior is sort of two things in the Smile CDR implementation: 1. Don't create a new version, don't update meta values (lastUpdated etc) when PUTing a body that is exactly equal to the current content 2. Optionally, return an OperationOutcome that specifies that the response did not produce a change (not sure what the Smile CDR uses here as far as a code, but the docs suggest this is what they do)
172 Views