Coder Social home page Coder Social logo

Comments (6)

plynchnlm avatar plynchnlm commented on August 27, 2024

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.

GitHubUNCStudent avatar GitHubUNCStudent commented on August 27, 2024

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.

plynchnlm avatar plynchnlm commented on August 27, 2024

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.

plynchnlm avatar plynchnlm commented on August 27, 2024

(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.

GitHubUNCStudent avatar GitHubUNCStudent commented on August 27, 2024

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.

GitHubUNCStudent avatar GitHubUNCStudent commented on August 27, 2024

I have closed this ticket.

from lforms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.