To collect patient information, a survey instance must be created using the /survey
endpoint. Each survey is represented by a unique generated ID. Using this ID, it's possible to manage the survey, retrieve the questions assigned to the survey, etc.
To create a survey, send a POST request to the /api/v2/survey
endpoint.
curl -X 'POST' \
'https:///api/v2/surveys' \
-H 'Content-Type: application/json' \
-d '{
"patient": {
"id": "65ec46fd-4069-4102-913e-4af48cb09be6"
}
}'
female
and male
year
. Currently supported values: year
+11231231234
YYYY-MM-DD
Sections allow you to define which questions are to be asked during the survey. List of string values; allowed options include: dynamic, visit_reason, risk_factors, chronic_diseases, specialist, hospitalization, allergies, message_to_doctor, drugs. If not specified during the survey, all sections will be included.
Note: section order cannot be changed.
visit_reason (List[VisitReason], optional)
"symptoms"
, "test_results"
, "prescription_extension"
, "follow_up"
, "other"
.
evidence (List[Evidence], optional)
id
attribute indicates an observed symptom or risk factor.
choice_id
attribute represents the state of given evidence and can have one of 3 values: present
, absent
or unknown
. Please note that absent
and unknown
cannot be used interchangeably, as their mathematical meanings are different.
"source": "initial"
- evidence reported by user,"source": "suggest"
- evidence from /suggest
endpoint,source
attribute should be entirely omitted.Example:
[
{
"id":"s_21",
"source":"initial",
"choice_id":"present"
},
{
"id":"s_24",
"choice_id":"present"
},
{
"id":"s_1535",
"choice_id":"present"
},
]
The date of the visit to which the survey is associated.
expired_date (datetime, optional)The expiration date of the survey, after which it can no longer be completed.
specialist (str, optional)Speciality name.
A survey identifier is returned in the response. This identifier will be used in other endpoints to perform actions on a specific survey.
Example:
{
"id": "8ba7a7ad-996a-444e-b79b-77e373015617"
}
To fetch a list of surveys, make a GET request to /api/v2/survey
:
curl -X 'GET' \
'https:///api/v2/surveys'
The response will include a paginated list of surveys. The elements on a page can be limited using the limit
parameter.
Maximum limit of elements per page. Default value is 10
, maximum value is 50
.
Example response:
{
"self": "https:///api/v2/surveys?cursor=0",
"first": "https:///api/v2/surveys?cursor=0",
"prev": "null",
"next": null,
"last": "https:///api/v2/surveys?cursor=0",
"items": [
{
"visit_date": null,
"expired_date": null,
"specialist": null,
"id": "27bba1c9-37d1-4f91-8ab8-64f7a4d72f12",
"status": "new",
"last_modified_at": "2022-11-17T09:59:22.105669+00:00"
},
{
"visit_date": null,
"expired_date": null,
"specialist": null,
"id": "4aebc64a-e294-468c-9a40-fd234850e1c5",
"status": "new",
"last_modified_at": "2022-11-17T09:58:08.053865+00:00"
},
{
"visit_date": null,
"expired_date": null,
"specialist": null,
"id": "6d27f58e-8f50-4890-b9c7-2ec7bf6a6a49",
"status": "completed",
"last_modified_at": "2022-11-17T09:32:45.329011+00:00"
}
]
}
The survey can be in one of three statuses: new
, pending
, or completed
.
Date and time the survey was last modified.
To delete a survey, send a DELETE request to /api/v2/surveys/{survey_id}
. A successful response will return the status code HTTP 204.
Deleted surveys will be completely removed and no longer listed in the API.
You can update the base information in a survey by making a PUT request to /api/v2/surveys/{survey_id}
.
curl -X 'PUT' \
'https:///api/v2/surveys/4aebc64a-e294-468c-9a40-fd234850e1c5' \
-H 'Content-Type: application/json' \
-d '{
"visit_date": "2022-11-19T14:43:55.757Z",
"expired_date": "2022-11-19T14:43:55.757Z",
"specialist": "Dermatologist"
}'
The date of the visit to which the survey is associated. Default value: null
The expiration date of the survey, after which it can no longer be completed.
Default value: null
Speciality name. Default value: null
Note: If the fields are not specified, empty values will be set.
{
"visit_date": "2022-11-19T14:43:55.757Z",
"expired_date": "2022-11-19T14:43:55.757Z",
"specialist": "Dermatologist"
}