Skip to Content
DocsForms in O3Field types and renderings

React field types and renderings

In the React Form Engine, type and questionOptions.rendering are independent contracts:

  • type selects a field-value adapter, which reads existing data and creates submission data.
  • rendering selects the input or display control.

The Form Builder exposes choices for authoring, but its dropdown is not a guarantee that a type/rendering combination has the metadata or server support it needs. The builder preview renders through the React Form Engine.

Field adapter types

typeBuilt-in React adapterOffered by the Interactive Builder
obsObservationYes
obsGroupGrouped observationsYes
controlNon-submitting/display controlYes
testOrderOrdersYes
programStateProgram stateYes
encounterLocationEncounter locationYes
encounterProviderEncounter providerYes
encounterRoleEncounter roleYes
encounterDatetimeEncounter date/timeYes
patientIdentifierPatient identifierYes
personAttributePerson attributeYes
diagnosisEncounter diagnosisNo; use the Schema Editor
obsCommentObservation commentNo; generated by showComment
inlineDateObservation date overrideNo; generated by showDate

A type that has no built-in or registered adapter cannot reliably load or submit a value. There is no generic submission fallback for unknown types.

Rendering inventory

“Builder” below means the rendering appears in the builder’s default renderingTypes list. Only some renderings have a dedicated options panel; the Schema Editor remains necessary for properties the interactive UI does not expose.

renderingReact runtime behaviorBuilder
textSingle-line text controlYes
textareaMulti-line text controlYes
numberNumeric control with min/max, step, and decimal optionsYes
dateDate control; defaults to calendar modeYes
datetimeDate control; defaults to combined date/time modeYes
selectSingle-selection dropdownYes
radioSingle selection as radio buttonsYes
checkboxMultiple selectionYes
checkbox-searchableNormalized to checkbox with searchable behaviorYes
content-switcherSingle selection with a content switcherYes
toggleBoolean-style toggleYes
ui-select-extendedSearchable data-backed selection controlYes
select-concept-answersSearchable control backed by a concept’s answersYes
drugui-select-extended template backed by the drug data sourceYes
problemui-select-extended template backed by the problem data sourceYes
encounter-locationData-backed location templateYes
encounter-providerData-backed provider templateYes
encounter-roleData-backed encounter-role templateYes
fileFile upload controlYes
fixed-valueRead-only fixed valueYes
groupNested grouped fieldsYes
repeatingRepeatable nested fieldsYes
markdownRendered Markdown content; normalized to controlYes
workspace-launcherButton that launches a named O3 workspace; normalized to controlYes
extension-widgetDeclared by the type/schema and offered by the builder, but has no built-in registered control in the current libraryYes

The normative schema still accepts the legacy multiCheckbox name, and the React transformer normalizes it. Use checkbox-searchable in new schemas.

Common field examples

A coded observation supplies its own answer concepts:

{ "id": "visitOutcome", "label": "Visit outcome", "type": "obs", "questionOptions": { "rendering": "radio", "concept": "33333333-3333-3333-3333-333333333333", "answers": [ { "label": "Completed", "concept": "44444444-4444-4444-4444-444444444444" }, { "label": "Referred", "concept": "55555555-5555-5555-5555-555555555555" } ] } }

A repeating observation group carries nested questions:

{ "id": "symptoms", "label": "Symptoms", "type": "obsGroup", "questionOptions": { "rendering": "repeating", "concept": "66666666-6666-6666-6666-666666666666", "repeatOptions": { "addText": "Add symptom", "limit": "5" } }, "questions": [ { "id": "symptomName", "label": "Symptom", "type": "obs", "questionOptions": { "rendering": "text", "concept": "77777777-7777-7777-7777-777777777777" } } ] }

Fallback and unsupported behavior

  • An obs question without a concept falls back to a disabled text control, except for file and fixed-value renderings. This makes the metadata problem visible; it does not make the question submit correctly.
  • An unknown or unregistered rendering resolves to no control, so the field does not render.
  • extension-widget requires distribution code to register a compatible control. The presence of extensionId and extensionSlotName in JSON does not install that control.
  • checkbox-searchable is transformed to the checkbox control with isCheckboxSearchable: true.
  • drug, problem, encounter metadata, and concept-answer templates depend on their registered data sources and the corresponding OpenMRS APIs.

Use Troubleshooting forms when the builder accepts a schema but its preview or runtime behavior is incomplete.

Last updated on