📊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)
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 thedata
property. You can also use thenext
andprevious
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
.
Request a periodic report in PDF-format
The sdk.getPeriodicReportPdf
method will retrieve a pdf-version of the periodic report.
This method takes the
reportId
as a parameter.The pdf will always be rendered in the language of the user (this language is specified during #register-a-new-user)
Saving this locally allows you to render a pdf with packages such as https://pub.dev/packages/pdf_render
Last updated