Replies: 3 comments
-
Template for just one questionSimpliest case when we can define a template for one question choice-question
{:type "choice"
:label "Placeholder label"
:options [{:code "0" :display "Not at all" :score 0}
{:code "1" :display "Severe" :score 1}]} And then we can use it in a form using special keyword ( [{:use choice-question
:label "Do you have depression?"
:id "depression-flag"}
{:use choice-question
:label "Do you have suicidal thoughts?"
:id "suicidal-thougts"}] In the example above two questions will reuse from template answers list, How does it affect answers data schema?Answers schema doesn't know it using templates Can I define form template and then override attributes in it?Yes, that's possible. The template and usage will be merged in resulting form. |
Beta Was this translation helpful? Give feedback.
-
Any form can be used as template and included to another formThere are form about patient information: patient-info-form
{:item [{:id :first-name
:label "First Name"
:type "string"}
{:id :last-name
:label "Last Name"
:type "string"}]} We can include it to another form: form
{:item [{:use patient-info-form}
{...}
{...}]} In the example above Can I define form template and then override attributes in it?That's can be done with partially describing this form overriding attributes in particular fields. |
Beta Was this translation helpful? Give feedback.
-
Templates can't be used from DSL, templates are snippetsIn simpliest case when we can define a template for one question choice-question
{:type "choice"
:label "Placeholder label"
:options [{:code "0" :display "Not at all" :score 0}
{:code "1" :display "Severe" :score 1}]} We don't create any specific DSL to include question/form templates. These templates are only for use User can select question template, and this template will be included in form. Can I define form template and then override attributes in it?Yes. Once template included in form, we don't work with template anymore, we work with question directly, |
Beta Was this translation helpful? Give feedback.
-
Description
Form is a list of questions grouped together around specific problem.
Form is used to capture data from respondents (patients,practitioners, etc...)
Some forms can be builded by common used blocks (patient info). Also, there are many forms
that consists of identical questions.
Current solution in Aidbox SDC is called
subforms
for layout part andschema
for data schema part.We have to separately describe schema part and layout part for reusable piece of form.
Schema part:
Layout part:
We can't say this approach is about real reuse. We can't change id of question, we can't change label of the question.
We limited only to this question id (see
:bind
key in Layout definition) and this label.Problem
How to define a form piece template that is enough flexible and self-sufficiency. Template that can be used as-is or with
some changes
Use cases
Approaches
Template for just one question
Any form can be used as template and included to another form
Both approaches :)
Questions
Beta Was this translation helpful? Give feedback.
All reactions