Adding functionality

I am working on a project that requires me to write code and integrate to OpenMRS a basic decision support functionality, such as predicting a particular detail such as mortality risk for example from the patient information stored in the database.

For implementing such a system, do I create a new module or an OWA to achieve this? Is it possibe to integrate a machine learning model into this system that can do the prediction.

I would separate this into backend and frontend functionality. For the frontend, this is our recommendation: OpenMRS 3.0: A Frontend Framework that enables collaboration and better User Experience - Projects - OpenMRS Wiki

As per our technology radar, OWA is no longer recommended:

And for the backend, you could look at our attempts at Analytics Engine (including ETL and reporting improvement) - Projects - OpenMRS Wiki and Toward a standard approach for change data capture (CDC) for OpenMRS