/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Icd101::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['sex' => $this->sex]); $query->andFilterWhere(['like', 'code', $this->code])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'spclty', $this->spclty])->andFilterWhere(['like', 'tname', $this->tname])->andFilterWhere(['like', 'code3', $this->code3])->andFilterWhere(['like', 'code4', $this->code4])->andFilterWhere(['like', 'code5', $this->code5])->andFilterWhere(['like', 'ipd_valid', $this->ipd_valid])->andFilterWhere(['like', 'icd10compat', $this->icd10compat])->andFilterWhere(['like', 'icd10tmcompat', $this->icd10tmcompat])->andFilterWhere(['like', 'active_status', $this->active_status])->andFilterWhere(['like', 'hos_guid', $this->hos_guid])->andFilterWhere(['like', 'hos_guid_ext', $this->hos_guid_ext]); return $dataProvider; }
/** * Relation */ public function getIcd101() { return $this->hasOne(Icd101::className(), ['code' => 'icd10']); }
public function getOvstdiag() { return $this->hasOne(Icd101::className(), ['vn' => 'vn']); }
/** * Finds the Icd101 model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Icd101 the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Icd101::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }