medTimer icon indicating copy to clipboard operation
medTimer copied to clipboard

Pill count and refill reminder

Open SATISHDEEPU opened this issue 1 year ago • 1 comments

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

SATISHDEEPU avatar Sep 24 '24 21:09 SATISHDEEPU

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.

Futsch1 avatar Sep 27 '24 13:09 Futsch1

@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)

Blend3rman avatar Oct 20 '24 00:10 Blend3rman

@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.

Futsch1 avatar Oct 20 '24 07:10 Futsch1

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

Blend3rman avatar Oct 20 '24 11:10 Blend3rman

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.

arittner avatar Dec 17 '24 08:12 arittner

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 avatar Dec 18 '24 08:12 Futsch1

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

arittner avatar Dec 29 '24 21:12 arittner