Skip to main content

Number and integer properties

Numbers store measurements. Integers store whole numbers.

TypeUse it forExample
numberDecimals allowed.37.5
integerWhole numbers only.3

Always include the unit or scale in the title or description.

Common constraints

ConstraintMeaning
minimumSmallest allowed value.
maximumLargest allowed value.
exclusiveMinimumValue must be greater than this.
exclusiveMaximumValue must be less than this.
multipleOfValue 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.