Skip to main content
Version: 9.x (Current)

Submit URLs API

The submit URLs can be either provided with the CRUD Service or with custom APIs, but it's important that they expose the following methods:

  • GET /{id}
  • POST /
  • PATCH /{id}
  • DELETE /{id}

GET route

The GET /{id} route returns the submitted data of a form by ID.

Response body schema

If the retrieve data procedure is successful, the response body must be a JSON object with the following schema:

NameRequiredDescription
datatrueContent of the form data
info

Each property of the data object is related to a component of the form.

Example

{
"data": {
"property1": "value1",
"property2": "value2",
...
}
}

POST route

The POST / route saves the data of a new submitted form.

Request body schema

The POST route must receive a body containing a JSON object with the following schema:

NameRequiredDescription
formSchemaIdtrueThe ID of the form schema related to the provided form data
formAssignmentIdtrueThe ID of the form assignment
datatrueContent of the form data

Example

{
"formSchemaId": "1234",
"data": {
"property1": "value1",
"property2": "value2",
...
}
}

Response body schema

If the save procedure is successful, the response body must be a JSON object with the following schema:

NameRequiredDescription
_idtrueThe ID of the saved form data

The returned _id will be stored by the Form Service Backend, and it will be used to retrieve the form data through the GET /{id} route.

Example

{
"_id": "fd215ds6s4sa5a",
}

PATCH route

The PATCH /{id} route updates the data of a previously submitted form.

info

Note that, the Form Service Backend calls the PATCH route with a body containing the entire form data, regardless if the properties has been modified or not by the user.

Request body schema

The PATCH route must receive a body containing a JSON object with the following schema:

NameRequiredDescription
formSchemaIdtrueThe ID of the form schema related to the provided form data
formAssignmentIdtrueThe ID of the form assignment
datatrueContent of the form data

All these properties are included into a parent object with the $set key.

Example

{
"$set": {
"formSchemaId": "1234",
"formAssignmentId": "abcd",
"data": {
"property1": "value1",
"property2": "value2",
...
}
}
}

Response body schema

If the update procedure is successful, the response body must be a JSON object with the following schema:

NameRequiredDescription
formDataIdtrueThe ID of the updated form data
formSchemaIdtrueThe ID of the form schema related to the provided form data
formAssignmentIdtrueThe ID of the form assignment
datatrueContent of the form data

Example

{
"formDataId": "fd215ds6s4sa5a",
"formSchemaId": "1234",
"formAssignmentId": "abcd",
"data": {
"property1": "value1",
"property2": "value2",
...
}

DELETE route

The DELETE /{id} route removes a form saved data from the FHIR API Server. It is required to allow to rollback in case of failure during the insertion in the formSchemaMapCrud collection.

The DELETE route does not have a request body. The only passed parameter is the ID of the form data represented by the query parameter {id}. There is no schema for the response body since we only provide a 204 No Content.