LHNCBC / lforms

See the project website at http://lhncbc.github.io/lforms/, or view the demo website at https://lhcforms.nlm.nih.gov/lhcforms.
Other
107 stars 56 forks source link

Use R5 of Fhir #150

Open DaniArj1980 opened 5 months ago

DaniArj1980 commented 5 months ago

Good morning, Would there be a way to modify the code so that the questionnaires make use of the configuration of the R5 version of Fhir? Greetings, thank you.

plynchnlm commented 5 months ago

lforms does support R5, except for 'disabledDisplay' and answerConstraint=optionsOrType. What are you having trouble with?

DaniArj1980 commented 5 months ago

Thank you very much for the response, my idea is to use the functionality made in the formbuilder demo at the url: https://lhcforms.nlm.nih.gov/lhcforms. I don't know if I need to make any configuration to use a version R5 questionnaire. In this case I would like to expand because I don't know if a questionnaire items of the attachment type is made, to add a file to the questionnaire.

Greetings, thank you

plynchnlm commented 5 months ago

https://lhcforms.nlm.nih.gov/lhcforms is actually the demo of LHC-Forms (not the formbuilder, which is at https://formbuilder.nlm.nih.gov), but yes, you should be able to load an R5 Questionnaire there using the "Load From File" button, and we do support Questionnaire items of type attachment.

DaniArj1980 commented 5 months ago

Thanks, I would have to make some type of modification to the demo to be able to use R5, on a local server?

plynchnlm commented 5 months ago

There should be no need to modify lforms (this package) to use R5. Which demo are you referring to? Some of our demos are probably in need of an update.

DaniArj1980 commented 5 months ago

Yes, I refer to https://lhcforms.nlm.nih.gov/lhcforms

plynchnlm commented 5 months ago

Okay, that demo is not open-source, because it is a part of the project website. What part of that demo is of interest to you? I assume you probably don't want the same sidebar. Would this demo, which is one of the demos on the lforms documentation site, be a good starting point for you?

DaniArj1980 commented 5 months ago

Yes, of course. I would be interested in both the formbuilder and the formviewer for questionnaire in R5

plynchnlm commented 5 months ago

The formbuilder is a separate package, https://github.com/LHNCBC/formbuilder-lhcforms, which is also on-line as a website, https://formbuilder.nlm.nih.gov/. However, it does not have R5 support yet.

DaniArj1980 commented 5 months ago

And could you use this functionality for a Fhir R5 service? If so, what changes should I make? because it gives me problems for the choise types since in R5, they no longer exist, it would be the coding types

plynchnlm commented 5 months ago

The formbuidler's UI is still focused on R4, and only does lists for types choice and open-choice. However, if that limitation is acceptable, you could use lforms to convert the formbuilder's R4 output to R5 (so the types of the lists would be "coding").

DaniArj1980 commented 5 months ago

Would this be very complex? Would I have to modify a code? I already have the lform library modified?

plynchnlm commented 5 months ago

Well, I am not clear on what you are doing. If you are going to use the formbuilder, you would probably want to modify that code to provide an option to export the built form in R5 format, which you could create using this lforms package, by importing the R4 version and exporting it in R5, using the documented FHIR APIs.

DaniArj1980 commented 5 months ago

Hello, I have managed to solve the choise problem for R5, but when I try to make a post, I get the following error:

Error: Question with linkId '2561826271176' contains enableWhen pointing to a question with linkId 'undefined' that does not exist.

This occurs when calling the function LForms.Util.convertFHIRQuestionnaireToLForms(fhirQ),'R5')

plynchnlm commented 5 months ago

That error indicates that there is a problem with the Questionnaire definition. It is saying that the question that has linkId 2561826271176 has an enableWhen section that that is missing a linkId (in the "enableWhen.question" field).