Changes in heart function observed on electrocardiograms of patients hospitalized with COVID-19 or influenza can help predict a time frame for worsening health, a study says.