9. API

The Explorer API is made up of two distinct parts:

  1. An external API that is used by other applications to present data in e.g. a dashboard or an alternative user interface.

  2. An internal API that is used by the built-in user interface.

Note that all paths should be prepended by /api/v1 when calling them.

9.1. External API

GET /platform/data/{presetref}

Get data for the specified preset reference

Parameters:
  • presetref (string) – A preset reference

Status Codes:
Response JSON Object:
  • table.count (integer) – Number of rows in the table

  • table.header[].description (string) – Column description

  • table.header[].id (string) – Column identifier

  • table.header[].name (string) – Column name

  • table.poprows[][] (object) – Value of a cell in a population row

  • table.preset (any) – Preset used for the table

  • table.rows[][] (object) – Value of a cell in a row

  • table_meta.last_update (string) – Timestamp of last update to the table

GET /platform/filter/{filter_id}

Get filter values for the specified filter

Parameters:
  • filter_id (string) – A filter identifier

Status Codes:
Response JSON Object:
  • values[] (object) – Value of a filter

GET /platform/presets

Get list of presets and presetcategories

Status Codes:
Response JSON Object:
  • categories[].description (string) – Description of the category

  • categories[].id (integer) – Identifier of the category

  • categories[].level (integer) – Distance between the category and the top

  • categories[].locked (boolean) – Is the category locked (true) or unlocked (false)

  • categories[].name (string) – Name of the category

  • categories[].parent (string) – Identifier of the parent category

  • categories[].predefined (boolean) – Is the category predefined (true) or userdefined (false)

  • items[].category (string) – Category of the report

  • items[].description (string) – Description of the report

  • items[].id (integer) – Identifier of the report

  • items[].name (string) – Name of the report

  • items[].predefined (boolean) – Is the report predefined (true) or userdefined (false)

  • items[].public (boolean) – Is the report public (true) or private (false)

GET /platform/reports

Get list of reports and reportcategories

Status Codes:
Response JSON Object:
  • categories[].description (string) – Description of the category

  • categories[].id (integer) – Identifier of the category

  • categories[].level (integer) – Distance between the category and the top

  • categories[].locked (boolean) – Is the category locked (true) or unlocked (false)

  • categories[].name (string) – Name of the category

  • categories[].parent (string) – Identifier of the parent category

  • categories[].predefined (boolean) – Is the category predefined (true) or userdefined (false)

  • items[].category (string) – Category of the report

  • items[].description (string) – Description of the report

  • items[].id (integer) – Identifier of the report

  • items[].name (string) – Name of the report

  • items[].predefined (boolean) – Is the report predefined (true) or userdefined (false)

  • items[].public (boolean) – Is the report public (true) or private (false)

GET /platform/user

Get user account data

Status Codes:
Response JSON Object:
  • account_view (integer) – Account view identifier

  • display_name (string) – Name of the user as it should be displayed

  • group_id (integer) – Identifier of the group the user belongs to

  • organization_ids[] (string) – List of organization identifiers

  • organization_name (string) – Name of the organization the user belongs to

  • scoping_organization_name (string) – Name of the organization when comparing with others

  • user_id (string) – Unique identifier of the user

  • user_name (string) – Name of the user

9.2. Internal API

GET /configadmin/aggregates
Status Codes:
GET /configadmin/columns
Status Codes:
POST /configadmin/filters
Status Codes:
GET /configadmin/filters
Status Codes:
DELETE /configadmin/filters/{filter_id}
Parameters:
  • filter_id (string) –

Status Codes:
PUT /configadmin/filters/{filter_id}
Parameters:
  • filter_id (string) –

Status Codes:
POST /configadmin/importtable
Status Codes:
POST /configadmin/options
Status Codes:
POST /configadmin/projections
Status Codes:
GET /configadmin/projections
Status Codes:
DELETE /configadmin/projections/{projection_id}
Parameters:
  • projection_id (string) –

Status Codes:
PUT /configadmin/projections/{projection_id}
Parameters:
  • projection_id (string) –

Status Codes:
GET /describe/sql
Status Codes:
GET /describe/table
Status Codes:
GET /describe/view
Status Codes:
GET /download/po/{locale}
Parameters:
  • locale (string) –

Status Codes:
GET /download/pot
Status Codes:
GET /export/csv
Status Codes:
GET /export/json
Status Codes:
GET /export/jsonids
Status Codes:
GET /export/tab
Status Codes:
GET /info
Status Codes:
POST /presets

/api/v1/presets

Create new preset.

Parameters:
  • name – Preset name

  • description – Preset description

  • category – Preset category

  • visibility – Preset visibility

Return:

Created preset

Status Codes:
GET /presets

/api/v1/presets

Get list of presets.

Return:

List of presets. Dictionary containing “presets”, “categories” and “roots”.

Status Codes:
GET /presets/breadcrumbs

/api/v1/presets/breadcrumbs

Get breadcrumbs for active preset. Returns a list containing a breadcrumb list (each breadcrumb having a number and a name), the name of the preset, and a flag signaling if the preset has been modified by the user.

Return:

Breadcrumbs for active preset. Example: [[[3, “Public presets”], [10, “CGM”]], “Overview”, false]

Status Codes:
POST /presets/category

/api/v1/presets/category

Create new preset category.

Parameters:
  • name – Preset category name

  • parent – Identifier of the parent category

Return:

Created preset category. Example: {“id”: 25, “name”: “New category”, “description”: null, “schema_id”: 1, “user_id”: 2, “group_id”: null, “parent”: 1, “public”: false, “readonly”: false, “predefined”: false}

Status Codes:
DELETE /presets/category/{category_id}

/api/v1/presets/category/{category_id}

Delete preset category with specified identifier.

Parameters:
  • preset_id – Identifier of the preset category.

  • category_id (integer) –

Return:

{}

Status Codes:
PUT /presets/category/{category_id}

/api/v1/presets/category/{category_id}

Update preset category with specified identifier.

Parameters:
  • preset_id – Identifier of the preset category.

  • name – Preset category name

  • parent – Identifier of the parent category

  • category_id (integer) –

Return:

Created preset category. Example: {“id”: 25, “name”: “Renamed category”, “description”: null, “schema_id”: 1, “user_id”: 2, “group_id”: null, “parent”: 1, “public”: false, “readonly”: false, “predefined”: false}

Status Codes:

/api/v1/presets/search

Search for presets based on specified keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of presets. Example: [{“id”: 4, “name”: “All patients”, “path”: “Public presets, Patientlists”, “description”: “All patients”, “public”: true}]

Status Codes:
DELETE /presets/{preset_id}

/api/v1/presets/{preset_id}

Delete preset with specified identifier.

Parameters:
  • preset_id (integer) – Identifier of the preset.

  • preset_id

Return:

{}

Status Codes:
PUT /presets/{preset_id}

/api/v1/presets/{preset_id}

Update preset with specified identifier.

Parameters:
  • preset_id (integer) – Identifier of the preset.

  • name – Preset name

  • description – Preset description

  • category – Preset category

  • visibility – Preset visibility

  • preset_id

Return:

Updated preset

Status Codes:
GET /report/parameter/{param_id}

Return list of parameter values

Parameters:
  • param_id (string) –

Status Codes:
POST /report/template/{template_id}
Parameters:
  • template_id (string) –

Status Codes:
GET /table/filter/{filter_id}

/api/v1/table/filter/{filter_id}

Get filter identified by filter_id.

Parameters:
  • filter_id (string) – Identifier of the filter.

  • filter_id

Return:

Filter identified by filter_id. Example: [{“id”: 1, “text”: “Determined”}, {“id”: 2, “text”: “< 3”}, {“id”: 3, “text”: “3-5”}, {“id”: 4, “text”: “5-10”}, {“id”: 5, “text”: “>= 10”}]

Status Codes:
GET /table/state

/api/v1/table/state

Get the active table.

Return:

Active table. Example: {“poprows”: [], “count”: 3, “page”: 1, “pages”: 1, “rows”: [[1, “257333”, “12-08-1901”], [2, “443871”, “20-05-1972”], [3, “210487”, “18-05-1962”]], “action_ids”: [null, null, null], “filters”: “acq_score 1”, “preset”: {“id”: 1, “name”: “All patients”, “description”: “Overview of all patients”, “ref”: “PATIENT_OVERVIEW”, “group_id”: null, “user_id”: null, “public”: true, “predefined”: true, “category”: 7, “visibility”: “Public presets”, “custom”: true, “type”: “flat”, “breadcrumb”: [[3, “Public presets”], [7, “Patientlists”]], “path”: “Public presets, Patientlists”}, “header”: [{“id”: “_rownumber”, “name”: “No.”, “description”: “Row number”, “sort”: null, “align”: “right”, “decimals”: 0, “kind”: “rownumber”}, {“id”: “patient_id”, “name”: “Patientnumber”, “description”: “Patientnumber”, “sort”: null, “align”: “right”, “decimals”: “”, “kind”: “value”}, {“id”: “patient_birthdate”, “name”: “Birthdate”, “description”: “Birthdate”, “sort”: null, “align”: “right”, “decimals”: “”, “kind”: “value”}], “pagenumbers”: [1], “showing”: “Showing 1 to 3 of 3 rows”, “action_function”: null}

Status Codes:
DELETE /table/state/column

/api/v1/table/state/column

Delete the active columns.

Return:

[]

Status Codes:
GET /table/state/column

/api/v1/table/state/column

Get list of all columns. Optionally, the list is sorted by how well its items match given keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of columns. Example: [{“id”: “patient_id”, “text”: “Patientnumber”, “selected”: true}, {“id”: “patient_name”, “text”: “Patientname”, “selected”: true}]

Status Codes:
PUT /table/state/column/order

/api/v1/table/state/column/order

Set a new column ordering.

Parameters:
  • values – List of column names. Example: [“result_smoking”, “result_acq”]

Return:

True

Status Codes:
PUT /table/state/column/sort/{column_id}

/api/v1/table/state/column/sort/{column_id}

Toggle the sort ordering for a column (switch between no sorting, ascending and descending).

Parameters:
  • column_id (string) – Identifier of the column.

  • column_id

Return:

True

Status Codes:
PUT /table/state/column/toggle/{column_id}

/api/v1/table/state/column/toggle/{column_id}

Toggle column (switch between active and inactive).

Parameters:
  • column_id (string) – Identifier of the column.

  • column_id

Return:

True

Status Codes:
GET /table/state/filter

/api/v1/table/state/filter

Get list of active (i.e. selected) filters.

Return:

List of filters. Example: [{“id”: “acq_score”, “text”: “ACQ Score”, “description”: “ACQ Score”, “selected”: [{“id”: 4, “text”: “1”}], “userexpr”: true}]

Status Codes:
PUT /table/state/filter/{filter_id}

/api/v1/table/state/filter/{filter_id}

Set a number of valid values for a particular filter.

Parameters:
  • filter_id (string) – Identifier of the filter.

  • values – List of filter values. Example: [“5”, “7”]

  • filter_id

Return:

True

Status Codes:
PUT /table/state/filterexpr/{filter_id}/{expression}

/api/v1/table/state/filterexpr/{filter_id}/{expression}

Add a user expression.

Parameters:
  • filter_id (string) – Identifier of the filter.

  • expression (string) – User expression. Example for value greater than 3: %3C%203

  • filter_id

  • expression

Return:

Index of user expression in filter if user expression is valid, else None

Status Codes:
GET /table/state/filters/inactive

/api/v1/table/state/filters/inactive

Get list of all inactive filters.

Return:

List of filters. Example: [{“id”: “result_acq”, “text”: “ACQ Score”, “selected”: false}, {“id”: “result_acq_timestamp”, “text”: “ACQ Score, last measurement”, “selected”: false}]

Status Codes:
PUT /table/state/group/aggregate/{column_id}/{index}

/api/v1/table/state/group/aggregate/{column_id}/{index}

Set group aggregate.

Parameters:
  • column_id (string) – Identifier of the column.

  • index (integer) – Index of the aggregate.

  • column_id

  • index

Return:

True

Status Codes:
DELETE /table/state/group/data

/api/v1/table/state/group/data

Delete the active group data fields.

Return:

[]

Status Codes:
GET /table/state/group/data

/api/v1/table/state/group/data

Get list of group data fields.

Optionally, the list is filtered by the given keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of group data fields. Example: [{“id”: “result_acq”, “text”: “ACQ Score”, “aggregates”: [“count”, “avg”, “sum”, “max”, “min”, “var_pop”, “var_samp”, “variance”, “stddev_pop”, “stddev_samp”, “stddev”], “selected”: false, “aggregate”: null}]

Status Codes:
DELETE /table/state/group/field

/api/v1/table/state/group/field

Delete the active group fields.

Return:

[]

Status Codes:
GET /table/state/group/field

/api/v1/table/state/group/field

Get list of group fields. Optionally, the list is filtered by the given keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of group fields. Example: [{“id”: “result_acq”, “text”: “ACQ Score”, “selected”: false}, {“id”: “result_acq_timestamp”, “text”: “ACQ Score, last measurement”, “selected”: false}]

Status Codes:
PUT /table/state/group/toggle/data/{column_id}

/api/v1/table/state/group/toggle/data/{column_id}

Toggle a data field (switch between active and inactive).

Parameters:
  • column_id (string) – Identifier of the column.

  • column_id

Return:

True

Status Codes:
PUT /table/state/group/toggle/field/{column_id}

/api/v1/table/state/group/toggle/field/{column_id}

Toggle a group field (switch between active and inactive).

Parameters:
  • column_id (string) – Identifier of the column.

  • column_id

Return:

True

Status Codes:
GET /table/state/groupfraction

/api/v1/table/state/groupfraction

Get list of active (i.e. selected) group fractions.

Return:

List of all active group fractions. Example: [{“id”: “acq_score”, “text”: “ACQ Score”, “description”: “ACQ Score”, “selected”: [{“id”: 4, “text”: “1”}], “userexpr”: true}]

Status Codes:
PUT /table/state/groupfraction/{filter_id}

/api/v1/table/state/groupfraction/{filter_id}

Set a number of valid values for a particular group fraction.

Parameters:
  • filter_id (string) – Identifier of the filter.

  • values – List of filter values. Example: [“5”, “7”]

  • filter_id

Return:

True

Status Codes:
GET /table/state/groupfractions/inactive

/api/v1/table/state/groupfractions/inactive

Get list of all inactive group fractions. Optionally, the list is sorted by how well its items match given keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of group fractions. Example: [{“id”: “acq_score”, “text”: “ACQ Score”, “description”: “ACQ Score”, “selected”: [{“id”: 4, “text”: “1”}], “userexpr”: true}]

Status Codes:
PUT /table/state/page/{page_id}

/api/v1/table/state/page/{page_id}

Move to specified page in table.

Return:

True

Parameters:
  • page_id (integer) –

Status Codes:
PUT /table/state/pivot/aggregate/{column_id}/{index}

/api/v1/table/state/pivot/aggregate/{column_id}/{index}

Set pivot aggregate.

Parameters:
  • column_id (string) – Identifier of the column.

  • index (integer) – Index of the aggregate.

  • column_id

  • index

Return:

True

Status Codes:
DELETE /table/state/pivot/column

/api/v1/table/state/pivot/column

Delete the active pivot columns.

Return:

[]

Status Codes:
GET /table/state/pivot/column

/api/v1/table/state/pivot/column

Get all pivot columns. Optionally, the list is sorted by how well its items match given keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of pivot columns. Example: [{“id”: “result_acq”, “text”: “ACQ Score”, “selected”: true}, {“id”: “result_acq_timestamp”, “text”: “ACQ Score, last measurement”, “selected”: false}]

Status Codes:
DELETE /table/state/pivot/data

/api/v1/table/state/pivot/data

Delete the active pivot data.

Return:

[]

Status Codes:
GET /table/state/pivot/data

/api/v1/table/state/pivot/data

Get list of pivot data. Optionally, the list is filtered by the given keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of pivot data. Example: [{“id”: “number_examinations”, “text”: “Number of examinations”, “aggregates”: [“count”, “avg”], “selected”: false, “aggregate”: null}]

Status Codes:
DELETE /table/state/pivot/row

/api/v1/table/state/pivot/row

Delete all pivot rows.

Return:

[]

Status Codes:
GET /table/state/pivot/row

/api/v1/table/state/pivot/row

Get list of pivot rows. Optionally, the list is filtered by the given keyword(s).

Parameters:
  • q – Keyword(s) to search for (separated by spaces).

Return:

List of pivot rows. Example: [{“id”: “result_acq”, “text”: “ACQ Score”, “selected”: false}, {“id”: “result_acq_timestamp”, “text”: “ACQ Score, last measurement”, “selected”: false}]

Status Codes:
PUT /table/state/pivot/toggle/column/{column_id}

/api/v1/table/state/pivot/toggle/column/{column_id}

Toggle pivot column (between active and inactive).

Parameters:
  • column_id (string) – Identifier of the column.

  • column_id

Return:

True

Status Codes:
PUT /table/state/pivot/toggle/data/{column_id}

/api/v1/table/state/pivot/toggle/data/{column_id}

Toggle pivot data (between active and inactive).

Parameters:
  • column_id (string) – Identifier of the column.

  • column_id

Return:

True

Status Codes:
PUT /table/state/pivot/toggle/row/{column_id}

/api/v1/table/state/pivot/toggle/row/{column_id}

Toggle pivot row (between active and inactive).

Parameters:
  • column_id (string) – Identifier of the column.

  • column_id

Return:

True

Status Codes:
POST /table/state/reset/{table_type}

/api/v1/table/state/reset/{table_type}

Switch table to specified type (flat, group, pivot) and reset contents.

Return:

None

Parameters:
  • table_type (string) –

Status Codes: