medic / cht-interoperability

CHT - eCHIS interoperability project
GNU Affero General Public License v3.0
2 stars 3 forks source link

Allow mediators to update resources with PUT requests #116

Open witash opened 6 months ago

witash commented 6 months ago

If a FHIR resource needs to be updated on a remote endpoint, the mediator needs to send a request to the endpoint with method PUT, instead of POST. If POST is used, it will be treated as trying to create a new resource and the request will usually fail due to duplicates.

This requires either the mediator or outbound push to be able to differentiate between a new resource and an existing resource. Note that "existing resource" means existing for the remote endpoint; although it may be possible to assume that an existing resource on the CHT side has already been created on the remote endpoint.

The current mediator implementation only uses POST. Outbound push from CHT also only uses POST; it does send requests for updates, but these requests have method POST.

Either outbound push needs to send PUT requests for existing resources, assuming they have already been created on the remote, and the mediator needs to support PUT requests.

Or the mediator itself needs a way to tell if a resource is being created or updated