...
parameter[0]
name = "target"
use = "in"
min = 1
max = “500“
type = "Reference(Patient|Organization)"
documentation = “the target references can be either represented as a URL reference or through the use of an identifier representing the national health number. If a target is represented twice, only one request will be created per API call.“
parameter[1]
name = "teamId"
use = "in"
min = 1
max = "1"
type = "Identifier"
parameter[2]
name = “additionalIdentifier”
use = “in”
min = 0
max = “1”
type = “Identifier”
parameter[32]
name = "request"
use = "out"
min = 0
max = "*"
type = "Reference(ServiceRequest)"
...
Generate an access token by following the OAuth 2.0 walkthrough
This example assumes you have been granted an access token of: aaaaa-bbbbb
Confirm the ID of the team. You can request this from the PKB support team (available via API in the future).
This example assumes you have a team ID (x-team-id) of: 235a397b-1ae8-4755-9c77-1a0e2fbc5314
Confirm the national ID of the patient
The example below assumes you have one Patient with the following NHS number: 5193233945
If you do not include a national ID, the questionnaire will be sent to every patient in the team represented by the team ID.
Confirm the ID of the Questionnaire
To find the Questionnaire ID of the questionnaire you would like to send, query the Questionnaire endpoint with your teamcode and, optionally, the questionnaire title. This will return a bundle of Questionnaire resources that you have access to. Take the ID of the Questionnaire resource that you are interested in.
This example assumes a Questionnaire ID of: bd17e556-20e3-4f01-8078-30e5f675b0f2
Make the call as detailed below, replacing the access token, x-team-id, NHS number, and Questionnaire ID with your own values
The questionnaire request will be created and an email will be sent to the patient containing a link to the questionnaire.
If the patient’s PKB record does not have an email address, given name, family name and date of birth, they will not be sent a questionnaire. If the request contains more than one NHS number, patients with an email address, given name, family name and date of birth will still receive a questionnaire. The response from the API call will contain the patients that did not receive a questionnaire.
...
curl -X POST --header "Accept: application/fhir+json" --header "Content-Type: application/fhir+json" --header "Authorization: Bearer aaaaa-bbbbb" --header “x-team-id: 235a397b-1ae8-4755-9c77-1a0e2fbc5314” "FHIRWALL_URL/Questionnaire/bd17e556-20e3-4f01-8078-30e5f675b0f2/$send-questionnaire-request" --data "{ \"resourceType\":\"Parameters\", \"parameter\":[ { \"name\":\"target\", \"valueReference\":{ \"identifier\":{ \"system\":\"https://fhir.nhs.uk/Id/nhs-number\", \"value\":\"5193233945\" } } }, { \"name\":\"teamIdadditionalIdentifier\", \"valueStringvalueIdentifier\":{ \“235a397b-1ae8-4755-9c77-1a0e2fbc5314\”} }, { \"name\":\"additionalIdentifier\", \"valueIdentifier\":{ \"system\":\"\"system\":\"https://fhir-open.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/ServiceRequest\", \"value\":\"12345\" } } ] }"
...
curl -X POST --header "Accept: application/fhir+json" --header "Content-Type: application/fhir+json" --header "Authorization: Bearer aaaaa-bbbbb" --header “x-team-id: 235a397b-1ae8-4755-9c77-1a0e2fbc5314” "FHIRWALL_URL/Questionnaire/bd17e556-20e3-4f01-8078-30e5f675b0f2/$send-questionnaire-request" --data "{ \"resourceType\":\"Parameters\", \"parameter\":[ { \"name\":\"target\", \"valueReference\":{ \"identifier\":{ \"system\":\"https://fhir.nhs.uk/Id/nhs-number\", \"value\":\"5193233945\" } } }, { \"name\":\"teamId\", \"valueString\":{\“235a397b-1ae8-4755-9c77-1a0e2fbc5314\”} }, { \"name\":\"additionalIdentifier\", \"valueIdentifier\":{ \"system\":\"https://fhir-open.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/ServiceRequest\", \"value\":\"12345\" } } ] }"
...
This section will contain the search parameters that can be used to retrieve Questionnaire resources and an example workflow.
Organisations will need to provide teamId when searching for Questionnaire resources.
Code Block |
---|
GET [baseURL]/Questionnaire?teamId=235a397b-1ae8-4755-9c77-1a0e2fbc5314 |
The following search parameters can be used to search for Questionnaire resources:
...
Generate an access token by following the OAuth 2.0 walkthrough
This example assumes you have been granted an access token of: aaaaa-bbbbb
Confirm the ID of the team. You can request this from the PKB support team (available via API in the future).
This example assumes you have a team ID (x-team-id) of: 235a397b-1ae8-4755-9c77-1a0e2fbc5314
Make the call as detailed below, replacing the access token and teamId token and x-team-id with your own values.
A bundle of Questionnaire resources will be returned
...
This section will contain the search parameters that can be used to retrieve QuestionnaireResponse resources and an example workflow. Organisations will need to provide teamId when searching for Questionnaire resources.
Code Block |
---|
GET [baseURL]/QuestionnaireResponse?teamId=235a397b-1ae8-4755-9c77-1a0e2fbc5314 |
The following search parameters can be used to search for QuestionnaireResponse resources:
...
Generate an access token by following the OAuth 2.0 walkthrough
The example below assumes you have been granted an access token of: eyJhbGxxxx
Confirm the ID of the team. You can request this from the PKB support team (available via API in the future).
This example assumes you have a team ID (x-team-id) of: 235a397b-1ae8-4755-9c77-1a0e2fbc5314
Confirm the Patient’s NHS number
The example below assumes a patient with a Patient resource ID of 3d8afd18-0844-459a-b3c2-355d02e54c0a
Make the call as detailed below, replacing the access token, x-team-id and search parameters with your own values
A bundle of QuestionnaireResponse resources will be returned
...
Follow the above steps in ‘How to trigger a questionnaire request using national ID’, including the business identifier as the additionalIdentifier in the body of the API call. This example assumes a business identifier of 12345
Generate an access token by following the OAuth 2.0 walkthrough
The example below assumes you have been granted an access token of: eyJhbGxxxx
Confirm the ID of the team. You can request this from the PKB support team (available via API in the future).
This example assumes you have a team ID (x-team-id) of: 235a397b-1ae8-4755-9c77-1a0e2fbc5314
Confirm the Questionnaire reference
The example below assumes a reference of: Questionnaire/f1a841f1-6f3a-43fc-830f-e1417b4ff13d
Confirm the business identifier
The business identifier in this example was set in step 1 as 12345
Make the call as detailed below, replacing the access token, x-team-id, and search parameters with your own
A bundle of QuestionnaireResponse resources will be returned
...