Skip to content

EnhancedCPET/system-interface

Repository files navigation

system-file-handler

This repository provides a framework to extract and process cardiopulmonary exercise tests from various systems.

Table of Contents

Features

  • Flexible System Interface: Easily extensible to support more systems in the future.
  • COSMED Data Extraction: Extracts demographic and time series data from COSMED system files.

Getting Started

Prerequisites

Installation

To extract data from a supported system:

npm i system-interface

Usage

import { SystemInterface } from 'system-interface';

const dataFromFile = SystemInterface.extractFileData('filepath', 'system');
const dataFromBuffer = SystemInterface.extractFileData(buffer, 'system');

// output
{
  demographics: {
    id: '1',
    fname: 'Apurva',
    lname: 'Shah',
    ...
  },
  timeSeries: {
    t: [...],
    power: [...],
    vo2: [...],
    vco2: [...],
    ve: [...],
    hr: [...],
  }
}

Valid systems as of right now consist of: 'cosmed'.

Contribution Guidelines

Interested in contributing? Here's how to get started.

Installation

Requirements

Steps

  1. Clone the Repository:

    git clone https://github.com/your-username/system-file-handler.git
  2. Navigate to the Project Directory:

    cd system-file-handler
  3. Install Dependencies:

    npm install
  4. Compile TypeScript Code: If you make changes to the TypeScript files, you will need to compile them to JavaScript:

    tsc
  5. Usage: You can now use the package locally. To use it in other projects, you can link it:

    npm link

Commit Formatting

All commits into the main branch must follow the conventional commit formatting.

Pull Request Process

  1. Please ensure that you're squashing your commits before submitting a PR. We follow the "Squash and merge" policy.
  2. Make sure to create changes on a separate branch before opening a pull request.
  3. All pull requests must be approved before merging.
  4. Ensure all checks are passing before requesting a review or merging your PR.

Coding Standards

  1. Before committing your changes, make sure to run npm run prettier to format your code.
  2. Also, ensure no linting errors by running npm run lint.

License

Distributed under the MIT License. See LICENSE for more information.