Therapy Configuration Pipeline

Overview

The Therapy Configuration pipeline will handle processing therapy dictionary into structured format for comparison.

Methods

Percept.Therapy.saveTherapySettings(deviceID, therapyList, sessionDate, type, sourceFile)

Save Indefinite Streaming Data in Database Storage

Parameters
  • deviceID – UUID4 deidentified id for each unique Percept device.

  • therapyList – Array of Therapy Configuration structures extracted from Medtronic JSON file.

  • sessionDate – DateTime object indicating when the therapy configuration is saved.

  • type – One of three data types: [“Past Therapy”,”Pre-visit Therapy”,”Post-visit Therapy”].

  • sourceFile – filename of the raw JSON file that the original data extracted from.

Returns

Boolean indicating if new data is found (to be saved).

Percept.Therapy.queryTherapyHistory(user, device, authority)

Extract all therapy change logs related to a specific device.

This pipeline go through all therapy change logs and extract the time at which a group changes is made. The pipeline will also extract the actual setting that the device is on before and after changes.

Parameters
  • user – BRAVO Platform User object.

  • device – QuerySet Device Object.

  • authority – User permission structure indicating the type of access the user has.

Returns

List of therapy group history ordered by time.

Percept.Therapy.getTherapyDetails(TherapyHistory, timestamp, groupID, typeID)

Extract detail therapy configuration of specific group at specific time.

This pipeline will go through all configurations and extract the detail therapy configurations based on the user’s request.

For example, if Group A configuration is desired for Jan 01, 2021. The pipeline will go through all configurations and find the last therapy settings before Jan 01, 2021 for Group A and return that to you.

Parameters
  • TherapyHistory – List of therapy configurations ordered by time extracted from queryTherapyConfigurations.

  • timestamp – A timestamp at which therapy configurations is wanted.

  • groupID – Medtronic Group ID (Group_A to Group_D).

  • typeID (string) – The type of therapy that you want (Past Therapy, Pre-visit Therapy, and Post-visit Therapy).

Returns

A tuple of Therapy Details dictionary and unix timestamp at which the setting is programmed.

Percept.Therapy.extractTherapyDetails(therapy)

General pipeline to extract therapy details for visualization.

The pipeline will go through all timestamp first to identify all unique programming dates. The unique dates were used to identify all TherapyChangeLog between visits to calculate percent time for each group in between visit.

Then a processed organized dictionary of therapy settings called “Overview” will be generated for each therapy group.

Parameters
  • TherapyConfigurations – List of therapy configurations ordered by time extracted from queryTherapyConfigurations.

  • TherapyChangeLog – List of therapy change logs ordered by time extracted from queryTherapyHistory.

Returns

A list of processed Therapy Data organized by time and by group.