Skip to Content

Calibration Functionality

Overview

The Shen.AI SDK introduces a calibration feature to enhance blood pressure measurement accuracy. By integrating user-provided readings from an external blood pressure monitor, the SDK adjusts its measurements for improved precision.

Initialization Modes

The SDK supports three modes, defined by the initializationMode parameter:

1. MEASUREMENT (Standard Mode)

  • Default mode, following the standard measurement process.
  • No calibration data is required or applied.

2. CALIBRATION (Calibration Mode)

  • Activates the calibration workflow, guiding users through:
    • Calibration onboarding instructions.
    • Four manual data entry steps for external blood pressure readings.
    • Three SDK-based measurements, each with a two-minute limit.
  • Calibration results are stored locally on the current device/browser and partitioned by userId.
  • If userId is not provided, results are saved under the default user ID, so multiple users on the same device/browser will share that calibration bucket.

3. CALIBRATED_MEASUREMENT (Calibrated Measurement Mode)

  • Uses previously stored calibration data (if available).
  • The SDK:
    • Loads the previously stored local calibration data for the current userId.
    • Conducts a normal measurement process.
    • Adjusts the results for improved accuracy.
  • If no matching local calibration data is found, the SDK falls back to standard measurement mode.
lib/main.dart
import 'package:shenai_sdk/shenai_sdk.dart'; var API_KEY = "" var USER_ID = "" final settings = InitializationSettings( initializationMode: InitializationMode.calibration, ); final _initResult = await ShenaiSdk.initialize(API_KEY, USER_ID, settings);

To see more about SDK initialization settings, visit the Initialization page.

Usage Instructions

  1. Set initializationMode in the SDK configuration.
  2. Ensure users complete the full calibration process.
  3. Use Calibrated Measurement Mode to apply stored calibration adjustments.

Note: When the Calibration workflow finishes successfully, the SDK sends a userFlowFinished event.

Important Notes

  • Local, User-Partitioned Calibration: Calibration data is stored locally on the current device/browser and looked up by userId.
  • Cross-Device Behavior: Calibration does not automatically sync across devices or browsers, even when the same userId is used.
  • Default Bucket: If userId is omitted, calibration is stored under a default bucket and may be reused by other users on the same device/browser.
  • Time-Limited SDK Measurements: Calibration mode requires SDK measurements to stay within two minutes.
  • Fallback to Standard Mode: If calibration is not performed, the SDK reverts to standard mode without adjustments.

This feature ensures greater accuracy and reliability in blood pressure readings for users who complete the calibration process.