1.0.3 • Published 10 months ago

@synanetics/fdl-interpreter v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

FDL Interpreter

This is a React implementation of a Forms Definition Language (FDL) interpreter.

Installation and Usage

See the example folder for an example setup of using the FDL Interpreter. The general steps are:

  1. Install using npm install @synanetics/fdl-interpreter.
  2. Setup all controls that will be required as React components. These must have the props of type FdlControlProps.
  3. Create a map of React controls to the AbstractFormControlDefinition URLs.
  4. Create a button component that has props of type ButtonComponentProps.
  5. Have an FDL template FHIR bundle ready to be loaded in. This bundle includes all AbstractFormControlDefinitions and StructureMaps required to generate the form.
  6. Create a Parameters FHIR resource to inject context into the form. For example, this could contain the current patient reference and if editing a form then the previous form response.
  7. Use the FdlForm component to render the form:
  <FdlForm
    controls={controls}
    fdl={fdlBundle}
    params={params}
    onOutputChange={setOutput}
    ButtonComponent={MyButton}
  />

Development Setup

  1. Run npm run setup to install dependencies
  2. Run npm run dev to run watch changes to both the FDL interpreter and the example app
  3. Open http://localhost:5173 to see the example app
1.0.3

10 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago