Skip to main content

Questionnaires

Welshare can help you collect Questionnaire responses. We're building upon a baseline of Fhir schemas, so responses and questionnaire definitions should be generally interoperable with other systems and vice versa.

Crafting a new Questionnaire

The first thing to do after having registered as an application, is to switch over to your favorite form builder / preview tool and build a valid Fhir Qustionnaire.

info

At the moment we're not offering a form builder on our own, for obvious reasons: it's not trivial to build one, and there are insanely good ones publicly available. We've tested many of them for simple and complex scenarios, also tried out clinical standard forms (LOINC panels) and we're quite positive that this is quite a good start for Alpha state software.

That being sad, don't be too sad if some Questionnaire code that you found on the internet breaks our inline preview - it likely only contained a feature that our default renderer doesn't handle well. You should still be able to register the Questionnare and collect responses, but you are responsible of rendering yourself. Some Fhir questionnaire form builders that we recommend, in no particular order:

Aidbox form builder

If you're interested in best practices how to craft questionnaires, checkout this documentation by eheahltsuisse

Registering your Questionnaire with Welshare

Visit your application page and hit the "New Questionnaire" button. On the following page, paste the JSON definition file that you've exported from your favorite tool. We're immediately validating that it conforms to the Fhir Questionnaire specs and display eventual errors.

If the form is valid, you can render a preview to check that it'd likely work as expected. We use CSIRO's Smart Forms Renderer to render generic forms. You'll likely want to present a far more customized version to your users, however.

Aidbox form builder

Overwritten fields

Upon pasting your new Questionnaire definition file, we're automatically adding (or replacing) any publisher field with the did:nil: identity that represents the application you're registering the questionnaire for. If your Questionnaire definition contains an id field, it remains untouched, otherwise we're overriding it with the technical database _id.

Creating Form Frontends

A Fhir Questionnaire document resource implies the values of respective QuestionnaireResponse documents. When users submit new records according to that response schema, those responses are validated against the referenced Questionnaire instance. Applications are supposed to come up with virtually any custom questionnaire renderer interface that transforms responses into appropriate QuestionnaireResponse documents. We're offering a simple json endpoint that allows you to download the Questionnaire specification using its public unique _id, e.g. https://wallet.welshare.app/api/questionnaire/49a07119-42db-427c-ae10-d83c76466e31

Modern LLM based UI builders are shockingly good in rendering a form frontend for that specification, particularly if you make sure to add the Fhir docs to their context. Here's what v0 makes out of a trivial one shot prompt (Try it), here's another demo repo that submits data for real.

Prompt

Here's a JSON file that contains a Questionnaire definition according to the Fhir standard: https://wallet.welshare.app/api/questionnaire/49a07119-42db-427c-ae10-d83c76466e31 . Render a nice looking frontend that collects information according to the form, converts it into an appropriate QuestionResponse format upon submission and logs the submitted response to the browser console.

Aidbox form builder

Overwritten Fields on QuestionnaireResponses

Submitted responses are interpolated with fields that we cannot trust users to be honest about:

  • authored is replaced with the submission date ("now"). This will always be an ISO timestamp in UTC.
  • status is set to completed
  • subject is set to to submitting user's profile did
  • author is set to the controller did of the application that created the questionnaire
  • source is set to the _id of the application that created the questionnaire

Using the Generic Form Frontend

Mostly for testing reasons we're offering a generically rendered form frontend that you can simply send to your users to have them file it. We're discouraging this approach in favor of a far more appealing onboarding experience.

https://wallet.welshare.app/questionnaire/49a07119-42db-427c-ae10-d83c76466e31