Skip to main content

Boolean properties

Booleans are yes/no answers.

They store:

  • true for yes.
  • false for no.

Good boolean titles

Good:

Patient uses a mobility aid

Bad:

Mobility aid

The good version is clear because the answer can be yes or no.

Simple confirmation

"is-post-op": {
"title": "Is this a post-op visit?",
"type": "boolean",
"description": "Mark yes if today’s visit is related to recent surgery"
}

Boolean that reveals follow-ups

"mobility": {
"title": "Mobility",
"type": "object",
"properties": {
"uses-mobility-aid": {
"title": "Patient uses a mobility aid",
"type": "boolean",
"description": "Confirm if the patient relies on any aid to walk"
}
},
"allOf": [
{
"if": {
"properties": { "uses-mobility-aid": { "const": true } },
"required": ["uses-mobility-aid"]
},
"then": {
"properties": {
"aid-type": {
"title": "Aid type",
"type": "string",
"oneOf": [
{ "const": "CANES", "title": "Cane" },
{ "const": "WALKER", "title": "Walker" },
{ "const": "WHEELCHAIR", "title": "Wheelchair" }
]
}
},
"required": ["aid-type"]
}
}
]
}

Simple rule

Use booleans when the question can be answered with yes or no. If the answer needs details, add follow-up fields with dependencies or conditions.