Code Monkey home page Code Monkey logo

fdai's Introduction

title description
💊 FDAi 🌎
A set of tools and framework to create autonomous agents to help regulatory agencies quantify the effects of millions of factors like foods, drugs, and supplements affect human health and happiness.

🤖 FDAi 💊

This monorepo contains a set of:

  • FAIR libraries
  • apps
  • autonomous agents to help people and organizations quantify the positive and negative effects of every food, supplement, drug, and treatment on every measurable aspect of human health and happiness.

fdai-framework-diagram.png

😕 Why are we doing this?

The current system of clinical research, diagnosis, and treatment is failing the billions of people are suffering from chronic diseases.

👉 Problems we're trying to fix...

🧪 Our Hypothesis

By harnessing global collective intelligence and oceans of real-world data, we hope to emulate Wikipedia's speed of knowledge generation.

👉 How to generate discoveries 50X faster and 1000X cheaper than current systems...

Global Scale Clinical Research + Collective Intelligence = 🤯

So in the 90's, Microsoft spent billions hiring thousands of PhDs to create Encarta, the greatest encyclopedia in history. A decade later, when Wikipedia was created, the general consensus was that it was going to be a dumpster fire of lies. Surprisingly, Wikipedia ended up generating information 50X faster than Encarta and was about 1000X cheaper without any loss in accuracy. This is the magical power of crowdsourcing and open collaboration.

Our crazy theory is that we can accomplish the same great feat in the realm of clinical research. By crowdsourcing real-world data and observations from patients, clinicians, and researchers, we hope to generate clinical discoveries 50X faster and 1000X cheaper than current systems.

The Potential of Real-World Evidence-Based Studies

  • Diagnostics - Data mining and analysis to identify causes of illness
  • Preventative medicine - Predictive analytics and data analysis of genetic, lifestyle, and social circumstances to prevent disease
  • Precision medicine - Leveraging aggregate data to drive hyper-personalized care
  • Medical research - Data-driven medical and pharmacological research to cure disease and discover new treatments and medicines
  • Reduction of adverse medication events - Harnessing of big data to spot medication errors and flag potential adverse reactions
  • Cost reduction - Identification of value that drives better patient outcomes for long-term savings
  • Population health - Monitor big data to identify disease trends and health strategies based on demographics, geography, and socioeconomic

🖥️ FDAi Framework Components

This is a very high-level overview of the architecture. The three primary primitive components of the FDAi framework are:

  1. Data Silo API Gateway Nodes that facilitate data export from data silos
  2. PersonalFDA Nodes that import, store, and analyze your data to identify how various factors affect your health
  3. Clinipedia that contains the aggregate of all available data on the effects of every food, drug, supplement, and medical intervention on human health.

The core characteristics that define the FDAi are:

  • Modularity - a set of modular libraries and tools that can be reused in any project
  • Protocols - an abstract framework of core primitive components rather than a specific implementation
  • Interoperability - a directory of existing open-source projects that can be used to fulfill the requirements of each primitive or component
  • Collective Intelligence - a collaborative effort, so please feel free to contribute or edit anything!

fdai-framework-diagram.png

1. Data Silo API Gateway Nodes

dfda-gateway-api-node-silo.png

FDAi Gateway API Nodes should make it easy for data silos, such as hospitals and digital health apps, to let people export and save their data locally in their PersonalFDA Nodes.

👉 Learn More About Gateway APIs

2. PersonalFDA Nodes

PersonalFDA Nodes are applications that can run on your phone or computer. They import, store, and analyze your data to identify how various factors affect your health. They can also be used to share anonymous analytical results with the Clinipedia FDAi Wiki in a secure and privacy-preserving manner.

PersonalFDA Nodes are composed of two components, a Digital Twin Safe and a personal AI agent applies causal inference algorithms to estimate how various factors affect your health.

2.1. Digital Twin Safes

digital-twin-safe-no-text.pngaider

A local application for self-sovereign import and storage of personal data.

👉Learn More or Contribute to Digital Twin Safe

2.2. Personal AI Agents

Personal AI agents that live in your PersonalFDA nodes and use causal inference to estimate how various factors affect your health.

data-import-and-analysis.gif

👉Learn More About Optimitron

3. Clinipedia—The Wikipedia of Clinical Research

clinipedia_globe_circle.png

The Clinipedia wiki should be a global knowledge repository containing the aggregate of all available data on the effects of every food, drug, supplement, and medical intervention on human health.

👉 Learn More or Contribute to the Clinipedia

3.1 Outcome Labels

A key component of Clinipedia is Outcome Labels that list the degree to which the product is likely to improve or worsen specific health outcomes or symptoms.

outcome-labels.png

👉 Learn More About Outcome Labels

Human-AI Collective Intelligence Platform

A collective intelligence coordination platform is needed for facilitating cooperation, communication, and collaborative actions among contributors.

👉 Learn More or Contribute to the FDAi Collaboration Framework

Roadmap

We'd love your help and input in determining an optimal roadmap for this project.

👉 Click Here for a Detailed Roadmap

Why a Monorepo?

Our goal is to develop FAIR (Findable, Accessible, Interoperable, and Reusable) data and analytical tools that can be used by any regulatory agencies, businesses, non-profits or individuals to quantify the effects of every food, drug, supplement, and treatment on every measurable aspect of human health and happiness.

The Nx Monorepo is to achieve maximum interoperability and minimum duplication of effort between the various projects to maximize the speed of development and minimize costs. This can be done by modularizing the codebase into libraries and plugins that can be shared between the various projects.

Apps in this monorepo:

  • FDAi-1 - The first version of the decentralized FDA. It is a web app that allows users to track their health data and analyze it to identify the most effective ways to maximize health and happiness.
  • Yours? - If you'd like to create the next version of the FDAi, expand its functionality, or get help with your app, feel free to add it to the apps folder and submit a pull request.

FDAi v1 Prototype

We've got a monolithic centralized implementation of the FDAi at apps/dfda-1 that we're wanting to modularize and decentralize into a set of FAIR libraries and plugins that can be shared with other apps.

Currently, the main apps are the Demo Data Collection, Import, and Analysis App and the Journal of Citizen Science.

Features

FDAi screenshots  

Reminder Inbox

Collects and aggregate data on symptoms, diet, sleep, exercise, weather, medication, and anything else from dozens of life-tracking apps and devices. Analyzes data to reveal hidden factors exacerbating or improving symptoms of chronic illness.

Web Notifications

Web and mobile push notifications with action buttons.

web notification action buttons

Browser Extensions

By using the Browser Extension, you can track your mood, symptoms, or any outcome you want to optimize in a fraction of a second using a unique popup interface.

Chrome Extension

Data Analysis

The Analytics Engine performs temporal precedence accounting, longitudinal data aggregation, erroneous data filtering, unit conversions, ingredient tagging, and variable grouping to quantify correlations between symptoms, treatments, and other factors.

It then pairs every combination of variables and identifies likely causal relationships using correlation mining algorithms in conjunction with a pharmacokinetic model. The algorithms first identify the onset delay and duration of action for each hypothetical factor. It then identifies the optimal daily values for each factor.

👉 More info about data analysis

🏷 Outcome Labels

outcome-labels-plugin.png

More info about outcome labels

Real-time Decision Support Notifications

More info about real time decision support

📈 Predictor Search Engine

Predictor Search Engine

👉 More info about the predictor search engine...

Auto-Generated Observational Studies

👉 More info about observational studies...

🤚 Tell Us About Your Project!

🤝 Join Us: Whether you're a developer, researcher, health professional, regulatory, or simply passionate about health innovation, your contribution can make a monumental difference!

👉 Tell Us About Your Project!

🤚 Help Wanted!

Code or documentation improvements are eternally appreciated!

It's our goal to avoid any duplication of effort. So please include existing projects that would be interested in fulfilling any part of this global framework.

👉 Click Here to Contribute

🛟 Support

If you have any questions or need help, please create an issue instead of emailing us so that others can benefit from the discussion.

fdai's People

Contributors

deepsource-autofix[bot] avatar dependabot[bot] avatar mikepsinn avatar stacksharebot avatar sweep-ai[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fdai's Issues

Voice2Measurements Library/API/Client for Robocall Service for Data Collection and Reminders

Technical Documentation: Creating an AI Agent for Daily Patient Interactions and Data Collection

Overview:
This document outlines the workflow and implementation details for creating an AI agent that interacts with patients daily, collects health-related data, structures it as time series measurements, and stores it in a database using the OpenAI API.

Workflow:

  1. Daily Interaction Setup:

    • The AI agent is scheduled to initiate daily interactions with patients through their preferred communication channel (e.g., SMS, email, or a dedicated app).
    • Each interaction focuses on collecting specific data on symptoms, dietary intake, supplements, and medications.
  2. Data Collection:

    • Patients are prompted to report their intake of foods, supplements, and medications, including specific amounts and units.
    • The AI agent asks follow-up questions to ensure completeness and accuracy, including checking for any items the patient may have forgotten.
  3. Data Structuring:

    • Collected data is structured as time series measurements, with each entry tagged with a timestamp, the type of data (food, supplement, medication), quantity, and unit.
    • This structure facilitates tracking changes over time and performing causal inference analysis.
  4. Data Storage:

    • Structured data is stored in a secure, HIPAA-compliant database.
    • The database design supports scalability, efficient querying, and data privacy.

Implementation Details:

  • OpenAI API Integration:

    • The AI agent leverages the OpenAI API for natural language processing capabilities, enabling it to understand and process patient responses.
    • The API is used to generate follow-up questions dynamically based on previous responses to gather comprehensive data.
  • Database Technology:

    • A relational database (e.g., PostgreSQL) is recommended for storing structured time series data.
    • The database schema includes tables for patients, daily reports, foods, supplements, and medications, with appropriate relationships and indexes for fast access.
  • Security and Privacy:

    • All data transmission and storage adhere to encryption standards (e.g., TLS for data in transit, AES for data at rest).
    • Access controls and authentication mechanisms are in place to ensure data privacy and security.
  • User Interface:

    • A user-friendly interface is developed for patients to interact with the AI agent, providing a seamless experience for daily reporting.
    • The interface supports notifications and reminders to encourage patient engagement.
  • Monitoring and Updates:

    • The system includes monitoring tools to track the AI agent's performance and patient engagement.
    • Regular updates are implemented based on feedback and the latest health research to improve the AI agent's recommendations and interactions.

Conclusion:
Creating an AI agent for daily patient interactions and data collection involves setting up a reliable interaction schedule, employing natural language processing for data collection, structuring the data for analysis, and ensuring secure data storage. This system enables personalized health recommendations and supports ongoing health management.

Example Conversation

FDAi Agent: "Good morning! Let's do our daily check-in. Can you provide today's intake of specific foods, supplements, and any medications, including doses and units?"

Patient: "Sure. For breakfast, I had eggs and white bread, and for lunch, fried chicken with french fries. I haven't taken my supplements yet, but I plan to take vitamin D and omega-3. I'm on Fluoxetine for depression."

FDAi Agent: "Thank you. How much vitamin D and omega-3 will you take, and what's the dosage of Fluoxetine?"

Patient: "I take 1000 IU of vitamin D, 1000 mg of omega-3, and 20 mg of Fluoxetine."

FDAi Agent: "Let's optimize that. Based on your conditions and intake:

  • Foods: Replace white bread and french fries with whole grain bread and sweet potatoes. Add salmon or walnuts to increase natural omega-3 intake, aiming for an anti-inflammatory diet.
  • Vitamin D: Increase to 2000 IU daily to better support skin and joint health.
  • Omega-3: Boost to 2000 mg to more effectively combat inflammation and support mental health.
  • Fluoxetine: Continue as prescribed, but let's monitor closely for any changes in symptom severity.

Forgotten items? Any other foods, medications, or supplements not mentioned?

Supplement efficacy: You've been on vitamin D and omega-3 for 3 months with minimal improvement in psoriasis severity. Considering the expense—approximately $30 monthly on these supplements—it might be wise to reallocate funds towards higher doses or different supplements, like turmeric (curcumin), which has shown benefits in inflammation and depression at 500 mg daily.

We'll also track zeros for non-taken items for accurate causal inference. It's crucial to monitor onset delays and action durations, adjusting our strategy as we gather more data."

This approach ensures daily, precise tracking of the patient's intake and symptoms, allowing for data-driven adjustments and recommendations tailored to their specific health conditions and lifestyle.

User Story:

When I visit my grandma, I try to collect data on her cognitive performance and factors that could influence them.

I also talk to her for a while. But she can only remember 5 minutes, so I repeat myself 12 times in an hour.

She'd probably like to talk to me 16 hours a day, but I'd get even less done than I already do.

So it would be cool to have a robocaller service that calls lonely old people, reminds them to take their grandma, and talks to her for about 16 hours.

Also, I'd like it if I got a phone call every day and could do my treatment/diet/symptom tracking that way. i.e.

  • What'd you eat today?
  • What'd you drink today?
  • What treatments did you take today?
  • Rate all your symptoms on a scale of 1 to 5

Then it would convert the responses to measurement objects and post to whatever endpoint is specified.

Example Measurement Array for the response, I took 5 grams of NMN:

[
	{
		"combinationOperation" : "SUM",
		"startAt" : "{ISO_DATETIME_IN_UTC}",
		"unitName" : "grams",
		"value" : "5",
		"variableCategoryName" : "Treatments",
		"variableName" : "NMN",
		"note" : "{MAYBE_THE_ORIGINAL_STATEMENT_FOR_REFERENCE}"
	}
]

Nice possible future feature:
Since people with Alzheimer's don't remember what you said before, ideally, it could eventually use verbal and maybe frequency data to quantify how nice each statement makes her feel. Then, it could gradually say more of the nice things that make her the happiest since it's usually like she heard it the first time.

Draft Implementation Roadmap

For reference and cannibalization, I implemented statement intent identification and handling in PHP and JavaScript here
https://github.com/search?q=repo%3AFDA-AI%2FFDAi%20intent&type=code

It's dumb relative to what's possible with LLM's now, though:

We may want a T3 framework API or something less monolithic and more maintainable.

Vocode also has a great framework for this. The response times in the demo are superfast.
https://docs.vocode.dev/welcome

Milestone 1 - Design service architecture

  • Research existing robocall/IVR platforms
  • Define requirements for call flow, speech recognition, natural language processing etc.
  • Design database schema for user profiles, call logs, responses etc.
  • Plan workflow for calls - scheduling, duration, frequency etc.
  • Design APIs for accessing user data, logging responses etc.
  • Developer portal API for getting API Keys

Milestone 2 - Build core platform

  • Set up robocall service account and phone numbers
  • Integrate speech recognition and natural language processing
  • Build call scheduling engine
  • Develop core IVR call flows for greeting, menu navigation etc.
  • Build database and APIs for storing and accessing user data
  • Implement basic conversational responses and logic

Milestone 3 - Develop health-tracking features

  • Design system for tracking symptoms, diet, medications etc.
  • Build natural language interfaces for entering health data
  • Integrate with external APIs for weather data, local resources etc.
  • Develop logic to provide personalized health recommendations
  • Build reporting system to share health data with caregivers

Milestone 4 - Add cognitive assessment and talk therapy

  • Research and integrate cognitive tests into calls
  • Build conversational system for open-ended therapy sessions
  • Implement sentiment analysis to gauge emotional state
  • Develop logic to provide encouraging responses, flag concerns etc.
  • Enhance reporting to include therapy notes and test results

Milestone 5 - Enhance personalization

  • Build user profiles with preferences, interests, nostalgia triggers etc.
  • Develop analytics to track most engaging conversation topics
  • Fine-tune dialog system to incorporate personalized content
  • Implement reinforcement learning to optimize positive responses
  • Expand knowledge base for specific interests - sports, hobbies, family etc.

Milestone 6 - Launch and iterate

  • Start with small pilot group to test and refine system
  • Gradually expand to broader elderly population
  • Monitor feedback, usage data to improve features and experience
  • Add new capabilities like medication reminders, family conference calls etc.
  • Build caregiver portal for managing profiles and overseeing service

Optimize consistency between the studies and discoveries section in the app

The relationship between a given variable and the actual figure is usually inconsistent.

Example below:

image

Also, the guiltiness in the example is not found in the study, which is linked to:
https://app.quantimo.do/variables/1872

More examples of the relationships below:
image

image

Link to the vitamin D mega study mentioned in the example above:
https://app.quantimo.do/variables/95802

Also, the studies show similar descriptions, such as "very slightly higher" ,"very slightly lower" for huge deviations in percentage:

image-2
image-1
image

Sweep: Create GitHub issues for all the tasks in docs/treaty/strategy.md

Details

Create GitHub issues for all the the tasks in https://github.com/FDA-AI/FDAi/blob/develop/docs/treaty/strategy.md

Checklist
  • Create scripts/jobs/create_issues_from_strategy_doc.py12d90a2 Edit
  • Running GitHub Actions for scripts/jobs/create_issues_from_strategy_doc.pyEdit
  • Modify docs/contributing/task-management/create-a-task.mdaa8cd99 Edit
  • Running GitHub Actions for docs/contributing/task-management/create-a-task.mdEdit

Create and Update Dynamic NFT

User Story

  1. As a generous person, I want to showcase my donations by having an NFT that changes colors based on the amount I've donated to a wallet.

Tasks

  • Create an API endpoint that returns colored images based on a number provided: 0=Black, >0=Yellow .

  • Create an NFT contract with updatable metadata using Revise (http://app.revise.network/).

  • Send the Revise NFT to Wallet A.

  • Create an API endpoint and a button that:

    • Fetches all the owners of the NFT.
    • Fetches all the addresses that have sent tokens to a smart contract.
    • Loops through the addresses and sums the total contributions to the smart contract.
    • Updates the metadata on each NFT from the API endpoint https://example.com/donationImage/{amountDonated}.
  • Create a job that runs and updates the NFT color:

  • When the NFT is in Wallet A, the color should be yellow.

  • When the NFT is moved to Wallet B, the color should be black.

  • When the NFT is moved back to Wallet A, the color should be yellow again.

High-Level Overview

  1. Wallet A gives money to Charity Smart Contract.
  2. Dev gives NFT to Wallet A.
  3. Job runs and sets the NFT color to yellow based on the current amount of donations to the smart contract.
  4. NFT is moved to Wallet B.
  5. Job runs and sets the NFT color to black because the NFT is no longer in Wallet A and therefore not associated with any donations.
  6. NFT is moved back to Wallet A.
  7. Job runs and sets the NFT color to yellow based on the current amount of donations to the smart contract.

The job changes the color of the NFT based on whether it is associated with any donations or not. When the NFT is in Wallet A, it is associated with donations because the owner of Wallet A has made donations to the smart contract. Therefore, the job sets the color to yellow based on the current amount of donations. When the NFT is moved to Wallet B, it is no longer associated with any donations because the owner of Wallet B has not made any donations to the smart contract. Therefore, the job sets the color to black to indicate that the NFT is not associated with any donations. When the NFT is moved back to Wallet A, it is again associated with donations because the owner of Wallet A has made donations to the smart contract. Therefore, the job sets the color back to yellow based on the current amount of donations.

https://docs.google.com/document/d/1_XrLAnj15dXUr7tgWCdJWNoaQseslrsF1GUEXz1KEGQ/edit#

Implement Cognitive Health Monitoring Features in Longevitron

Air quality has been shown to impact Alzheimer's severity and cognition.

It would be great if we could do a cognition study that inferred cognitive performance from speech and a minicog test administered by a robot with speech, speech recognition, and an artificial nose.

Tasks:

  1. Cognitive Performance Inference from Speech: Develop a feature that allows Longevitron to analyze speech patterns and infer cognitive performance. This will involve using speech recognition technology to monitor changes in speech fluency and word usage over time.

  2. Mini-Cog Test Administration: Implement a feature that allows Longevitron to administer the Mini-Cog test, a brief cognitive test involving a memory recall task and a clock-drawing task. Longevitron should be able to guide its owner through the test, record the results, and track changes over time.

  3. Air Quality Monitoring with an Artificial Nose: Integrate an artificial nose sensor into Longevitron to monitor air quality. This sensor could be based on the technology developed by Microsoft's AI Lab. The data collected by this sensor should be correlated with cognitive performance data to study the impact of air quality on cognition.

Acceptance Criteria:

  • Longevitron should be able to analyze speech patterns and infer cognitive performance.
  • Longevitron should be able to administer the Mini-Cog test and record the results.
  • Longevitron should be able to monitor air quality using an artificial nose sensor.
  • The data collected by Longevitron should be used to study the impact of air quality on cognitive performance.

Notes:

This enhancement will allow Longevitron to provide a comprehensive approach to cognitive health monitoring and research. It could lead to earlier detection of cognitive decline, better understanding of the environmental factors that impact cognitive health, and more effective interventions to improve cognitive performance and quality of life.

https://www.microsoft.com/en-us/ai/ai-lab-artificial-nose

https://www.seeedstudio.com/wio-terminal-tinyml.html

Provide feedback on my.opencures.org

Phase 1 until April 1st

General User stories for testing:

Functional stories:

  • As as user i want to aggregate / upload my data and make sense of it. It should be correct data.
  • As a User I want to export my data for my personal backup purposes
  • As a User I want to chart my data (timelines, correlations) to find insights

Create Black Box Optimization Control Systems Engineering Approach to Precision Medicine

See
https://github.com/wishonia/FDAi/edit/develop/libs/black-box-optimization/README.md

image

☝️The image above is what we're trying to achieve here.

To determine the effects of various factors on health outcomes, we currently apply pharmacokinetic modeling over various onset delay and duration of action hyper-parameters. We combine that with some other parameters for each of Hill's criteria for causality.

The distributions in this type of data aren't super normal, and you've got the onset delays and durations of action, so regular Pearson correlations don't work so well. So, we mainly focus on change from baseline. There's a ton of room for improvement by controlling using instrumental variables or convolutional recursive neural networks.

Hybrid Predictive Control Black Box Models seem most appropriate.

image

Test and Training Data

The best file is probably arthritis-factor-measurements-matrix-zeros-unixtime.csv. It's a matrix of years of self-reported
Arthritis Severity Rating measurements and hundreds of potential factors over time.

Format

The first row is the variable names. The first column is Unix timestamp (seconds since 1970-01-01 00:00:00 UTC).

Pre-Processing

To make it easier to analyze some preprocessing has been done. This includes zero-filling where appropriate. Also,
the factor measurement values are aggregated values preceding the Arthritis measurements based on the onset
delay
and duration of action.

Hyper-Parameters

The aggregation method and other hyper-parameters can be found by putting the Variable Name in either

  1. the API Explorer or
  2. in the URL https://api.fdai.earth/VARIABLE_NAME_HERE.

Resources

Implement Universal Health Intervention Trial Protocol and Related Reward System

The goal is to publish a universal health intervention protocol that can be shared on the blockchain for anyone to use and report results on health outcomes, and reward various actors using cost savings from prevented healthcare spending.

Protocol Schemas

Identify or create a standard schema for intervention protocols: We will need to define a standard schema for the intervention protocols to ensure consistency and ease of use. This schema should include fields such as the intervention name, purpose, target population, duration, and expected outcomes.

There are existing schemas for health interventions protocols that can be used as a basis for our universal protocol schema. For example, the National Library of Medicine's (NLM) Health Services Research Projects in Progress (HSRProj) uses a standardized schema to collect information on ongoing health services research projects. The schema includes fields such as the project title, research objectives, study design, study population, and expected outcomes.

In addition, the Consolidated Standards of Reporting Trials (CONSORT) statement provides a standard schema for reporting randomized controlled trials, which can also be useful in developing a schema for health intervention protocols.

We can use these existing schemas as a starting point and tailor them to our specific needs for a universal health intervention protocol schema.

Storage

Find or create a JavaScript library for storing and displaying the protocol: We will need to create or find a JavaScript library that can store and display the protocol. This library should be easy to use and integrate into any app.

Seems lovely:

Implement the protocol on the blockchain: Once we have the standard schema and JavaScript library, we can implement the protocol on the blockchain. This will make the protocol universally accessible from any app, as long as the app integrates the JavaScript library.

Data Collection

Can be done with existing platform (https://github.com/curedao/decentralized-fda/tree/develop/apps/dfda-1), OpenCures, Healome, Reputable.Health or others.

Ideally, WorldCoin or some KYC would be integrated eventually.

Incentives

Establish a rewards system: To incentivize people to create and follow the protocols, we can establish a rewards system based on the health outcomes and cost savings. For example, once the impacts on health were identified for a protocol, and it was determined to be beneficial, we could calculate the health cost savings to the government or insurance companies.

The government could then distribute the savings as follows (or some other proposed allocation):

a. Keep 25% of the savings (or reduce taxes)
b. Give 25% to the person who posted the protocol (You)
c. Give 25% to the person who followed the protocol and reduced their costs
d. Give 25% to the dFDA or whatever apps recorded the data or something

Ideally, this would be implemented in the smart contract with DBDAO or whatever.

Please comment with any suggested modifications or interest in this issue.

Create a Docusaurus2 instance for developer documentation in this repo with interactive OpenAPI documentation

We need to create a Docusaurus2 instance for our developer documentation in this repository. The documentation should include detailed instructions on how to use our APIs, SDKs, and other developer tools.

User Story

As a developer who is new to our API, I want to be able to quickly and easily find the information I need to get started. This includes detailed documentation on each endpoint, example code snippets in various programming languages, and interactive OpenAPI documentation that I can use to explore and test the API.

Requirements

The Docusaurus2 instance should be set up with the following features:

  • A clean and easy-to-navigate design that's optimized for developer documentation
  • Interactive OpenAPI documentation that's automatically generated and updated from our API specs
  • Clear and concise instructions on how to use our APIs, SDKs, and other developer tools
  • Code snippets and examples that illustrate how to use our APIs and SDKs
  • A search function that allows developers to quickly find the information they need

Existing Work

Suggested Libraries

How You Can Help

  • Please ask any questions you can think of in the comments
  • Propose a framework or suggest implementation details
  • Help us prioritize this issue by reacting with 👍or 👎
  • Create a Gitcoin campaign to fund this issue
  • Assign it to yourself and do it

Image2Measurement Library

Image2Measurement Library: Develop Server-Side Next.js API and Framework-Agnostic Client Library for UPC Barcode Scanning and Measurement

We aim to develop a server-side Next.js API that will process images into measurements, handling product labels, UPCs, nutrition facts, ingredient lists, or images of foods. We'll also create a client-side library, compatible with any JavaScript framework, that communicates with this API. Both components will be developed within our Nx monorepo, using TypeScript.

Here's where the scanning is currently done:
https://github.com/curedao/decentralized-fda/blob/75423cb44f6f2a3b43720e2b6e7ff95bced06c0f/apps/dfda-1/public/app/public/js/controllers/searchPageCtrl.js#LL63C14-L63C25

Here are the UPC usages for reference:
https://github.com/search?q=repo%3Acuredao%2Fdecentralized-fda%20upc&type=code

User Story

As a user, I want to use my device's camera to take a picture of a product (label, UPC, nutrition facts, ingredients list, or food image), and have the app convert this image into an array of measurements for me.

Steps

  1. User activates the camera button.
  2. User takes a picture.
  3. The client-side library securely uploads the image to a decentralized storage platform (e.g., NFT.storage) and a URL is generated.
  4. The server-side Next.js API fetches the image using the URL.
  5. The API attempts to scan the barcode from the image.
  6. If successful, it looks up the product via a UPC API.
  7. The API creates a measurement using the obtained variable name.
  8. If not found, the API attempts to OCR the image.
  9. The API converts the ingredients list, nutrition facts label, and product name to measurements if possible.
  10. If no useful data is found, the API tries to identify the food with an image identification AI model.
  11. The API returns an array of measurements to the client library. If no useful data can be extracted, the API returns an error message.

Measurement Objects

Measurements should be an array with at least the following properties:

  • combinationOperation – string – Way to aggregate measurements over time. SUM should be used for things like minutes of exercise. If you use MEAN for exercise, then a person might exercise more minutes in one day but add separate measurements that were smaller. So when we are doing correlational analysis, we would think that the person exercised less that day even though they exercised more. Conversely, we must use MEAN for things such as ratings which cannot be SUMMED.
  • startAt – required – The current time in UTC ISO 8601 YYYY-MM-DDThh:mm:ss date time format. Time zone should be UTC and not local.
  • value – double – required – Measurement value. Default to 1 serving for foods, x %RDA in one serving for nutrition facts, maybe 1 for yes with yes/no unit, unless we can figure out a more precise unit from the measurement
  • unitName – string – required – Unit of measurement like serving, %RDA, yes/no
  • variableCategoryName – string – Ex: Treatments, Foods, or Nutrients. See options here https://curedao.readme.io/reference/getvariablecategories
  • variableName – string – required – Name of the variable for which we are creating the measurement records
  • upc – string – UPC or other barcode scan result
  • note – string – Optional additional information

Server-side Next.js API Features

  1. Barcode scanning
  2. OCR processing
  3. Product lookup via UPC API
  4. Conversion of text to measurements
  5. Food identification using AI

Client-side Library Features

  1. Image capture and upload
  2. Interaction with the server-side API
  3. Handling API responses
  4. Compatibility with any JavaScript framework

Developer Registration Page

We will include a developer registration page on the Next.js site. This page will generate API keys for the client-side libraries to use when interacting with the server-side API.

Relevant Libraries and APIs

  1. Barcode Scanning: QuaggaJS
  2. OCR Processing: Tesseract.js
  3. UPC API: UPCitemdb
  4. Image Recognition AI: Google Vision AI

https://opendata.stackexchange.com/questions/17714/food-ingredient-api-database

https://www.logmeal.es/api

https://www.marktechpost.com/2023/07/10/meet-minigpt-4-an-open-source-ai-model-that-performs-complex-vision-language-tasks-like-gpt-4/

Demo Implementation

We'll create an Img2Measurements demo application in the apps folder within the monorepo. This application will demonstrate the usage of the client-side library and be built using a cross-platform framework like React Native.

Testing

We'll write unit tests for all functionality in the client-side library and the server-side API. Cypress UI tests should be implemented in the demo app.

Automatic Deployments

We'll set up GitHub Actions for automatic deployments. The server-side API will be deployed to Vercel and the client-side library will be published to npm.

GitHub Actions for Testing

Before merging any feature branches to the develop branch, we'll require that all tests are run via GitHub Actions and that all tests pass successfully.

Library Publishing

The client-side library should be included in the libs folder of our Nx monorepo.

Documentation

We'll include comprehensive documentation in the README.md and also publish it on a site built using Mintlify. Documentation should be accessible and follow web content accessibility guidelines (WCAG).

Additional Clarifications

  1. The library should be developed using TypeScript. This will ensure type safety and compatibility with our Nx monorepo.
  2. Data privacy and security are of utmost importance. All image uploads and data handling should be done securely, with user consent where necessary.
  3. The system should be designed with scalability in mind. It should be capable of handling a high number of requests and provide a response quickly.
  4. Error handling should be robust. The system should be able to gracefully handle errors, and communicate them effectively to the user.

We want to be able to include the barcode in any app with a script tag that has

  • a trigger function for the variable search box popup
  • a barcode button to trigger the camera scanner
  • the search or UPC matches to be passed to the provided callback function or displayed
  • the selected variable to be passed to an onVariableSelected callback function

Black Box Predictive Control Model Causal Inference Library

Data Collection and Analysis

We collect data on food and drug intake in addition to symptom severity ratings.

Adaptive Intervention and Predictive Control Models

This data is fed into a predictive control model system, a concept borrowed from behavioral medicine and control systems engineering. This system uses the data to continually refine its suggestions, helping you optimize your health and well-being.

Adaptive intervention is a strategy used in behavioral medicine to create individually tailored strategies for the prevention and treatment of chronic disorders. It involves intensive measurement and frequent decision-making over time, allowing the intervention to adapt to the individual's needs.

Predictive control models are a control system that uses data to predict future outcomes and adjust actions accordingly. In the context of Longevitron, this means using the data it collects to predict your future health outcomes and adjust its suggestions to optimize your health.

image

A control systems engineering approach for adaptive behavioral interventions: illustration with a fibromyalgia intervention - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4167895/

Real-Life Application and Benefits

Consider a hypothetical scenario where you're dealing with a chronic condition like fibromyalgia. We collect data on your symptoms, medication intake, stress levels, sleep quality, and other relevant factors. It would then feed this data into its predictive control model system, which would use it to predict your future symptoms and adjust your treatment plan accordingly.

This could involve suggesting changes to your medication dosage, recommending lifestyle changes, or even alerting your healthcare provider if it detects a potential issue. The goal is to optimize your health and well-being based on your needs and circumstances.

decision-support-notifications

☝️The image above is what we're trying to achieve here.

To determine the effects of various factors on health outcomes, we currently apply pharmacokinetic modeling over various onset delay and duration of action hyper-parameters and combine that with some other parameters for each of Hill's criteria for causality.

The distributions in this type of data aren't super normal, and you've got the onset delays and durations of action so regular Pearson correlations don't work so well. So we mainly focus on change from baseline. There's a ton of room for improvement by controlling using instrumental variables or convolutional recursive neural networks.

Hybrid Predictive Control Black Box Models seem most appropriate.

image

Test and Training Data

It's a matrix of years of self-reported Arthritis Severity Rating measurements and hundreds of potential factors over
time.

https://github.com/curedao/curedao-black-box-optimization-engine/raw/main/data/arthritis-factor-measurements-matrix-zeros-unixtime.csv

Format

The first row is the variable names. The first column is Unix timestamp (seconds since 1970-01-01 00:00:00 UTC).

Pre-Processing

To make it easier to analyze some preprocessing has been done. This includes zero-filling where appropriate. Also,
the factor measurement values are aggregated values preceding the Arthritis measurements based on the onset
delay
and duration of action.

Hyper-Parameters

The aggregation method and other hyper-parameters can be found by putting the Variable Name in either

  1. the API Explorer or
  2. in the URL https://studies.fdai.earth/VARIABLE_NAME_HERE.

Determining Treatment Effects from Sparse and Irregular Time Series Data

Introduction

Analyzing the effects of a treatment based on observational time series data is a common need in many domains like medicine, psychology, and economics. However, this analysis often faces several key challenges:

  • The data is sparse - there are limited number of observations.
  • The data is irregular - observations are not at regular time intervals.
  • There is missing data - many timepoints have no observation.
  • The onset delay of the treatment effect is unknown. It may take time to appear.
  • The duration of the treatment effect is unknown. It may persist after cessation.
  • Both acute (short-term) and cumulative (long-term) effects need to be analyzed.
  • Causality and statistical significance need to be established rigorously.
  • The optimal dosage needs to be determined to maximize benefits.

This article provides a comprehensive methodology to overcome these challenges and determine whether a treatment makes an outcome metric better, worse, or has no effect based on sparse, irregular time series data with missingness.

Data Preprocessing

Before statistical analysis can begin, the data must be preprocessed:

  • Resample the time series to a regular interval if needed while preserving original timestamps. This allows handling missing data. For example, resample to 1 measurement per day.
  • Do not do interpolation or forward fill to estimate missing values. This introduces incorrect data. Simply exclude those time periods from analysis.
  • Filter out any irrelevant variances like daily/weekly cycles. For example, detrend the data.

Proper preprocessing sets up the data for robust analysis.

Statistical Analysis Methodology

With cleaned data, a rigorous methodology can determine treatment effects:

Segment Data

First, split the data into three segments:

  • Pre-treatment - Period before treatment began
  • During treatment - Period during which treatment was actively administered
  • Post-treatment - Period after treatment ended

This enables separate analysis of the acute and cumulative effects.

Acute Effects Analysis

To analyze acute effects, compare the 'during treatment' segment vs the 'pre-treatment' segment:

  • Use interrupted time series analysis models to determine causality.
  • Apply statistical tests like t-tests to determine significance.
  • Systematically test different onset delays by shifting the 'during treatment' segment start time back incrementally. Account for unknown onset.
  • Systematically test excluding various amounts of time after treatment cessation to account for effect duration.
  • Look for acute improvements or decrements right after treatment begins based on the models.

Cumulative Effects Analysis

To analyze cumulative effects, build regression models between the outcome variable and the cumulative treatment dosage over time:

  • Use linear regression, enforcing causality constraints.
  • Apply statistical tests like F-tests for significance.
  • Systematically test excluding various amounts of time after treatment cessation to account for effect duration.
  • Look for long-term improvements or decrements over time based on the regression models.

Overall Effect Determination

Combine the acute and cumulative insights to determine the overall effect direction and statistical significance.

For example, acute worsening but long-term cumulative improvement would imply an initial side effect but long-term benefits. Lack of statistical significance would imply no effect.

Optimization

To determine the optimal dosage, incrementally adjust the daily dosage amount in the models above. Determine the dosage that minimizes the outcome variable in both the acute and cumulative sense.

Analysis Pipeline

Absolutely, given your constraints and requirements, here's a refined methodology:

  1. Data Preprocessing:

    • Handling Missingness: Exclude rows or time periods with missing data. This ensures the analysis is grounded in actual observations.
    • Standardization: For treatments with larger scales, standardize values to have a mean of 0 and a standard deviation of 1. This will make regression coefficients more interpretable, representing changes in symptom severity per standard deviation change in treatment.
  2. Lagged Regression Analysis:

    • Evaluate if treatment on previous days affects today's outcome, given the discrete nature of treatment.
    • Examine up to a certain number of lags (e.g., 30 days) to determine potential onset delay and duration.
    • Coefficients represent the change in symptom severity due to a one unit or one standard deviation change in treatment, depending on whether standardization was applied. P-values indicate significance.
  3. Reverse Causality Check:

    • Assess if symptom severity on previous days predicts treatment intake. This helps in understanding potential feedback mechanisms.
  4. Cross-Correlation Analysis:

    • Analyze the correlation between treatment and symptom severity across various lags.
    • This aids in understanding potential onset delays and durations of effect.
  5. Granger Causality Tests:

    • Test if past values of treatment provide information about future values of symptom severity and vice-versa.
    • This test can help in determining the direction of influence.
  6. Moving Window Analysis (for cumulative effects):

    • Create aggregated variables representing the sum or average treatment intake over windows (e.g., 7 days, 14 days) leading up to each observation.
    • Use these in regression models to assess if cumulative intake over time affects symptom severity.
  7. Optimal Dosage Analysis:

    • Group data by discrete dosage levels.
    • Calculate the mean symptom severity for each group.
    • The dosage associated with the lowest mean symptom severity suggests the optimal intake level.
  8. Control for Confounders (if data is available):

    • If data on potential confounding variables is available, incorporate them in the regression models. This helps in isolating the unique effect of the treatment.
  9. Model Diagnostics:

    • After regression, check residuals for normality, autocorrelation, and other potential issues to validate the model.
  10. Interpretation:

    • Consistency in findings across multiple analyses strengthens the case for a relationship.
    • While no single test confirms causality, evidence from multiple methods can offer a compelling case.

By adhering to this methodology, you will be working with actual observations, minimizing the introduction of potential errors from imputation. The combination of lagged regression, Granger causality tests, and moving window analysis will provide insights into both acute and cumulative effects, onset delays, and optimal treatment dosages.

Data Schema for Storing User Variable Relationship Analyses

Property Type Nullable Description
id int auto_increment No Unique identifier for each correlation entry.
user_id bigint unsigned No ID of the user to whom this correlation data belongs.
cause_variable_id int unsigned No ID of the variable considered as the cause in the correlation.
effect_variable_id int unsigned No ID of the variable considered as the effect in the correlation.
qm_score double Yes Quantitative metric scoring the importance of the correlation based on strength, usefulness, and causal plausibility.
forward_pearson_correlation_coefficient float(10, 4) Yes Statistical measure indicating the linear relationship strength between cause and effect.
value_predicting_high_outcome double Yes Specific cause variable value that predicts a higher than average effect.
value_predicting_low_outcome double Yes Specific cause variable value that predicts a lower than average effect.
predicts_high_effect_change int(5) Yes Percentage change in the effect when the predictor is near the value predicting high outcome.
predicts_low_effect_change int(5) No Percentage change in the effect when the predictor is near the value predicting low outcome.
average_effect double No Average value of the effect variable across all measurements.
average_effect_following_high_cause double No Average value of the effect variable following high cause variable measurements.
average_effect_following_low_cause double No Average value of the effect variable following low cause variable measurements.
average_daily_low_cause double No Daily average of cause variable values that are below average.
average_daily_high_cause double No Daily average of cause variable values that are above average.
average_forward_pearson_correlation_over_onset_delays float Yes Average of Pearson correlation coefficients calculated over different onset delays.
average_reverse_pearson_correlation_over_onset_delays float Yes Average of reverse Pearson correlation coefficients over different onset delays.
cause_changes int No Count of changes in cause variable values across the dataset.
cause_filling_value double Yes Default value used to fill gaps in cause variable data.
cause_number_of_processed_daily_measurements int No Count of daily processed measurements for the cause variable.
cause_number_of_raw_measurements int No Count of raw data measurements for the cause variable.
cause_unit_id smallint unsigned Yes ID representing the unit of measurement for the cause variable.
confidence_interval double No Statistical range indicating the reliability of the correlation effect size.
critical_t_value double No Threshold value for statistical significance in correlation analysis.
created_at timestamp No Timestamp of when the correlation record was created.
data_source_name varchar(255) Yes Name of the data source for the correlation data.
deleted_at timestamp Yes Timestamp of when the correlation record was marked as deleted.
duration_of_action int No Duration in seconds for which the cause is expected to have an effect.
effect_changes int No Count of changes in effect variable values across the dataset.
effect_filling_value double Yes Default value used to fill gaps in effect variable data.
effect_number_of_processed_daily_measurements int No Count of daily processed measurements for the effect variable.
effect_number_of_raw_measurements int No Count of raw data measurements for the effect

variable. |
| forward_spearman_correlation_coefficient| float | No | Spearman correlation assessing monotonic relationships between lagged cause and effect data. |
| number_of_days | int | No | Number of days over which the correlation data was collected. |
| number_of_pairs | int | No | Total number of cause-effect pairs used for calculating the correlation. |
| onset_delay | int | No | Estimated time in seconds between cause occurrence and effect observation. |
| onset_delay_with_strongest_pearson_correlation | int(10) | Yes | Onset delay duration yielding the strongest Pearson correlation. |
| optimal_pearson_product | double | Yes | Theoretical optimal value for the Pearson product in the correlation analysis. |
| p_value | double | Yes | Statistical significance indicator for the correlation, with values below 0.05 indicating high significance. |
| pearson_correlation_with_no_onset_delay | float | Yes | Pearson correlation coefficient calculated without considering onset delay. |
| predictive_pearson_correlation_coefficient | double | Yes | Pearson coefficient quantifying the predictive strength of the cause variable on the effect. |
| reverse_pearson_correlation_coefficient | double | Yes | Correlation coefficient when cause and effect variables are reversed, used to assess causality. |
| statistical_significance | float(10, 4) | Yes | Value representing the combination of effect size and sample size in determining correlation significance. |
| strongest_pearson_correlation_coefficient | float | Yes | The highest Pearson correlation coefficient observed in the analysis. |
| t_value | double | Yes | Statistical value derived from correlation and sample size, used in assessing significance. |
| updated_at | timestamp | No | Timestamp of the most recent update made to the correlation record. |
| grouped_cause_value_closest_to_value_predicting_low_outcome | double | No | Realistic daily cause variable value associated with lower-than-average outcomes. |
| grouped_cause_value_closest_to_value_predicting_high_outcome | double | No | Realistic daily cause variable value associated with higher-than-average outcomes. |

Conclusion

This rigorous methodology uses interrupted time series analysis, regression modeling, statistical testing, onset/duration modeling, and optimization to determine treatment effects from sparse, irregular observational data with missingness. It establishes causality and significance in both an acute and cumulative sense. By finding the optimal dosage, it provides actionable insights for maximizing the benefits of the treatment.

Resources

Links

  1. SunilDeshpande_S2014_ETD.pdf (asu.edu)
  2. LocalControl: An R Package for Comparative Safety and Effectiveness Research | Journal of Statistical Software (jstatsoft.org)
  3. bbotk: A brief introduction (r-project.org)
  4. artemis-toumazi/dfpk (github.com)
  5. miroslavgasparek/MPC_Cancer: Model Predictive Control for the optimisation of the tumour treatment through the combination of the chemotherapy and immunotherapy. (github.com)
  6. Doubly Robust Learning — econml 0.12.0 documentation
  7. A control systems engineering approach for adaptive behavioral interventions: illustration with a fibromyalgia intervention (nih.gov)
  8. The promise of machine learning in predicting treatment outcomes in psychiatry - Chekroud - 2021 - World Psychiatry - Wiley Online Library
  9. CURATE.AI: Optimizing Personalized Medicine with Artificial Intelligence - Agata Blasiak, Jeffrey Khong, Theodore Kee, 2020 (sagepub.com)
  10. Using nonlinear model predictive control to find optimal therapeutic strategies to modulate inflammation (aimspress.com)
  11. Forecasting Treatment Responses Over Time Using Recurrent Marginal Structural Networks (nips.cc)
  12. Estimating counterfactual treatment outcomes over time through adversarially balanced representations | OpenReview
  13. https://dash.harvard.edu/bitstream/handle/1/37366470/AGUILAR-SENIORTHESIS-2019.pdf?isAllowed=y&sequence=1

Collective decision-making platform

Enhancement Proposal for Governance System: Proposals and Voting Features

Description:

We aim to improve our governance system by implementing a robust system for proposals and voting. The desired system should be capable of handling time-limited proposals to circumvent analysis paralysis and unnecessary delays.

A proposal for the system can be found in this document: https://docs.google.com/document/d/1hkl5n7WlG6Nmr-ZvPU_oW7D-EHZ9dSbGoZdt4ttaZwM/edit?usp=driveyqsdk

The problem:

Our current system, Swae (https://dfda.swae.io), has limited functionality - it neither works on mobile devices nor does it integrate with Discord. Furthermore, GitHub Discussion polls (#80) also lack mobile support.

Other platforms like Discourse and Discord (https://discord.gg/XQqEPmkK5K) have their own drawbacks, such as the inability to perform rank choice voting, and a generally low engagement rate.

Possible Solutions:

Potential platforms to consider for our voting system include:

Requirements:

The new system must meet the following criteria:

  1. Mobile responsive: To enable participation from any device.
  2. Token weighted voting: To ensure every vote counts and the majority decision is accurately represented.
  3. Hidden results until the end of the vote: To prevent influence and maintain the independence of each vote.

Nice-to-have features:

  1. A ranked-choice option: To provide more nuanced voting options for users.

User Stories:

User Story 1: As a user, I want to be able to submit and vote on proposals from any device so that I can participate in the governance process at my convenience.

User Story 2: As a user, I want my votes to carry weight proportional to my token holdings so that the influence of my decisions is accurately represented.

User Story 3: As a user, I want the voting results to be hidden until the end of the voting period to ensure that my vote is uninfluenced and independent.

User Story 4 (Nice to have): As a user, I want the option to rank my choices in a vote to provide more nuance to my voting decisions.

We welcome suggestions, ideas, and feedback on how to improve our governance system. Please feel free to share your thoughts below.

Cloudron as a One-Click Platform for Your Own Digital Health Ecosystem

Problems

It's currently a pain to:

  1. get this mono-repo and other digital health projects running locally or on a cloud provider
  2. share data between applications
  3. set up a new API to make siloed data accessible

Cloudron solves these problems by automating most of the processes.

Why We Still Need Raw Data

LLMs are amazing. However, they can only be trained on existing public research papers, which suffer from many shortcomings.

Furthermore, there has only been thorough research on a small percentage of available data. The rest of the data exists as dark matter in silos. By creating an easily deployable local instance for sharing and deriving business value from health data, we can shine light on this dark matter data to produce valuable discoveries.

Solution: Cloudron as a One-Click Platform for Your Own Digital Health Ecosystem

  • Streamlined Installation and Management: Cloudron simplifies the installation and management of various web apps, such as Hospital Management Information Systems (HMIS), on a server 1
  • It automates tasks like provisioning databases, DNS management, and SSL certificate management 2
  • Integrated App and User Management: Cloudron provides a complete integrated solution for app and user management, allowing third-party app developers to iterate quickly and provide support via the Cloudron App Store 1
  • Built-in Backup Storage: Cloudron offers built-in support for backup storage, ensuring data safety and enabling individual apps to be rolled back, cloned, or migrated to another Cloudron installation2
  • Focus on App Usage: By simplifying app deployment and maintenance, Cloudron allows healthcare providers and developers to focus on using the apps and improving patient care, rather than worrying about system administration3

Currently, Cloudron is set up so that each application uses its own database, which is not accessible to other applications. This issue aims to create a Cloudron instance that makes it possible to automatically install any digital health application and allows them to share the same database or easily sync between databases. Relevant Links:

Some Existing Useful Cloudron Apps

Here are some Cloudron applications and their usefulness for a digital health platform:

  • Metabase: Useful for visualizing and analyzing health data, creating dashboards, and sharing insights with team members1
  • NocoDB: Helps manage health-related databases, providing instant APIs for data manipulation and analysis.
  • Wiki.js: Ideal for creating and managing knowledge bases and documentation related to digital health projects and research.
  • WordPress: Useful for creating and managing websites and blogs related to digital health, patient education, and health promotion.
  • Nextcloud: Provides secure file storage, sharing, and syncing for digital health data and collaboration.
  • Jupyter Notebooks: Enables data analysis and scientific computing for digital health research and development.

These applications can be installed and managed on Cloudron, providing a centralized platform for digital health data aggregation, storage, and analysis2

Project Scope:

The project aims to customize Cloudron (or create a setup script) to support shared databases and enable the automatic installation of open-source digital health applications. The goal is to improve integration and data sharing between digital health applications, enhancing the overall user experience and functionality of self-hosted solutions.

Required Resources:

  • A JavaScript/PHP developer with ability to perform Cloudron customization and database management.
  • A test environment (Github Actions or something) to validate the custom Cloudron instance's functionality and compatibility with various digital health applications.

Phase 1: Add This Mono-Repo To Cloudron

  1. Install Cloudron: Set up Cloudron on a server (e.g., AWS, Digital Ocean) by following the installation instructions provided in the Cloudron documentation . This will automate tasks like configuring databases, DNS setup, and certificate management.
  2. Develop App: Use the Cloudron CLI tool to develop your open-source app on your Cloudron instance. The CLI tool uses the REST API to manage all aspects of the Cloudron, such as adding users, configuring groups, and installing apps.
  3. App Store Submission: Submit your app to the Cloudron App Store for review. Once approved, your app will be available for easy installation and receive continuous updates.
  4. Automate Deployment: Create a script or use a continuous integration (CI) tool to automate the deployment of your app on Cloudron. This will ensure that the latest version of your app is always available on the Cloudron App Store.
  5. Documentation: Provide clear documentation on how to deploy and use your open-source app on Cloudron. Include instructions for setting up the app, configuring user access, and managing backups.
  6. Monitor and Maintain: Keep track of any issues or feature requests related to the Cloudron deployment of your open-source app. Address these issues promptly and provide regular updates to ensure a smooth user experience.

By following these steps, you can streamline the deployment and management of your open-source project on Cloudron, making it easier for users to install and maintain your app.

Phase 2: Automate Database Access for Other Cloudron Applications

  • Contact the creators of Cloudron to inquire about the possibility of creating a custom version that supports shared databases for digital health applications.
  • If the Cloudron creators are unable to assist, explore options for hiring a developer to create the custom version.
  • Modify the Cloudron instance to support the installation of digital health applications and ensure they can share the same database or easily sync between databases.
  • Test the custom Cloudron instance with various digital health applications to ensure seamless integration and data sharing.
  • Document the process and any necessary modifications for future reference and potential contributions to the Cloudron project.

This customization will enable better integration and data sharing between digital health applications, improving the overall user experience and functionality of self-hosted solutions.

Phase 3: Create Documentation, Reach Out, and Provide Support to Other Applications Wishing to Integrate

Some Potential Additional Applications

(I'm sure I'm missing a million, so please suggest any other valuable projects in the comments.)

  • Weavechain - Weavechain provides cross-industry solutions for verifiability, privacy-preserving data sharing, and monetization.
  • OpenHumans - A platform for sharing personal data and connecting with data-driven research projects.
  • OpenCures: A platform for sharing and analyzing personal health data, enabling individuals to contribute to medical research and improve their health.
  • Healome: A personalized health platform that uses AI and machine learning to analyze health data and provide personalized recommendations for improving health and wellness.
  • GNU Health - A free health and hospital information system with strong focus on public health and social medicine.
  • Tidepool - A modular monitoring platform for artificial pancreas research groups to visualize and monitor their patients during and after clinical studies
  • rPPG-Toolbox - Deep physiological sensing toolbox.
  • SMART ASCVD Risk Calculator - A web-based calculator for estimating the 10-year risk of atherosclerotic cardiovascular disease.
  • Medplum - A healthcare platform that helps you quickly develop high-quality compliant applications.
  • OpenMRS - Open source electronic health records and medical practice management solution.
  • Open Hospital - A free and open-source Electronic Health Record (EHR) software application.
  • Mining Minds - A collection of services, tools, and techniques working collaboratively to investigate human daily routines.

Phase 4: Federated Learning on Locally Stored Data

To run a Cloudron health instance locally in Vagrant instances and utilize federated learning to share synthetic analytical results while keeping raw data local, you can follow these steps:

  1. Local Cloudron Instance: Set up a local Cloudron instance using Vagrant, which allows you to create and configure lightweight, reproducible, and portable development environments. You can use the Cloudron CLI tool to develop apps on your local Cloudron instance1
  2. Federated Learning: Implement federated learning in your digital health ecosystem by training machine learning models on local data and sharing only the model updates, not the raw data. This approach ensures data privacy while still benefiting from collaborative learning.
  3. Synthetic Data Sharing: Share synthetic analytical results generated from the local data with other instances in the network. Synthetic data maintains the statistical properties of the original data without revealing sensitive information.
  4. Data Security: Ensure that raw data remains local and secure by configuring Cloudron to periodically save backups to a location external to the server2. This approach allows apps to be individually rolled back, cloned, and migrated to another Cloudron installation without compromising data privacy.

By following these steps, you can create a digital health ecosystem that leverages federated learning and synthetic data sharing while keeping raw data secure and local.

Text2Measurements API and Developer Portal

I made a library for this:
https://github.com/FDA-AI/FDAi/tree/develop/libs/text-2-measurements

It works well for the test cases here:
https://github.com/FDA-AI/FDAi/blob/develop/libs/text-2-measurements/src/lib/statement-2-measurements.json

We'll have to add more test cases and set up automated testing with GitHub actions to avoid regression.

We can create a NextJS app in the apps folder with an API and developer portal for people to sign up, create API keys, and manage usage, similar to the OpenAI API key management system.
https://platform.openai.com/api-keys

Ideally, it would be easily deployable on Vercel.

We'll also want to implement caching for when we receive identical requests so we don't waste so much money on the LLM calls.

The measurement keeps on showing the previously inputted option

After adding cacao powder as a measurement, I wanted to add a water measurement as well, but every time I try to add the water measurement, it keeps on showing me the previous cacao powder measurement as seen below:

image

image

The same happened when trying to input other measurements such as Himalayan salt after inputting an espresso:

image

image

I notice it happens when you want to record two or more measurements after another.
You have to go to another page for you to be able to record the new measurement properly.

Test Issue

Your Question

This is test Issue for pipedream

What have you tried so far?

setting up issue resolver agent

Additional context

Create a PurpleAir Connector and Run Study on the Relationship between VOC and Particulate Matter in the Home and Various Outcomes

This seems to be the best one for indoor monitoring:
https://www2.purpleair.com/products/purpleair-touch

API Docs
https://community.purpleair.com/t/making-api-calls-with-the-purpleair-api/180

Example API Connectors Located Here:
https://github.com/wishonia/FDAi/tree/72a45934262b88bb99bf4f527edd0d014e0e57ac/apps/dfda-1/app/DataSources/Connectors

This would be a good opportunity to document how to add a new connector.

Please comment if you're interested, and I can help you build it.

Create a new TypeScript-based API Gateway and Authentication Server with Prisma Client for Proxying 3rd Party APIs

User Story

As a user of CureDAO, I want to obtain data from any health app or wearable device in a standardized format consisting of an array of measurements with the following properties:

  • value
  • data_source_name
  • unit_name
  • variable_name
  • start_at
  • end_at
  • variable_category_name
  • user_id
  • note
  • image
  • url

image

We already have an Express-based gateway server with a Prisma schema here:

https://github.com/curedao/curedao-monorepo/tree/develop/apps/api

However, it doesn't use a framework, so it's not well-organized. Also, it's vanilla JavaScript, so it isn't type-safe.

Ideally, we'd have a TypeScript-based API Gateway server that acts as a proxy to these APIs, utilizing Prisma Client for database operations. The API Gateway server will handle the authentication, authorization, rate limiting, and caching of requests to the 3rd party APIs.

More Context

CureDAO interacts with multiple 3rd party APIs, each with its own authentication and authorization process. Managing these processes for each API separately can be time-consuming and error-prone. Furthermore, making direct requests to the 3rd party APIs can result in performance issues due to network latency and the number of requests made.

To address these issues, we need an API Gateway server that acts as a proxy to the 3rd party APIs, utilizing TypeScript and Prisma Client for efficient and type-safe code. The API Gateway server will handle the authentication and authorization processes for the 3rd party APIs, as well as rate limiting and caching of requests. This will improve the performance and security of CureDAO.

More details here:
https://docs.curedao.org/constitution/3-platform

Objective

Create a TypeScript-based API Gateway server that acts as a proxy to the 3rd party APIs and utilizes Prisma Client for database operations. The API Gateway server should be designed to handle multiple APIs and should be flexible enough to support new APIs as they are added.

Proposed Solution

A TypeScript-based API Gateway server using a framework such as NestJS. The API Gateway server will act as a reverse proxy, routing requests to the appropriate backend server based on the path and HTTP method. It will also handle the authentication and authorization processes for the 3rd party APIs using OAuth2 or other authentication mechanisms. The API Gateway server will also handle rate limiting and caching of requests to improve performance.

The API Gateway server should be designed to be scalable and fault-tolerant. It should be able to handle a large number of requests and should be able to recover from failures quickly. It should also utilize Prisma Client for efficient and type-safe database operations.

Libraries and Tools

Acceptance Criteria

The acceptance criteria for this issue are as follows:

  • The API Gateway server is designed using TypeScript and Prisma Client for efficient and type-safe code
  • The API Gateway server is designed to handle multiple 3rd party APIs
  • The API Gateway server uses OAuth2 or other authentication mechanisms to handle the authentication and authorization processes for the 3rd party APIs
  • The API Gateway server handles rate limiting and caching of requests to improve performance
  • The API Gateway server is designed to be scalable and fault-tolerant
  • The API Gateway server is tested and meets our performance and security requirements
  • The API Gateway server should have an OpenAPI specification with auto-generated interactive documentation
     

Examples

  • https://www.apideck.com/products/vault - Awesome, but closed source and focused on marketing instead of health data
  • https://github.com/NangoHQ/nango - Awesome for proxying, but there aren't any digital health APIs, and we'd still need data mapping functionality to get measurements in the desired formats.  Perhaps this could be forked and modified, or just used as inspiration for a new one in this monorepo.

Existing Work

Express Gateway Server

We already have an Express-based gateway server here:

https://github.com/curedao/curedao-monorepo/tree/develop/apps/api

Prisma Schema

https://github.com/curedao/curedao-monorepo/blob/develop/apps/api/prisma/schema.prisma

Current API Documentation: https://curedao.readme.io/reference

How You Can Help

  • Please ask any questions you can think of in the comments
  • Propose a framework or suggest implementation details
  • Help us prioritize this issue by reacting with 👍or 👎
  • Create a Gitcoin campaign to fund this issue
  • Assign it to yourself and do it

FDAi Autonomous Project Manager AI Agent for Repository Management

We want an AI agent, named FDAi, that will eventually serve as the director of the FDAi project. This AI agent will be responsible for automating various repository management tasks, significantly improving efficiency and ensuring consistent project progression. The ultimate goal is to create a self-improving system that will autonomously manage the repository, contributing to the global mission of accelerating clinical research and maximizing health and happiness.

Objectives

  1. Automate Issue Labeling: The FDAi AI agent must automatically label incoming issues based on their content, using a predefined set of labels for categorization.
  2. Milestone Creation and Management: The agent should be capable of creating and assigning milestones to issues and pull requests, facilitating better tracking of project progress.
  3. Issue and Pull Request Management: FDAi should autonomously manage issues and pull requests, including the ability to create, update, and close them based on project requirements and contributions.
  4. Data Indexing and Analysis: It should index and analyze the contents of the FDAi GitHub repository, extracting valuable insights to guide project direction and priorities.
  5. Community Engagement: The agent must foster community engagement by facilitating discussions, responding to queries, and encouraging contributions from developers and researchers.

Requirements

  • Integration Capability: Ability to integrate with the GitHub API for performing various repository management tasks.
  • Self-Improvement Mechanism: The agent should have the capability for self-assessment and self-improvement, learning from its actions to optimize its performance over time.
  • Security and Privacy: Ensure strict adherence to security and privacy standards, safeguarding project data and contributor information.
  • Open-Source Development: Development should be carried out in an open-source manner, encouraging collaboration and transparency throughout the project lifecycle.

Milestones

  1. Research and Planning: Conduct thorough research to identify the best approaches and technologies for developing the FDAi AI agent. (Duration: 1 Month)
  2. Prototype Development: Develop a prototype that demonstrates basic capabilities such as issue labeling and milestone management. (Duration: 3 Months)
  3. Testing and Feedback: Test the prototype within the community, gathering feedback for improvements. (Duration: 2 Months)
  4. Full-Scale Development: Implement feedback and develop the full-scale AI agent with complete functionalities. (Duration: 6 Months)
  5. Deployment and Monitoring: Deploy the FDAi AI agent and monitor its performance, making adjustments as necessary. (Duration: Ongoing)

Contribution Guidelines

  • Code Contributions: Please submit pull requests with detailed descriptions of your contributions and how they enhance the FDAi AI agent's functionality.
  • Feedback and Suggestions: We welcome feedback and suggestions through issue submissions. Please label them appropriately as feedback or suggestion.
  • Community Discussion: Engage with the community through discussions to share ideas and collaborate on enhancing the FDAi AI agent's development.

Searches for regular intake of foods should not include nutrients

Currently, the regular food consumed by an individual includes many nutrients rather than merely foods.
It also includes beverages, which is okay, if we just change the section to include which foods and drinks are consumed on a regular basis and not just foods.

image

Display by correlation strength or alphabetically in predictors results page

If a user wants to see results for memory, and quickly see Caloric Intake or the strongest improver of memory,
they should be able to, at the top of the page, Sort by > alphabetically (ascending), alphabetically (descending), effect size (large), effect size (small).
--Other sort field could be n# of the study.

Fix loading times

The loading times and processing power required to use the app in a browser is substantial.
Discovered on both computer and mobile devices.
Ideally, this would dramatically be reduced, so all potential users could use the app regularly in a web browser with no issues.

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.