When the user enters the child's birth date, a list of all his vaccinations appearsHow can building blocks be used to create code?
I think you are asking how to store data and read it.
The simplest solution would be to store the data in a file, and use a simple searching method. You could store the dates and vaccinations on each line of a file, and use the 'split text at' to split a line into a date and vaccination.
You might want to look at the following to understand how linear searching works: here
Also, you need to add a file component to your screen - found in the storage tab.
use TinyDB to store the data
also you might want to learn how to work with lists
A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles
How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .
Also do the tutorials http://appinventor.mit.edu.ezproxy.canberra.edu.au/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
Here is a good basis for your data model:
https://www.cdc.gov/vaccines/schedules/hcp/imz/child-adolescent.html
This table's granularity is by month, with a range of months for each vaccination, and multiple phases for some vaccinations.
That web site split the table into 2 parts for presentation purposes. For lookup purposes, they should be combined into one table.
The column headings could be combined with the birthdate using Clock AddMonth blocks to make new headings with calendar dates.
You might want to pivot the table to show recommendations by date range instead of vaccination order.
I make an app when entering child's date of birth, a list appears for him or calendar of the upcoming vaccination dates, for example the user enter 12/12/2020
calender or list appear had dates of the next vaccinations,
the idea is where I compare the date that the user entered and add certain days to it , for example, user enter 12/12/2020 then calender or list appear upcoming vaccinations will be in 18/12/2020
The problem I have is that I cannot do the correct comparison and add days
what did you try?
use the Clock component and the AddDays method
http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/components/sensors.html#Clock
see also this guide
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
it looks like you first have to think about how to setup a list of dates and corresponding vaccines for a specific person? do you want to store several persons with their dates and vaccines in the app? who is using the app? first you have to make a plan before starting to code...
Taifun
I am also looking for a solution
welcome to the community
follow the already mentioned guide and try something yourself...
and if you get stuck, then post a screenshot of your relevant blocks
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
@Elham_Ali someone flagged your post as spam by accident...
what should happen, if the child is already 2 months and 1 day old? you like to display only the upcoming vacciations? do you also want to store the received vaccinations in the app?
Taifun
also a list of upcoming vaccination dates appears for age two month and all vaccination
the idea is that based on the age of a child, a list of all vaccinations appears until the age of two years
Even if he is two months old, and one day he has the two-month vaccination list until the age of two years
to make things easier what about providing a spinner or listview with the following items...
- 0 months
- 2 months
- 4 months
- 6 months
- 9 months
- 18 months
no need to do any calculations and the parents will be able to select the information they want to see themselves...
Taifun
Iwant to use the calendar because I use timepicker .when entering the date of birth a Schedule of vaccine dates appear
The part that I cannot code in is that it will store this date that you entered and then create vaccination dates based on this date.
like this
Off topic. Which extension are you using to make pink cards?
al already mentioned to calculate the days starting from the birthday use the AddMonths method from the clock component...
http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/components/sensors.html#Clock
AddMonths( instant , quantity )
Returns an instant in time some months after the given instant.
the instant for the AddMonths method in your case is the Instant property of the datepicker component and the quantity is the quantity of months you like to add, for example 2, it's very simple, isn't it?
see again
please try something yourself and if you get stuck, post a screenshot of your relevant blocks
Taifun
thanks for your help
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.