public static function getList($term, $restrict = null)
{
$search = "%{$term}%";
$select = 'term, short_format, id, default_duration';
$where = '(term like :search or short_format like :search or snomed_term like :search or snomed_code = :term or aliases like :search)';
if ($restrict == 'unbooked') {
$where .= ' and unbooked = 1';
} elseif ($restrict == 'booked') {
$where .= ' and unbooked = 0';
}
$where .= ' and proc.active = 1';
return Yii::app()->db->createCommand()->select('term')->from('proc')->where($where, array(':term' => $term, ':search' => $search))->order('term')->queryColumn();
}