Pulling Questionnaire Responses
Introduction
Once a patient has completed their questionnaire, the response can be pulled out of PKB and sent into a downstream system or data warehouse, where it can be used to determine whether each patient should stay on the waiting list of can be removed.
QuestionnaireResponse endpoint
It is also necessary to include the team id as a header (as was the case in Step 2).
The above search parameters can be used in any combination but it is common for new responses to a particular questionnaire for all patients within a team to be polled on a regular basis.
There is no way to be notified by PKB when a new response is available, so this approach ensures that new responses are pulled regularly.
This is done by using the authored and based-on search parameter. The authored parameter allows you to specify the date and time from which you want to pull responses (e.g from the last time the query was made) and the based-on parameter allows you to specify the questionnaire template, by using the Questionnaire ID previously obtained.
The below example assumes that the questionnaire ID is 2becaa96-8d4c-4ea4-84b8-6b41edba854a and all new responses since 10/03/2025 are required.
Example Request URL
The below example assumes that the questionnaire ID is 2becaa96-8d4c-4ea4-84b8-6b41edba854a and all new responses since 10/03/2025 are required.
GET https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/QuestionnaireResponse?authored=2025-03-10&?based-on:ServiceRequest.identifier=2becaa96-8d4c-4ea4-84b8-6b41edba8
Example Request Header
If you have multiple WLV teams or questionnaires, this query will need to be run multiple times in order to obtain all relevant WLV questionnaire responses.
Patients Know Best Wiki Hub | Deploy | Developer | Trust Centre | Manual | Research | Education | Release Notes
© Patients Know Best, Ltd. Registered in England and Wales Number: 6517382. VAT Number: GB 944 9739 67.
This API specification and design is licensed under a Creative Commons Attribution 4.0 International License.