pediatricapplewatchstudy

The Pediatric Apple Watch Study Application

https://github.com/stanfordbdhg/pediatricapplewatchstudy

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.3%) to scientific vocabulary

Keywords

apple cs342 digitalhealth fhir pediatric stanford watch
Last synced: 6 months ago · JSON representation ·

Repository

The Pediatric Apple Watch Study Application

Basic Info
  • Host: GitHub
  • Owner: StanfordBDHG
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 9.65 MB
Statistics
  • Stars: 8
  • Watchers: 16
  • Forks: 0
  • Open Issues: 3
  • Releases: 7
Topics
apple cs342 digitalhealth fhir pediatric stanford watch
Created about 3 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Pediatric Apple Watch Study Application

Deployment codecov DOI

This repository contains the Pediatric Apple Watch Study Application application. The Pediatric Apple Watch Study Application uses the Spezi ecosystem and builds on top of the Stanford Spezi Template Application.

Application Structure

The Spezi Template Application uses a modularized structure using the Spezi modules enabled by the Swift Package Manager.

The application uses the FHIR standard to provide a shared standard to encode data exchanged between different modules.

[!NOTE]
Do you want to learn more about the Stanford Spezi Template Application and how to use, extend, and modify this application? Check out the Stanford Spezi Template Application documentation

Build and Run the Application

You can build and run the application using Xcode by opening up the PAWS.xcodeproj.

Generate Invitation Codes

When signing in to the application for the first time, you will be required to enter a valid invitation code before a user account is created. Use the upload_codes.py script to generate new codes and upload them to a specified Firebase instance or a local file.

```bash export FIRESTOREEMULATORHOST="localhost:8080" export GCLOUDPROJECT=<projectid>

python -m scripts.uploadcodes --outfile=<localpath> \ --count= --length= \ --serviceaccount=<serviceaccountkeyfile> [--dry] ```

Generate Screenshots

PAWS uses Fastlane Snapshots to automatically screenshot specific screens in the app during UI tests. To generate new screenshots, you will likewise need to set the proper environment variables for your shell session.

bash firebase emulators:start --import=./firebase

Then, run fastlane snapshot. By default, results will end up in the .screenshots folder, overwriting previous files.

[!NOTE] Snapshot will run UI tests and concurrently take screenshots on multiple device simulators. As such, multiple new PAWS accounts will be created, possibly in rapid succession, using the same hard-coded testing invitation codes.

The current workaround for simultaneous account registrations during fastlane snapshot is to continually reset invitation codes to an unused state in Firestore by running a designated Python script on repeat (in a shell session with the same environment variables).

bash for i in {1..360}; do python -m scripts.upload_codes; sleep 10; done

ECG Data Manager

The ECG Data Manager provides capabilities for reviewing and exploring the recorded ECG data. It relies on the spezidatapipeline package, which is a library engineered to improve workflows associated with data accessibility and analysis in healthcare environments. In addition to the functions and classes of the spezidatapipeline, the two notebooks, namely ECGReviewer.ipynb and ECGExplore.ipynb, offer an environment for interactive data visualization and analysis.

The ECG Data Manager includes: - utils.py: Provides utility functions for data processing. - visualization.py: Contains functions for data visualization. - ECGReviewer.ipynb: An interactive notebook for loading, analyzing, and reviewing ECG data. - ECGExplorer.ipynb: An interactive notebook for loading, exploring, and filtering ECG data based on filters, such as age group, ECG recording classification, user, and date.

Notebook Setup Instructions

You can open and run the ECGReviewer.ipynb and ECGExplorer.ipynb notebooks in, e.g., Google Colab. Once the notebook is open, execute the following cell to clone the PediatricAppleWatchStudy repository and navigate into the cloned directory:

```python

Clone GitHub repository for Spezi ECG Data Pipeline

git clone https://github.com/StanfordBDHG/PediatricAppleWatchStudy.git cd PediatricAppleWatchStudy/ecgdatamanager ```

To run the notebooks, add them to Colab Enterprise within the same Google Cloud project as your Firebase setup. For other Python notebook environments, use the Firebase credentials and upload the serviceAccountKey_file.json to the workspace directory to enable Firebase access. This file is essential for authentication and should be securely handled.

Use the Interactive ECG Reviewing Tool

To start reviewing ECG data, execute the cells in your notebook.

This interactive tool allows you to plot ECG data, add diagnoses, evaluate the trace quality, and add notes.

ecg_data_interactive_reviewer.png

Use the Interactive ECG Exploring Tool

To start exploring ECG data, execute the cells in your notebook.

This interactive tool allows you to plot ECG data, filter ECG recordings, and select specific users and timestamps.

ecg_data_interactive_explorer.png

Firebase & Google Cloud Setup

The Google Cloud Setup at Stanford to deploy the project requires the following setup for Google Cloud Firebase and to execute the ECG review and exploration tools.

Firebase Setup

Each Firebase Project for development, staging, and production GitHub environments need the following configurations: - Firestore Database - Firebase Authentication with Identity Platform (Anonymous Authentication, Username + Password, and Sign In With Apple Enabled) - Firebase Storage - Cloud Functions (also enable Cloud Build API, Google Cloud Run, and Eventarc API)

The CI setup requires a github-deployment@PROJECT_ID.iam.gserviceaccount.com account that requires the following rules: - Cloud Datastore Index Admin - Cloud Functions Developer - Firebase Admin - Firebase Rules Admin - Service Account User on PROJECT_ID@appspot.gserviceaccount.com

Set up a cloudfunctionsserviceaccount@PROJECT_ID.iam.gserviceaccount.com to execute cloud functions. It needs the following rules: - Cloud Datastore User

Notebooks & Colab Enterprise

Created a storage bucket that is used to store the packaged dependencies & code for the Python notebooks in a versioned and isolated state. You need to enable Colab Enterprise.

To secure the data in the notebook, the network access should be retricted to needed Google Services only and using runners that only use a private network.

Run the following commands in the ECGReviewer folder to package the dependencies and upload them, as well as the modules folder to the cloud storage bucket if no outside internet access is enabled. sh mkdir packages pip download -r requirements.txt -d packages tar -czvf packages.tar.gz packages/

Copy the ECGExporter and ECGReviewer notebooks in Colab Enterprise, uncomment, and adapt the storage bucket paths if the restricted network access is configured.

Continous Integration Setup

The project supports different GitHub environments (development, staging, and production). - The Firebase project ID needs to be saved as a GitHub variable with the name FIREBASE_PROJECT_ID for the different deployment environments. - The service account key needs to be added to the GitHub secrets as GOOGLE_APPLICATION_CREDENTIALS_BASE64 in a base64 encoding to enable the beta deployment. - To report code coverage, a CodeCov token should be added as a CODECOV_TOKEN environment secret. - The Firebase Google plist needs to be stored as a base64 encoded secret named GOOGLE_SERVICE_INFO_PLIST_BASE64. - Store all secrets for a beta deployment of the iOS application as documented for the Stanford Spezi Template Application.

Contributing

Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.

License

This project is licensed under the MIT License. See Licenses for more information.

Our Research

For more information, check out our website at biodesigndigitalhealth.stanford.edu.

Stanford Byers Center for Biodesign Logo Stanford Byers Center for Biodesign Logo

Owner

  • Name: Stanford Biodesign Digital Health
  • Login: StanfordBDHG
  • Kind: organization
  • Location: United States of America

Citation (CITATION.cff)

#
# This source file is part of the PAWS application based on the Stanford Spezi Template Application project
#
# SPDX-FileCopyrightText: 2023 Stanford University
#
# SPDX-License-Identifier: MIT
#

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Schmiedmayer"
  given-names: "Paul"
  orcid: "https://orcid.org/0000-0002-8607-9148"
- family-names: "Ravi"
  given-names: "Vishnu"
  orcid: "https://orcid.org/0000-0003-0359-1275"
- family-names: "Aalami"
  given-names: "Oliver"
  orcid: "https://orcid.org/0000-0002-7799-2429"
title: "PAWS"

GitHub Events

Total
  • Create event: 13
  • Issues event: 1
  • Release event: 4
  • Watch event: 4
  • Delete event: 15
  • Member event: 2
  • Issue comment event: 24
  • Push event: 63
  • Pull request review comment event: 12
  • Pull request review event: 23
  • Pull request event: 22
Last Year
  • Create event: 13
  • Issues event: 1
  • Release event: 4
  • Watch event: 4
  • Delete event: 15
  • Member event: 2
  • Issue comment event: 24
  • Push event: 63
  • Pull request review comment event: 12
  • Pull request review event: 23
  • Pull request event: 22

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 81
  • Average time to close issues: 3 months
  • Average time to close pull requests: 11 days
  • Total issue authors: 7
  • Total pull request authors: 12
  • Average comments per issue: 0.73
  • Average comments per pull request: 1.32
  • Merged pull requests: 64
  • Bot issues: 0
  • Bot pull requests: 8
Past Year
  • Issues: 1
  • Pull requests: 15
  • Average time to close issues: N/A
  • Average time to close pull requests: 20 days
  • Issue authors: 1
  • Pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.67
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
  • ckunchur (3)
  • gottliebtj (1)
  • PSchmiedmayer (1)
  • philippzagar (1)
  • MatthewTurk247 (1)
  • vishnuravi (1)
Pull Request Authors
  • PSchmiedmayer (43)
  • MatthewTurk247 (19)
  • dependabot[bot] (13)
  • Vicbi (9)
  • ckunchur (8)
  • reddyrose (7)
  • riyakaru (3)
  • aydinzahedi (2)
  • ananya-vasireddy (2)
  • abhinav30219 (2)
  • dannyslowpark (2)
  • juliaarhee (1)
Top Labels
Issue Labels
enhancement (6) bug (2) good first issue (1)
Pull Request Labels
enhancement (31) dependencies (15) bug (10) javascript (10) documentation (5) ruby (2)

Dependencies

Gemfile rubygems
  • fastlane >= 0
Gemfile.lock rubygems
  • CFPropertyList 3.0.5
  • addressable 2.8.1
  • artifactory 3.0.15
  • atomos 0.1.3
  • aws-eventstream 1.2.0
  • aws-partitions 1.699.0
  • aws-sdk-core 3.169.0
  • aws-sdk-kms 1.62.0
  • aws-sdk-s3 1.118.0
  • aws-sigv4 1.5.2
  • babosa 1.0.4
  • bundler 2.3.23
  • claide 1.1.0
  • colored 1.2
  • colored2 3.1.2
  • commander 4.6.0
  • declarative 0.0.20
  • digest-crc 0.6.4
  • domain_name 0.5.20190701
  • dotenv 2.8.1
  • emoji_regex 3.2.3
  • excon 0.97.2
  • faraday 1.10.3
  • faraday-cookie_jar 0.0.7
  • faraday-em_http 1.0.0
  • faraday-em_synchrony 1.0.0
  • faraday-excon 1.1.0
  • faraday-httpclient 1.0.1
  • faraday-multipart 1.0.4
  • faraday-net_http 1.0.1
  • faraday-net_http_persistent 1.2.0
  • faraday-patron 1.0.0
  • faraday-rack 1.0.0
  • faraday-retry 1.0.3
  • faraday_middleware 1.2.0
  • fastimage 2.2.6
  • fastlane 2.211.0
  • gh_inspector 1.1.3
  • google-apis-androidpublisher_v3 0.32.0
  • google-apis-core 0.9.5
  • google-apis-iamcredentials_v1 0.16.0
  • google-apis-playcustomapp_v1 0.12.0
  • google-apis-storage_v1 0.19.0
  • google-cloud-core 1.6.0
  • google-cloud-env 1.6.0
  • google-cloud-errors 1.3.0
  • google-cloud-storage 1.44.0
  • googleauth 1.3.0
  • highline 2.0.3
  • http-cookie 1.0.5
  • httpclient 2.8.3
  • jmespath 1.6.2
  • json 2.6.3
  • jwt 2.6.0
  • memoist 0.16.2
  • mini_magick 4.12.0
  • mini_mime 1.1.2
  • multi_json 1.15.0
  • multipart-post 2.0.0
  • nanaimo 0.3.0
  • naturally 2.2.1
  • optparse 0.1.1
  • os 1.1.4
  • plist 3.6.0
  • public_suffix 5.0.1
  • rake 13.0.6
  • representable 3.2.0
  • retriable 3.1.2
  • rexml 3.2.5
  • rouge 2.0.7
  • ruby2_keywords 0.0.5
  • rubyzip 2.3.2
  • security 0.1.3
  • signet 0.17.0
  • simctl 1.6.8
  • terminal-notifier 2.0.0
  • terminal-table 1.8.0
  • trailblazer-option 0.1.2
  • tty-cursor 0.7.1
  • tty-screen 0.8.1
  • tty-spinner 0.9.3
  • uber 0.1.0
  • unf 0.1.4
  • unf_ext 0.0.8.2
  • unicode-display_width 1.8.0
  • webrick 1.7.0
  • word_wrap 1.0.0
  • xcodeproj 1.22.0
  • xcpretty 0.3.0
  • xcpretty-travis-formatter 1.0.1
.github/workflows/beta-deployment.yml actions
.github/workflows/build-and-test.yml actions
.github/workflows/monthly-markdown-link-check.yml.yml actions
PAWS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved swiftpm
  • github.com/FelixHerrmann/swift-package-list 3.1.0
  • github.com/JohnSundell/CollectionConcurrencyKit 0.2.0
  • github.com/StanfordBDHG/HealthKitOnFHIR 0.2.5
  • github.com/StanfordBDHG/XCTHealthKit 0.3.5
  • github.com/StanfordBDHG/XCTRuntimeAssertions 1.0.0
  • github.com/StanfordBDHG/XCTestExtensions 0.4.7
  • github.com/StanfordSpezi/Spezi 1.1.0
  • github.com/StanfordSpezi/SpeziAccount 1.1.0
  • github.com/StanfordSpezi/SpeziContact 1.0.0
  • github.com/StanfordSpezi/SpeziFirebase 1.0.0
  • github.com/StanfordSpezi/SpeziFoundation 1.0.0
  • github.com/StanfordSpezi/SpeziHealthKit 0.5.0
  • github.com/StanfordSpezi/SpeziMockWebService 1.0.0
  • github.com/StanfordSpezi/SpeziOnboarding 1.0.0
  • github.com/StanfordSpezi/SpeziScheduler 0.8.0
  • github.com/StanfordSpezi/SpeziStorage 1.0.0
  • github.com/StanfordSpezi/SpeziViews 1.0.0
  • github.com/apple/FHIRModels 0.5.0
  • github.com/apple/swift-argument-parser 1.2.3
  • github.com/apple/swift-collections 1.0.6
  • github.com/apple/swift-protobuf 1.25.2
  • github.com/apple/swift-syntax 509.0.2
  • github.com/drmohundro/SWXMLHash 7.0.2
  • github.com/firebase/firebase-ios-sdk 10.19.1
  • github.com/firebase/leveldb 1.22.3
  • github.com/firebase/nanopb 2.30909.0
  • github.com/google/GoogleAppMeasurement 10.17.0
  • github.com/google/GoogleDataTransport 9.3.0
  • github.com/google/GoogleUtilities 7.12.1
  • github.com/google/abseil-cpp-binary 1.2022062300.0
  • github.com/google/app-check 10.18.0
  • github.com/google/grpc-binary 1.49.1
  • github.com/google/gtm-session-fetcher 3.2.0
  • github.com/google/interop-ios-for-google-sdks 100.0.0
  • github.com/google/promises 2.3.1
  • github.com/jpsim/SourceKitten 0.34.1
  • github.com/jpsim/Yams 5.0.6
  • github.com/krzyzanowskim/CryptoSwift 1.8.1
  • github.com/realm/SwiftLint 0.54.0
  • github.com/scottrhoyt/SwiftyTextTable 0.9.0