Links for previous discussions about apps providing a medication reminder Search results for 'medication reminder' - MIT App Inventor Community might help you.
App Inventor does not have the ability to create an app that runs in the Background using only App Inventor Blocks. Developers need to use an extension like this one Background Tasks extension [3.8 A] 🥳 .
First design the medical reminder app; then see if you can adapt your app to 'run in the background' using an extension.
Will it work? Only if you code the app using the advice provided in the extension links. Be aware, there is not any tutorial showing exactly how to do this for your app idea.
Possibly someone will provide some specific advice. You might share with the community what you have already done without running in the background. Anyone providing specific advice to design your app to run in the background would need that information.
Good luck.