LForms Updater
This package is used to update an LForms form definition from one version of
LForms to the latest one. It will also update FHIR resources created by LForms
to structures that would be generated by the current LForms package.
Command-line Usage
node bin/updater -f [path to form definition or FHIR resource file]
node bin/updater -f [filepath to a form/resource]
-d [directory of form/resource files] -o [output directory]
-v [version to be updated to, optional]
Either -f or, -d and -o are required.
Installation as an npm package
npm install lforms-updater
Using the Package in a Program
var lformsUpdater = require('lforms-updater');
var updatedResource = lformsUpdater.update(formDeforResourceToBeUpdated);
Alternatively, you can include the browser/updater.js as a script tag. That will define
window.lformsUpdater, which you can use as above.
The lformsUpdater object contains a function "update" which takes the parsed JSON for
the form definition or resource. The function also takes a second, optional
argument which is the version of lforms at which to stop updating. (This was
useful for our tests.)