Medical Supplies Manager for My Mother

Daniel Collier
1 min readApr 26, 2021

In 2019 mother had a stroke and she got really disabled. Getting all assistance in place for her took some time, and building automations helped me on having more quality time with her and my family.

One of the tools that I’ve developed is a script to manage her medical supplies. Daily it updates the supplies and notifies me and my brother if any of her medicines are ending in the next 10 days.

The Algorithm

The main function handles the following steps:

  • Loading the data from the spreadsheet
  • Applying the management rules in the current data
  • Updating the spreadsheet
  • Verifying if there is any medical supply ending
  • If there is any medicine ending, notifying me and my brother
function manageMedicalSupplies() {
let endingSupplies;
// Initialization
let dataArray = dataHandling_loadArray();
Logger.log("Yesterday:")
Logger.log(dataArray)
// Action
dataArray = dataArray.map(supply_applyManagementRules);
Logger.log("Today:")
Logger.log(dataArray);
// Storing
dataHandling_updateSheet(dataArray);
// Notification
let isSupplyEnding = supply_verifyStatus(dataArray);
if (isSupplyEnding) {
endingSupplies = supply_getOnesEnding(dataArray);
notification_notifySons(endingSupplies);
}
Logger.log("Data updated!")
return true;
}

The script also logs in the console the procedures to help me if for any reason the spreadsheet or the script gets broken (it’s my mother's information).

Project on Github

If you are interested in knowing how to implement a system like this, you can check out the code on my Github.

If you need any help, please let me know by commenting below.

Thanks for the reading!

--

--

Daniel Collier

Software Developer graduated in Electrical Engineering. Data-driven, with a love for Business Automation and Customer Experience.