Replies: 2 comments
-
Fixed grid layout (row == 12 columns). Layout details described in questions itself.In this option we assume that every form's row contains 12 cells. For example to place input in a center and take half of the width we define
Both attributes are optional. {:items [{:id "systolic"
:text "Blood Pressure - Systolic"
:size 8}
{:id "diastolic"
:text "Blood Pressure - Diastolic"
:size 6}]}
This definition renders as
Also how much effort need to create custom layout (grid 2x2)
We need to set {:items [{:id "systolic"
:text "Systolic blood pressure"
:size 6}
{:id "diastolic"
:text "Diastolic blood pressure"
:size 6}
{:id "body-position"
:text "Body Position"
:size 6}
{:id "body-site"
:text "Body Site"
:size 6}]} how error-prone to change layoutError prone due to size changes in previous widgets may affect How easily it will be to convert Form to QuestionnaireStraight-forward, no additional wrappers, question order is the same. Do you need visual form to understand DSL layout?It's better to use visual representation. Since layout is based on widget size (and start column), it's more difficult to tell where is the widget located without visual representation - you shold calculate sizes and positions to know that. |
Beta Was this translation helpful? Give feedback.
-
Flex container widgets that place questions in a particular wayIn this option we add additional item types for layout - row and column
These items behave like containers - they contain other items and place them in a particular way. For example row container places its children in a row and splits width between them.
column container places its children in a column and every children placed in a new row.
Also these containers can be composed together in a several ways. [{:type "row"
:items [{:type "column"
:items [{:id "systolic" :text "Systolic blood pressure"}
{:id "body-position" :text "Body Position"}]}
{:type "column"
:items [{:id "diastolic" :text "Diastolic blood pressure"}
{:id "body-site" :text "Body Site"}
]}]} renders to this layout
how much effort need to create custom layout (grid 2x2)
we need to wrap questions in 3 containers - 2 row containers and one column container {:items {:type "column"
:items [{:type "row"
:items [{:id "systolic"
:text "Systolic blood pressure"}
{:id "diastolic"
:text "Diastolic blood pressure"}]}
{:type "row"
:items [{:id "body-position"
:text "Body Position"}
{:id "body-site"
:text "Body Site"}]}]}} How error-prone to change layoutNot at all. We can remove/add/change container and impact only child widgets. How easily it will be to convert Form to QuestionnaireNot so straightforward - we need to remove all containers, Do you need visual form to understand DSL layout?Likely it will be better to use it, but you can infer widgets position |
Beta Was this translation helpful? Give feedback.
-
Description
Form is a list of questions, grouped together around specific problem.
Form has it's own UI and should be filled out by some person (patient, practitioner, etc...)
By default questions are placed linearly, but it's usefull to arrange them more precicely.
Form has it's representation as JSON - which we call DSL.
It defines questions and their visual details (arrangement, size).
FHIR Questionnaire
definitions example:This example defines 2 questions and 1 display item in a group
"Blood Pressure"
.There is no information about their visual representation - just grouping and questions order.
In
Aidbox Forms
we have 2 separate DSLs forQuestions
andLayout
definitions, they complement each other:Questions
definition describes questions.Layout
definition describes questions arrangement(row, column) and has additional UI items (label)Separate
Layout
definition gives ability to define and use several layouts for the same form interchangeably.But separate definitions goes with a cost - you should type twice one question - in a
Questions
and in aLayout
.Also it's more error prone to change a form - you can forget to update other definition.
Both options has it's pros and cons and we want to get best of that options.
Our intention - to simplify form definition and minimize required effort.
For that purpose we want to try use only single DSL instead of 2 separated.
Problem
How to simplify form definition and minimize effort required to define a form with custom layout.
Questions
Options
We found these options:
Aspects
Approach
Decision matrix
Call for action
You can read more about options in next comments.
Please give your feedback - what do you think
or just vote for the comment with emoji or "up" button.
Beta Was this translation helpful? Give feedback.
All reactions