FHIR Chat · Returning a created resource on POST · implementers

Stream: implementers

Topic: Returning a created resource on POST


view this post on Zulip David Hay (Mar 30 2021 at 17:37):

The spec doesn't talk about whether a server should return the created resources using a POST - some do and some don't. If it does, is the response obligated to be the same as that submitted? The server is allowed to modify the resource submitted if it needs to do so for business rules, so I would assume that it is OK to return an altered resource (In fact it could be argued that it is a good thing).

The specific scenario is a server that will automatically accept from known clients where the requested slot is available. We're proposing that the appointment.status is 'proposed' in the request, but 'booked' in the response.

view this post on Zulip Lloyd McKenzie (Mar 30 2021 at 17:38):

The response is obligated to be what's stored - which might not be the same as what was submitted. What's returned is the basis for subsequent updates.

view this post on Zulip Lloyd McKenzie (Mar 30 2021 at 17:39):

And yes, changing proposed to booked would be something that could happen. (Though throwing away data elements is more typical.)

view this post on Zulip Shyju K P (Apr 05 2021 at 11:59):

How to prepare the resource post data

view this post on Zulip Shyju K P (Apr 05 2021 at 12:01):

{
"resourceType": "Patient",
"id": "example",
"text": {
"status": "generated",
"active": true,
"name": [
{
"use": "official",
"family": "Chalmers",
"given": [
"Peter",
"James"
]
},
{
"use": "usual",
"given": [
"Jim"
]
},


This is the sample structure of patient resource, how can we understand the structure of each resources.

view this post on Zulip Shyju K P (Apr 05 2021 at 12:03):

Could you please give the guidelines or suggestions of my above query

view this post on Zulip Oliver Egger (Apr 05 2021 at 12:51):

Shyju K P said:

{
"resourceType": "Patient",
"id": "example",
"text": {
"status": "generated",
"active": true,
"name": [
{
"use": "official",
"family": "Chalmers",
"given": [
"Peter",
"James"
]
},
{
"use": "usual",
"given": [
"Jim"
]
},


This is the sample structure of patient resource, how can we understand the structure of each resources.

On the resourcelist you find references to all resources, and you can view for each resource the structured tree view, or if you prefer you can directly switch there to the JSON tab which gives you a template how the resource structure has to be.


Last updated: Apr 12 2022 at 19:14 UTC