Relative endpoint |
HTTP method |
Request Content type |
Response Content type |
Minimum permission required |
Device permission override |
Pagination |
---|---|---|---|---|---|---|
api/reporting/reporting-metrics |
GET |
json |
json |
None |
No |
No |
This endpoint calculates a range of metrics utilised within the analytic pages and external client reporting. Various parameters determine permissions and partitioning of data, along with the ability to select which pool (group) of metrics are returned within the response. The data accessing and metric logic are handled via a parameterised call of the stored procedure ss_metric_data.
Certain details are configured by the user session in which the endpoint is accessed. The associated license is used the restrict the data within that license. Similarly, the data will be restricted to what the session user has access to. The timezone, which impacts date partitioning, is inferred from the associated license settings - defaults to AEST.
Parameters |
Data Type |
Source |
---|---|---|
metric_pools |
Mandatory String List |
Accepts a list of accepted metric pool strings. Each of the included metric pools includes that group of metrics in the response. |
license_uuid |
Optional UUID |
If the user session is for a superuser, and this param is provided, it will restrict the data to this license. |
site_id |
Optional UUID |
The site to return data for. If not supplied, data for all sites is returned. |
patient_id |
Optional UUID |
The patient to return data for. If not supplied, data for all patients are returned. |
period_unit1 |
Optional String |
The basic time span being used for reporting. Defaults to “month” |
group_size1 |
Optional Integer |
The number of units making up each reporting group. Defaults to 1, so a default group will be 1 month |
number_of_groups1 |
Optional Integer |
How many reporting groups make up the reporting period. Defaults to 12, so a default period will contain 12 groups of 1 month |
now1 |
Optional String |
The Postgres timestamp with timezone, which acts as a point in time from which the metrics are calculated. Acts as the end of the all partition, and determines other date partitioning. |
mode |
Optional String |
Filters metrics for either painchek or nrs. Defaults to null, which results in metrics for all assessment mode data |
return_all_data |
Optional Boolean String |
Accepts True, true, False and false which determines whether the all partition is included in the response. Defaults as true |
return_period_data |
Optional Boolean String |
Accepts True, true, False and false which determines whether the period partition is included in the response. Defaults as true |
return_group_data |
Optional Boolean String |
Accepts True, true, False and false which determines whether the group partitions are included in the response. Defaults as true |
Note
1. See Analytics Reporting Periods Terminology and Analytics Reporting Partition Generation Algorithm for more details
The following table documents the accepted list values for the metric_pools parameter:
Metric Pool Name |
Metric Pool Detailed Documentation |
Supported partion_types |
---|---|---|
general |
all, period, groups |
|
followup |
all, period, groups |
|
descriptor |
all, period, groups |
|
residents_assessed |
all |
|
residents_followup_outstanding |
Analytics Endpoint 'residents_followup_outstanding' Metric Pool |
all |
residents_assessment_outstanding |
Analytics Endpoint 'residents_assessment_outstanding' Metric Pool |
all |
Note
See Analytics Reporting Partition Generation Algorithm for a definition of the partition_type values
A partition describes a date-based subset of data to calculate metrics on.
See Analytics Reporting Partition Generation Algorithm for:
-
details of each partition type: all, period, group
-
examples of different partitions
-
the partitions generation algorithm
The endpoint return data is JSON, with the optional keys all, period and groups which are included if their corresponding parameters return_all_data, return_period_data and return_group_data are true.
The all and period keys contain a single PartitionInfo JSON, while the groups key contains a list of PartitionInfo objects, which include information describing the specific partition and metrics.
The groups key partitions will be ordered by the group_end within each partition.
The keys of a PartitionInfo object are detailed below:
Key |
Description |
Examples |
---|---|---|
site_id |
The site id, if the partition is for a particular site |
48d7dcca-d9c8-4505-b4cb-489ae1cb18a6 |
site_name |
The site name, if the partition is for a particular site |
Example Site A |
group_name |
A name for the partition scope (that is suitable for displaying to a user) |
May - Jul 20 |
group_start |
The start date/time of the partition. In ISO 8601 format, with a timezone designator. Can be null, meaning there is no defined start. |
2020-05-01 00:00:00.000+10 |
metrics |
A JSON object with a key corresponding to each chosen metric pool. Each metric pool key contains another JSON object with keys for each individual metric in the pool. The individual metric values are those calculated for the specific partition.The documentation for metric pools and their associated metrics can be found under the Metric Pools section.Only selected/in-use metrics are returned from this endpoint in the metric pools - a whitelist per metric pool is specified within the endpoint code. |
A metrics JSON for the metric pools “general” and “followup” { “general“: { “assessments”: 50, “active_patients”: 12, … }, “followup“: { “mild_followup_fail“: 3, “moderate_followup_fail”: 2, … } } |
{ "all": { "site_id": null "site_name": null, "group_name": "All/Current", "group_start": null, "group_end": "2020-07-06 10:06:42+10", "metrics": { ... } }, "period": { "site_id": null "site_name": null, "group_name": "May - Jul 20", "group_start": "2020-05-01 00:00:00.000+10", "group_end": "2020-07-31 23:59:59.999+10", "metrics": { ... } }, "groups": [{ "site_id": null "site_name": null, "group_name": "May 20", "group_start": "2020-05-01 00:00:00.000+10", "group_end": "2020-05-31 23:59:59.999+10", "metrics": { ... } }, { "site_id": null "site_name": null, "group_name": "Jun20", "group_start": "2020-06-01 00:00:00.000+10", "group_end": "2020-06-30 23:59:59.999+10", "metrics": { ... } }, { "site_id": null "site_name": null, "group_name": "Jul20", "group_start": "2020-07-01 00:00:00.000+10", "group_end": "2020-07-31 23:59:59.999+10", "metrics": { ... } }, ] }