Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

[Monday.com Board]

FHIR questionnaires are a standardized way of representing clinical questionnaires. They are used in a variety of healthcare settings, including hospitals, clinics, and home health agencies. Beside containing the questions and structured answers (value types and value options), the also defined hide/show logic and validation statements. FHIR Questionnaires are used to collect a diversity of contents in relation to the patient. Examples In the context of chatbots or USSD examples include:

  • A bot or ussd app could be used to collect patient history information. This could help to ensure that all patients are asked the same questions, and that no important information is missed.

  • A bot could be used to provide education to patients. This could help patients to understand their condition and how to manage it.

  • A bot could be used to collect feedback from patients. This could help to improve the quality of care and patient satisfaction.

As of August 2023, PSI extensively uses conversational chatbots to collect information directly from clients. In some cases we also make use of USSD sessions, for which we run short questionnaires. For chatbots, the flow of those conversations is defined in system like RapidPro, and the answers are stored on a FHIR backend, as a QuestionnaireResponse resource. But in most cases we currently (Aug 2023) don’t have the associated Questionnaire, which means that the metadata is missing.

Proposed solution (Sept 2023)

In the context of being able to support future chatbot and USSD implementations which runs part of their flow as structured conversations , we will use a FHIR Questionnaire Flow Engine that can:

  1. Use any FHIR Questionnaire to run a sequence of question/answers as part of a Bot or USSD app

  2. Validate the user input in accordance to the constraints for the related Question Item

  3. Return the next question as part of the API response body

  4. have a final outputs on the form of a FHIR QuestionnaireResponse resource, based on the answer provided.

This service should be self-contained, usable by USSD and Bot implementations.

It should be possible to deploy as a node.js service or a OpenHIM mediator.

Image Removed

Inputs

  • Initialization: FHIR Questionnaire JSON (http or file), session id

  • Flow/input: session id, user’s input.

Outputs

  • Flow/output: Next Question/ validation error current question.

  • Final output: QuestionnaireResponse JSON

...

The creates challenges for analytics, and also force to code questionnaires as part of the bot or the USSD application, instead of just using a FHIR questionnaire.

Questionnaire Processor application

Questionnaire Processor is a server-side Node.js application designed able to seamlessly process FHIR Questionnaires. This robust tool The service can be integrated with USSD or chatbot applications to prompt users with questionnaire items and gather their responses.

...

. The services validate user input in accordance to the constraints for the related FHIR Question Item, and it return the next question as part of the API response body. At the end of the process you get the FHIR QuestionnaireResponse resource, based on the answer provided.

...

The service includes:

  • Parse the provided FHIR Questionnaire.

  • Prompt users with relevant questions.

  • Validate and process user responses based on question types.

  • Provide Evaluates skip logic and conditional validations.

  • Save and resume sessions.

  • Detailed Keeps a detailed logging of user interactions.

...

Getting Started:

  1. Environment Configuration:

    • Rename the .env.example file to .env.

    • Update the .env file based on your system configuration.

  2. API Endpoint: base_url/api/v1/questionnaire

  3. API Documentation: Access detailed API documentation and test endpoints using swagger-ui at base_url/api/v1/docs.

Request Parameters:

...

Link: https://drive.google.com/file/d/1WM5nvoVbOon-X0yTX7t5Prz7mt_1DRVP/view?usp=sharing

Request Parameters

  • Headers

    • X-api-key: Your API token set in the .env file (required).

    • Accept-Language: Set the desired language for the response. Supported languages: English, French, Spanish and Burundi.

  • Body:

    • sessionId: Unique session id for the interaction (required).

    • userId: Unique identifier related to the user.

    • Input: User response to the prompt (optional for first request).

    • showQR: Return Questionnaire response after each request (optional). The valid values are

      Status
      colourGreen
      titletrue
      or
      Status
      colourRed
      titlefalse

    • questionnaire: FHIR Questionnaire in JSON format (optional after the initial request).

Example Request

Code Block
languagejson

...

{
  "sessionId": "123456789",
  "userId": "user123",
  "Input": null,
  "showQR": true,
  "questionnaire": {...} // Your FHIR Questionnaire JSON
}

Response Structure

  • Status: Reflects the state of the session (CON or END).

  • Message: Question item, options, or validation message displayed to the user.

  • QuestionnaireResponse: Returned if showQR is true or the session reaches the end.

Example Response Utsav Ashish Koju please add an example of a response

Code Block

Supported FHIR Question Types

...

  • Boolean

  • Choice

  • Date

  • Decimal

  • Display

  • Integer

  • Phone

  • Quantity

  • Text

  • URL

...

  • For Boolean questions, 1 is used for True and 2 for False.

  • Skip logic and validations like greater than, less than, or equals to are supported.

  • The application uses SQLite for session management and Winston for logging.

  • Use a simple token-based authentication mechanism for enhanced security.

  • The application doesn’t support nested FHIR questionnaire.

...

Getting Started:

Code Block
languagejson
{
  "sessionId": "123456789",
  "userId": "user123",
  "Input": null,
  "showQR": true,
  "questionnaire": {...} // Your FHIR Questionnaire JSON
}

Conclusion:

Questionnaire Processor offers a comprehensive solution to efficiently gather and manage user data via FHIR Questionnaires. This well-documented API ensures easy integration into diverse platforms, providing both developers and end-users with an enriching experience.

Issues and Support:

For any issues, feature requests, or support queries, feel free to raise an issue in our GitHub repository.

Flow Diagram:

...

  1. Environment Configuration:

    • Rename the .env.example file to .env.

    • Update the .env file based on your system configuration.

  2. API Endpoint: base_url/api/v1/questionnaire

  3. API Documentation: Access detailed API documentation and test endpoints using swagger-ui at base_url/api/v1/docs.

[Monday.com Board]