A Temporal Bayesian Network for Diagnosis and Prediction