Questionnaire/Assessment feature implementation instructions

@ruth
Here is a new version of lhc-forms to test with.
The admins over at the project have been doing active work lately and are improving daily however, they are not updating or don’t seem to have plans to update the public builder except the new version builder so I suggest folks start getting use to using it. They recently updated to v8.0.7 which is supposed to have some lform updates besides moving to FHIR Paths away from the lform format.

I have to makes some changes to this version for adding an option to exclude appending the score to rendered answers which I will contribute a PR on LHC NIH git which they have already agreed to the contribution.
From openemr root unzip.

1 Like

thanks for your help and the zip file, i think i’m getting there!! - i’ve added linkIds, but need to add codes as well, then will test again.

The codes don’t need to be LOINC but any tag unique to the item so say the code used for question could be question-1 and the Link Id path with group id of group-1 /group-1/question-1
and so on…

1 Like

good morning. I’ve fed my master source code (git fetch… and git pull…) which seems to have bought in the latest questionnaire code, thanks.

sadly the ‘edit’ bug seems quite persistant now. I can sometimes edit previous filled in instances of the questionnaire, but when I filled in a new instance (to test modifictions) and i try to ‘edit’ it, i get the screen showing nothing, together with php warnings - as follows

[Mon Jan 16 11:09:38.499824 2023] [php:warn] [pid 37] [client 172.19.0.1:35490] 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
[Mon Jan 16 11:09:38.499836 2023] [php:warn] [pid 37] [client 172.19.0.1:35490] 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
ruth@localhost:~/software/OpenEMR/openemr/docker/development-easy>

this is quite persistent with existing patients. but when i created a new patient and filled in the questionnaire for them, then i could ‘edit’ successfully one time. when I tried to ‘edit’ a second time the bug manifested.

this makes working with questionnaires quite difficult, especially as the summary in the encounter pane does not display subordinate questions in a group (even when no skip logic is applied) so the only way to check these answers would be to go in and edit (or for developers look at the record in the db!!)

may i check: when linkIds are set . My LinkIds have the format <no.no.no…> where the text indicates a group of questions, e.g. medic-1 and the nos are the sub questions, e.g. medic-1-1, medic-1-2, medic-1-2-1. In the same form i have allergies-1 and allergies-1-1, with the assumption the different groups themselves don’t need numeric hierarchy?

when you said earlier (message 40 11th jan) that the form would still not work does that include for subordinate questions? i had assumed this would be so for skip logic questions only.

so if you’d like to see an example without skip logic with the current questionnaire form
TIMEDASS V.1.2.R4.json (18.2 KB)

filled in as shown here (medications, indications and quantity)

the encounter display is only medications

thanks

You need to turn on Globals User Debug or pay attention to your console errors because you have errors in your form.
Again the example I gave you here works Questionnaire/Assessment feature implementation instructions - #43 by sjpadgett
It has the elements you are trying to do and reports correctly.
Your link ids must be unique and make logical sense as a path to the item.

There are over a thousand examples of forms/panels that can be referenced for building forms.

Thanks for your help, it was really useful. I now have a working form (hooray). I’m not sure exactly why it was crashing for ‘edit’, but it seemed to be triggered using multiple answers from a drop down (i obvs didn’t have that right in .json) . In any case i’ve used ‘repeats’ for a group now, which in any case is a much better way to do what we wanted.

also to get a master question and then it’s subordinates to display in the encounter summary i changed tack and made the master a group heading rather than a question.

1 Like

Glad to see you’ve figured it out. Gold star!:slight_smile:

1 Like

@ruth and all others.
I highly recommend for building questionnaires you start using the SDC spec and FHIR Paths.
Here’s a basic example using a PHQ you’re used to seeing.
PHQ-9-quick-depression-assessment-panel.sdc.json (51.7 KB)

Question.
I don’t have Questionnaire displayed as in your screenshot. I only have Miscellaneous, Administration, Clinical Layout Based on my instance of OpenEMR V5.0.1 running on a local Windows machine with XAMPP


.

I have had a few modifications made here and there.

I would love to use the Questionnaire feature but I am having trouble following the tutorial since my menus items seem to differ.

I imported PHQ9 questionnaire from the NLM builder through my patient portal but I only have limited options available. There is just a box to choose file and import.

Can you point me in the right direction pls. Much appreciated.

Hi Mercy,

i think that questionnaires are only available in the latest version of OpenEMR, i.e. version 7, with patch 2. Are you able to upgrade and try again?
Ruth

1 Like

Unfortunately I can’t update for now. But I would love to.

I have had some modifications effected like adding Patient ID Number column to Flow board and a couple of LBFs. Configured Lab and populated in-house inventory and all that. Also have patient data that has accumulated.

I am afraid of losing these modifications. If there was a nice upgrade procedure to v7 and keep my modifications, I would totally try it.

I have done some googling but not sure exactly what will work for me or how to effect a nice upgrade.

Any tips would really help. Thanks for the clarification.

I’m maybe not the best person to answer this, but I think that your database records should remain in tact after the upgrade, but it’s best to do a backup first. Is anyone else able to give mercy some advice on how to safely do an upgrade?

1 Like

This is wonderful work, a nifty feature to have, but unfortunately for me I am running v5.0.1 OpenEMR with XAMPP on Windows.

My Question:
Is there a way for me to import a built questionnaire into my v5.0.1 and make it work?

Much appreciated.

To update you must first do it in a test environment. For example, you download mysql and apache from the xampp control panel, then close the control panel. Copy the xampp folder to xampp2. You use the xampp2 control panel, you start mysql and apache and you already have the test environment to update. I recommend you upgrade from 5.0.2 to 6 (and patches from 6). You make sure that everything is fine. Then upgrade from 6 to 7 and apply the patches.
You can use these guides:
https://www.open-emr.org/wiki/index.php/OpenEMR_Upgrade_Guides

1 Like

@luisuriarte

Now this is a concise set of instructions I can live by.

Will get right on it. So may v7 features I am needing like yesterday.

Thank you so much!

@sjpadgett Hi Jerry-
You mentioned somewhere (last year?) that you were working on a copy/ paste option for importing json file questionnaires. Is this it (oval below)?

Also, 'New Empty Template (arrow) collects a questionnaire name then puts it in the template repository, where clicking on it brings up the template editor. Does the editor work or am I not doing it right? Clicking on a template does not show it in the editor.

I have been getting to know this incredible piece of awesomeness that is the questionnaire module; thanks v much for creating it!

  • Harley

q1-02 (copy)

The manual questionnaire is the right place to copy in the JSON. I’ve used it and it should be working.

@adunsulag Right, thanks for the confirmation!
Best- HT

@sjpadgett Hi Jerry-
In the GitHub issue: Handle FHIR QuestionnaireResponse Resource · Issue #5677 · openemr/openemr · GitHub
ran across your comment:

Current plan is to import questionnaires as FHIR json from endpoint, file holding the json, LOINC panels, external FHIR server or select a questionnaire from our repository.
The portal can import questionnaires to our repository or auto create a document template to schedule to a portal patient.

Besides storing the FHIR json objects as part of the resource I plan to store question/answers to vertical table for analytics/search

Has there been any progress on this? Or maybe it’s done but not released?
Thanks- Harley

Unsure I understand the question. The project as far as importing and rendering questionnaires is finished and in production v7.

All questionnaire/answer results are stored as json objects in several places where I decided to not implement a vertical table schema for answers.