Skip to main content

Survey

This is based on the FHIR resource Task.

Key Information

Creating surveys in the Bingli API involves initiating a new task related to patients and healthcare services. Following the FHIR standard ensures proper data structuring and seamless integration.

Essential Parameters

Survey ID

  • Description: A unique identifier for the survey.
  • Usage: Recommended to use your system’s survey ID, or generate a random GUID.

Patient Reference

  • Description: Links the survey to a previously created patient.
  • Usage: Must reference the patient ID created in an earlier step.

Requester (Organization)

  • Description: Indicates which organization is initiating the task.
  • Usage: Must reference the organization ID from the organization creation step.

Healthcare Service ID

  • Description: Identifies the healthcare service linked to the survey.
  • Usage: The ID provided by Bingli for healthcare services.

API Environments

Bingli provides multiple environments for different use cases:

  • Production EU: https://fhir-gateway.api.bingli.eu/tenant-api/task
  • Acceptance EU: https://fhir-gateway.api.acc.bingli.be/tenant-api/task
  • Production US: https://fhir-gateway.api.bingli.us/tenant-api/task

Creating a Survey

POST - Create Survey

Endpoint

https://fhir-gateway.api.bingli.eu/tenant-api/task

Description

This endpoint is used to create a new task, specifically for initiating surveys related to patients and healthcare services. The task is structured using FHIR standards.


Request Details

Headers

KeyValue
Content-Typeapplication/fhir+json
AuthorizationBearer JWTTOKEN

Body (Raw JSON)

{
"resourceType": "Task",
"id": "<YOUR-SURVEY-ID>",
"status": "draft",
"intent": "order",
"code": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/task-type",
"code": "create-survey"
}
]
},
"for": {
"reference": "patient/<PATIENT-ID-FROM-STEP-CREATE-PATIENT>"
},
"requester": {
"reference": "organization/<ORGANIZATION-ID-FROM-STEP-CREATE-ORGANIZATION>"
},
"input": [
{
"type": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/identifier",
"code": "HealthCareServiceId"
}
]
},
"valueString": "<HEALTHCARESERVICE-ID-FROM-BINGLI>"
}
]
}

cURL Request

To create a survey using cURL, use the following command:

curl --location 'https://fhir-gateway.api.bingli.eu/tenant-api/task' \
--header 'Content-Type: application/fhir+json' \
--header 'Authorization: Bearer <TOKEN>' \
--data '{
"resourceType": "Task",
"id": "<YOUR-SURVEY-ID>",
"status": "draft",
"intent": "order",
"code": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/task-type",
"code": "create-survey"
}
]
},
"for": {
"reference": "patient/<PATIENT-ID-FROM-STEP-CREATE-PATIENT>"
},
"requester": {
"reference": "organization/<ORGANIZATION-ID-FROM-STEP-CREATE-ORGANIZATION>"
},
"input": [
{
"type": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/identifier",
"code": "HealthCareServiceId"
}
]
},
"valueString": "<HEALTHCARESERVICE-ID-FROM-BINGLI>"
}
]
}'

Parameters Explanation

  • id: Unique identifier for the survey.
  • status: Always set to draft when creating a survey.
  • intent: Should always be order.
  • code.coding.system: Defines the task type system.
  • code.coding.code: Specifies the action as create-survey.
  • for.reference: Links the survey to an existing patient record.
  • requester.reference: Specifies the organization initiating the survey.
  • input.type.coding.system: Defines the coding system for healthcare services.
  • input.valueString: The ID of the healthcare service.

Extra Inputs

  • sendInvitation: Choose to send an invitation yes or no (true/false).
  • includePinInUrl: Include the pin in the URL for disabling 2FA (true/false).
  • communicationPreference: Select invitation possibility (email/sms).
    "input": [
{
"type": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/identifier",
"code": "HealthCareServiceId"
}
]
},
"valueString": "<HEALTHCARESERVICE-ID-FROM-BINGLI>"
},
{
"type": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/task-param",
"code": "CommunicationPreference"
}
]
},
"valueString": "sms"
},
{
"type": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/task-param",
"code": "IncludePinInUrl"
}
]
},
"valueBoolean": true
},
{
"type": {
"coding": [
{
"system": "http://fhirgateway.bingli.com/coding/task-param",
"code": "SendInvitation"
}
]
},
"valueBoolean": true
}
]
}'

Fetching a Survey

GET - Fetch Survey

Endpoint

https://fhir-gateway.api.bingli.eu/tenant-api/task/<YOUR-SURVEY-ID>

Description

This endpoint is used to fetch a new task, specifically retrieving surveys related to patients and healthcare services. The task is structured using FHIR standards.


Request Details

Headers

KeyValue
Content-Typeapplication/fhir+json
AuthorizationBearer JWTTOKEN

cURL Request

To retrieve a survey using cURL, use the following command:

curl --location 'https://fhir-gateway.api.bingli.eu/tenant-api/task/<YOUR-SURVEY-ID>' \
--header 'Authorization: Bearer <TOKEN>'

Parameters Explanation

  • id: Unique identifier for the survey.

Conclusion

Successfully creating a survey in the Bingli system enables smooth integration between your healthcare system and Bingli’s API. For further details, refer to the Bingli API Documentation or contact support@mybingli.com.