Ok, I'm grateful for your help. I'll try to translate it into my work, if I have any problems I'll reply to the post. You're a genius.
Everything is going very well, but I am still in the same place, when I save an equal data, it replaces it. My goal is for it to detect that that element or in this case the tag exists, and inform me that the shift I am trying to add already exists at that time. It should be remembered that the shifts will be erected by the users and if that data already exists, the user should be notified with a notification.
In this version I added a filter to match the Spinner Selections in the ListView, so the Elements list will have a length of 1if a replacement will happen. It would be hard to miss that the chosen tag exists from that.
weekly_shifts.aia (6.5 KB)
Unfiltered:
Clinic filter:
Type of Care filter:
The same thing still happens, when I try to save a value in the same clinic, day, time and same query I would like it not to be able to be assigned because that label already exists. My idea is basic but I would like it to be something like "If that label exists", in the case that if there is a message saying, "there is already a shift at that time, try to assign another time or day" and in the case that the shift is not repeated, save it. I repeat, the application is for the client, not for the doctor.
That's an entirely different game.
The concept of a shift schedule is for administrators of a business, to set up policy for where and when doctors should show up to do business.
Are you trying to turn this into a patient scheduling app?
I realized that it was for administrator, so I clarified that it was for patients. Exactly, they are shifts for patients. To save hours of lines and waiting. Could you help me in that case? I thank you with all my heart for the time you take to help me.
To simplify login of administrators versus patients, I suggest a splash Button at startup, with Click leading to setting up for patient read-only access, and a Long Click leading to asking for admin login.
Admin login would be a low security password request from Firebase Bucket ADMIN tag Password.
After login succeeds, expose an option to change the admin password (optional).
Leave admin status (true/false) in a global variable for use at browse time.
If admin is false, don't show the Horizontal Arrangement for updating the shifts.
Is that okay with you?
Here's an implementation of admin login.
I leave it to you to add password maintenance.
Default admin password is 'admin'.
weekly_shifts.aia (8.2 KB)
Sorry, I think it's not what I was looking for, my goal is for the patient to choose the shift, not the administrator. I already have the login section. I only need one sector where the patient chooses his turn and does not get in the way of another at the time of requesting it.
That sounds like a list hanging off the shift tag, with the date as a subkey. To avoid patient login you could mimic one of those numbered ticket dispensers they have at the deli counter, where the patient can take the next number, and the receptionist calls the next number.
You might need a receptionist login.
Think about it.
Your idea is very good, but it's not what I'm looking for. Regardless of the login, the labels you would like to achieve are: Shifts -> clinic - day - time.
The only thing I am not achieving is that when pressing the "save" button, the patient identifies if that shift is saved or not. For example a "check" button was my main idea, if there is that shift to launch an alert "it already exists choose another time or day", but with mit app inventor and firebase I could not achieve it. I think I'm getting complicated, maybe you have a more simplified idea or another method that can help me. I'm a little frustrated because I'm missing only that
On its way into the ListView but before the filter blocks, save the dictionary that arrives from Firebase into a global variable.
Its keys (use the dictionary keys block) are a list of what has already been saved.
So you can use the is_in_list block to check the existence.
You would have to join the 4 picker selections with '-' between them to get the item you want.
I suspect I am giving the right advice for the wrong problem.
Going back to the benefit to the app user,
How would this app help its users?
What data do they need to feed it to let it do its job?
How long should the app keep that data?
This has been difficult for me to understand. Because I don't know the Firebase database. Answering your questions would help reduce the queues that are currently generated here where I live. The data I want to save is what I have been mentioning: Clinic, day, time, and type of consultation. For local data it has worked but with the Firebase database I am having problems when comparing the shift I want to save with the shift existing in the database.
This is difficult for me to understand because I don't see the benefit or purpose of your app.
If you would walk around and pretend to be your app, talking to people around you, what would you ask of them and what would you observe?
If you see any solution to recommend me, I would appreciate it. My goal is to save patient shifts and no repetitions in the database. What I asked for before is precisely so that the data is not repeated.
I saw some solution with google sheets, but I should look into that.
What is a patient shift?
Do you make your patients work for you?
Google Sheets are good for demonstrating the data structure.
Typing up some sample data in a sheet might help clear up my confusion.
I suggest browsing these search results, to help you define your data needs more precisely.
These are foundational ideas.
If you get the foundation wrong, the building will be wrong.
https://www.google.com/search?q=introduction+to+data+modelling
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.