...
Fork and clone the React Form Engine repository.
cd
into your clone.pwd
to get the path of the React Form Engine , which you will use later. You should see something likeCode Block language text /Users/johndoe/code/openmrs-form-engine-lib
The engine is a library and not an O3 MF module. It can be consumed by bundling it within an ESM or custom frontend app that incorporates it within a UI workflow.
You can make changes to the library and test them on forms in the O3 patient chart.
Open your local
openmrs-esm-patient-chart
clone. Install dependencies using:Code Block language sh yarn
We'll then link the
openmrs-form-engine-lib
from the previous step inside ofpackages/esm-form-engine-app
. To do so, run:Code Block language sh cd packages/esm-form-engine-app yarn link ... # where ... is the path to your `openmrs-form-engine-lib` directory from the previous step. It could look like: /Users/johndoe/code/openmrs-form-engine-lib.
If you're using Windows, you might need to wrap your path in double quotes.
It is very important that this step works correctly to establish the link between the formengine library and the frontend.
Open the package.json file in the esm-patient-chart-app
and confirm that in the resolutions section, you have something like
Code Block | ||
---|---|---|
| ||
"resolutions": { "@openmrs/openmrs-form-engine-lib": "portal:/Users/johndoe/code/openmrs-form-engine-lib" } |
...