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
fhir javascript

What is LForms?

LForms, a.k.a. LHC-Forms, is a feature-rich, open-source Web Component that creates input forms, based on definition files, for Web-based applications. In addition to its native form-definition format, it partially supports the HL7 FHIR Questionnaire standard (SDC profile), and work is in progress to expand that support.

It is being developed by the Lister Hill National Center for Biomedical Communications (LHNCBC), National Library of Medicine (NLM), part of the National Institutes of Health (NIH), with the collaboration and support from the Regenstrief Institute, Inc. and the LOINC Committee.

For features and demos, please visit the project page.

Licensing and Copyright Notice

See LICENSE.md.

Customizing and Contributing

If you wish to revise this package, the following steps will allow you to make changes and test them:

If you are planning to contribute new functionality back to us, please coordinate with us, so that the new code is in the right places, and so that you don't accidentally add something that we are also working on.

Development server

Build

Running tests

  1. Run npm run test to run unit tests and e2e tests, which also copies the FHIR lib files and built files in places for testing.

Running unit tests

  1. Run npm run test:unit to execute the unit tests via Karma.

Running end-to-end tests

  1. Run npm run test:e2e to execute the end-to-end tests via Cypress. The e2e tests are configured to use Chrome.

Using the LHC-Forms Web Component

There are several script files to load. If you are building this, these files will be under dist/lforms. If you are using the pre-built versions from https://clinicaltables.nlm.nih.gov/lforms-versions, then the file paths below are relative to those versioned directories.

  1. webcomponent/styles.css

You need to include the following files in your project:

  1. webcomponent/styles.css
  2. webcomponent/assets/lib/zone.min.js (unless you already have zone.min.js on the page)
  3. webcomponent/runtime.js
  4. webcomponent/polyfills.js
  5. webcomponent/main.js
  6. One of the FHIR support library files, assuming you are planning to use FHIR Questionnaires:
    • fhir/lformsFHIRAll.min.js
    • fhir/R5/lformsFHIR.min.js
    • fhir/R4B/lformsFHIR.min.js
    • fhir/R4/lformsFHIR.min.js
    • fhir/STU3/lformsFHIR.min.js

There is an example of an app using these files at https://lhcforms.nlm.nih.gov/lforms-fhir-app/. For details about how to work with this library, and for information about an announcements list, see the documentation.

lforms npm package

A complete npm package that you can use with import/require statements in your code is not ready yet. The current lforms npm package only contains built files in /dist/lforms directory. You can use those files as described in above section Using the LHC-Forms Web Component.

Related Documents