Comments (6)
The only reason for that kind of structure is if the item containing linkId 9.1 (linkId 9) was itself a question that had an answer. (See Lloyd's comment at https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/QuestionnaireResponse.20item.2Eitem.20vs.20item.2Eanswer.2Eitem/near/154018519, "item.item is used when the parent is a group (and thus will not have answers). item.answer.item is used when the parent is a question (and thus will have an answer).")
LForms' handling of this rule was corrected in version 20.1.0. Which version are you using? It could be there is a bug with our "fix".
However, when I load your attached form into 20.1.3, I don't see that problem in the QuestionnaireResponse. Here is an excerpt of what I get after filling out "Name of the risk":
{
"linkId": "9",
"text": "Risks",
"item": [
{
"linkId": "9.1",
"text": "Risk List",
"item": [
{
"linkId": "9.1.1",
"text": "Name of the risk",
"answer": [
{
"valueString": "zzz"
}
]
}
]
}
]
},
from lforms.
Hi plynchnlm,
I am not sure if I understand your answer, exactly, but it is informative.
Our problem is that all of our questionnaire responses in the past were in the format (at the parent level) of a linkId, text and either an item or an answer such as:
{
"linkId": "9",
"text": "Risks"
"item": [
{more FHIR stuff here }
]
}
OR
{
"linkId": "9",
"text": "Risks",
"answer": [
{more FHIR stuff here }
]
}
But not just an answer without a link ID and text, which is what is happening:
{
"answer": [
{more FHIR stuff here }
]
}
Are you saying that moving to version 20.1.0 or 20.1.3 will fix this? We are still using version 17.3.2 because we were afraid that a newer version might not be backwards compatible with our questionnaires that work with 17.3.2.
If our questionnaires will still work and this will make the parent have a linkId and text, then I will change my scripts to call version 20.1.0 or 20.1.3.
from lforms.
Okay, now I see what you mean. The 10th item (linkId 9) is missing its linkId field in your output. However, I am not sure how that is happening. I checked out version 17.3.2 (thanks for mentioning the specific version), loaded your form, filled in some values around linkId 9, and I get this structure for the QuestionnaireResponse:
{
"linkId": "9",
"text": "Risks",
"item": [
{
"linkId": "9.1",
"text": "Risk List",
"item": [
{
"linkId": "9.1.1",
"text": "Name of the risk",
"answer": [
{
"valueString": "falling"
}
So, for me, the linkId not missing. I wonder if there is some special combination of filled-in fields that triggers the problem. If the only answer you fill in is Name of the risk (9.1.1), do you still see the problem?
from lforms.
(Please note my question in my previous post as well.) Here is a jsFiddle using LForms 17.3.2, which shows your form, and at the bottom of the form (best viewed on a large screen if possible) there is a "Show QuestionnaireResponse" button which will display the JSON of the QuestionnaireResponse. When I fill in a value for "Name of the risk", I get the structure I mentioned above (which has the linkId). https://jsfiddle.net/lforms/5czb8217/23/
Please give it a try and let me know if you find a way to reproduce the problem.
from lforms.
Hello,
You can close this ticket. The person responsible for creating the questionnaire on our team made some changes to the questionnaire and it is now properly making FHIR JSON questionnaire responses. Thank you.
from lforms.
I have closed this ticket.
from lforms.
Related Issues (20)
- Prepopulating forms HOT 5
- Do we have any feature for patient resource? We need to update patient resource using LHC. HOT 1
- 0 value for number types in response is ignored HOT 3
- How to pre-populate values setting lhcFormData trough LhcDataService
- Integer & date datatype field issue HOT 2
- CSS is overwriting other CSS in my application HOT 2
- Static images used by lforms cannot be found. HOT 7
- Error on library import: Uncaught TypeError: Cannot read properties of null (reading 'appendChild') HOT 2
- In repeat questions, SNOMED Answer valuesets are not rendered in the second repetition HOT 2
- How to extract the full panel structure? HOT 3
- conditionnal display not well managed HOT 4
- UI issue in dropdown options list when resizing the window HOT 2
- Error using run build HOT 32
- Validation popover addresses wrong answer in repeatable item HOT 2
- No response is created if an answer contains an invalid data type
- Preview in multiple columns HOT 3
- A new widget HOT 3
- Use R5 of Fhir HOT 15
- CalculatedExpressions not working? HOT 1
- Prepopulate form with source data HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lforms.