2. Introduction¶
The analytics component is a web based UI for the MGRID platform. The complete platform contains the following components:
One analytics frontend which shows dashboards, tables and reports.
Possibly one authprov backend+frontend which allows users to login to the platform.
Zero or more explorer backends which fetch historical data.
Possibly one reportserver backend which contains reports.
Zero or more tracker backends which fetch realtime data.
2.1. Analytics¶
The analytics component is the UI of the MGRID platform. It can show dashboards, tables and reports in one interface.
The dashboards, tables and reports are categorized into folders for easy access and grouping.
When a lock sign is present, the user is not allowed to edit that item.
2.1.1. Dashboards¶
Dashboards contain widgets that visualize data. There are several types of widgets to choose from, e.g. barchart, linechart, progressbar and single value.
Each widget has its own configuration:
Type. Specifies the kind of widget, e.g. barchart, geomap or wordcloud.
Title. Title and optionally subtitle of the widget.
Options. Static configuration of the widget, e.g. styling of a chart, number formatting, and for some widgets its static content.
Data. Specifies how to get dynamic content from a backend app. Supported apps are currently explorer and tracker.
Actions. Specifies what action to take when a user clicks on a certain part of the widget.
See Widgets for more information.
2.2. Authprov¶
Authprov is an authentication provider that uses OpenID Connect (OIDC). OpenID Connect is an interoperable authentication protocol based on the OAuth 2.0 framework of specifications. See How OpenID Connect Works for more info.
There are four modes of operation for Authprov:
Password based (with optional TOTP). A user can be provisioned upfront in Authprov by setting a username and password. When the user tries to access one of the components in the MGRID platform, the user is redirected to an Authprov login page to enter these credentials.
One-time token. A user can be provisioned just before entering the MGRID platform. When the user is about to visit the platform, a provisioning call is made from a customer system to Authprov to provide details about the user. Authprov returns a one-time access token which the user sends in its visit to Authprov.
JWT token. A user can be granted access by a customer system by signing a JWT token, which is provided by the user in its request to Authprov. The customer system has a private key and Authprov has the corresponding public key, so it can check if the JWT is valid.
Azure. A user can be logged in by Azure and redirected to Authprov. When the redirect contains the entry token provided by Authprov, the user is logged in.
In all cases, the components using Authprov will know who the user is and can decide what the user is allowed to do inside the component.
2.3. Explorer¶
Explorer is an application that exposes a data table with a REST API. Only the backend is provided by Explorer. The frontend for viewing the tables is the Analytics component.
2.3.1. Data table¶
The data table can be a very wide and long table that is constructed by an ETL process. Data is extracted periodically, e.g. once a week or every night, from a customer database and placed in the data table. The ETL is custom-made for each customer, as the data is different from one organisation to another. Special care is taken to ensure the database server can quickly get to the data it needs from this table, e.g. by partitioning the data into small sets.
An example of a data table is one where each row is a patient at a particular moment in time. A row would contain for example a reference date, patient identifier, name, address, birthdate, length and weight. The ETL makes sure that a row for patient A with a reference date of e.g. 2024-10-01 contains all info about that patient on the first of October 2024. When something changes for that patient in October, the row for patient A with reference date 2024-11-01 will contain those changes.
The data table is the source and starting point for Explorer. Typically, the whole table is never shown to a user as it may be far too large to handle or view. Explorer allows the user to select smaller parts of the data table by limiting both the number of columns and the number of rows.
2.3.2. Projections¶
Limiting the number of columns is done by creating projections and using only a few of those in the resulting table. A projection contains the name of the resulting column and the expression to get that from the source table. In most cases, the expression is just the name of the source column. For e.g. the birthdate projection, the value from the birthday source column is selected as-is. But for e.g. the age projection, a reference date and a calculation is needed.
A projection also defines what aggregates can be applied to it, e.g. count, min, max, and average. Settings regarding alignment in the user interface and number formatting are also defined in a projection.
2.3.3. Filters¶
Limiting the number of rows is done by creating filters. A filter defines its name and one or more expressions to fetch the value(s) to filter on from the row that is being inspected. The filter for e.g. hdl additionally contains named filter values such as low and high with corresponding checks such as < 2 and > 3. The filter for e.g. doctor name does not contain named filter values, but specifies that all values present in the database should be used.
Multiple filters can be combined to limit the number of rows even further, e.g. hdl is low and doctor name is smith.
2.3.4. Presets¶
Projections and filters can be combined in presets to create ready-to-use tables. There are three types of tables that can be constructed in Explorer:
flat. A flat table can be used to simply show a list of projections.
group. A group table can be used to group rows that have the same values into summary rows.
pivot. A pivot table can be used to summarize data by transforming rows into columns.
Each preset has a name, description, and a list of filters that are applied. Presets are stored inside categories, making it easier to group and access them.
2.4. Reportserver¶
Reportserver is an application that can create reports based on preset tables. The reports can be viewed in HTML, PDF or Excel format.
Only the backend is provided by Reportserver. The frontend for viewing the reports is the Analytics component.
2.5. Tracker¶
Tracker is an application that can fetch realtime data from external sources. Where Explorer is used to fetch large quantities of historical data, tracker is geared towards more recent data.
Modules can be added to Tracker for fetching data from specific sources, such as customer APIs or public APIs, online spreadsheets, etc.