generated from StanfordSpezi/SpeziTemplateApplication
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inconsistency in string values in the visualisation module (#71)
# *Fix inconsistency in string values in the visualisation module* ## ⚙️ Release Notes - Updated the `visualization` module to include enumeration for diagnosis-related string in order to ensure consistency and easier maintainability. ### Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md). --------- Co-authored-by: Paul Schmiedmayer <[email protected]>
- Loading branch information
1 parent
eae1fce
commit c146ce7
Showing
15 changed files
with
3,901 additions
and
5,087 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,6 @@ __pycache__/ | |
|
||
# Fastlane | ||
.screenshots/ | ||
|
||
# Stanford Google Cloud Setup | ||
ecg_data_manager/packages* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ SPDX-License-Identifier: MIT | |
|
||
|
||
This repository contains the Pediatric Apple Watch Study Application application. | ||
The Pediatric Apple Watch Study Application is using the [Spezi](https://github.com/StanfordSpezi/Spezi) ecosystem and builds on top of the [Stanford Spezi Template Application](https://github.com/StanfordSpezi/SpeziTemplateApplication). | ||
The Pediatric Apple Watch Study Application uses the [Spezi](https://github.com/StanfordSpezi/Spezi) ecosystem and builds on top of the [Stanford Spezi Template Application](https://github.com/StanfordSpezi/SpeziTemplateApplication). | ||
|
||
|
||
## Application Structure | ||
|
@@ -33,6 +33,7 @@ The application uses the FHIR standard to provide a shared standard to encode da | |
|
||
You can build and run the application using [Xcode](https://developer.apple.com/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. | ||
|
@@ -47,9 +48,11 @@ python -m scripts.upload_codes --outfile=<local_path> \ | |
--service_account=<service_account_key_file> [--dry] | ||
``` | ||
|
||
|
||
## Generate Screenshots | ||
|
||
PAWS uses [Fastlane Snapshots](https://docs.fastlane.tools/getting-started/ios/screenshots/) 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 you shell session. | ||
To generate new screenshots, you will likewise need to set the proper environment variables for your shell session. | ||
|
||
```bash | ||
export FIRESTORE_EMULATOR_HOST="localhost:8080" | ||
|
@@ -73,7 +76,7 @@ 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 [spezi_data_pipeline](https://test.pypi.org/project/spezi-data-pipeline/0.1.0b1/) 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 spezi_data_pipeline, the two notebooks, namely `ECGReviewer.ipynb` and `ECGExplore.ipynb` offer an environment for interactive data visualization and analysis. | ||
The ECG Data Manager provides capabilities for reviewing and exploring the recorded ECG data. It relies on the [spezi_data_pipeline](https://pypi.org/project/spezi-data-pipeline/0.1.0) 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 spezi_data_pipeline, 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. | ||
|
@@ -94,15 +97,15 @@ cd PediatricAppleWatchStudy/ecg_data_manager | |
|
||
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 | ||
#### 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](ecg_data_manager/Figures/ecg_data_interactive_reviewer.png) | ||
|
||
### Use the Interactive ECG Exploring Tool | ||
#### Use the Interactive ECG Exploring Tool | ||
|
||
To start exploring ECG data, execute the cells in your notebook. | ||
|
||
|
@@ -111,6 +114,54 @@ This interactive tool allows you to plot ECG data, filter ECG recordings, and se | |
![ecg_data_interactive_explorer.png](ecg_data_manager/Figures/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 [email protected] | ||
|
||
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](https://cloud.google.com/colab/docs/service-controls) 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 proejct 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](https://github.com/StanfordSpezi/SpeziTemplateApplication). | ||
|
||
|
||
## Contributing | ||
|
||
Contributions to this project are welcome. Please make sure to read the [contribution guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md) and the [contributor covenant code of conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md) first. | ||
|
Oops, something went wrong.