Form Version
The form version contains the actual contents for the form. Each form response contains 'form_version' field, which tells you exactly the contents of the form when the patient took it, even if the contents are now modified.
The form version model
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the form version.
- Name
object
- Type
- string
- Description
Always 'form_version'.
- Name
form
- Type
- string
- Description
Form this form version belongs to.
- Name
sections
- Type
- array of strings
- Description
List of sections in this form version.
- Name
created_at
- Type
- number
- Description
Timestamp (in ISO 8601 format) of when the form version was created.
- Name
last_updated_at
- Type
- number
- Description
Timestamp (in ISO 8601 format) of when the form version was last updated.
Response
{
"id": "fver_U8xtAULYUrX7GVsTKePy",
"object": "form_version",
"form": "form_NOIYLBGOBNhSwTWCUzfu",
"sections": [{
"id": "ntsc_1JtjV1QEY84Fv395Hl7h",
"name": "Section 1",
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}
]
],
"questions": [
{
"id": "nqst_U8xtAULYUrX7GVsTKePy",
"object": "note_template_question",
"name": "What is your name?",
"type": "short_answer",
"show_on_summary_card": true,
"required": true,
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equalTo",
"value": "Yes"
}
]
]
}
]
}],
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
Retrieve a form version
Retrieves the specified form version.
Response
{
"id": "fver_U8xtAULYUrX7GVsTKePy",
"object": "form_version",
"form": "form_NOIYLBGOBNhSwTWCUzfu",
"sections": [{
"id": "ntsc_1JtjV1QEY84Fv395Hl7h",
"name": "Section 1",
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}
]
],
"questions": [
{
"id": "nqst_U8xtAULYUrX7GVsTKePy",
"object": "note_template_question",
"name": "What is your name?",
"type": "short_answer",
"show_on_summary_card": true,
"required": true,
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equalTo",
"value": "Yes"
}
]
]
}
]
}],
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
Update a form version question
Updates the specified form question by setting the values of the parameters passed. Any other parameters not provided will not be modified. The form question can only be updated if the form version is in the 'latest_version' field of the associated form. A form version cannot be updated once it's been moved to the 'published_version' field of the associated form.
Required attributes
Optional attributes
- Name
name
- Type
- string
- Description
Name of the form version question.
- Name
type
- Type
- string
- Description
Type of form version question.
multipleChoice
dropdown
short_answer
grid
number
paragraph
date
time
picture
file
statement
consent
ssn
address
insurance
icd_codes
cpt_codes
editor
setup_payment
preferred_pharmacy
allergy
medication
vitals
family_history
Possible values:- Name
show_on_summary_card
- Type
- boolean
- Description
Whether or not the form version question should be shown on the summary card in Avon UI's patient chart.
- Name
required
- Type
- boolean
- Description
Whether or not a response to the form version question is required.
- Name
logic
- Type
- 2D array of objects
- Description
- Set of criteria that have to be met for this form version question to be visible. If no conditions are passed, this form version question will always be visible. The inner array is a set of conditions that are ANDed together whereas the outer array is a set of conditions that are ORed together. For example, if you want this form version question to be visible if the patient selects either option 1 or option 2, you would pass:
[ [ { "field": "opt_1", "condition": "equal_to", "value": true } ], [ { "field": "opt_2", "condition": "equal_to", "value": true } ] ]
If you want this form version question to be visible if the patient selects option 1 and option 2, you would pass:[ [ { "field": "opt_1", "condition": "equal_to", "value": true }, { "field": "opt_2", "condition": "equal_to", "value": true } ] ]
- Name
add_to_patient_chart
- Type
- boolean
- Description
Only applies for question types . Whether or not the response to this question should be automatically added to the patient's chart.
- Name
policy
- Type
- string
- Description
Only applies if 'question.type' is 'consent'. Policy that patient is agreeing to.
- Name
default_codes
- Type
- string
- Description
Only applies if 'question.type' is 'ICDCodes' and 'CPTCodes'. Default ICD/CPT codes respectively to be auto-filled into response.
- Name
options
- Type
- array of objects
- Description
- Only applies if "question.type" is "dropdown" or "multipleChoice". Options to be represented to the patient.
- Name
description
- Type
- boolean
- Description
Only applies if 'question.type' is 'dropdown' or 'grid'. If you want each option to have a description.
- Name
default_text
- Type
- string
- Description
Only applies if 'question.type' is 'editor'. Default text to be autopopulated in the response.
- Name
rows
- Type
- array of objects
- Description
- Only applies if "question.type" is "grid". Rows of grid.
- Name
columns
- Type
- array
- Description
Only applies if 'question.type' is 'grid'. Array of columns for the grid.
- Name
buttons
- Type
- array of objects
- Description
- Only applies if "question.type" is "grid". Buttons in grid.
- Name
multi_select
- Type
- boolean
- Description
Only applies if 'question.type' is 'grid' or 'multipleChoice'. Whether the patient can select multiple buttons in a row (for grid) and multiple options (for multiple choice).
- Name
image
- Type
- boolean
- Description
Only applies if 'question.type' is 'multipleChoice'. Whether to display an image next to each option.
- Name
placeholder
- Type
- string
- Description
Only applies if 'question.type' is 'number,' 'paragraph,' 'shortAnswer,' or 'ssn'. The placeholder text for the input.
- Name
details
- Type
- string
- Description
Only applies if 'question.type' is 'statement'. The content of the statement. Can be HTML.
Response
{
"id": "fver_U8xtAULYUrX7GVsTKePy",
"object": "form_version",
"form": "form_NOIYLBGOBNhSwTWCUzfu",
"sections": [{
"id": "ntsc_1JtjV1QEY84Fv395Hl7h",
"name": "Section 1",
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}
]
],
"questions": [
{
"id": "nqst_U8xtAULYUrX7GVsTKePy",
"object": "note_template_question",
"name": "What is your name?",
"type": "short_answer",
"show_on_summary_card": true,
"required": true,
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equalTo",
"value": "Yes"
}
]
]
}
]
}],
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}
List all form versions
Returns a list of all form versions.
Response
{
"object": "list",
"data": [{
"id": "fver_U8xtAULYUrX7GVsTKePy",
"object": "form_version",
"form": "form_NOIYLBGOBNhSwTWCUzfu",
"sections": [{
"id": "ntsc_1JtjV1QEY84Fv395Hl7h",
"name": "Section 1",
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equal_to",
"value": "Yes"
}
]
],
"questions": [
{
"id": "nqst_U8xtAULYUrX7GVsTKePy",
"object": "note_template_question",
"name": "What is your name?",
"type": "short_answer",
"show_on_summary_card": true,
"required": true,
"logic": [
[
{
"field": "nqst_3951JtjV1QEY84FvHl7h",
"condition": "equalTo",
"value": "Yes"
}
]
]
}
]
}],
"created_at": "2024-04-10T13:20:21.724Z",
"last_updated_at": "2024-04-10T13:20:21.724Z"
}]
}