Comment on page
🫀
Measurements
A FibriCheck measurement is performed in 3 steps:
- Process the measurement: the measurement data is sent to the FibriCheck cloud where our AI algorithm will process the measurement and make a diagnosis. In some cases the measurement will be reviewed by a medical expert.
- Visualise the measurement: the measurement can be visualised in your application or through a generated PDF.
A measurement can have multiple statuses, depending in which phase of the review process it is in:
Status | Description |
---|---|
measured | The measurement is received. The status should change to preprocessing_selection immediately. |
preprocessing_selection | The correct preprocessing algo is being determined. The status should change to analysis_selection immediately. |
analysis_selection | The correct analysis algo is being determined. The status should change to pending_analysis immediately. |
pending_analysis | The measurement is waiting for the algorithm to analyze it. The status should change to under_analysis when the algorithm is ready to analyze |
under_analysis | The measurement is being analyzed by the algo. The status will be transitioned to analysis_failed or processing_results depending on the response of the algorithm. |
analysis_failed | The algorithm was not able to analyze this measurement. The measurement will stay in this status until manually transitioned back to pending_analysis . |
processing_results | The result of the analysis is being processed. The status should change to analyzed when ready. |
analyzed | The measurement was successfully analyzed . Depending on the subscription, the measurement will immediately transition to pending_review or stay in this status. Upon request, the measurement can also be manually transitioned topending_review . |
pending_review | The measurement is awaiting revision by a human medical expert. The human revision is currently meant to be completed within 48 hours and will transition the status to reviewed . |
reviewed | The measurement is reviewed by a human medical expert. The measurement will stay in this status until manually transitioned back to pending_review . |
This value represents the indicator that the FibriCheck algorithm has given to the measurement. When the
status
is reviewed
, it means this indicator is validated by a medical professional. Possible values are 'normal' | 'quality' | 'urgent' | 'warning'
Once a measurement is reviewed, it can have (multiple) diagnoses. To get the most severe diagnosis, you can check the
mostSevereLabel
property from the measurement object:{
...
"mostSevereLabel" : {
"key": "regular",
"color": "green"
}
}
Possible values of this diagnosis are, in decreasing order of severity:
'no-result'
'regular'
'sinus_arrhythmia'
'extrasystoles_trig_episode'
'undiagnosable'
'extrasystoles_isolated'
'dubious_rhythm'
'extrasystoles'
'extrasystoles_trigeminy'
'tachy_episode'
'extrasystoles_frequent'
'phone_incompatible'
'extrasystoles_big_episode'
'increased_hrv'
'sinus'
'atrial_flutter'
'brady_episode'
'tachycardia'
'extrasystoles_bigminy'
'tachy_arrhytmia'
'pacemaker_rhythm'
'bradycardia'
'brady_arrhytmia'
'quality_too_low'
'atrial_fibrillation'
'other'
'no_diagnosis'
In older versions of the Cloud SDK, this property may not be visible yet. If so, you can always use the
getMostSevereLabel()
function.The algorithm returns the calculated heart rate in the
heartrate
property. This calculated value can differ from the real-time heart rate value that you can see while performing a measurement. The reason for the difference is because the
heartrate
property is provided by the FibriCheck Cloud AI algorithm, which provides a more accurate value than the lighter on-device algorithm.The date and time of the measurement is given in epoch format under the
measurement_timestamp
property.When a measurement has been performed, context can be added. The context can contain one activity and multiple symptoms.
The context can be added directly to a measurement or can be updated at a later stage through the
updateMeasurementContext
method. This can be beneficial to the user experience. If you send the raw measurement data first, the processing of the measurement can already start in the FibriCheck Cloud. When the user has selected their symptoms, it can be added to the already processed measurement. Property | Possible Values | Description |
---|---|---|
activity | resting , sleeping , sitting , walking working , exercising other , standing | Describes what the user was doing just before taking the measurement. A single value can be selected. |
symptoms | no_symptoms , lightheaded , confused , fatigue , other , palpitations , chest_pains , shortness_of_breath , dizziness , feeling_of_fainting , racing_heart | Symptoms that the user was experiencing at the time of the measurement. One or more values can be selected. |
symptomSeverity | 2a , 2b , 3 , 4 | A single severity score across the different symptoms a user is experiencing. |
The symptom severity score follows the modified EHRA classification for symptom severity. The symptom severity score is a single score given across the symptoms a patient is experiencing.
mEHRA score | Symptoms | Description |
---|---|---|
2a | Mild | Normal daily activity not affected, symptoms not troublesome to patient |
2b | Moderate | Normal daily activity not affected but patient troubled by symptoms |
3 | Severe | Normal daily activity affected |
4 | Disabling | Normal daily activity discontinued |
When a measurement done by the Camera SDK is finished, it needs to be uploaded to the FibriCheck cloud for processing and analysis.
Take a look at the Camera SDK documentation for a full code example on how to perform and post a FibriCheck measurement.
Measurements will only be analyzed by the algorithm when the authenticated user has an active prescription. See the prescriptions documentation for more information on how to create and manage prescriptions.
The Cloud SDK is aware of the data structure of the Camera SDK. Posting a measurement is nothing more than executing the
postMeasurement
function with the data object from the Camera SDK.The SDK will automatically augment the measurement data with some meta-data like the device details and the application version.
Flutter
React Native
Future _onMeasurementFinished(String measurementString) async {
var mCreationData = MeasurementCreationData.fromCameraSdk(measurementString);
await widget.sdk.postMeasurement(mCreationData, "v0.0.1");
}
async function postMeasurement(cameraData, context) {
const measurement = {
...cameraData,
context
};
await sdk.postMeasurement(measurement, RNFibriCheckView.version);
}
After a successful measurement, the platform-specific FibriCheck Camera SDK will output a structure that, converted to JSON, can be uploaded as-is to the FibriCheck cloud via the following
POST
call:post
https://api.fibricheck.com
/data/v1/documents/fibricheck-measurements/
Post a new measurement
Typically you want to add some meta-data to the measurement. This can be done by augmenting the
measurement
object from the Camera SDK in the following way:{
...measurement,
device: {
os: "12.5.5",
model: "iPhone6,2",
manufacturer: "Apple",
type: "ios|android|ionic|versa|versa_lite|versa_2|Tizen|versa_3|sense",
},
app: {
build: 10,
name: 'mobile-spot-check',
version: "2.6.0"
fibricheck_sdk_version: "",
camera_sdk_version: "1.2.0",
},
tags: ['custom-tag'],
}
Always include the device information. The algorithm requires this information to know which parameters to include in the analysis!
The
tags
parameter can be used to categorise sets of measurements for easier filtering later on.Take a look at the documentation of your app development platform to find out how to retrieve metadata parameters like OS version, build number,... in your application
Flutter
React Native
class MeasurementContext {
final List<Symptoms>? symptoms;
final Activity? activity;
final SymptomSeverity? symptomSeverity;
MeasurementContext({
required this.symptoms,
required this.activity,
this.symptomSeverity,
});
factory MeasurementContext.fromJson(Map<String, dynamic> json) => _$MeasurementContextFromJson(json);
Map<String, dynamic> toJson() => _$MeasurementContextToJson(this);
}
await _sdk.updateMeasurementContext(
"{measurementId}",
MeasurementContext(
symptoms: [Symptoms.chestPains],
activity: Activity.resting
symptomSeverity: SymptomSeverity.severity_1
));
await sdk.updateMeasurementContext('{measurementId}',{
symptoms: ['fatigue'],
activity: 'other',
symptomSeverity: '1'
});
To update the measurement context through the API, you have to execute the API call below with the following body:
{
"context": {
"activity": "sitting",
"symptoms": ["fatigue"],
"symptomSeverity": "2a"
}
}
put
https://api.fibricheck.com
/data/v1/fibricheck-measurements/documents/{measurementId}
Update the measurement context
Use the
getMeasurement
method to get a single measurement based on an id
. The SDK only allows to request measurements for the currently authenticated user.To fetch multiple measurements, you can use the
getMeasurements
method. This will return a paginated result with all measurements for the currently authenticated user. You can find the measurements under the data
property. You can also use the next
and previous
functions, present on the result, to navigate through the user's measurements.Flutter
React Native
// Fetch a single measurement
const measurementId = '0000';
const measurement = await _sdk.getMeasurement(measurementId);
// To fetch all your measurements
_sdk.getMeasurements(true); // true -> get newest measurements first
await res.getNextMeasurements(); // get next 20 measurements
await res.getPreviousMeasurements(); // get previous 20 measurements
// Fetch a single measurement
const measurementId = '0000';
const measurement = await sdk.getMeasurement(measurementId);
// Returns the first 20 measurements
const measurements = await sdk.getMeasurements();
// Returns the next 20 measurements
const nextMeasurements = await measurements.next();
get
https://api.fibricheck.com
/data/v1/fibricheck-measurements/documents
Fetch measurements
- In a single call, by default 20 items are returned, the maximum number of items that can be fetched in a single API call is 50. You can customise the number of returned items using the
limit()
operator. - If there are more than 50 measurements in your query, you have to use an offset to fetch more than the first. For example
limit(10,50)
will return 10 results, with an offset of 50. - By default the API returns the results in ascending order, the oldest measurement is returned first. Use the
sort(-creationTimestamp)
operator to return results in descending order.
The following example queries give an overview of how to use this endpoint. For brevity, the full URL is omitted.
- Fetch the latest measurement
/documents?limit(1)&sort(-creationTimestamp)
- Fetch the latest 50 measurements
/documents?limit(50)&sort(-creationTimestamp)
- Fetch the next 50 measurements
/documents?limit(50,50)&sort(-creationTimestamp)
- Fetch measurements where the analysis failed
/documents?eq(status,analysis_failed)
App Development Best Practice
By default, a registered user with no additional permissions will be able to only fetch his own measurements through the API. However, if at some point the user receives additional permissions, for example when the user is a doctor or nurse, that might change.
Therefore it's strongly advised to always filter on
creatorId
using the following RQL query:/documents?eq(creatorId,{userId})
It is also possible to remove measurements that you are entitled to. To do this, you need to be a staff member of at least one group of the recorded measurement.
delete
https://api.fibricheck.com
/data/v1/fibricheck-measurements/documents/{measurementId}
Delete a measurement
The Camera SDK is the workhorse for generating the measurement data. After a PPG measurement has been completed, the Camera SDK will emit an
onMeasurementProcessed
event with a CameraData
object that contains all data to process the the measurement.The complete structure is exported as a
Measurement
type in the SDK. The CameraData
object is explained here for informational purposes, the Camera SDK will populate all the fields. Flutter
React Native
Cordova
class CameraData {
acc?: MotionData;
rotation?: MotionData;
grav?: MotionData;
gyro?: MotionData;
heartrate: num;
measurement_timestamp: num;
quadrants: Yuv[][];
technical_details: {
camera_exposure_time: num;
camera_hardware_level: String;
camera_iso: num;
};
time: num[];
yList: num[];
abnormalities?: Abnormalities[];
attempts?: num;
skippedPulseDetection: bool;
skippedFingerDetection: bool;
skippedMovementDetection: bool;
}
This structure can be used for creating
MeasurementCreationData,
which can be posted to our backend via the postMeasurement
methodFuture _onMeasurementProcessed(String measurementString) async {
var json = jsonDecode(measurementString);
var mCreationData = MeasurementCreationData.fromJson(json);
await sdk.postMeasurement(mCreationData, "v0.0.1");
}
This snippet shows the interface that is implemented when performing a measurement via the
react-native-camera-sdk
. This way, you don't have to worry about populating these fields.interface CameraData {
acc?: MotionData;
rotation?: MotionData;
grav?: MotionData;
gyro?: MotionData;
heartrate: number;
measurement_timestamp: number;
quadrants: Yuv[][];
technical_details: {
camera_exposure_time: number;
camera_hardware_level: string;
camera_iso: number;
};
time: number[];
yList: number[];
abnormalities?: Abnormalities[];
attempts?: number;
skippedPulseDetection: boolean;
skippedFingerDetection: boolean;
skippedMovementDetection: boolean;
}
This structure can be used for creating
MeasurementCreationData,
which can be posted to our backend via the sdk.postMeasurement()
The
onMeasurementProcessed
event contains a data
object with the results of the measurement. It has the following structure:{
"acc": {
"x": [],
"y": [],
"z": []
},
"attempts": 1,
"grav": {
"x": [],
"y": [],
"z": []
},
"gyro": {
"x": [],
"y": [],
"z": []
},
"heartrate": 64,
"measurement_timestamp": 1696239824855,
"quadrants": [
[
{
"u": [],
"v": [],
"y": []
},
{
"u": [],
"v": [],
"y": []
},
{
"u": [],
"v": [],
"y": []
},
{
"u": [],
"v": [],
"y": []
}
],
[
{
"u": [],
"v": [],
"y": []
},
{
"u": [],
"v": [],
"y": []
},
{
"u": [],
"v": [],
"y": []
},
{
"u": [],
"v": [],
"y": []
}
]
],
"rotation": {
"x": [],
"y": [],
"z": []
},
"skippedFingerDetection": false,
"skippedMovementDetection": false,
"skippedPulseDetection": false,
"technical_details": {
"camera_hardware_level": "camera2 - limited",
"camera_resolution": "176x144"
},
"time": []
}
All the fields mentioned in this object are automatically filled in by the Camera SDK. This object must be augmented with data as mentioned in the section "Post a new measurement"
Last modified 21d ago