2025-10-24 09:23:53 +00:00
< ? php
namespace frontend\modules\administrator\models ;
2026-02-16 07:32:27 +00:00
2025-10-24 09:23:53 +00:00
use yii\base\Model ;
use yii\db\Expression ;
use common\models\CaseFrozen ;
use yii\data\ActiveDataProvider ;
/**
* CaseFrozenSearch represents the model behind the search form of `common\models\CaseFrozen` .
*/
class CaseFrozenSearch extends CaseFrozen
{
public $patient_name ;
/**
* { @ inheritdoc }
*/
public function rules ()
{
return [
[[ 'id' , 'patient_name' , 'hospital_id' , 'title_id' , 'gender' , 'age' , 'amount' , 'block_type_id' , 'gross_img_update_id' , 'gross_id' , 'gross_edit_by' , 'is_no_microscopic' , 'pathologist_id' , 'status_id' , 'is_immuno_staining' , 'is_histo_staining' , 'is_critical_diagnosis' , 'is_outlab' , 'is_consult' , 'is_pathologist_ot' , 'register_id' , 'table_no' , 'cut_id' , 'note_id' , 'write_block_id' , 'type_id' , 'charge_user_id' , 'edit_charge_user_id' , 'trainer_id' , 'bone' , 'is_kidney' ,], 'integer' ],
2026-02-16 07:32:27 +00:00
[[ 'id_case' , 'case_reference' , 'hos_ref' , 'patient_name' , 'nation' , 'id_card' , 'birthdate' , 'age_unit' , 'h_n' , 'a_n' , 'right_to_treatment' , 'ward' , 'collected_at' , 'specimen' , 'section_label' , 'gross_img' , 'gross_img_at' , 'clinical_diagnosis' , 'gross_description' , 'gross_at' , 'gross_edit_at' , 'microscopic_description' , 'diagnosis' , 'additional_diagnosis' , 'additional_at' , 'pathologist_at' , 'report_at' , 'microscopic_img' , 'files' , 'patho_remark' , 'outlab_report' , 'status_at' , 'clinician' , 'decal_block' , 'register_at' , 'cut_at' , 'cut_start' , 'cut_end' , 'note_at' , 'write_block_at' , 'type_at' , 'charge_at' , 'edit_charge_at' , 'bone_note' , 'decal_end_date' , 'his_ln' ], 'safe' ],
2025-10-24 09:23:53 +00:00
];
}
/**
* { @ 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 = CaseFrozen :: 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 ,
'patient_id' => $this -> patient_id ,
'hospital_id' => $this -> hospital_id ,
'title_id' => $this -> title_id ,
'gender' => $this -> gender ,
'birthdate' => $this -> birthdate ,
'age' => $this -> age ,
'collected_at' => $this -> collected_at ,
'amount' => $this -> amount ,
'block_type_id' => $this -> block_type_id ,
'gross_img_at' => $this -> gross_img_at ,
'gross_img_update_id' => $this -> gross_img_update_id ,
'gross_id' => $this -> gross_id ,
'gross_at' => $this -> gross_at ,
'gross_edit_by' => $this -> gross_edit_by ,
'gross_edit_at' => $this -> gross_edit_at ,
'is_no_microscopic' => $this -> is_no_microscopic ,
'additional_at' => $this -> additional_at ,
'pathologist_id' => $this -> pathologist_id ,
'pathologist_at' => $this -> pathologist_at ,
//'status_id' => $this->status_id,
'report_at' => $this -> report_at ,
'is_immuno_staining' => $this -> is_immuno_staining ,
'is_histo_staining' => $this -> is_histo_staining ,
'is_critical_diagnosis' => $this -> is_critical_diagnosis ,
'is_outlab' => $this -> is_outlab ,
'status_at' => $this -> status_at ,
'is_consult' => $this -> is_consult ,
'is_pathologist_ot' => $this -> is_pathologist_ot ,
'register_id' => $this -> register_id ,
'register_at' => $this -> register_at ,
'table_no' => $this -> table_no ,
'cut_id' => $this -> cut_id ,
'cut_at' => $this -> cut_at ,
'cut_start' => $this -> cut_start ,
'cut_end' => $this -> cut_end ,
'note_id' => $this -> note_id ,
'note_at' => $this -> note_at ,
'write_block_id' => $this -> write_block_id ,
'write_block_at' => $this -> write_block_at ,
'type_id' => $this -> type_id ,
'type_at' => $this -> type_at ,
'charge_user_id' => $this -> charge_user_id ,
'charge_at' => $this -> charge_at ,
'edit_charge_user_id' => $this -> edit_charge_user_id ,
'edit_charge_at' => $this -> edit_charge_at ,
'trainer_id' => $this -> trainer_id ,
'bone' => $this -> bone ,
'decal_end_date' => $this -> decal_end_date ,
'is_kidney' => $this -> is_kidney ,
]);
$query -> andFilterWhere ([ 'like' , 'id_case' , $this -> id_case ])
-> andFilterWhere ([ 'like' , 'case_reference' , $this -> case_reference ])
-> andFilterWhere ([ 'like' , 'hos_ref' , $this -> hos_ref ])
2026-02-16 07:32:27 +00:00
-> andFilterWhere ([ 'like' , 'his_ln' , $this -> his_ln ])
2025-10-24 09:23:53 +00:00
-> andFilterWhere ([ 'like' , new Expression ( '(CAST(case_frozen.given_name as nvarchar) + \' \' + CAST(case_frozen.surname as nvarchar))' ), $this -> patient_name ])
-> andFilterWhere ([ 'like' , 'nation' , $this -> nation ])
-> andFilterWhere ([ 'like' , 'id_card' , $this -> id_card ])
-> andFilterWhere ([ 'like' , 'age_unit' , $this -> age_unit ])
-> andFilterWhere ([ 'like' , 'h_n' , $this -> h_n ])
-> andFilterWhere ([ 'like' , 'a_n' , $this -> a_n ])
-> andFilterWhere ([ 'like' , 'right_to_treatment' , $this -> right_to_treatment ])
-> andFilterWhere ([ 'like' , 'ward_id' , $this -> ward_id ])
-> andFilterWhere ([ 'like' , 'status_id' , $this -> status_id ])
-> andFilterWhere ([ 'like' , 'specimen' , $this -> specimen ])
-> andFilterWhere ([ 'like' , 'section_label' , $this -> section_label ])
-> andFilterWhere ([ 'like' , 'gross_img' , $this -> gross_img ])
-> andFilterWhere ([ 'like' , 'clinical_diagnosis' , $this -> clinical_diagnosis ])
-> andFilterWhere ([ 'like' , 'gross_description' , $this -> gross_description ])
-> andFilterWhere ([ 'like' , 'microscopic_description' , $this -> microscopic_description ])
-> andFilterWhere ([ 'like' , 'diagnosis' , $this -> diagnosis ])
-> andFilterWhere ([ 'like' , 'additional_diagnosis' , $this -> additional_diagnosis ])
-> andFilterWhere ([ 'like' , 'microscopic_img' , $this -> microscopic_img ])
-> andFilterWhere ([ 'like' , 'files' , $this -> files ])
-> andFilterWhere ([ 'like' , 'patho_remark' , $this -> patho_remark ])
-> andFilterWhere ([ 'like' , 'outlab_report' , $this -> outlab_report ])
-> andFilterWhere ([ 'like' , 'clinician' , $this -> clinician ])
-> andFilterWhere ([ 'like' , 'decal_block' , $this -> decal_block ])
-> andFilterWhere ([ 'like' , 'bone_note' , $this -> bone_note ]);
return $dataProvider ;
}
}