Skip to content

Baseline measurement

The baseline measurement answers: how much range does the patient have today? It’s the median of the peaks of the first N clean reps. Rejected reps don’t count, so the starting point is measured with good form.

session.startBaseline(reps: 3) // resets the counter and starts

For hold exercises it counts clean holds instead of reps.

if let baseline = session.snapshot.baseline {
Text("\(baseline.repsDone) of \(baseline.repsNeeded)")
if let result = baseline.result {
Text("Your range today: \(Int(result))°")
}
}

Or wait for the event:

for await event in session.events() {
if case .baselineCompleted(let value) = event {
patient.baselineRange = value
target = max(value + 10, exercise.defaultTarget) // your logic
}
}
session.finishBaseline() // finishes with the clean reps so far (at least one)
session.cancelBaseline() // leaves without a result and resets

finishBaseline() does nothing if there are no clean reps yet.

With three reps of 98°, 102° and 131°, the average (110°) gets dragged up by one bounce. The median (102°) reflects what the patient does consistently.