/** * Generates insights for given hospital. * @param integer $id * @return mixed */ public function actionInsights($id) { $model = $this->findModel($id); $indicators = new Indicators(); $indicators->calculateIndicators($id); $insights = new Insights(); $insights->prepareInsights($indicators->getIndicatorsArray()); return $this->render('insights', ['model' => $model, 'insights' => $insights]); }