Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related to design for Fever Check in the background #6

Closed
1 task done
mmervecerit opened this issue Feb 5, 2025 · 1 comment
Closed
1 task done

Related to design for Fever Check in the background #6

mmervecerit opened this issue Feb 5, 2025 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@mmervecerit
Copy link
Contributor

mmervecerit commented Feb 5, 2025

Problem

My question is related to the following requirement:

        The app includes an alarm system designed to enhance patient safety during neutropenia. If at any time the app detects the following conditions:
              
         Fever: A rise in body temperature consistent with a fever, in the context of neutropenia (e.g., absolute neutrophil counts below a specified threshold, such as 500/µL).
         Increased Resting Heart Rate: Resting heart rate exceeding 100 BPM.
              
         An alert will immediately display on the user’s iPhone, advising them to seek medical attention without delay.

To detect fever and heart rate at the same time, should we listen in the background all the time for timely alert? Would that happen in client side or server side?

It looks like the collect sample function i run gets the health data automatically when the app is running. So should we keep the app running in the background + doing asynchronous check for the alert condition?

Would love your thoughts to design this the best way. @nriedman @PSchmiedmayer @vishnuravi

Solution

I am thinking we can run the app in the background all the time, and check in the client side for the alert condition in case there's an issue with firebase/internet? -- Not sure

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@mmervecerit mmervecerit added the help wanted Extra attention is needed label Feb 5, 2025
@PSchmiedmayer
Copy link
Member

Good question!

  1. Yes, I think running this in the background & reacting on the latest data is the way to go. I would suggest to listening to HealthKit entries in the background & merge this with any local stored data or other elements that you can query from HealthKit. SpeziHealthKit has a convenient background mode that will wake your app up if new samples are added (won't happen immediately but up to the system to schedule this, most of the time least once an hour), e.g. using something like CollectSample(.heartRate, continueInBackground: true) in your HealthKit configuration.
  2. I would even suggest updating the SpeziHealthKit component to the latest beta (1.0.0-beta.1) which adds some more improvements to this and might be really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

2 participants