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

Pill count and refill reminder #250

Closed
SATISHDEEPU opened this issue Sep 24, 2024 · 7 comments · Fixed by #402
Closed

Pill count and refill reminder #250

SATISHDEEPU opened this issue Sep 24, 2024 · 7 comments · Fixed by #402
Labels
enhancement New feature or request
Milestone

Comments

@SATISHDEEPU
Copy link

Can you please add a option to get the count of pills remaining and refill alert. It would be great if you could add this feature

@Futsch1 Futsch1 added the enhancement New feature or request label Sep 27, 2024
@Futsch1
Copy link
Owner

Futsch1 commented Sep 27, 2024

This was already asked some time ago and would be a major new feature. I currently have no time to work on this, but I'll keep it open to track potential progress and discussion about it.

@Blend3rman
Copy link
Contributor

Blend3rman commented Oct 20, 2024

@Futsch1 could you perhaps outline the steps needed to implement this feature? From what I can gather, they would be:

  • Create a new database class for Pill Count Reminders. The properties are different enough that I don't think we can reuse the Reminder class (which is more time-based rather than counter-based)
  • Associate with medicine data using medicineRelId
  • Implement a decrement feature that runs every time a dose of the associated medicine is marked taken. Figure out a way to deal with custom units and dosages (or provide users with standard units and limit this feature to those)
  • Incorporate into UX flow (creation/deletion, updation, notification) (I'd appreciate more guidance on this)
  • Test the new class and associated helpers and modals (also in need of guidance)

@Futsch1
Copy link
Owner

Futsch1 commented Oct 20, 2024

@Blend3rman your points would summarize the basic ideas.

In terms of database, there would be two aspects to consider: One is the remaining amount of the medicine - this should be added to the Medicine table. To start easy, it might be enough to only have one refill reminder setting per medicine (like on/off and reminder threshold). This way, no new table is required and these settings can also be added to the Medicine table.

The decrement feature would be a bit more tricky. What I could think of is to have a second amount field where the user can add the actual value the medicine amount is decreased per dosage (like you would have the amount as "1 tbl spoon", you would set the decrease amount to "10" representing 10 ml). If the amount is a number, this decrease amount could be filled automatically. However, the alternative using units is also possible, albeit more complex I guess.

Regarding the UX, you would have to work with the layout XMLs. The app uses Android navigation (https://developer.android.com/guide/navigation) and fragments classes associated with each screen. I have not worked with ViewModels a lot, since most of the fragments are just pure configuration screens and the state of the data does not change by itself. So the classes corresponding to the fragments contain the logic to put the database fields into the UI fields and back.

Concerning testing, unit tests are used for the core business logic and some helpers. For UI centric features, Android test via Espresso is the way to go.

In terms of code quality, SonarQube is used and should be added to AndroidStudio as a plugin.

@Blend3rman
Copy link
Contributor

@Futsch1 Thank you for the details! I'll try figuring this out slowly.

@arittner
Copy link

As more and more medication trackers are switching to subscription models, I switched to this app and I really like the UI.

What I also miss is the reminder to buy new pills.

I think it needs a pack size, a current amount (which you can maintain manually please) and a threshold for when to buy a new pack. The threshold value should be individual. Because some medicines are difficult to get, others are not very important (vitamins).

Counting down is hopefully not complicated and should be done with the confirmation of intake. If something goes wrong, you can adjust the current amount manually.

@Futsch1
Copy link
Owner

Futsch1 commented Dec 18, 2024

Since I consider the app with the upcoming v1.13.0 rather feature complete in terms of reminder types, I will start working on this feature.

@Futsch1 Futsch1 added this to the v1.14.0 milestone Dec 18, 2024
@Futsch1 Futsch1 linked a pull request Dec 28, 2024 that will close this issue
@arittner
Copy link

Wow, fantastic. Thank you for your efforts. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants