📊Reports
After a user completes a measurement or when the prescription period ends, the user and physician receive (periodic) reports with results and insights into the measurement(s).
Request a measurement report and render the PDF
SDK
The getMeasurementReportUrl
method accepts a measurementId
and handles the creation and fetching of the report.
The first time you execute this function for a measurement, it will take a little longer. The cloud service will render the report synchronously. Once it's ready (~5s) a URL will be returned. The report is available at this URL.
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 user's language. This is the language that was specified during the user's registration process. Currently, the supported languages are:
de
,en
,es
,fr
,it
,nl
,ar
andzh
. When other languages are provided, the report will fall back to the default languageen
.
This functionality works great in combination with url_launcher.
REST API
Rendering a PDF report using the REST API takes 3 simple steps. The first step is only needed when no report has been created yet.
Step 1 • Generate a report
Generate a new report
POST
https://api.fibricheck.com/data/v1/measurement-reports/documents
This API call should be executed with the following body to trigger a report creation:
measurementId
identifies the measurement for which you want to generate a report.language
defines the language in which the report will be generated. It is advised to use the user's set language.
The report is generated in the timezone of the user that performed the measurement. Once a report is generated, it's not possible to change the timezone anymore. To change the timezone of the report, you have to change the timezone of the user.
To generate a report for a measurement, make sure that the measurement status is set toanalyzed, pending-review
or reviewed
Step 2 • Fetch the report file token
Using the measurementId
from the measurement, execute the API call below. This will return the latest generated report.
Fetch report details
GET
https://api.fibricheck.com/data/v1/measurement-reports/documents?limit(1)&sort(-id)&eq(data.measurementId,{measurementId})
Query Parameters
measurementId
Best Practice
We recommend to compare data.forMeasurementUpdatedTimestamp
from the report with value with the updateTimestamp
from the measurement.
If the measurement timestamp is later than the report timestamp, a new report should be generated (see step 1) because the measurement data has been updated.
If data.status
is set to rendered
, the PDF report is available for downloading.
Step 3 • Fetch the PDF report URL
Using data.readFileToken
from step 2 you can construct the URL at which the PDF is available:
This endpoint is publicly available.
Request periodic reports
Periodic reports are generated automatically on predetermined timeframes. This can be manual, 7 days, 30 days or at the end of a prescription.
Note that B2C Essential users will not receive periodic reports!
SDK
The getPeriodicReports
method returns a paginated result with all periodic reports for the authenticated user. You can find the measurements from that period in the data.measurements
property. You can also use the next
and previous
methods available on the result to navigate through the user's measurements.
In periodic reports, the trigger
field indicates for which period the report was made. This can be 7 days, 30 days or at the end of a prescription.
The getPeriodicReportPdf
method retrieves a PDF version of the report. This method takes a reportId
as a parameter. The PDF is rendered in the user's language.
If you save the PDF you could render it in the app with a package such as https://pub.dev/packages/pdf_render
REST API
Get periodic reports
GET
https://api/reports/v1?sort(-creation_timestamp)&user_id={userId}
This API call returns a list of periodic reports for a given user
Query Parameters
userId
The user for which you want to fetch reports
To render a PDF version of the periodic report:
Render periodic report
GET
https://api.fibricheck.com/reports/v1/{reportId}/pdf?language={language}&time_zone={timeZone}
This API call renders a PDF version of a periodic report.
Path Parameters
reportId*
String
The report for which a PDF version needs to be generated
Query Parameters
language
String
The language in which te report should be generated
timeZone
String
The timezone in which te report should be generated
Last updated