home api list

Hexostore API Documentation

surveyanswers

/api/surveyanswers/

List methods: post, get

Detail methods: options, post, get

Submit a filled questionnaire to a survey.
For more information on what is a survey, check the study section here

Example usage

Let's suppose we have a survey that look like this example below. We can submit a response to this survey by making a POST to /api/surveyanswers/. At a glance, the expected structure we need to submit is as follow:

{
    "survey": "/api/survey/<survey id>/",
    "study": "api/study/<study id>/",
    "subject": "subject id"
    "fhir_answer": {},
}

The survey id, study id, and subject id are required by Hexoskin to map the response with the appropriate study/survey/subject combination. The fhir_answer element is a valid FHIR Questionnaire.

A valid survey response for the example below would look like this:

{
    "survey": "/api/survey/1/",
    "study": "api/study/1/",
    "fhir_answer": {
        "id": "1",
        "identifier": "1",
        "resourceType": "Questionnaire",
        "status": "completed",
        "authored": "2020-04-17T20:00:25.073Z",
        "item": [
            {
                "linkId": "1",
                "answer": [
                    {
                        "valueBoolean": true
                    }
                ]
            },
            {
                "linkId": "2",
                "answer": [
                    {
                        "valueBoolean": true
                    }
                ]
            },
            {
                "linkId": "3",
                "answer": [
                    {
                        "valueBoolean": true
                    }
                ]
            }
        ],
        "subject": "Test Subject #1"
    }
}

Survey used in the example above

{
    "id": 1,
    "survey_description": "Very short example survey that could be used for a patient suffering of the COVID-19",
    "resource_uri": "/api/survey/1/",
    "fhir_questionnaire": {
        "id": "1",
        "status": "active",
        "subjectType": ["Patient"],
        "resourceType": "Questionnaire",
        "item": [
        {
            "id": "1",
            "type": "boolean",
            "linkId": "1",
            "text": "Chest pain when breathing deeply?"
        },
        {
            "id": "2",
            "type": "boolean",
            "linkId": "2",
            "text": "Feeling tired or weak?"
        },
        {
            "id": "3",
            "type": "boolean",
            "linkId": "3",
            "text": "Loss of smell or taste?"
        }
        ],
        "url": "/api/questionnaire/1/",
        "name": "COVID-19 Survey",
        "title": "COVID-19 Survey",
        "description": "Daily questionnaire to follow up on a patient with COVID-19."
    },
    "survey_name": "COVID-19 Example"
}

Fields

id: IntegerField

This field is readonly.

answers: ListSerializer

Answers to the questionnaire

This field will default to: '' (empty string)

study: RelatedUrlField

study id or uri in the form of /api/study/id/

This field is readonly.

survey: RelatedUrlField

survey id or uri in the form of /api/survey/id/

This field is readonly.

user: RelatedUrlField

studysubject id or uri in the form of /api/studysubject/id/

This field is readonly.

event_schedule: RelatedUrlField

planning id or uri in the form of /api/planning/id/

This field is readonly.

survey_id: IntegerField

survey id used internally. Please ignore.

This field will default to: '' (empty string)

study_id: IntegerField

study id used internally. Please ignore.

This field will default to: '' (empty string)

user_id: IntegerField

studysubject id used internally. Please ignore.

This field will default to: '' (empty string)

event_schedule_id: IntegerField

planning id used internally. Please ignore.

This field may be blank

This field will default to: '' (empty string)

status: CharField

in-progress | completed | amended | entered-in-error | stopped More information

This field is readonly.

status_write: CharField

Used internally to convert and write the status in the database. Please ignore.

This field will default to: '' (empty string)

authored: DateTimeField

This field will default to: '' (empty string)

Filtering Options

authored: exact, in, gt, gte, lt, lte

id: exact, in, isnull

study: exact, in, gt, gte, lt, lte

survey: exact, in, gt, gte, lt, lte

user: exact, in, gt, gte, lt, lte

Sorting Options

id

© 2024 by CarrĂ© Technologies Inc.