LHNCBC / formbuilder-lhcforms

Build LHC-Forms and FHIR Questionnaires
Other
28 stars 22 forks source link

"EnableWhen" Error #1

Closed kirubel22 closed 5 years ago

kirubel22 commented 5 years ago

I was unable to upload fhir questionnaire (R4)into the NLM form builder if "enable when" extension is used. The error I am getting is as follows: "Cannot read property 'type' of undefined: Failed to convert the selected FHIR Questionnaire. File loading is aborted." If I remove all "enable when" options, the form does upload without a problem.

In addition, even if I create a form using the NLM tool and upload it to FHIR server, I will get the same error if I try to import it back to the tool.

akanduru commented 5 years ago

Can you create a sample questionnaire that produces the error?

kirubel22 commented 5 years ago

Test.zip

akanduru commented 5 years ago

The linkid is invalid in enableWhen.question (item[0].item[5].item[1].item[4].enableWhen[0].question). If you change it from "/1/52/55/59" to "59" it should work.

Here is the spec for enableWhen.question

kirubel22 commented 5 years ago

Thanks. I provided "59" as a link ID but the form builder is appending the forward slashes and parent link IDs when I generate SDC Questionnaire.

akanduru commented 5 years ago

You are right. It is a bug to assign a code path, when you have linkid. I will fix it.

kirubel22 commented 5 years ago

Thanks.

plynchnlm commented 5 years ago

@kirubel22 -- Since he hasn't fixed it yet, it is better not to close this. I am reopening it until it is fixed.

akanduru commented 5 years ago

@kirubel22 -- The fix is promoted to the site. Please let us know if you notice any issues. Thanks.