Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple, but useful PATCH operation #9

Open
niquola opened this issue Jun 20, 2017 · 5 comments
Open

Simple, but useful PATCH operation #9

niquola opened this issue Jun 20, 2017 · 5 comments

Comments

@niquola
Copy link
Member

niquola commented Jun 20, 2017

Problem

Sometimes you need update only part of resource,
but FHIR operations granularity requires to update resource as a whole.
There is json/xml-diff proposal, but it's not so easy to construct diff, you need some library.
Server could diff and do it for you

Solution 1

Patch operation with the logic of object/hash-map merging:

PUT /Patient/1
{ 
  birthDate: '1970-01-01',
  name: [{given: ['nicola'], family: 'Ryzhikov', use: 'official'}],
  active: false
}

PATCH /Patient/1
{
  active: null, // delete active element
  birthDate: '1970-02-01' // updaet birthDate element
}

Open questions

  • more cases
  • how work with collections?
@grahamegrieve
Copy link

grahamegrieve commented Jun 20, 2017 via email

@niquola
Copy link
Member Author

niquola commented Jun 21, 2017

This is just a sugar to PATCH API - 80% simplicity for 80% simple cases

@grahamegrieve
Copy link

grahamegrieve commented Jun 21, 2017 via email

@niquola
Copy link
Member Author

niquola commented Jan 27, 2018

https://datatracker.ietf.org/doc/rfc7396/?include_text=1 could be used for this

@igorsirkovich
Copy link

I agree that this would be a simpler solution than regular PATCH in many scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants