Medication Reminder (again)

Taifun is recommending you redo a major part of your Project to achieve a new feature you want You probably don't have enough time to do that and submit your Project on the 9th; so don't add the feature. Instead get all the other parts of your app to work.

I doubt I could do all he is recommending in the time available. :thinking: and am not sure I could implement his advice.

Do what you can. And provide a screenshot of a TinyDB.GetTags block together with a Do it result as Taifun requests. After you do it perhaps he will provide some Blocks to help you. Provide a screenshot oof the GetTags, not the format you provided.

The format is: dd-MM-yyyy HH:mm(that's the one we use here in portugal)
And the Do It printscreen is of the get tags in the listview screen, right?

That format is not useful to sort...
You have to differentiate 2 things, 1) to store the data and 2) to display the data
And you always can convert data from a format as it is stored to a better readable fornat to display it

It does not matter from where

Actually I'm not doing that
And for the record, this was my suggestion already a few days ago

To get the smallest item from the list you put 3 blocks together like this

  1. Select list item (to select the first item)
  2. sort list in ascending order
  3. TinyDB.GetTags

Taifun

image
Here is the result of the get tags

Ok, very good... you have stored currently one alarm time...
Now as already said..

What about storing millis in the database? This would make it very easy to sort... and to display it in the listview, you convert it into readable format

Taifun

Soo transforming the alarm time into millis?

Soo instead of this...


Having this?

Yes exactly
Very good!!!

And if you want to consider this

Then add the if statement again

And use the GetMillis blocks there

Taifun

I didnt exactly understand, can you explain it a little better?

Your blocks are correct, but do not consider the alarm time < current time problem

From my screenshot remove the blocks marked with a red x and replace the blocks marked with a yellow arrow by Get Millis

Taifun


Is this correct?

Yes
Now clear TinyDB to continue and find the next alarm time like this

unknown

Taifun

I'm afraid that I'm not finding the correct blocks... may you please sent a printscreen of the blocks needed?

the list blocks are in the list drawer and the TinyDB.GetTags block you alaready know
Taifun

image
Is it this one you are talking about? Im not seeing the ascended order thing you said


Tafun

Just to understand.. this blocks will be in the Listview screen, right? And now what do I do with these blocks?

no
you are currently working in the CLock.Timer event
these blocks will replace the red circle

unknown

and for the listview you can use these blocks (draggable), which convert the list of millis into a list of your datetime format

Taifun

including Do it

Oh my god, thank you! There's one more thing I want to change in my project. I'm using a "Show Alert Notice" that isn't functioning as a real notification, as you can see in the blocks I've sent before.

Is it possible to create a proper notification that displays the name of the medication that the user wrote in alarm time?

Like... "It's time to take (name of the medication)" and it would change for the different medications that the user saved.

You can use also the Notifier ShowMessage method and the join block from the text drawer to join some text and the name of the medicament

To get the name of the medicament, just select it from the list of the current alarm time

Remember the concept

Taifun