This is a work in progress page and is meant for documentation purposes only |
To create a custom property/component for Forms 2.0 , you would need to clone the following two Bahmni repos:
As seen above, the two repos represent two distinct parts of Forms 2.0.
Form Builder
Form Controls represents the actual components to be rendered in the Form Builder and the actual Observation Forms.
Designer Control, in Form Builder these control specific designer control assist to define the design time properties and behaviour for a specific control.
Components in an Observation Form
For the actual development , you would only need to focus on the Form-controls repo.
The Form Controls repo has the following structure:
The Designer Controls are the components that are seen in the Form Builder. These components are present in the /src/components/designer directory.
The Components that are displayed in the Observation form are present in the /src/components directory.
Steps to Create Form Builder Designer Controls:
After following the above steps, compile the code using the steps mentioned here, copy the files from the dist folder and paste it in the node_modules/bahmni-form-controls/dist of the implementer interface repo.Then, follow the steps mentioned here to compile and run the implementer interface. You can then see your changes reflected.
Steps to Create Controls For Observation Forms:
Check out the following links and its associated repo for a sample component. The sample component is a Date Calculator which calculates a Future date based on the provided date.