Questionnaire/Assessment feature implementation instructions

to answer anyway, the report can be setup to display the yes/no.

excellent. Just to clarify: is this something i need to set up in some way, either configuring or in the questionnaireā€™s json - or will you be doing it in the code? thanks

i have had skip logic working with the ice-cream example (from Lforms), now to get it into the form iā€™m developing, many thanks

1 Like

@ruth I went ahead and took some time to format validation at least for the common required response.
When I get some time I may be able to replace in place the error render in LForms. It is a tedious fix but would save me from having to fork LForms project. Something I do want to do if the new Questionnaire feature proves to be as widely used as I hope.

Since I render the report using the questionnaire response rather than the lform definitions(I do this because response needs to be universal with the API and SMART app use), I donā€™t currently parse the datatype to include in the answer array making it difficult to test for boolean to change radios/checks to yes/no. I will soon but donā€™t know when. Instead of radio/checks you can build forms to use yes/no dropdowns.

@ruth here are the changes

many thanks @sjpadgett - this works well - i like the use of colour.

iā€™ve been able to use skip logic in my form - but it seems if i save it as an LHC form (from nlm form builder) skip logic is ignored, which may mean one canā€™t use it in the same questionnaire as a score total? i might play with this at some point. :grinning: - but take care the nlm form builder doesnā€™t always seem to get it right so i have to correct the json!

(I notice that the LHC format json starts with ā€œitemsā€ (i.e. plural) and R4/lform starts with ā€œitemā€ singular, but there are other many other differences as well. )

WARNING
The current public web app at NLM Form Builder has a bug.
If you have a form using skip logic and export as LHC-Form then when re-importing to builder it will fail meaning one canā€™t do further edits.
However if exported as R4 questionnaire with skip logic then re-import will work.
The problem with this is Lforms version must be used when scoring forms so if you have a form that combines both skip logic and scoring then using the builder to further edit forms become unusable.

Since the builder canā€™t create SDC questionnaires which is required when rendering scoring form if lforms is not used then weā€™re stuck.

Iā€™ve updated openemr with new lforms version so imports will work but until the public site is updated this workflow is troublesome!

Hi. Is it possible that questionnaires be available via patient portal such that they not be tied to a particular patient encounter?

@PeteBoyd
Yes and is one of the main reasons I implemented the feature, for the portal.
I made it pretty easy when you import the questionnaire in Portal Dashboard by uncheck the Use Questionnaire Tool, select import then click Templates.

This will auto create the necessary template for portal.
Then assign to a profile, assign profile to a group that you have assigned patients then enable the profile for portal. Important to note that profiles must be assigned to one or more patient group to send to portal.

You can assign patients to Groups in Demographics on a per patient or using the Group button to drag and drop patients into groups.

This actually works very well as I use almost daily as I continue to develop this feature.
Let me know Pete or Ruth if you have any more questions or send me a Questionnaire(pun intended):slight_smile:

thanks jerry. Iā€™ve made a couple of questionnaires, i do like this way of creating them, although still getting my head round using them!. One thing i came across today that is a tiny bug i think: iā€™ve been using questionnaires in encounters. I filled in a questionnaire, and subsequently went to delete that instance. It was called ā€˜TimeDassā€™. When i chose delete i got the message in this screen shot


which warns a form is about to be deleted, but the warning has the wrong name for the form (PHQ-9 quickā€¦). The form named in the warning is a questionnaire that iā€™d also imported onto my system early on - in fact in the database table questionnaire_repository it is the third record, with id=3. (the delete works fine in this repect for api forms btw)
also the delete of the questionnaire works fine, itā€™s just the message thatā€™s incorrect.

Hmm, never paid attention to delete. Iā€™ll look into

1 Like

We had another couple of things we wondered might be possible:

  1. Using them via encounters the only way iā€™ve found to register a new questionnaire (to put it into the forms admin table, and have it available to all patients on the system) is to go to a patientā€™s encounter (any patient will do) then questionnaire/new questionnaire - then find it in the repository and then register it. We were wondering if one can do this higher up, e.g. somewhere like the admin/forms menues, i.e. so one doesnā€™t have to get up a patient first. does this make sense? and is there a method to do this that iā€™m missing?

  2. Would it be possible to have a field automatically filled in from patient data, such as their name ? I guess at the moment this is less important as the instances are tied to a patient, e.g. in an encounter, but if they were to be printed at any time in the future e.g. then that would be useful. Or perhaps if there was a conditional question based on the answer to some data already in the patientā€™s data, e.g.

Good point! Easiest way would be the ability to register from Portal Dashboard. Iā€™ll look into implementing there. Perhaps a Register to Encounter button.

Not so easy. While there are ways to do this the problem becomes making generic i.e. A patient name id may be different from one form to another. There are ways to populate a form item from another form item in builder however from openemr POV and since all patient info is already known to the system I donā€™t see a reason patient info is needed in a questionnaire.

Even still, currently the only post processing on the questionnaire is the encounter report though I am in process of adding better questionnaire scheduling with triggers based on previous questionnaire and analytics tied to CDR engine.

1 Like

Is a bug and have duplicated although is a strange one!

hi @sjpadgett - i have two more problems this morning. I was having the problem described here - but when I made a small change to the json file, by changing only the ā€˜titleā€™, and then importing again, which made a new questionnaire - the problem did not manifest? So maybe wait to see if it comes again??

iā€™m working with a questionnaire TimeDass which iā€™ve created -
TIMEDASS V.1.1.R4.json (11.7 KB)

having completed it for a patient it is listed in the encounter. When i press ā€˜editā€™ (to add more answers) i get the following php errors:

[Tue Jan 10 12:40:25.126287 2023] [php:warn] [pid 45] [client 172.21.0.1:53006] PHP Warning: Undefined variable $q_list in /var/
www/localhost/htdocs/openemr/interface/forms/questionnaire_assessments/questionnaire_assessments.php on line 378, referer: http:/
/localhost:8300/interface/patient_file/encounter/encounter_top.php?set_encounter=7
[Tue Jan 10 12:40:25.126304 2023] [php:warn] [pid 45] [client 172.21.0.1:53006] PHP Warning: foreach() argument must be of type
array|object, null given in /var/www/localhost/htdocs/openemr/interface/forms/questionnaire_assessments/questionnaire_assessments
.php on line 378, referer: http://localhost:8300/interface/patient_file/encounter/encounter_top.php?set_encounter=7

and the screen shows only

the second issue is about the way a completed form is displayed in the encounter. Using the same form I sent in the message above. The form has conditional logic. e.g. i tested by replying ā€˜trueā€™ to the question ā€˜do you have allergiesā€™ in order to reveal the question ā€˜what are you allergic toā€™, which i filled in (kiwi fruit). The display in the encounter only shows the first question to be true (i.e. value ā€˜1ā€™), but not the details as follows

is the problem in the way iā€™ve written the json for the form itself? (it seems to work when filling in the form for the first time). Is there any more information i can give you?
thanks.

also, would it be possible to show the answer to the question ā€˜have you any allergiesā€™ as ā€˜trueā€™ or ā€˜yesā€™ rather than ā€˜1ā€™, which i think would make more sense to someone filling it in?

I answer this before!

I imported to builder but you are missing link ids. They must be unique and have order to the group
1

Thanks Jerry. If i understand what you are saying I think itā€™s the controlling question that needs a linkId - i.e. ā€˜are you taking any medicationā€™. This has linkId = medic-1. in the ā€˜preview widgetā€™ screen of NLM builder, if the box under the ā€˜are you taking any medicationā€™ is checked one is shown the dependant questions

in OpenEMR the questionnaire itself works ok, i.e. the dependant question is only shown when the controlling question is ā€˜1ā€™, or ā€˜trueā€™ - but when the dependant question is answered it doesnā€™t show in the encounter summary

and the inability to edit bug, reported above, has shown up again consistently. Iā€™m afraid itā€™s evening time in the uk now and iā€™ve something else to do, but iā€™ll explore this more tomorrow.

by the way this is the latest version of the questionnaire
TIMEDASS V.1.2.R4.json (11.8 KB)

just in case what youā€™d suggested is adding the link-id to the dependant questions as well, i tried that, with the same display result, although that doesnā€™t make any sense to me?

Every item, question and answer has to have an unique Link Id and code that makes sense(look for asterisk for required in builder).
Everything done for skip logic and answer lookups require a link path starting from group down.
Take a look at the FHIR spec example or pull in a similar form like this one.
USSG-Family-Health-Portrait.json (111.9 KB)

Reporting works fine if form is designed correctly. Remember to look on the Link Id as paths to the item starting at say the group o g1 then first question would be g1/q1 etc.

Also I think current lforms version has a rendering bug for these type forms. Your form would still break regrdless until link ids are fix. Note how many times Iā€™ve stressed the link ids!

Once I verify, Iā€™ll put up patch as a new lform release has come out.

1 Like