Hardware and software for management of chronic diseases