Smart phone based patient monitoring system