Reports
Last updated
Last updated
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).
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
and zh
. When other languages are provided, the report will fall back to the default language en
.
This functionality works great in combination with .
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.
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.
Using the measurementId
from the measurement, execute the API call below. This will return the latest generated report.
GET
https://api.fibricheck.com/data/v1/measurement-reports/documents?limit(1)&sort(-id)&eq(data.measurementId,{measurementId})
measurementId
If data.status
is set to rendered
, the PDF report is available for downloading.
Using data.readFileToken
from step 2 you can construct the URL at which the PDF is available:
This endpoint is publicly available.
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!
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.
GET
https://api/reports/v1?sort(-creation_timestamp)&user_id={userId}
This API call returns a list of periodic reports for a given user
userId
The user for which you want to fetch reports
To render a PDF version of the 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.
reportId*
String
The report for which a PDF version needs to be generated
language
String
The language in which te report should be generated
timeZone
String
The timezone in which te report should be generated
To generate a report for a measurement, make sure that the measurement is set toanalyzed, pending-review
or reviewed
If you save the PDF you could render it in the app with a package such as
The method is a that returns an . This iterator can be called with .next()
to retrieve the next 20 reports. Another way to do this is by using the for await construction, as seen in the example.
Here's an example of how to convert the response to a PDF using :