surat/frontend/modules/administrator/models/SurgicalDiagnosisSearch.php

119 lines
5.7 KiB
PHP

<?php
namespace frontend\modules\administrator\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\SurgicalDiagnosis;
/**
* SurgicalDiagnosisSearch represents the model behind the search form of `common\models\SurgicalDiagnosis`.
*/
class SurgicalDiagnosisSearch extends SurgicalDiagnosis
{
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id', 'is_no_microscopic', 'pathologist_id', 'status_id', 'is_critical_diagnosis', 'is_first_cancer', 'reference_img_id', 'is_edit_patient_information', 'surgical_diagnosis_id', 'diagnosis_type', 'pathologist2_id', 'is_co_pathologist', 'co_pathologist_id', 'is_agree', 'is_m', 'diag_by', 'is_no_comment', 'is_conference', 'is_review', 'patho_report_id', 'is_ca_confirm', 'is_suggesstion_ihc', 'is_suggesstion_special_stain', 'is_suggesstion_other', 'is_ca_confirm_agree', 'organ_id', 'organ_code', 'is_reject', 'is_reject_list'], 'integer'],
[['report_type', 'id_case', 'gross_description', 'microscopic_description', 'microscopic_img', 'microscopic_img_caption', 'diagnosis', 'pathologist_at', 'rev', 'rev_date', 'pathologist2_at', 'reason', 'diagnosis_comment', 'conference_at', 'review_remark', 'review_at', 'outlab_report', 'consult_outlab_report', 'is_ca_confirm_at', 'ca_confirm_remark', 'suggesstion_ihc', 'suggesstion_special_stain', 'suggesstion_other', 'organ_remark'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = SurgicalDiagnosis::find();
// add conditions that should always apply here
$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;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'is_no_microscopic' => $this->is_no_microscopic,
'pathologist_id' => $this->pathologist_id,
'pathologist_at' => $this->pathologist_at,
'status_id' => $this->status_id,
'is_critical_diagnosis' => $this->is_critical_diagnosis,
'is_first_cancer' => $this->is_first_cancer,
'reference_img_id' => $this->reference_img_id,
'is_edit_patient_information' => $this->is_edit_patient_information,
'surgical_diagnosis_id' => $this->surgical_diagnosis_id,
'diagnosis_type' => $this->diagnosis_type,
'pathologist2_id' => $this->pathologist2_id,
'pathologist2_at' => $this->pathologist2_at,
'is_co_pathologist' => $this->is_co_pathologist,
'co_pathologist_id' => $this->co_pathologist_id,
'is_agree' => $this->is_agree,
'is_m' => $this->is_m,
'diag_by' => $this->diag_by,
'is_no_comment' => $this->is_no_comment,
'is_conference' => $this->is_conference,
'conference_at' => $this->conference_at,
'is_review' => $this->is_review,
'review_at' => $this->review_at,
'patho_report_id' => $this->patho_report_id,
'is_ca_confirm' => $this->is_ca_confirm,
'is_ca_confirm_at' => $this->is_ca_confirm_at,
'is_suggesstion_ihc' => $this->is_suggesstion_ihc,
'is_suggesstion_special_stain' => $this->is_suggesstion_special_stain,
'is_suggesstion_other' => $this->is_suggesstion_other,
'is_ca_confirm_agree' => $this->is_ca_confirm_agree,
'organ_id' => $this->organ_id,
'organ_code' => $this->organ_code,
'is_reject' => $this->is_reject,
'is_reject_list' => $this->is_reject_list,
]);
$query->andFilterWhere(['like', 'report_type', $this->report_type])
->andFilterWhere(['like', 'id_case', $this->id_case])
->andFilterWhere(['like', 'gross_description', $this->gross_description])
->andFilterWhere(['like', 'microscopic_description', $this->microscopic_description])
->andFilterWhere(['like', 'microscopic_img', $this->microscopic_img])
->andFilterWhere(['like', 'microscopic_img_caption', $this->microscopic_img_caption])
->andFilterWhere(['like', 'diagnosis', $this->diagnosis])
->andFilterWhere(['like', 'rev', $this->rev])
->andFilterWhere(['like', 'rev_date', $this->rev_date])
->andFilterWhere(['like', 'reason', $this->reason])
->andFilterWhere(['like', 'diagnosis_comment', $this->diagnosis_comment])
->andFilterWhere(['like', 'review_remark', $this->review_remark])
->andFilterWhere(['like', 'outlab_report', $this->outlab_report])
->andFilterWhere(['like', 'consult_outlab_report', $this->consult_outlab_report])
->andFilterWhere(['like', 'ca_confirm_remark', $this->ca_confirm_remark])
->andFilterWhere(['like', 'suggesstion_ihc', $this->suggesstion_ihc])
->andFilterWhere(['like', 'suggesstion_special_stain', $this->suggesstion_special_stain])
->andFilterWhere(['like', 'suggesstion_other', $this->suggesstion_other])
->andFilterWhere(['like', 'organ_remark', $this->organ_remark]);
return $dataProvider;
}
}