Number and integer properties
Numbers store measurements. Integers store whole numbers.
| Type | Use it for | Example |
|---|---|---|
number | Decimals allowed. | 37.5 |
integer | Whole numbers only. | 3 |
Always include the unit or scale in the title or description.
Common constraints
| Constraint | Meaning |
|---|---|
minimum | Smallest allowed value. |
maximum | Largest allowed value. |
exclusiveMinimum | Value must be greater than this. |
exclusiveMaximum | Value must be less than this. |
multipleOf | Value must follow a step, like 0.5. |
Integer with scale
"pain-score": {
"title": "Pain score (0-10)",
"type": "integer",
"description": "Numeric rating scale reported by the patient",
"minimum": 0,
"maximum": 10,
"multipleOf": 1,
"examples": [1, 3, 6]
}
Decimal with precision
"temperature": {
"title": "Temperature (C)",
"type": "number",
"description": "Single oral temperature reading",
"minimum": 34.0,
"maximum": 42.0,
"multipleOf": 0.1
}
Coded numeric bands
"pain-band": {
"title": "Pain band",
"type": "integer",
"description": "Map the score to a band for downstream analytics",
"oneOf": [
{ "const": 0, "title": "0-3 Mild" },
{ "const": 1, "title": "4-6 Moderate" },
{ "const": 2, "title": "7-10 Severe" }
]
}
Simple rule
Use numbers for things you may want to chart later:
- Pain score.
- Temperature.
- Weight.
- Range of motion.
- Number of visits.