The complete structure is exported as a type: `Measurement` in the SDK. For completeness, we will explain some parts more in detail here.
Creating a measurement
CameraData
This snippet shows the interface that is implemented when performing a measurement via the flutter-camera-sdk. This way, you don't have to worry about populating these fields.
These symptoms can be directly added to a measurement or can be updated at a later stage by using sdk.updateMeasurementContext. This can be beneficial to the user experience. If you send the raw measurement data first, the processing of the measurement can already take place on the backend. When the user has selected their symptoms, it can then be added to the already processed measurement.
Displaying a measurement
Indicator
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'
Status
A measurement can have multiple statuses, depending in which phase of the review process it is currently in:
Diagnosis
A measurement can have multiple diagnoses, to get the most severe diagnosis, you can use the getMostSevereLabel function. Possible values of this diagnose are:
The algorithm also returns the calculated heartrate under heartrate property
Measurement timestamp
The date and time of the measurement is given in epoch format under the measurement_timestamp property.
Perform a measurement with the Camera SDK component
You can use the FibriCheckView exported from the package:camera_sdk/fibri_check_view.dart package to perform a measurement and hook up sdk.postMeasurement to post the data returned from the camera to the backend in the onMeasurementProcessed event.
Before taking a measurement, you need to check if you are entitled to perform a measurement. This can be achieved by invoking sdk.canPerformMeasurement. If you try to execute a measurement when you are not entitled, a NoActivePrescriptionError will be thrown. So make sure you've Activated a Prescription.
It is highly recommended to provide the camera sdk version as a second argument, as shown in the example.
In some rare cases, it can occur that the motion sensors don't provide the correct data. In such cases, the movement detection will kick in, although the user is not moving. A way to fix this, is to disable the motion sensors by setting the movementDetectionEnabled to false on for example a onLongPress
Fetch a measurement
Use the sdk.getMeasurement function to get a single measurement based on an ID. Only measurements for the currently authenticated user can be requested.
Using sdk.getMeasurements 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.
import'package:flutter_fibricheck_sdk/flutter_fibricheck_sdk.dart';_sdk.getMeasurements(true); // true -> get newest measurements firstawait res.getNextMeasurements(); // get next 20 measurementsawait res.getPreviousMeasurements(); // get previous 20 measurements
The measurement is received. The value of viewResult is being determined. The status should change to preprocessing_selection immediately.
preprocessing_selection
The value of algoPreprocessing is being determined. The status should change to analysis_selection immediately.
analysis_selection
The value of algoAnalysis is being determined. The status should change to pending_analysis immediately.
pending_analysis
The measurement is waiting for the algorithm to analyze it. The Algo Queue Manager will transition the measurement to under_analysis if the algorithm is ready to analyze
under_analysis
The measurement is being analyzed by the measurement. The Algo Queue Manager will transition the measurement 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 by the process-measurement-result-task. The task will transition the measurement to the analyzed status.
analyzed
The measurement was successfully analyzed. Depending on the value of autoPendingReview, set by the task in the previous step, the measurement will immediately transition to pending_review or stay in this status until manually transitioned to pending_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
The measurement is reviewed by a human medical expert. The measurement will stay in this status until manually transitioned to pending_review.