2024-12-25 03:04:59 +00:00
< ? php
namespace frontend\modules\administrator\models ;
use yii\base\Model ;
use yii\data\ActiveDataProvider ;
use common\models\CaseNonGyn ;
use yii\db\Expression ;
/**
* CaseNonGynSearch represents the model behind the search form of `common\models\CaseNonGyn` .
*/
class CaseNonGynSearch extends CaseNonGyn
{
public $patient_name ;
/**
* { @ inheritdoc }
*/
public function rules ()
{
return [
[[ 'id' , 'patient_id' , 'hospital_id' , 'register_id' , 'title_id' , 'gender' , 'age' , 'specimen_type_id' , 'specimen_id' , 'no_slide' , 'no_slide_dry_smear' , 'is_stained' , 'is_restain' , 'is_pathologist_ot' , 'specimen_adequacy' , 'specimen_adequacy_1' , 'specimen_adequacy_2' , 'pathologist_id' , 'is_provisional' , 'is_consult' , 'is_qa' , 'is_conference' , 'is_critical_diagnosis' , 'status_id' , 'is_print' , 'is_histo_staining' , 'is_outlab' , /*'cytotech_id'*/ ], 'integer' ],
2026-02-16 07:32:27 +00:00
[[ 'id_case' , 'register_at' , 'patient_name' , 'race' , 'id_card' , 'birthdate' , 'age_unit' , 'h_n' , 'a_n' , 'right_to_treatment' , 'ward' , 'clinician' , 'collected_at' , 'collect_method' , 'organ_and_location' , 'side_of_specimen' , 'fluid_volume' , 'fluid_appearance' , 'fluid_colour' , 'clinical_diagnosis' , 'adequacy_other' , 'finding' , 'screener_diagnosis' , 'microscopic' , 'microscopic_img' , 'gross_description' , 'diagnosis' , 'additional_diagnosis' , 'additional_at' , 'suggestion' , 'conference_at' , 'report_at' , 'files' , 'file' , 'outlab_report' , 'his_ln' /*, 'cytotech_at'*/ ], 'safe' ],
2024-12-25 03:04:59 +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 = CaseNonGyn :: 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 ,
'register_id' => $this -> register_id ,
'register_at' => $this -> register_at ,
'title_id' => $this -> title_id ,
'gender' => $this -> gender ,
'birthdate' => $this -> birthdate ,
'age' => $this -> age ,
'collected_at' => $this -> collected_at ,
'specimen_type_id' => $this -> specimen_type_id ,
'specimen_id' => $this -> specimen_id ,
'no_slide' => $this -> no_slide ,
'no_slide_dry_smear' => $this -> no_slide_dry_smear ,
'is_stained' => $this -> is_stained ,
'is_restain' => $this -> is_restain ,
'is_pathologist_ot' => $this -> is_pathologist_ot ,
'specimen_adequacy' => $this -> specimen_adequacy ,
'specimen_adequacy_1' => $this -> specimen_adequacy_1 ,
'specimen_adequacy_2' => $this -> specimen_adequacy_2 ,
'additional_at' => $this -> additional_at ,
'pathologist_id' => $this -> pathologist_id ,
'is_provisional' => $this -> is_provisional ,
'is_consult' => $this -> is_consult ,
'is_qa' => $this -> is_qa ,
'is_conference' => $this -> is_conference ,
'conference_at' => $this -> conference_at ,
'is_critical_diagnosis' => $this -> is_critical_diagnosis ,
//'status_id' => $this->status_id,
'report_at' => $this -> report_at ,
'is_print' => $this -> is_print ,
'is_histo_staining' => $this -> is_histo_staining ,
'is_outlab' => $this -> is_outlab ,
//'cytotech_id' => $this->cytotech_id,
//'cytotech_at' => $this->cytotech_at,
]);
$query -> andFilterWhere ([ 'like' , 'id_case' , $this -> id_case ])
-> andFilterWhere ([ 'like' , new Expression ( '(CAST(case_non_gyn.given_name as nvarchar) + \' \' + CAST(case_non_gyn.surname as nvarchar))' ), $this -> patient_name ])
-> andFilterWhere ([ 'like' , 'race' , $this -> race ])
2026-02-16 07:32:27 +00:00
-> andFilterWhere ([ 'like' , 'his_ln' , $this -> his_ln ])
2024-12-25 03:04:59 +00:00
-> 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' , $this -> ward ])
-> andFilterWhere ([ 'like' , 'status_id' , $this -> status_id ])
-> andFilterWhere ([ 'like' , 'clinician' , $this -> clinician ])
-> andFilterWhere ([ 'like' , 'collect_method' , $this -> collect_method ])
-> andFilterWhere ([ 'like' , 'organ_and_location' , $this -> organ_and_location ])
-> andFilterWhere ([ 'like' , 'side_of_specimen' , $this -> side_of_specimen ])
-> andFilterWhere ([ 'like' , 'fluid_volume' , $this -> fluid_volume ])
-> andFilterWhere ([ 'like' , 'fluid_appearance' , $this -> fluid_appearance ])
-> andFilterWhere ([ 'like' , 'fluid_colour' , $this -> fluid_colour ])
-> andFilterWhere ([ 'like' , 'clinical_diagnosis' , $this -> clinical_diagnosis ])
-> andFilterWhere ([ 'like' , 'adequacy_other' , $this -> adequacy_other ])
-> andFilterWhere ([ 'like' , 'finding' , $this -> finding ])
-> andFilterWhere ([ 'like' , 'screener_diagnosis' , $this -> screener_diagnosis ])
-> andFilterWhere ([ 'like' , 'microscopic' , $this -> microscopic ])
-> andFilterWhere ([ 'like' , 'microscopic_img' , $this -> microscopic_img ])
-> andFilterWhere ([ 'like' , 'gross_description' , $this -> gross_description ])
-> andFilterWhere ([ 'like' , 'diagnosis' , $this -> diagnosis ])
-> andFilterWhere ([ 'like' , 'additional_diagnosis' , $this -> additional_diagnosis ])
-> andFilterWhere ([ 'like' , 'suggestion' , $this -> suggestion ])
//->andFilterWhere(['like', 'hospital_ref', $this->hospital_ref])
-> andFilterWhere ([ 'like' , 'files' , $this -> files ])
-> andFilterWhere ([ 'like' , 'file' , $this -> file ])
-> andFilterWhere ([ 'like' , 'outlab_report' , $this -> outlab_report ]);
return $dataProvider ;
}
}