Create a Spezi-based study application that allows researchers to easily conduct basic data collection studies, including questionnaires and the collection of data from connected devices.
Background
While Spezi offers a great way to build custom and application-specific digital health systems, some first preliminary studies and simple setups only require the collection of a few key information, such as questionnaires and mobile health data.
We want to build an application & web service that offers a simple one-way stop to onboard smaller studies using a preexisting infrastructure, account system, and user install base. Studies should be dynamically loaded and configurable at runtime to ensure extensibility without major application updates.
Apple and other commercial entities provide similar study applications. We want to differentiate and democratize access to these resources within Stanford and beyond by building the system as a complete open-source solution and eventually enabling cross-platform user studies using an Android-based application.
Project Requirements
| Questionnaires |
Research studies can define FHIR-based questionnaires, e.g., using the Phoenix FHIR questionnaire builder and define when these questionnaires should be displayed using the Spezi Scheduler Module. |
| Mobile Health Data |
Research studies can define mobile health data types, queries, and constraints that should be collected as part of the research study. Patients have study-specific permission settings to limit access to the HealthKit data. This information must be, e.g., HealthKit independent to allow expansion to an Android App in the future. |
| User Account System |
The system introduces an user account management system that is shared across research studies. Research studies can obtain permission to get access to specific user information. |
| Separated Study Database Storage |
Data from individual studies should be logically separated and guarded with appropriate access rules to ensure that data is separated between participating actors. |
| Web-based Configuration |
Research studies should be configurable using a web-based interface, and study information should be pulled from a web service. The information about a study should be packable in a single configuration bundle and dynamically downloaded in the application. This should include basic customization, e.g., color schemes. |
| Dynamic Study Loading |
Upon approval of the Spezi team, study bundles should be publishable to the application and updated using a version control system. |
Current Project State
- We have started with an initial implementation of a web frontend to configure the study platform: ‣. It is a great way to explore the vision and current web-based functionality of the platform; it utilizes the Spezi web design system: ‣. The work for the Study platform builds on the foundations developed as part of the Spezi Web Dashboard project.
- We are developing SpeziStudy, a Spezi module allowing one to consume a study definition bundle and integrate the functionality defined in the bundle with existing Spezi modules: ‣. Eventually, we aim to integrate this setup into the ‣ and further expand the Stanford Spezi ecosystem as described in Stanford Spezi.
- In the future, we aim to develop a Swift-based web service to communicate with the study web frontend to manage users and study definitions, a FHIR-based data storage server to store the data from users collected in studies. An early TypeScript-based prototype from an earlier iteration of prototyping can be found here: ‣. We aim to build on the foundations of the Spezi Web Service project.
- KeyCloak-based authentication and authorization mechanism, a K8s-based deployment infrastructure enabling self-hosting of the platform. An earlier prototype of this setup can be found in feature branches in the following repository: https://github.com/StanfordSpezi/spezi-study-platform-infrastructure.
Important Skills
This project is a multi-person project and will be developed by a team of students and members of the Stanford Mussallem Center for Biodesign digital health group. We are looking for talented and motivated students who would like to expand their open-source development portfolio and want to be embedded in a wide variety of research studies.
- The mobile application is written in Swift and SwiftUI. The web service will utilize the SpeziStudy Swift package and Vapor in the backend. A prerequisite to work on these parts of the project will be sufficient Swift knowledge to start contributing to a moderate to large open-source project. You should be familiar with the existing Stanford Spezi ecosystem of modules and functionalities.
- The web frontend is written in TypeScript using a React stack. API definitions are generated as OpenAPI definitions, which will define the API surface of the study management setup of the system. Familiarity with these components and best practices is beneficial. We encourage you to check out our web design system, building the foundation of the web frontend: https://github.com/StanfordSpezi/spezi-web-design-system.
- The deployment infrastructure will utilize K8s to orchestrate the different components and will utilize KeyCloak to handle authorization and authentication. Familiarity with these technologies and components is beneficial for working on these components.
- Most data encoded in Spezi or shared between subsystems uses HL7 FHIR. You will learn or use FHIR throughout the project, so a basic understanding is helpful. Any data storage mechanism for the user data should use FHIR to handle data flows and should be integrated in the K8s and KeyCloak deployment infrastructure.
- Our goal is to make the platform as approachable and automated as possible; we aim to develop AI-based mechanisms to facilitate the study definition creation, data analysis, and supervision of study participants.
- In the future, we also plan to extend the project to Android and Kotlin; in-depth experience in Kotlin and Jetpack Compose would be necessary to support us in the next steps to mirror a similar setup on Android.