Given a questionnaire with a list of questions, is there a (more or less) standardized way one could annotate the questions with expressions that would compare the question against some data supplied with the questionnaire?
Where a question could have an attribute along the lines of showExpression="data[question.id] == true" that would control whether or not the question should be shown, for instance.
I am thinking that the conceptual idea is general enough that it has been done a bunch of times before (like in SDC?), so would like to enquire before trying to come up with the wheel again.
Where does the âadditional dataâ come from when you launch the form filler application?
What you would typically do is have a hidden question (or set of them) that would be set up to have an âinitialValueExpressionâ that grabs the answer from either something from the launchContext or from a query. You would then use âenableWhenâ based on the answer to that hidden question to turn other items on or off.
(You want to propoagate the external information into hidden questions because the launchContext is only available when initially filling the form and because query results might change over time or not be available to subsequent users/systems who are trying to validate the answers.)
Thanks for answering. I get the hack of prepopulating hidden questions. That seems like a reasonable approach.
The Launch Context thing and Populatable Questionnaire seems promising. I guess I just need to do a deeper dive into this when time allows. I looked at some examples, but it was not immediately how this worked, but I guess this is a general concept that one can use to create ones own proprietary solution.
Where does the âadditional dataâ come from when you launch the form filler application?
That is basically what this question is about - I am not sure I took a FHIR Fundamentals course without being able to answer questions as this, so thatâs what I am wondering how to do. The conceptual solution we are looking for is this:
Create a basic questionnaire using some Form Designer (like Structor).
Manually annotate that questionnaire with some extensions that will make the following bits work
Have a patient open an app for filling that form and then have the form filler frontend customize the rendering of that questionnaire and the form filling based on data specific for that instance of questionnaire filling (which questions to enable, data to use in drop-downs, etc).
preprocess the questionnaire and embed the data into the questionnaire (this would essentially be equal to creating a new questionnaire from a template, so not ideal)
bundle the data alongside the questionnaire, somehow
make the form filler aware of some extension to the Questionnaire resource that allows it to dynamically fetch the required data from some other resource
I guess a Launch Context is essentially about the last point on that list?
Indicates to systems creating or updating a QuestionnaireResponse what types of information to pass in for internal processing.
In general, when you launch a questionnaire, the questionnaire will be passed the current user, patient and perhaps encounter. Some systems might pass the current research study or other âbusiness contextâ that is relevant in their specific space. Any other information (e.g. âmost recent lab X resultâ) would never be passed in by default - the Questionnaire would have to go query them (possibly using information such as âcurrent patientâ to help filter).
For step 3, when a form is displayed, the form filler will automatically evaluate some of the SDC extensions, such as âvariableâ and âinitialValueExpressionâ - which can be used to load certain information from the patient record and populate some answers to the QuestionnaireResponse (including âhiddenâ answers) before the end users sees or interacts with it. All such answers are âpartâ of the QuestionnaireResponse. Other questions can have logic that is driven by those pre-populated elements.
Launch context is a way of making contextual information available to the logic within the QuestionnaireResponse. (Itâs hard to go query Conditions, Observations, etc. for the current patient, when you donât know who the current patient is :>)
In general, when you launch a questionnaire, the questionnaire will be passed the current user, patient and perhaps encounter.
Hmm ⌠this was a bit abstract, but I feel it might be because of thinking in different contexts with different assumptions about the environment this is all happening in. I tried skimming through some sections of the SDC guide to see what this meant in practice.
Our context is simply is that we have a product that mostly produces data that is just exported as RTF documents (unstructured data) meant for direct human consumption to a patient journal (EHR). We might need to support exporting as FHIR in the future. We have created form solutions ourselves up until now, but every new form demanded programmer time for creating the schema. When creating a new product that would also deal with patient forms we mostly settled on using FHIR Questionnaire for rendering in our frontend as that freed us from creating a proprietary form designer (could use an existing one) and a form schema language of our own.
So the initial thought is that we will mostly just be using FHIR as a data format for storing forms and their responses, with no (so far?) interlinked data to Observations, etc. I see that we might need to have a âFHIR APIâ to support the frontend dynamically looking up ValueSets referenced in the Questionnaire (like when it is unfeasible to manually create a list of thousands of of medications for use in a drop down list), but otherwise I would assume the need for sourcing data to be minimal.
Seeing that most existing form filler and/or rendering solutions for SPAs were gigantic multi-megabyte bundles with unflexible styling options, while we only saw the need for a quite limited set of components with highly custom rendering for both the input form and the resulting questionnaire response, we decided to create the form filler components needed to render the questionnaire and the responses in the SPAs ourselves.
So when I am thinking âlaunching a questionnaireâ I am thinking React (rendering) + JSON (the questionnaire) + Fetch (parse and process the questionnaire to fetch data based on metadata/expressions defined in the Questionnaire). But I assume this is a different (simpler/more concrete) context than you were thinking in I assume that might be something like
Give a url to a questionnaire to some FHIR library (HAPI, IBM FHIR Server, âŚ)
Get a Questionnaire object back
Invoke some FHIR lib magic to resolve (fetch) all the data referenced in the questionnaire
Render that to user?
So given my context, what could âquestionnaire will be passed the current user, patient and perhaps encounterâ mean? What part of a Questionnaire definition would require a processor of the questionnaire to obtains a current user? And do you mean an actual FHIR Resource (like Practicioner)?
Your description (âReact (rendering) + JSON (the questionnaire) + Fetchâ) is completely reasonable as a form filler. I mis-typed when I said âuserâ. I should have said âpatientâ. (You can grab user too, but I doubt youâll care.) If youâre interested in retrieving other data to help drive form behavior, presumably youâll need to know who the patient is to grab that. If you want to do that in a âstandardâ way, youâll need to grab the data from a FHIR interface. Nothing stops you from grabbing data from a proprietary interface, but there wonât be any âstandardâ extensions that will know how to do that - and no other software will understand what extensions you create.