Forms in O3
Convert HTML form entry forms to O3

Converting HTML Form Entry forms to O3


O3 form schemas conform to a standard JSON schema (opens in a new tab). Forms that match this schema can be used with the Form Engine that it ships with. This means that if you have a form that doesn't match this schema, you'll need to convert it to a JSON representation that is compatible O3 schema before you can use it with O3.


To learn more about the various properties that make up the schema, read the core concepts (opens in a new tab) section of the Angular Form Engine docs.

Many implementers have forms built using the HTML Form Entry module. To make it easier to migrate these forms to O3, the Palladium Kenya team built a tool that helps you convert your HTML Form Entry forms to O3 schema. This HFE to O3 schema converter (opens in a new tab) tool helps you migrate your forms by taking care of some important aspects, including:

  • Handling obs with defined answerConcepts and where the answers should be inferred from the dictionary
  • Handling of obs styling for radio, checkbox, dropdown
  • Handling obs fields that are marked as required
  • Handling of diagnosis answerClass
  • Handling of custom labels as defined in answerLabel/answerLabels
  • Schema generation for the obsgroup tag. The logic can group questions within an obs group. It also generates a schema for groups marked as repeating
  • Exporting the HFE schema to a configurable directory. This is helpful in cases where the HFE schema requires further updates to generate the correct JSON schema
  • Provide labels for grouped obs. A new attribute labelText is supported for that
  • Grouping of related checkboxes

While this won't get you all the way there in terms of migrating your forms, it should get you far along enough that you can use O3's built-in form builder to make the remaining changes to your schemas.

If you wish to contribute to improving the tool, feel free to read through the project README (opens in a new tab) to see what the feature roadmap looks like. We'd love to have you on there!

You can also read through the related talk post (opens in a new tab) on OpenMRS Talk.