Add Controls

Purpose and Benefits

This feature allows implementors to build a form using drag and drop via the UI. For now there are four controls supported which are Label, Section, Obs and ObsGroup. Label and section controls allow implementors to create some labels and groups which are not concept of OpenMRS. On the other hand, Obs and ObsGroup allow implementors to create observations and observation groups which are related to concepts of OpenMRS. This feature also makes it convenient to set the attribute of each observations or observation groups on form builder.

Supported Controls

Control NamePurposeTypeValueNote
LabelAt the time of designing a form in Implementer Interface, label control can be dragged and dropped on to the canvas. text fieldDefault value can be overridden by double clicking on the dropped control.In run-time mode, Label Control will be static and none of its properties can be changed.
Obs ControlAt the time of designing a form in Implementer Interface, Obs control can be dragged and dropped on to the canvas. 

Coded, Boolean, Date, DateTime, Text,Numeric,
Complex

Default value is the name of the concept the control is associated with but it can be overridden by double clicking on the dropped control.

Control properties can be changed through Property Inspector.

Obs Group ControlAt the time of designing a form in Implementer Interface, Obs Group control can be dragged and dropped on to the canvas. 


--

Default value is the name of the concept the control is associated with but it can be overridden by double clicking on the dropped control.Control properties can be changed through Property Inspector.
Section ControlAt the time of designing a form in Implementer Interface, Section control can be dragged and dropped on to the canvas. 


--

Use section control to make visual groupings of different Obs and Obs group controls on the form.


--

Control Properties

Following are the properties supported for the controls.

PropertyDescription
Mandatory

Marks the field as mandatory if selected

NotesAllows to capture Comments/Additional information
Add MoreAllows to capture Additional observation for the same control/concept
Hide LabelHides the label of obs Control
AbnormalSet's the abnormal value as true if the observation value is not in valid range
Multi Select

Allows to capture multiple values

AutocompleteDisplays the control as autocomplete component
DropdownDisplays the control as dropdown

AllowFutureDates

Allows date value to have future dates


Each control has its own properties and control properties can be set in the control properties box of form builder. The below table details about the properties supported by each control.

Control NameTypePropertiesDefaultComments
Obs ControlText/Boolean
  • Mandatory
  • Notes
  • AddMore
  • HideLabel
  • disabled
  • disabled
  • disabled
  • disabled

Obs ControlNumeric
  • Mandatory
  • Notes
  • AddMore
  • HideLabel
  • Abnormal
  • disabled
  • disabled
  • disabled
  • disabled
  • disabled

Obs ControlCoded
  • Mandatory
  • Notes
  • AddMore
  • HideLabel
  • MultiSelect
  • AutoComplete
  • DropDown
  • disabled
  • disabled
  • disabled
  • disabled
  • disabled
  • disabled
  • disabled
The coded control renders the answers as buttons by default. It can be change to autocomplete or dropdown using the properties
Obs ControlDate/Datetime
  • Mandatory
  • Notes
  • AddMore
  • HideLabel
  • AllowFutureDates
  • disabled
  • disabled
  • disabled
  • disabled
  • disabled

Obs ControlComplex(Image/Video)
  • Notes
  • AddMore
  • HideLabel
  • disabled
  • disabled
  • disabled

Obs ControlComplex(Location)
  • Notes
  • AddMore
  • HideLabel
  • Style
  • URL
  • disabled
  • disabled
  • disabled
  • dropdown
  • /openmrs/ws/rest/v1/location?v=custom:(id,name,uuid)
URL property is used to fetch all the locations and can be changed accordingly.
Obs ControlComplex(Provider)
  • Notes
  • AddMore
  • HideLabel
  • Style
  • URL
  • disabled
  • disabled
  • disabled
  • dropdown
  • /openmrs/ws/rest/v1/provider?v=custom:(id,name,uuid)
URL property is used to fetch all the providers and can be changed accordingly.
Obs Group Control
  • AddMore
  • disabled

Section Control
  • AddMore
  • disabled

Controls and behaviour not yet supported in Forms 2.0

Control NamePurposeTypeValueNote
Grid Obs Group ControlShow set members in a grid row layoutGrid LayoutUseful to layout answers of the members in grid rows, if the members themselves are of coded answers.

in Forms 1.0, this corresponds to configuring a Concept (set) as 

{ "grid" : true }

Tablular Obs Group ControlShow set members in tabular format, each member groups  displayed in a columnTabular LayoutUseful to layout members side-by-side. For example, if you want to capture and show "Visual acuity" of left and right eye side by side.

in Forms 1.0, this corresponds to configuring a Concept (set) as 

{ "isTabular" : true }
Chief Complaint ControlCapture complaints of patients with durationConcept class of "Concept Details"Show chief complaint details in a single rowin Forms 1.0, Concepts with classes "Concept Details" are shown as a single row. 

Steps

1. Select a control

Drag a control from the controls pane and drop it on canvas


Drag a controls on the canvas

2. Select the Obs and ObsGroup source

To do this, click on Obs control on the form and a input field will appear below the Control Properties pane. Then input the Concept and select one. For ObsGroup control, follow the same way.

About Obs and ObsGroup Source

Obs sources are all concepts which are not part of a set in OpenMRS.

On the contrary, ObsGroups sources are all concepts which are a set.

Select source for Obs control

3. Rename the Controls

By default the name of the Label control and Section control are "Label" and "Section" respectively. Double click on label to change the name of it. Obs and ObsGroup control are the concept names related with OpenMRS.

Rename a label control

4. Delete a Control

To do this, need to click the control and a trash can icon will show at top-right corner. Then click on the icon and confirm delete the control from canvas.

Delete a label control.

configuring a Concept (set) as