Giter Club home page Giter Club logo

cardinalkit's Introduction

Important

The CardinalKit iOS template application is in maintenance mode. All new projects should use Stanford Spezi, our modular and standards-based framework successor to CardinalKit. Check out the Spezi Template Application as a great way to get started.

CardinalKit Logo CardinalKit Logo

All Contributors


cardinalkit map

Includes:

  • Informed consent process using ResearchKit.
  • Track day-to-day adherence with CareKit.
  • Monitor health data with HealthKit.
  • Collect and upload EHR data.
  • CoreMotion data demo.
  • Awesome SwiftUI templates.
  • Zero-code customizable configuration file.
  • GCP Firebase Integration.

CardinalKit runs on iOS 15.0 and up. Xcode 14 is required for development.

Build your App with CardinalKit

This repository contains a fully functional example in the CardinalKit-Example directory that you can use as a starting point for building your own app. To get started, clone this repository and follow our simple setup instructions.

Feel free to join our Slack community or attend one of our workshops or buildathons for help customizing your app! Learn more at https://cardinalkit.org.

Contribute to CardinalKit

Head on over to https://cardinalkit.org/ to get onboarded to our open source community ⚡️

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Santiago Gutierrez

💻

Varun Shenoy

💻

mhittle

🤔 🚧 📆

aamirrasheed

🖋 📹

Zhiyu Zhu/朱智语

💻

Vishnu Ravi

💻

Ashley Griffin

🤔 💻

Paul Schmiedmayer

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

License

CardinalKit is available under the MIT license. See the LICENSE file for more info.

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

cardinalkit's People

Contributors

allcontributors[bot] avatar apollozhu avatar estebanramosfractal avatar frankcash avatar geoffrosen avatar griffinac avatar lucas-zx-w avatar pschmiedmayer avatar ssgutierrez42 avatar suvan-kumar avatar varunshenoy avatar vishnuravi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cardinalkit's Issues

[feature-request] Send HealthKit data to firebase in background

Is your feature request related to a problem? Please describe.
For many uses, it is helpful to access a user's HealthKit data at regular intervals (daily?) and send that data to our database for later analysis.

Describe the solution you'd like
It would be helpful to have an implementation of this in the example app. For instance, there could be an option in the configuration to enable this feature. Then there could be an example that sends daily step counts to firebase (from one day before). Would have to consider what to do if a user changed a previous day's step count later on.

Additional context
It looks like there may be some supporting files for such a feature in the source, but I do not see an implementation in the example app

[feature-request] enable active sensor collection with CardinalKit

Describe the solution you'd like

Expose CardinalKit built-in APIs for active sensor collection.

We are currently collecting HealthKit data in our sample app.

Use CardinalKit to also collect data from:
Pedometer, Raw Accel, Raw Gyro, Device Motion, etc.

To accomplish this, see the MotionController.swift file in the bundled CardinalKit Library.
This, along with the CKNetworkManager.swift provide an interface by which data can be collected and streamed.

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

Successful login intermittently doesn't advance to main view

Describe the bug
Login screen intermittently doesn't advance to main view after successful login.

To Reproduce
Steps to reproduce the behavior:

  1. Upon launching CardinalKit, select "I'm a Returning User" and log in with your username and password.

Expected behavior
Successful login should transition automatically to the main view.

Smartphone (please complete the following information):

  • OS: [e.g. iOS8.1]: iOS 15.0

Support for arm64 simulator

Describe the bug
Project fails to build for arm64 simulators due to missing support from dependencies.

To Reproduce
Attempt to build project for an arm64 simulator on an M1 mac.

Expected behavior
Project should build and launch on an arm64 simulator.

Additional context
Related PR #59

Unwanted pods folder in Example project

Describe the bug
Unwanted pods folder in Example project that leads to more space in the project

To Reproduce
Steps to reproduce the behavior:

  1. Go to CardinalKit-Example
  2. Click on Pods to see all pods that can be installed on local using pod install

Expected behavior
Pod folder must be added to .gitignore to avoid

[feature-request] Convert "Studies" tab Interface to SwiftUI

Describe the solution you'd like

Update the primary navigation list of the CardinalKit sample to leverage the flexible features of SwiftUI.

Use tutorial https://developer.apple.com/tutorials/swiftui/building-lists-and-navigation#Get-to-Know-the-Sample-Data as reference.

Create a sample Resource file such the landmarkData.json file seen above. Use hard-coded data for now.

A next step will be to grab this resource and populate it from server data (Firestore).

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

Add Support for the Swift Package Manager

Is your feature request related to a problem? Please describe.

Hi everyone! Thanks for maintaining and improving CardinalKit! 🚀
I have the following feature suggestion: CardinalKit currently supports CocoaPods to manage dependencies. The Swift Package Manager is an alternative tool for managing Swift dependencies bundled with the Swift compiler and directly supported in Xcode. Adding a dependency using the Swift Package Manager is supported by an easy UI workflow in the Xcode IDE.

Describe the solution you'd like

It would be great if CardinalKit could also support the Swift Package Manager as an option to add the library as a dependency to other projects.
After investigating the current project structure adding a Swift Package manifest seems to be no problem. The dependencies currently used might cause more challenges:

  • ⚠️ SAMKeychain version 1.x: Is no longer maintained, does not support the Swift Package Manager, and is archived by its owner. Would need a replacement.
  • RealmSwift version 10.x: Maintained and supports the Swift Package Manager
  • ObjectMapper version 3.x: Maintained and supports the Swift Package Manager from version 4.x on.
  • SwiftyJSON version 10x: Maintained and supports the Swift Package Manager
  • ReachabilitySwift version 3.X: Maintained and supports the Swift Package Manager in version 5.x.
  • Zip version 1.x: Maintained and supports the Swift Package Manager in version 2.x
  • ⚠️ Granola with no specified version constraints: No longer maintained and does not support the Swift Package Manager. Libraries like HealthKitReporter could be an alternative.

Describe alternatives you've considered

An alternative to finding new dependencies that would replace the deprecated/outdated dependencies would be rewriting the functionality in CardinalKit itself:

  • I have written a few Keychain API wrappers myself, so doing so for SAMKeychain should be doable.
  • Rewriting the functionality of Granola might be a bit more complicated. I would need to further investigate the functionality CardinalKit currently uses there. It would be possible to make the HealthKit types conform to the Swift Codable protocol.

Both JSON-related dependencies (SwiftyJSON and ObjectMapper) could also be replaced with the usage of the Swift Codable protocol.

Next Steps

Feel free to let me know what you think about the feature suggestion and if this would be something you would be interested in. I would be happy to help along the way. We would probably need to discuss the different dependency-related issues and unmaintained dependencies before we add support for the Swift Package Manager.

Password requirements not shown on registration step

Describe the bug
The password requirements are not shown on the registration step.

To Reproduce
Steps to reproduce the behavior:
Sign up with a new account on CardinalKit

Expected behavior
A clear and concise description of what you expected to happen:
Users should be able to see all the password requirements when choosing a password.

[feature-request] Push Notifications!

Is your feature request related to a problem? Please describe.
There should be a way to send a local notifications to users to remind them of surveys every day/week/specific time interval. This can be described in the CKConfiguration.plist file on the developers end.

Describe the solution you'd like
Use local notifications (see: https://developer.apple.com/documentation/usernotifications/scheduling_a_notification_locally_from_your_app) to alert patients of when to take surveys!

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

HealthKit types in Plist

Types entered into HealthKit Types to Read in CKConfiguration.plist does not work. CK still requests permission for all HK types.

[bug] PageView issue on iOS 13

Currently, the page view in the onboarding screen freezes on a single panel if you enter the ResearchKit onboarding slides and return back to the initial page. The data fetched to layout the panels does not persist for some reason.

Fortunately, the fix is in a new SwiftUI API for iOS 14 that we can push out when the new software comes out of beta: https://goshdarnswiftui.com/#uipageviewcontroller

If anyone finds a solution for this issue, please submit a pull request — I've been trying to fix this for a while to no avail.

in application error message: Unable to Login Please try again in 5 minutes.

Describe the bug
System information:
MacOS Catalina, v10.15.4
Git 2.24.1
XCode 11.6
Swift 5.2

Goal: Installation and run of CardinalKit-Example, with back-end data store connectivity

Details of error:
In-application error:
Unable to Login Please try again in 5 minutes.
XCode console error:
Domain not whitelisted by project
2020-09-04 17:16:29.906003-0400 CardinalKit Example[42808:383324] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2020-09-04 17:16:29.959844-0400 CardinalKit Example[42808:383324] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service

To Reproduce
Steps to reproduce the behavior:

  1. Follow these instructions:
    https://cardinalkit.org/docs/getting_started
    https://cardinalkit.org/docs/setup_cloud

Expected behavior
A running instance of CardinalKit-Example in the iPhone simulator of XCode, which uploads completed survey records to a Firebase Cloud FireStore NoSQL database

Smartphone (please complete the following information):

  • Device: iPhone SE Second Generation (simulator)

Additional context
Preparation for this hackathon:
https://biodesign.stanford.edu/news---events/virtual-buildathon.html

HealthKit background delivery entitlement is missing

iOS 15 requires a new HealthKit background delivery entitlement.

2021-12-28 23:48:26.816569-0500 CardinalKit Example[63076:2217316] [VError(::category:)] (
(
"Missing com.apple.developer.healthkit.background-delivery entitlement."
),
"setUpBackgroundDeliveryForDataTypes(types:frequency:_:)"
)

[feature-request] Create a production ready CardinalKit web portal.

Describe the solution you'd like
Must make use of #4 (including rule-sets).

Create a ReactJS-powered production ready CardinalKit web portal.

Here are some key features we're looking for:

  • It should be easy to set up (i.e. the only parts a potential team should worry about are replacing Firebase credentials and hosting the portal).
  • Two-factor authentication for access to data in portal (required for HIPAA compliance).
  • It should provide easy access to survey data.
  • Show the user customizable ways to visualize the survey data.
  • All survey consent forms can be aggregated into Firebase Storage from the app so clinicians can view them from the portal.
  • (nice to have) CRUD operations on the database through the portal (no need to ever touch the Firebase database through their website anymore!)
  • (nice to have) Customize user interface colors to match project.
  • (nice to have) Easy to understand documentation for customizing/setting up the portal.

See https://github.com/cs342/CardinalKit-CS342-Web
as an example!

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

'Map' is ambiguous for type lookup in this context

HealthKitData.swift uses ObjectMapper's Map class, but also imports RealmSwift which now contains its own Map class. This leads to an ambiguous type lookup compiler error. We will need to declare this explicitly.

User document not updating after completing onboarding

Describe the bug
Reported by developers that the user document isn't being updated with the user's email and last active timestamp after completing onboarding. It only updates upon the next launch of the app.

To Reproduce
Steps to reproduce the behavior:

  1. Install a fresh copy of the CardinalKit app.
  2. Register with a new user account.
  3. Check the user document in Firestore.

Expected behavior
The user document should be updated with the user's email and the last active timestamp at the end of onboarding.

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] iPhone 13
  • OS: [e.g. iOS8.1] iOS 15.6

[feature-request] mobile facing testing harness

If you're building and testing an app for a study, you don't want to wait for scheduled events in order to test. You want to be able to effectively simulate an entire study in 10 minutes, and ensure that the experience follows the study protocol.

There are many ways to do this, and ultimately this is a set of features under a larger project. One solution would include the following:

  1. secret testing menu accessible by esoteric long press or tapping pattern. We accomplished this in SC by long pressing the top right hand corner of one view.

  2. testing menu allows user to

  3. a. choose a study day to simulate.

  4. b. run a hyperspeed study that emulates 20X time warp with study.

  5. c. explore current settings data and schemas

  6. d. generate random / dummy data for current moment in study time

  7. e. access debugging / log data

  8. f. access specific unit tests from the mobile app

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

Cannot override initializer parameter of type 'ORKResult?' with non-optional type 'ORKResult'

I have tried many times to compile the application I get many errors which I have to fix along the way like adding VALID_ARCHS and so on. No module found for Cardinal kit and the research kit.

But I am really stuck on this error now I have fixed the rest but one error that comes up now is

ERROR MESSAGE: //Steps/LoginCustomWaitStepViewController.swift:37:34: Cannot override initializer parameter of type 'ORKResult?' with non-optional type 'ORKResult'Initializer does not override a designated initializer from its superclass Must call a designated initializer of the superclass 'ORKStepViewController'

CODE:
cl
Screenshot 2021-08-16 at 09 43 19
Screenshot 2021-08-16 at 09 44 34
ass LoginCustomWaitStepViewController: ORKStepViewController {

var onLoginCallback: NSObjectProtocol?

override init(step: ORKStep?) {
    super.init(step: step)
}

override init(step: ORKStep, result: ORKResult) {
    super.init(step: step, result: result)
}

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
    super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}

required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
}

override func viewDidLoad() {
    super.viewDidLoad()
    
    //loadCustomBackButton()

any help will be appreciated thank you

[feature-request] Implement a scheduling system for ResearchKit tasks (+CareKit)

Is your feature request related to a problem? Please describe.
Implement a system by which RK tasks can be scheduled and shown to patients at specific days or times.

Describe the solution you'd like
Use CareKit to define a care plan, and schedule a series of tasks to occur over a set amount of time.
https://developer.apple.com/carekit/

Bonus: leverage Firestore to enable the download of the latest schedule via your CardinalKit app.

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

[feature-request] 🎨 interface to edit the configuration plist within CK

Is your feature request related to a problem? Please describe.
The CardinalKit project has an editable file named CKConfiguration.plist that serves as a central point for key customization of your apps.

How can we create an interface by which editing this file is made even easier, or more flexible?

Describe the solution you'd like
(1) Create a system by which a .plist file can be downloaded by a CardinalKit app (potentially via GCP Firestore).
Develop a feature by which the CK app can download the latest .plist, and re-draw itself accordingly.

(2) Create a website by which the .plist can be created on the fly, with an editor that includes a color picker and other features. This file is then downloaded from the app.
Ideas: you can leverage something like ReactJS and https://react-hook-form.com/form-builder/

(3) super bonus: create a set of pre-defined .plist templates for CardinalKit apps that are selectable and swappable via website (Stanford Medicine theme, Stanford Athletics theme, Star Wars theme, or others).

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

[feature-request] email signed consent to patient after sign-up

Is your feature request related to a problem? Please describe.
CardinalKit projects make use of ResearchKit to prompt patients for medical consent:
https://user-images.githubusercontent.com/5482213/92849813-964a7380-f3a0-11ea-8436-c1388236a956.png

This feature request is to enable the delivery of the signed consent document via email directly to the patient. 📩

Describe the solution you'd like
The signed consent is already stored as a PDF on device right after the user fills it out (you can pull it up in the Profile tab).

You may also want to leverage Google Cloud Functions
https://cloud.google.com/functions/

^ &, if you do, some kind of email delivery solution
https://nodemailer.com/about/

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

Signature entry field does not appear

Describe the bug
During onboarding, the signature entry occassionally does not appear, and the first and last name fields scroll vertically out of view when the keyboard appears.

Expected behavior
Signature entry should appear and fields should not scroll out of view when the keyboard appears.

[feature-request] Apple Watch HRV w/ bounty to solve

Is your feature request related to a problem? Please describe.

The core problem is compliance with an action – in this case, taking an HRV measurement. It's very difficult to get consistent HRV data when the user has to make a conscious choice to take a measurement, either with the Breathe app or any other app.

In addition, the Apple Watch samples HRV on irregular intervals, which does not allow us to assess the autonomic nervous system's status accurately. HRV is best measured during sleep when there are minimal inputs to stress the various biological systems.

Describe the solution you'd like

We want to be able to trigger HRV measurements during sleep. In an ideal world, we could trigger several 1 to 5-minute HRV samples at the same time every night—for example, 1 hour after sleep onset, 2 hours after sleep onset, etc.

Describe alternatives you've considered
We have created a script that filters HRV measurements in the user's sleep window, but the measurements are random. Some nights we get ten measurements, and other nights we get one measurement. We need to be able to sample HRV in a consistent manner – duration of sample and sample timing.

Optional, but highly recommended
Leave us a Loom so the community can better understand what you want to bring to CardinalKit in a more visual and personal way.

Additional context
I am willing to pay $1000 for a solution to this problem.
https://www.loom.com/share/4b13f63597644d4b93163c472bd93de3

Translate CardinalKit to Spanish [Useful for developers in Spain & Latam]

Translate CardinalKit in multiples languages.
Starting a test by Spanish.

1.- Save time and money to developers. Improve time to implementation.
2.- Translate recognized medical surveys for use with CardinalKit.
3.- Extend Translates to Partner Projects.

CardinalKit

Useful for hispanic or latino population in US [For Example: Florida State]
Useful for hispanic or latino population Spain & LatAm.

More Studies: Track- Surveys - FollowUp

https://www.miscaminatas.com/index.html

Goals

1.- WHO Global action plan on physical activity 2018–2030 "More active people for a healthier world"
2.- Non-communicable disease (NCD) https://www.cdc.gov/globalhealth/healthprotection/ncd/about.html

[feature-request] Create a CardinalKit-owned production ready GCP instance.

Describe the solution you'd like

Create procedure to allow other CardinalKit teams to use our GCP instance as a fallback.

In addition to that, create and define a Firestore ruleset in conjunction to SOM RIT that enforces the patterned use of the authCollection in the CardinalKit sample projects.

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

Layout error on Change Passcode screen

Describe the bug
There is a layout issue on Change Passcode screen.

Screenshots

Smartphone (please complete the following information):

  • Device: iPhone 11

Users should not be able to proceed in onboarding if they disagree to consent

Describe the bug
Selecting "Disagree" on the consent review step still allows onboarding to continue.

To Reproduce
Launch app and go through the onboarding process, then choose "Disagree" on the consent document review step.

Expected behavior
Onboarding should be terminated if the user disagrees to consent.

Users are presented login screen despite being logged in

Describe the bug
Users have reported that they are occasionally returned to the login screen when launching the app although they already have a logged-in session. This also sometimes occurs at the end of onboarding, where they are returned to the login screen instead of moving forward to the home screen.

Expected behavior
Users that have a currently logged-in session should not be presented the login screen.

Smartphone (please complete the following information):

  • Device: iPhone 13
  • OS: iOS 15.5

Additional context
This problem is likely occurring because LaunchUIView is not properly observing the current user object for updates when Firebase refreshes it.

[feature-request] Integration with Bluetooth-powered wearables

Describe the solution you'd like

Expose a formal CardinalKit bluetooth connection and data delivery API.

To accomplish this, see the ChestStrapManager.swift file in the CardinalKit Library which connects to a Bluetooth chest strap and streams heart-rate information.

Collect information from wearables and store on Google Firestore.

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

Github build action succeeded despite bad path in Xcode project file

The build log shows the following:

2022-07-05T21:36:36.6024210Z error: Build input file cannot be found: '/Users/vishnu/code/CardinalKit/CardinalKit-Example/CardinalKit/Library/ResearchKit/CKUploadToGCPTaskViewControllerDelegate.swift' (in target 'CardinalKit_Example' from project 'CardinalKit') …

But then a few lines later it states:

** BUILD SUCCEEDED **

It is unclear why the build succeeded with a bad path.

[feature-request] Populate "Studies" tab from server (Firestore) data.

Describe the solution you'd like

Fetch the solution from Issue #2 and populate the project's activity rows from Firestore.

Update our CardinalKit documentation to instruct on how-to create entries on Firestore that each app can read.

Provide a data source that CardinalKit teams can automatically import to Firebase.

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

[feature-request] Data Visualization for Patients

Is your feature request related to a problem? Please describe.
Add a new section to the Studies view to include a third tab for data visualization. For bonus points: add hooks to the CKConfiguration.plist file to customize the data visualization.

Describe the solution you'd like
For every important quantitative survey, show some chart (bar, line, etc.) to go with it. It should read from Firebase and there should be an easy way to export the graphs as a PDF.

Additional context
This could also be a great place to provide advice and personalized "cards" to help patients understand what their data means.

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

[feature-request] Deploy to TestFlight

Is your feature request related to a problem? Please describe.
The CardinalKit example app is constantly updated with new contributions and features.
What is a quick way to build the latest version and get it running on test devices?

Describe the solution you'd like
With every update to master, create and deploy a TestFlight app.

Leverage any CI/CD integration. Please communicate with the CK team to define which Apple Developer account can be used.

NOTE: interest on features is gaged using reactions on this first post: e.g. 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.