Closed DaniArj1980 closed 5 months ago
We build lforms on Linux, so probably the issue is that there is something platform-specific in our build scripts. It looks like some issue with quotation marks. Anyway, are you trying to modify lforms? If you just want to use it, you can either you "npm install lforms" or download pre-built versions directly from https://lhcforms-static.nlm.nih.gov/lforms-versions/ (and note that there are zip files there, and that the latest version is currently 35.0.3).
Thank you very much, our idea is to import functionalities to store, modify and send responses to questionnaires on a FHIR server, as well as display them on the frontend. Something similar to the Form Builder option in the demo. Would it be possible? By running "npm install lforms" and importing the component, we could use the functions described at http://lhncbc.github.io/lforms/
Greetings, thank you
Yes, either by installing or downloading, or linking to the lforms-static website files above, you can use lforms without buliding it. However, "importing" it won't work. Just link to the files via script/link tags (as documented at http://lhncbc.github.io/lforms/#installation). For a simple example, see https://jsfiddle.net/lforms/8f754jhy/44/ .
Hello,
Running the "npm install lforms" command in a new project. Defining the following code in Angular in app.component.ts.
.
I am invoking the script with the libraries in the html.
This way I can't use the functions with LForms or I have skipped some import or configuration step.
Greetings, thank you
Can you be more specific about what is going wrong? Are you getting an error somewhere?
I see you are pulling the files from the clinicaltables website as in the demo, which is fine. However, in that case you don't need to run "npm install lforms".
Our problem is that we want to create an Angular project which uses part of the lforms functionality, do we need to make calls like, for example, LForms.Util.addFormToPage(fhirQ, 'formContainer'); We can't get it to recognize LForms to be able to invoke the call. We don't know what steps to follow or if we can use part of the functionality in our project.
Greetings, thank you
Yes, that is the API to use. I am not sure why you cannot access LForms. Are the scripts loading successfully? Do you have access to the "window" object? If so, window.LForms should work.
A suggestion from a team member: add "declare var LForms: any;"
Also, you might take a look at the https://github.com/lhncbc/formbuilder-lhcforms (the NLM Form Builder) project, which is an Angular app that uses LForms. It is not a simple example to look at, though. (src/app/services/fetch.service.ts:12:declare var LForms: any;)
Hello,
The process I follow is to create a new project called ejemploFormulario3:
PS C:\Curso\Angular> ng new ejemploFormulario3 --standalone=false
I create a new component:
PS C:\Curso\Angular\ejemploFormulario3> ng generate component mi_componente.
The created html file is as follows:
The created ps file is as foollows:
I understand that it would not be necessary to execute run install lform since it is bringing it from the Githubissues.
Hi, From what I understand I have to follow this series of steps to be able to use the lforms package.
When running npm run build, I get the following error:
'require(fs).writeFileSync(src/version.json, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token at new Script (vm.js:102:7) at createScript (vm.js:263:10) at Object.runInThisContext (vm.js:311:10) at internal/process/execution.js:77:19 at eval-wrapper:6:22 at evalScript (internal/process/execution.js:76:60) at internal/main/eval_string.js:23:3
I am using node js 20, I don't know if that is the reason. Could you help me?
Greetings, thank you