The COVID-19 pandemic, the growth of smartphones, and the internet have driven the use of technology for monitoring TB patients. Innovation in management of TB patients is needed to improve treatment outcomes. The study was conducted to obtain a predictive model of medication safety and solution model for at-risk patients, and to improve medication safety through mobile applications. The research was conducted in 4 stages, namely qualitative, quantitative (cross-sectional), qualitative, and quantitative (quasi-experimental, post-test group control design). Data were taken at the Public Health Center in Jakarta, Indonesia. Samples were taken by cluster random sampling. For quantitative research, 2nd phase (n = 114) and 4th phase (n = 96) were analyzed using logistic regression. This study analyzed predictors of medication safety to assist in monitoring patients undergoing treatment. At-risk patients were educated using an algorithm programmed in the application.