📊Reports

After a user complets a measurement or the prescription period ends, the user and physician receive measurement reports or periodic reports with results and insights into the measurement(s).

Request a measurement report and render the PDF

The sdk.getMeasurementReportUrl accepts a measurementId and will handle creation / fetching of the report. This function works great in combination with https://pub.dev/packages/url_launcher

  • First time calling this function for a measurement, it will take a little longer as the cloud service will render the report. Once it's ready (~5s) the url where you can fetch it will be returned

  • Subsequent calls will be much faster, as the report is already rendered and the url will be returned almost instantly.

  • The pdf will always be rendered in the language of the user (this language is specified during #register-a-new-user)

import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_fibricheck_sdk/flutter_fibricheck_sdk.dart';

_reportUrl = await _sdk.getMeasurementReportUrl(widget.measurement.id!);

Future<void> _launchUrl() async {
    final url = Platform.isAndroid ? "https://docs.google.com/viewer?url=$reportUrl" : reportUrl;
    if (await canLaunchUrl(Uri.parse(url))) {
      if (!await launchUrl(Uri.parse(url))) {
        throw 'Could not launch $reportUrl';
      }
    }
  }

Request all periodic reports

The sdk.getPeriodicReports method will retrieve all your periodic reports.

  • Using sdk.getPeriodicReports will return a paginated result with all periodicReports 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 measurents.

  • In the periodic reports, the trigger field indicates for which period the report was made (7 days, 30 days or at the end of a prescription)

⚠️ To use this functionality, @babel/plugin-proposal-async-generator-functions is required. This plugin is included in @babel/preset-env.

import 'package:flutter_fibricheck_sdk/flutter_fibricheck_sdk.dart';

_sdk.getPeriodicReports(true); // true -> get newest reports first
await res.getNextPagedPeriodicReportsResult(); // get next 20 reports
await res.getPreviousPagedPeriodicReportsResult(); // get previous 20 reports

Request a periodic report in PDF-format

The sdk.getPeriodicReportPdf method will retrieve a pdf-version of the periodic report.

import 'package:flutter_fibricheck_sdk/flutter_fibricheck_sdk.dart';

await a_sdk.getPeriodicReportPdf(reportId);

Last updated