- Table of Contents
- Installation
- Data Generator
- Date Transformations
- DIY Loop to Tidepool Loop Transformation
- Linting and Style Guide
- Contributing
First, you need to clone the repository:
Have you tried github desktop? https://desktop.github.com/
Next, install the dependencies:
npm install
The Diabetes Data Generator CLI is a command line application that generates synthetic diabetes data, with customizable parameters. The output data is generated in JSON format that conforms to the Tidepool data model and can be readily uploaded via the Tidepool API (https://tidepool.stoplight.io/.
To use the CLI, use the following command syntax:
node generateCGM.js --cgmUse <value> --days <value> --fingersticks <boolean> --bgRange <value> --service <value>
Here's a list of available options you can use with the command:
--cgmUse, -use
: Percentage of CGM usage (0-100)--days, -d
: Number of days to generate data for--fingersticks, -f
: Whether the user also uses a bg meter (true/false)--bgRange, -range
: CGM and/or BGM range skew (high/mid/low)--service, -s
: Service used to upload data (Jellyfish or Platform)
All options are required.
Here's an example of how you can use the command:
node index.js --cgmUse 70 --days 30 --fingersticks true --bgRange mid --service exampleService
This script modifies JSON files to update timestamps (time and deviceTime) using a calculated offset. Useful for refreshing demo patient data.
node transformdates/src/index.js --file <path-to-json-file> [--file <additional-json-file>]
Process:
- Reads and validates the input JSON files.
- Gathers all time fields and calculates an offset to
- align the latest timestamp with the current date.
- Applies the calculated offset to time and deviceTime fields.
- Writes the updated data back to the original files.
Located in diadatahelper/transformdates/src/transformTimes.js
, the main functions include:
gatherDates
: Recursively collects all date fields (time, deviceTime) from a dataset.
applyOffset
: Updates the date fields with a calculated offset.
calculateOffset
: Computes the offset to align dates with the current day.
transformAllWithSingleOffset
: Main function to orchestrate the transformation across datasets.
This script processes DIY Loop JSON data to normalize it into a Tidepool Loop-compatible format, removing unsupported fields and adjusting metadata.
node transformDIY/src/index.js --username <username> --password <password> --environment <environment>
Process:
- Fetch Data:
- Retrieves JSON data from the specified account.
- Transform Data:
- Converts DIY Loop metadata into Tidepool Loop format.
- Removes provenance, overridePresets, and unsupported fields.
- Filters out custom presets and automated boluses.
- Save Transformed Data:
- Writes the output to fixtures/fixture.json.
Located in diadatahelper/transformDIY/src/transformer.js
, the main functions include:
transformData
: Routes each dataset item to its specific transformation function based on type.
Transformers (transformCBG
, transformBolus
, etc.): Adjust fields and remove unsupported data for:
- Continuous Blood Glucose (CBG)
- Self-Monitored Blood Glucose (SMBG)
- Basal rates, food, pump settings, device events, and dosing decisions.
This project adheres to the Airbnb JavaScript Style Guide. To lint the code:
npm run lint
Contributions are welcome! If you'd like to contribute:
- Fork the repository.
- Create a feature branch.
- Submit a pull request for review.