Promemoria scadenza farmaci

Salve,
sto creando un’app che mi faccia da promemoria sulla scadenza delle mie medicine. Come si fa ad associare ad ogni medicina…la sua scadenza?
Vi allego il mio progetto
Saluti
Nicola

1 Like

Nicola,
If you want to be warned when taking a medicine is due, by having your app running in the background and by waking up at a certain time, that is impossible.
That said, you could make an app, that when run, shows you which medicines have to be taken at what time and which also records whether the medicines are taken.

Now, first you should make a design! Please specify how you want to create a list of the medicines and where you want to store that list (Google Spreadsheet, csv file, TinyDB, ClouDB, SQLite…).
I see that you have blocks to store things in a TinyDB, but what you are storing exactly is not at all clear to me (could be my not so good Italian.) I have the impression that you are only storing the name of the medicine, but where do you add the dates?

After you have made the design, you can specify what to do with the data and how are you presenting this on-screen?
Cheers, Ghica.

Ghica,
ogni medicinale che vado ad inserire nella ListView, lo vado a memorizzare in una TinyDB. Però ti chiedo come faccio ad associare la scadenza di ciascun medicinale?
Es: Aulin scadenza 20-03-2020
Supradyn scadenza 28-06-2020

Saluti
Nicola

but you can use the alarm extension to define several alarms and when one of the medicines is due, an alarm will sound...
you can find the alarm extension here App Inventor Extensions: Alarm | Pura Vida Apps

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

One way is you create your Medicine List as a List of Lists and use the pairs block

This is a simple example using a List (to save it on your device, save the medicineDates List as a Tag. To be fully functional, it requires more error control but you asked 'ad associare la scadenza di ciascun medicinale' and this is one way.

Good luck with your Project.

Regards,
Steve

Grazie Ghica, Taifun e SteveJG per il vostro preziosissimo aiuto che mi avete donato e vi auguro buona giornata.
P.s: Prego Dio affinchè faccia risolvere al più presto, questi gravissimi problemi causati dal Coronavirus. :pregare: :pregare: :pregare: :pregare: :pregare:
Saluti
Nicola

1 Like

Steve,
ho provato anche ad aggiungere una procedura per poter eliminare un farmaco, quando viene selezionato; ma visualizzo un errore.
Saluti
Nicola

What is the error you are seeing and what is the data you are using?
Cheers, Ghica

Here is part of what you want to do (a big guess):

How it works:
Select an item from the ListView. Selecting that item should delete the item immediately I expect. No safeguards provided. Add code to save the modified MedicineDates List to your TinyDB as the last item of code.

What is different mainly from your code is the contents of the remove list item Block puzzle piece.

Possibly use this code in conjunction with a Notifier… in a way similar to what you have coded.

Hope this small example is useful. Try it and let us know if this clears your error .

–Steve

Steve,
ti ringrazio per avermi fatto capire dove era errore. :occhiolino:
Saluti
Nicola

Salve,
lo so che Mit App Inventor non permette di poter lavorare in background; ma non so come poter effettuare un controllo sulle scadenze dei farmaci; all’avvio dell’app. :unamused:
Saluti
Nicola

Yes you do. You know how to work with Lists certainly. Write a Procedure to cycle through the List of MedicineDates. You know that your list is made of a List of pairs (a medicine with a date). Compare each date for the list of medicines with today's date or today's date plus some days (today's date + 30 so you know which ones expire within the next thirty days perhaps) Write the items that are = or <= to today's date. These are the medicines that expire today, or expire within a month. Write these 'expired' medicines out to a Label or somewhere.

This code might work. The code requires your dates are formatted month/day/year .. in that order. The dates need to be in that order so that you can use the Clock blocks to compare the dates (<= to the dates which are the second item in the List) .

The example shows how to do it with a Button. I assume you store the medicineDates List in a TinyDB. To check when the app starts; what do you usually do? I place a TinyDB Get block in the Screen1.Initialize. If that is what you do, simply call the Procedure there (after you populate the medicineDates from the TinyDB. Does that work?

Regards,
Steve

Ti ringrazio per il tuo preziosissimo aiuto e ti auguro buona domenica.
Saluti
Nicola

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.