fix register
commit
954ebf9be4
|
|
@ -3,6 +3,17 @@ return [
|
|||
'components' => [
|
||||
|
||||
'db' => [
|
||||
'class' => 'yii\db\Connection',
|
||||
'dsn' => 'mysql:host=localhost;dbname=surat_pathology',
|
||||
'username' => 'surat_pathology',
|
||||
'password' => 'Ss157344121165',
|
||||
'charset' => 'utf8',
|
||||
'enableSchemaCache' => false,
|
||||
'schemaCacheDuration' => 3600,
|
||||
'schemaCache' => 'cache',
|
||||
],
|
||||
|
||||
/*'db' => [
|
||||
'class' => 'yii\db\Connection',
|
||||
'dsn' => 'mysql:host=localhost;dbname=surat_pathology',
|
||||
'username' => 'root',
|
||||
|
|
@ -11,7 +22,7 @@ return [
|
|||
'enableSchemaCache' => false,
|
||||
'schemaCacheDuration' => 3600,
|
||||
'schemaCache' => 'cache',
|
||||
],
|
||||
],*/
|
||||
|
||||
'mailer' => [
|
||||
'class' => 'yii\swiftmailer\Mailer',
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use Imagick;
|
|||
use Imagine\Image\Box;
|
||||
use Yii;
|
||||
use common\components\PathologyActiveRecord;
|
||||
use frontend\modules\cyto\controllers\CytoSourceController;
|
||||
use yii\imagine\Image;
|
||||
use yii\web\UploadedFile;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
|
@ -127,11 +128,11 @@ class CaseNonGyn extends PathologyActiveRecord
|
|||
return [
|
||||
[['id_case', 'hospital_id', 'given_name'], 'required', 'on' => 'register'],
|
||||
[['pathologist_id'], 'required', 'on' => 'update'],
|
||||
[['autocomplete_patient', 'hos_ref', 'house', 'moo', 'soy', 'road', 'phone', 'email'], 'string'],
|
||||
[['autocomplete_patient', 'hos_ref', 'house', 'moo', 'soy', 'road', 'phone', 'email', 'color'], 'string'],
|
||||
[['id_case'], 'unique'],
|
||||
[['diagnosis'], 'required', 'on' => 'pathologist'],
|
||||
[['title_id', 'is_histo_staining', 'specimen_type_id', 'specimen_id', 'is_stained', 'register_id', 'is_restain', 'is_pathologist_ot', 'specimen_adequacy', 'specimen_adequacy_1', 'specimen_adequacy_2', 'pathologist_id', 'status_id', 'is_print', 'is_critical_diagnosis', 'is_outlab', 'is_consult_outlab', 'cytotech1_id', 'hospital_id', 'lab_order_number', 'is_no_microscopic', 'is_express', 'ward_id', 'rights_id', 'doctor_id', 'order_point_id', 'hospital_import_id', 'order_by_id'/*, 'smears_receive', 'smears_processed', 'is_effusion', 'is_non_gyn_direction', 'is_fna', 'is_fna_direction'*/, 'const_rights_id', 'specimen_img_update_id', 'tambon', 'amphur', 'province', 'postcode', 'marriage', 'occupation', 'religious', 'race', 'nation', 'citizenship', 'is_cell_block', 'is_molecular', 'is_conference', 'clinic_id'], 'integer'],
|
||||
[['id_case', 'given_name', 'surname', 'gender', 'id_card', 'age_unit', 'h_n', 'a_n', 'v_n', 'o_n', 'ward', 'clinician', 'collect_method', 'organ_and_location', 'side_of_specimen', 'fluid_volume', 'fluid_appearance', 'fluid_colour', 'fluid_description', 'clinical_diagnosis', 'clinical_diagnosis_his', 'adequacy_other', 'finding', 'screener_diagnosis', 'diagnosis', 'suggestion', 'cyto_side_of_specimen', 'additional_diagnosis', 'microscopic', 'gross_description', 'cytotech1_at', 'remark', 'non_gyn_specimen_other', 'cell_block_at'/*'fna_quantity', 'fna_slide', 'non_gyn_bal', 'non_gyn_other', 'fna_neck', 'fna_lymph_node', 'fna_salivary_gland', 'fna_other'*/, 'remark_consult_outlab', 'remark_report'], 'string'],
|
||||
[['title_id', 'is_histo_staining', 'specimen_type_id', 'specimen_id', 'is_stained', 'register_id', 'is_restain', 'is_pathologist_ot', 'specimen_adequacy', 'specimen_adequacy_1', 'specimen_adequacy_2', 'pathologist_id', 'status_id', 'is_print', 'is_critical_diagnosis', 'is_outlab', 'is_consult_outlab', 'cytotech1_id', 'hospital_id', 'lab_order_number', 'is_no_microscopic', 'is_express', 'ward_id', 'rights_id', 'doctor_id', 'order_point_id', 'hospital_import_id', 'order_by_id'/*, 'smears_receive', 'smears_processed', 'is_effusion', 'is_non_gyn_direction', 'is_fna', 'is_fna_direction'*/, 'const_rights_id', 'specimen_img_update_id', 'tambon', 'amphur', 'province', 'postcode', 'marriage', 'occupation', 'religious', 'race', 'nation', 'citizenship', 'is_cell_block', 'is_molecular', 'is_conference', 'clinic_id', 'volume', 'spin', 'smear', 'cell_block', 'method_cell_block', 'source_of_specimen_id', 'type_of_specimen_id', 'fixation_id'], 'integer'],
|
||||
[['id_case', 'given_name', 'surname', 'gender', 'id_card', 'age_unit', 'h_n', 'a_n', 'v_n', 'o_n', 'ward', 'clinician', 'collect_method', 'organ_and_location', 'side_of_specimen', 'fluid_volume', 'fluid_appearance', 'fluid_colour', 'fluid_description', 'clinical_diagnosis', 'clinical_diagnosis_his', 'adequacy_other', 'finding', 'screener_diagnosis', 'diagnosis', 'suggestion', 'cyto_side_of_specimen', 'additional_diagnosis', 'microscopic', 'gross_description', 'cytotech1_at', 'remark', 'non_gyn_specimen_other', 'cell_block_at'/*'fna_quantity', 'fna_slide', 'non_gyn_bal', 'non_gyn_other', 'fna_neck', 'fna_lymph_node', 'fna_salivary_gland', 'fna_other'*/, 'remark_consult_outlab', 'remark_report', 'method_cell_block_other'], 'string'],
|
||||
[['register_at', 'birthdate', 'collected_at', 'conference_at', 'report_at', 'patient_id', 'additional_at', 'receive_at', 'express_at'/*, 'non_gyn_type', 'fna_type'*/, 'express_day', 'specimen_img_at', 'slides'], 'safe'],
|
||||
[['age', 'no_slide', 'no_bottle', 'no_slide_dry_smear', 'is_provisional', 'is_consult', 'is_qa'], 'number'],
|
||||
[['his_ln', 'v_date', 'verify_date'], 'string', 'max' => 100],
|
||||
|
|
@ -308,6 +309,9 @@ class CaseNonGyn extends PathologyActiveRecord
|
|||
'religious' => 'ศาสนา',
|
||||
'race' => 'เชิ้อชาติ',
|
||||
'citizenship' => 'สัญชาติ',
|
||||
'source_of_specimen_id' => 'Source Of Specimen',
|
||||
'type_of_specimen_id' => 'Type Of Specimen',
|
||||
'fixation_id' => 'Fixation',
|
||||
'specimen_container_img' => 'Specimen Container'
|
||||
];
|
||||
}
|
||||
|
|
@ -324,6 +328,10 @@ class CaseNonGyn extends PathologyActiveRecord
|
|||
'conference_at' => 'วัน/เดือน/ปี ค.ศ. เช่น' . date('d/m/Y'),
|
||||
'no_slide' => 'กรอกเฉพาะตัวเลขเท่านั้น',
|
||||
'no_slide_dry_smear' => 'กรอกเฉพาะตัวเลขเท่านั้น',
|
||||
'volume' => 'ml.',
|
||||
'spin' => 'slides.',
|
||||
'smear' => 'slides.',
|
||||
'cell_block' => 'slides.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -380,6 +388,30 @@ class CaseNonGyn extends PathologyActiveRecord
|
|||
return $this->hasOne(CytoSpecimenType::class, ['id' => 'specimen_type_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getSourceSpecimen()
|
||||
{
|
||||
return $this->hasOne(CytoSourceOfSpecimen::class, ['id' => 'source_of_specimen_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getTypeSpecimen()
|
||||
{
|
||||
return $this->hasOne(CytoTypeOfSpecimen::class, ['id' => 'type_of_specimen_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getFixation()
|
||||
{
|
||||
return $this->hasOne(CytoFixation::class, ['id' => 'fixation_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
|
|
@ -1003,4 +1035,4 @@ class CaseNonGyn extends PathologyActiveRecord
|
|||
}
|
||||
return $img;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -147,11 +147,11 @@ class CaseSurgical extends PathologyActiveRecord
|
|||
return [
|
||||
[['id_case', 'hospital_id', 'given_name'], 'required'],
|
||||
[['id_case', 'hospital_id'], 'required', 'on' => 'register'],
|
||||
[['pathologist_id'], 'required', 'on' => 'update'],
|
||||
//[['pathologist_id'], 'required', 'on' => 'update'],
|
||||
//[['note_id', 'cut_id'], 'required', 'on' => 'gross'],
|
||||
[['id_case'], 'unique'],
|
||||
[['autocomplete_hospital', 'autocomplete_patient', 'autocomplete_ward', /*'frozen_id_case', 'cons_pathologist',*/ 'hos_ref' /*'case_reference'*/, 'house', 'moo', 'soy', 'road', 'phone', 'email', 'review_remark'], 'string'],
|
||||
[['patient_id', 'title_id', 'is_immuno_staining', 'is_histo_staining', 'register_id', 'amount', 'block_type_id', 'pathologist_id', 'is_consult', 'status_id', 'hospital_id', 'gross_id', /*'cons_pathologist_id', 'consultant_id', 'center_box_open_id',*/ 'is_critical_diagnosis', 'is_pathologist_ot', 'gross_img_update_id', 'is_no_microscopic', 'is_outlab', 'is_consult_outlab', 'charge_user_id', 'bone', 'is_kidney', 'note_id', 'cut_id', 'is_express', 'ward_id', 'rights_id', 'doctor_id', 'order_point_id', 'order_by_id', 'hospital_import_id', 'amount_in', 'const_rights_id', 'is_molecular', 'is_dish', 'is_frozen', 'is_necropsy', 'tambon', 'amphur', 'province', 'postcode', 'marriage', 'occupation', 'religious', 'race','nation', 'citizenship', 'is_flesh', 'bag', 'is_conference', 'is_smc', 'is_stat_smc', 'no_bottle', 'block_no', 'slide_no', 'clinic_id', 'is_ot', 'is_use_specimen'], 'integer'],
|
||||
[['patient_id', 'title_id', 'is_immuno_staining', 'is_histo_staining', 'register_id', 'amount', 'block_type_id', 'pathologist_id', 'is_consult', 'status_id', 'hospital_id', 'gross_id', /*'cons_pathologist_id', 'consultant_id', 'center_box_open_id',*/ 'is_critical_diagnosis', 'is_pathologist_ot', 'gross_img_update_id', 'is_no_microscopic', 'is_outlab', 'is_consult_outlab', 'charge_user_id', 'bone', 'is_kidney', 'note_id', 'cut_id', 'is_express', 'ward_id', 'rights_id', 'doctor_id', 'order_point_id', 'order_by_id', 'hospital_import_id', 'amount_in', 'const_rights_id', 'is_molecular', 'is_dish', 'is_frozen', 'is_necropsy', 'tambon', 'amphur', 'province', 'postcode', 'marriage', 'occupation', 'religious', 'race','nation', 'citizenship', 'is_flesh', 'bag', 'is_conference', 'is_smc', 'is_stat_smc', 'no_bottle', 'block_no', 'slide_no', 'clinic_id', 'is_ot', 'is_use_specimen', 'cancer_registry_id'], 'integer'],
|
||||
[['id_case', 'hos_ref', 'given_name', 'surname', 'gender','id_card', 'age_unit', 'h_n', 'a_n', 'ward', 'clinician', 'specimen', 'section_label', 'clinical_diagnosis', 'clinical_diagnosis_his', 'gross_description', 'microscopic_description', 'patho_remark', 'diagnosis', 'additional_diagnosis', /*'cons',*/ 'patho_remark', 'bone_note', 'lab_order_number', 'remark', 'remark_outlab', 'remark_consult_outlab', 'remark_report'], 'string'],
|
||||
[['his_ln', 'verify_date'], 'string', 'max' => 100],
|
||||
[['register_at', 'birthdate', 'collected_at', 'conference_at', 'report_at', 'id_case', 'gross_at', 'decal_end_date', 'items', 'slides', 'additional_at', 'status_at', 'cut_at', 'receive_at', 'express_at', 'finance_immuno', 'finance_histo', 'outlab_report', 'decal_block', 'finance_dish'], 'safe'],
|
||||
|
|
@ -289,6 +289,7 @@ class CaseSurgical extends PathologyActiveRecord
|
|||
'slide_no' => 'จำนวน Slide',
|
||||
'is_ot' => 'เนื้อนอกเวลา',
|
||||
'is_use_specimen' => 'Specimen',
|
||||
'cancer_registry_id' => 'Cancer Registry',
|
||||
'specimen_container_img' => 'Specimen Container'
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "cyto_source_of_specimen".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int|null $status
|
||||
* @property int|null $order_no
|
||||
*/
|
||||
class ConstCancerRegistry extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'cyto_source_of_specimen';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['name'], 'required'],
|
||||
[['name'], 'string', 'max' => 500],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'name' => 'Name',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "cyto_fixation".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $code
|
||||
* @property string $name
|
||||
* @property int|null $status
|
||||
*/
|
||||
class CytoFixation extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'cyto_fixation';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['name'], 'required'],
|
||||
[['name'], 'string', 'max' => 500],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'name' => 'Name',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@ class CytoNonGynDiagnosis extends PathologyActiveRecord
|
|||
[['report_type', 'id_case'], 'required'],
|
||||
[['report_type', 'id_case'], 'required', 'on' => 'consult'],
|
||||
//[['diagnosis'], 'required', 'on' => 'pathologist'],
|
||||
[['gross_description', 'comment', 'note', 'microscopic_description', 'diagnosis'], 'string'],
|
||||
[['gross_description', 'comment', 'note', 'microscopic_description', 'diagnosis', 'suggestion'], 'string'],
|
||||
[['pathologist_id', 'status_id', 'is_critical_diagnosis', 'reference_img_id', 'is_edit_patient_information', 'cyto_non_gyn_diagnosis_id', 'diagnosis_type', 'pathologist2_id', 'is_agree', 'is_m', 'diag_by', 'is_no_microscopic', 'cytotech1_id', 'is_first_cancer', 'is_conference', 'is_cell_block', 'is_review', 'is_co_pathologist', 'co_pathologist_id', 'specimen_adequacy_1'], 'integer'],
|
||||
[['pathologist_at', 'cytotech1_at', 'conference_at', 'icdos', 'cell_block_at', 'review_at'], 'safe'],
|
||||
[['reason', 'diagnosis_comment', 'review_remark'], 'string'],
|
||||
|
|
@ -119,6 +119,7 @@ class CytoNonGynDiagnosis extends PathologyActiveRecord
|
|||
'is_review' => 'Review Block/Slides',
|
||||
'review_remark' => 'Review Block/Slides Remark',
|
||||
'is_co_pathologist' => 'Co Pathologist?',
|
||||
'suggestion' => 'Suggestion',
|
||||
'co_pathologist_id' => 'Pathologist'
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "cyto_pap_diagnosis_log".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $id_case
|
||||
* @property string $report_type
|
||||
* @property int|null $specimen_adequacy
|
||||
* @property int|null $specimen_adequacy_1
|
||||
* @property int|null $specimen_adequacy_2
|
||||
* @property string|null $specimen_adequacy_3
|
||||
* @property string|null $adequacy_other
|
||||
* @property int|null $general_categorization
|
||||
* @property int|null $general_categorization_1
|
||||
* @property string|null $general_categorization_2
|
||||
* @property string|null $categorization_other
|
||||
* @property string|null $suggestion_list
|
||||
* @property string|null $suggestion
|
||||
* @property int $user_id
|
||||
* @property string|null $approve_at
|
||||
*/
|
||||
class CytoNonGynDiagnosisLog extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'cyto_non_gyn_diagnosis_log';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_case', 'report_type', 'user_id'], 'required'],
|
||||
[['id', 'specimen_adequacy', 'user_id'], 'integer'],
|
||||
[['gross_description', 'diagnosis', 'comment'], 'string'],
|
||||
[['approve_at'], 'safe'],
|
||||
[['id_case', 'report_type'], 'string', 'max' => 50],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'id_case' => 'Id Case',
|
||||
'report_type' => 'Report Type',
|
||||
'specimen_adequacy' => 'Specimen Adequacy',
|
||||
'gross_description' => 'Cytologic Findings',
|
||||
'diagnosis' => 'Cytologic Diagnosis',
|
||||
'comment' => 'Note',
|
||||
'user_id' => 'User ID',
|
||||
'approve_at' => 'Approve At',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
return $this->hasOne(User::class, ['id' => 'user_id']);
|
||||
}
|
||||
}
|
||||
|
|
@ -42,7 +42,7 @@ class CytoPapDiagnosisLog extends \yii\db\ActiveRecord
|
|||
return [
|
||||
[['id_case', 'report_type', 'user_id'], 'required'],
|
||||
[['id', 'specimen_adequacy', 'specimen_adequacy_1', 'specimen_adequacy_2', 'general_categorization', 'general_categorization_1', 'user_id'], 'integer'],
|
||||
[['specimen_adequacy_3', 'general_categorization_2', 'suggestion'], 'string'],
|
||||
[['specimen_adequacy_3', 'general_categorization_2', 'suggestion', 'specimen_adequacy_4'], 'string'],
|
||||
[['approve_at'], 'safe'],
|
||||
[['id_case', 'report_type'], 'string', 'max' => 50],
|
||||
[['adequacy_other', 'categorization_other', 'suggestion_list'], 'string', 'max' => 600],
|
||||
|
|
@ -60,8 +60,9 @@ class CytoPapDiagnosisLog extends \yii\db\ActiveRecord
|
|||
'report_type' => 'Report Type',
|
||||
'specimen_adequacy' => 'Specimen Adequacy',
|
||||
'specimen_adequacy_1' => 'Specimen Adequacy 1',
|
||||
'specimen_adequacy_2' => 'Specimen Adequacy 2',
|
||||
'specimen_adequacy_2' => 'Specimen Adequacy 5',
|
||||
'specimen_adequacy_3' => 'Specimen Adequacy 3',
|
||||
'specimen_adequacy_4' => 'Specimen Adequacy 2',
|
||||
'adequacy_other' => 'Adequacy Other',
|
||||
'general_categorization' => 'General Categorization',
|
||||
'general_categorization_1' => 'General Categorization 1',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "cyto_source_of_specimen".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $code
|
||||
* @property string $name
|
||||
* @property int|null $status
|
||||
*/
|
||||
class CytoSourceOfSpecimen extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'cyto_source_of_specimen';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['name'], 'required'],
|
||||
[['name'], 'string', 'max' => 500],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'name' => 'Name',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "cyto_type_of_specimen".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $code
|
||||
* @property string $name
|
||||
* @property int|null $status
|
||||
*/
|
||||
class CytoTypeOfSpecimen extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'cyto_type_of_specimen';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['name'], 'required'],
|
||||
[['name'], 'string', 'max' => 500],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'name' => 'Name',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use common\models\CytoPapDiagnosisLog;
|
||||
use common\models\CytoSpecimenAdequacy1;
|
||||
|
|
@ -14,133 +13,124 @@ $cytoPapDiagnosisLog = CytoPapDiagnosisLog::find()
|
|||
->where([
|
||||
'id_case' => $case_pap->id_case,
|
||||
])
|
||||
->all();
|
||||
->one(); // ใช้ one() เพื่อดึงรายการเดียว
|
||||
?>
|
||||
|
||||
<div class="card shadow my-5">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">All Report of <?= Html::encode($case_pap->id_case) ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<?php foreach ($cytoPapDiagnosisLog as $log) { ?>
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow">
|
||||
<div class="card-header" role="tab" id="headingPatho">
|
||||
<h4 class="card-title">
|
||||
|
||||
<?php if ($log->user->role === 'cyto') { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion" href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i data-feather="user-plus" style="width: 17px; margin-bottom: -5px"></i> นักเทคโนโลยีเซลล์วิทยา (Cytotechnologist)
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion" href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i data-feather="user-plus" style="width: 17px; margin-bottom: -5px"></i> พยาธิแพทย์ (Pathologist)
|
||||
</a>
|
||||
<?php } ?>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapsePatho" class="panel-collapse collapse show in" role="tabpanel" aria-labelledby="headingPatho">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<?= DetailView::widget([
|
||||
'model' => $log,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_1',
|
||||
'value' => function ($model) {
|
||||
$adequacies1 = CytoSpecimenAdequacy1::find()
|
||||
->where(['type' => 'pap'])
|
||||
->andWhere(['<>', 'id', 2])
|
||||
->all();
|
||||
|
||||
$adequacyMap1 = [];
|
||||
foreach ($adequacies1 as $adequacy1) {
|
||||
$adequacyMap1[$adequacy1->id] = '(' . $adequacy1->code . ') ' . $adequacy1->name;
|
||||
}
|
||||
|
||||
return isset($adequacyMap1[$model->specimen_adequacy_1]) ? $adequacyMap1[$model->specimen_adequacy_1] : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'general_categorization_1',
|
||||
'value' => function ($model) {
|
||||
$general1 = CytoGeneralCategorization1::find()
|
||||
->orderBy(['code' => SORT_ASC])->all();
|
||||
|
||||
$generalMap1 = [];
|
||||
foreach ($general1 as $categorization1) {
|
||||
$generalMap1[$categorization1->id] = '(' . $categorization1->code . ') ' . $categorization1->name;
|
||||
}
|
||||
|
||||
return isset($generalMap1[$model->general_categorization_1]) ? $generalMap1[$model->general_categorization_1] : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_2',
|
||||
'value' => function ($model) {
|
||||
$adequacies2 = CytoSpecimenAdequacy2::find()->orderBy(['code' => SORT_ASC])->all();
|
||||
|
||||
$adequacyMap2 = [];
|
||||
foreach ($adequacies2 as $adequacy2) {
|
||||
$adequacyMap2[$adequacy2->id] = '(' . $adequacy2->code . ') ' . $adequacy2->name;
|
||||
}
|
||||
|
||||
return isset($adequacyMap2[$model->specimen_adequacy_2]) ? $adequacyMap2[$model->specimen_adequacy_2] : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_3',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
$adequacies3 = CytoSpecimenAdequacy3::find()->where(['in', 'id', unserialize($model->specimen_adequacy_3)])->all();
|
||||
|
||||
$rt3 = '<ul>';
|
||||
foreach ($adequacies3 as $ad3) {
|
||||
$rt3 .= '<li>' . '(' . $ad3->code . ') ' . $ad3->name . '</li>';
|
||||
}
|
||||
$rt3 .= '</ul>';
|
||||
|
||||
return $rt3;
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'general_categorization_2',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
$general2 = CytoGeneralCategorization2::find()->where(['in', 'id', unserialize($model->general_categorization_2)])->all();
|
||||
|
||||
$rt3 = '<ul>';
|
||||
foreach ($general2 as $gc2) {
|
||||
$rt3 .= '<li>' . '(' . $gc2->code . ') ' . $gc2->name . '</li>';
|
||||
}
|
||||
$rt3 .= '</ul>';
|
||||
|
||||
return $rt3;
|
||||
}
|
||||
],
|
||||
'adequacy_other',
|
||||
'categorization_other',
|
||||
'is_no_comment',
|
||||
'suggestion',
|
||||
[
|
||||
'attribute' => 'user_id',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
return $model->user->report_name;
|
||||
}
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if ($cytoPapDiagnosisLog) { ?>
|
||||
<div class="col-md-6">
|
||||
<div class="card shadow">
|
||||
<div class="card-header" role="tab" id="headingPatho">
|
||||
<h5 class="card-title">
|
||||
<?php if ($cytoPapDiagnosisLog->user->role === 'cyto') { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion"
|
||||
href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i data-feather="user-plus" style="width: 17px; margin-bottom: -5px"></i>
|
||||
นักเทคโนโลยีเซลล์วิทยา (Cytotechnologist)
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion"
|
||||
href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i data-feather="user-plus" style="width: 17px; margin-bottom: -5px"></i> พยาธิแพทย์
|
||||
(Pathologist)
|
||||
</a>
|
||||
<?php } ?>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapsePatho" class="panel-collapse collapse show in" role="tabpanel" aria-labelledby="headingPatho">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<?= DetailView::widget([
|
||||
'model' => $cytoPapDiagnosisLog,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_1',
|
||||
'value' => function ($model) {
|
||||
$adequacies1 = CytoSpecimenAdequacy1::find()
|
||||
->where(['type' => 'pap'])
|
||||
->andWhere(['<>', 'id', 2])
|
||||
->all();
|
||||
|
||||
$adequacyMap1 = [];
|
||||
foreach ($adequacies1 as $adequacy1) {
|
||||
$adequacyMap1[$adequacy1->id] = '(' . $adequacy1->code . ') ' . $adequacy1->name;
|
||||
}
|
||||
|
||||
return isset($adequacyMap1[$model->specimen_adequacy_1]) ? $adequacyMap1[$model->specimen_adequacy_1] : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'general_categorization_1',
|
||||
'value' => function ($model) {
|
||||
$general1 = CytoGeneralCategorization1::find()
|
||||
->orderBy(['code' => SORT_ASC])->all();
|
||||
|
||||
$generalMap1 = [];
|
||||
foreach ($general1 as $categorization1) {
|
||||
$generalMap1[$categorization1->id] = '(' . $categorization1->code . ') ' . $categorization1->name;
|
||||
}
|
||||
|
||||
return isset($generalMap1[$model->general_categorization_1]) ? $generalMap1[$model->general_categorization_1] : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_2',
|
||||
'value' => function ($model) {
|
||||
$adequacies2 = CytoSpecimenAdequacy2::find()->orderBy(['code' => SORT_ASC])->all();
|
||||
|
||||
$adequacyMap2 = [];
|
||||
foreach ($adequacies2 as $adequacy2) {
|
||||
$adequacyMap2[$adequacy2->id] = '(' . $adequacy2->code . ') ' . $adequacy2->name;
|
||||
}
|
||||
|
||||
return isset($adequacyMap2[$model->specimen_adequacy_2]) ? $adequacyMap2[$model->specimen_adequacy_2] : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_3',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
$adequacies3 = CytoSpecimenAdequacy3::find()->where(['in', 'id', unserialize($model->specimen_adequacy_3)])->all();
|
||||
|
||||
$rt3 = '<ul>';
|
||||
foreach ($adequacies3 as $ad3) {
|
||||
$rt3 .= '<li>' . '(' . $ad3->code . ') ' . $ad3->name . '</li>';
|
||||
}
|
||||
$rt3 .= '</ul>';
|
||||
|
||||
return $rt3;
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'general_categorization_2',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
$general2 = CytoGeneralCategorization2::find()->where(['in', 'id', unserialize($model->general_categorization_2)])->all();
|
||||
|
||||
$rt3 = '<ul>';
|
||||
foreach ($general2 as $gc2) {
|
||||
$rt3 .= '<li>' . '(' . $gc2->code . ') ' . $gc2->name . '</li>';
|
||||
}
|
||||
$rt3 .= '</ul>';
|
||||
|
||||
return $rt3;
|
||||
}
|
||||
],
|
||||
'adequacy_other',
|
||||
'categorization_other',
|
||||
'is_no_comment',
|
||||
'suggestion',
|
||||
[
|
||||
'attribute' => 'user_id',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
return $model->user->report_name;
|
||||
}
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
@ -10,9 +10,11 @@ use common\models\CasePap;
|
|||
use common\models\Patient;
|
||||
use common\models\CaseNonGyn;
|
||||
use common\models\CytoNonGynDiagnosis;
|
||||
use common\models\CytoNonGynDiagnosisLog;
|
||||
use common\models\IdCaseForm;
|
||||
use common\models\CytoOperate;
|
||||
use common\models\CytoPapDiagnosis;
|
||||
use common\models\CytoSpecimen;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use common\models\HistoStaining;
|
||||
use common\models\PathologistTransfer;
|
||||
|
|
@ -767,8 +769,6 @@ class NonGynController extends \yii\web\Controller
|
|||
//ระบุ Cytotech
|
||||
$model->cytotech1_id = Yii::$app->user->getId();
|
||||
|
||||
//$patient = Patient::findOne($case_non_gyn->patient_id);
|
||||
|
||||
if (
|
||||
$model->load(Yii::$app->request->post())
|
||||
&& $case_non_gyn->load(Yii::$app->request->post())
|
||||
|
|
@ -804,6 +804,19 @@ class NonGynController extends \yii\web\Controller
|
|||
|
||||
if ($case_non_gyn->save() && $model->save()) {
|
||||
|
||||
$log = new CytoNonGynDiagnosisLog([
|
||||
'id_case' => $model->id_case,
|
||||
'user_id' => Yii::$app->user->getId(),
|
||||
'report_type' => $model->report_type,
|
||||
'specimen_adequacy' => $model->specimen_adequacy_1,
|
||||
'gross_description' => $model->gross_description,
|
||||
'diagnosis' => $model->diagnosis,
|
||||
'comment' => $model->comment,
|
||||
'approve_at' => date('Y-m-d H:i:s'),
|
||||
]);
|
||||
if ($log->save()) {
|
||||
}
|
||||
|
||||
|
||||
Yii::$app->session->setFlash('success', 'บันทึกข้อมูลและส่งให้พยาธิแพทย์ เรียบร้อยแล้ว');
|
||||
return $this->redirect(['/cyto/non-gyn/non-gyn-new']);
|
||||
|
|
@ -1334,4 +1347,4 @@ class NonGynController extends \yii\web\Controller
|
|||
]);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
@ -552,6 +552,27 @@ class PapController extends \yii\web\Controller
|
|||
|
||||
if ($case_pap->save() && $model->save()) {
|
||||
|
||||
$log = new CytoPapDiagnosisLog([
|
||||
'id_case' => $model->id_case,
|
||||
'user_id' => Yii::$app->user->getId(),
|
||||
'report_type' => $model->report_type,
|
||||
'specimen_adequacy' => $model->specimen_adequacy,
|
||||
'specimen_adequacy_1' => $model->specimen_adequacy_1,
|
||||
'specimen_adequacy_2' => $model->specimen_adequacy_2,
|
||||
'specimen_adequacy_3' => $model->specimen_adequacy_3,
|
||||
'specimen_adequacy_4' => $model->specimen_adequacy_4,
|
||||
'adequacy_other' => $model->adequacy_other,
|
||||
'general_categorization' => $model->general_categorization,
|
||||
'general_categorization_1' => $model->general_categorization_1,
|
||||
'general_categorization_2' => $model->general_categorization_2,
|
||||
'categorization_other' => $model->categorization_other,
|
||||
'suggestion_list' => $model->suggestion_list,
|
||||
'suggestion' => $model->suggestion,
|
||||
'approve_at' => date('Y-m-d H:i:s'),
|
||||
]);
|
||||
if ($log->save()) {
|
||||
}
|
||||
|
||||
Yii::$app->session->setFlash('success', 'บันทึกข้อมูลและส่งให้พยาธิแพทย์ เรียบร้อยแล้ว');
|
||||
return $this->redirect(['/cyto/pap/pap-new']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,35 +215,38 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'volume'); ?>
|
||||
<?= $form->field($case_non_gyn, 'volume'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'color'); ?>
|
||||
<?= $form->field($case_non_gyn, 'color'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'spin'); ?>
|
||||
<?= $form->field($case_non_gyn, 'spin'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'smear'); ?>
|
||||
<?= $form->field($case_non_gyn, 'smear'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'cell_block'); ?>
|
||||
<?= $form->field($case_non_gyn, 'cell_block'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'method_cell_block')->dropDownList(
|
||||
<?= $form->field($case_non_gyn, 'method_cell_block')->dropDownList(
|
||||
[1 => 'Fibrin', 2 => 'Gel Foam', 3 => 'Alcohol', 4 => 'Formalin', 5 => 'Other'],
|
||||
['prompt' => 'เลือก Method Cell Block...']
|
||||
) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($case_non_gyn, 'method_cell_block_other')->textarea() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
<i class="ri-file-text-line"></i> Clinical Diagnosis
|
||||
</h5>
|
||||
<h5><i class="ri-file-text-line"></i></span> Report</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php if (!empty($case_non_gyn->files)) { ?>
|
||||
|
|
@ -263,45 +266,11 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
} ?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<h6 class="mt-4"><strong> Clinical Diagnosis</strong></h6>
|
||||
|
||||
<?= $form->field($case_non_gyn, 'clinical_diagnosis')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
'removePlugins' => 'scayt',
|
||||
'disableNativeSpellChecker' => false,
|
||||
'extraPlugins' => 'font',
|
||||
'extraPlugins' => 'font,justify,colorbutton,iframe,dialogadvtab,liststyle',
|
||||
'removeButtons' => 'Source,Save,NewPage,Preview,Print,Templates,Find,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,PageBreak,Iframe,Styles,Format,Font,FontSize,ShowBlocks,About,Replace,Snippet',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'indent', 'align', 'bidi', 'paragraph']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection']],
|
||||
['name' => 'insert', 'groups' => ['table']],
|
||||
['name' => 'tools', 'groups' => ['maximize']],
|
||||
//['name' => 'styles', 'groups' => ['font']],
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<h5><i class="ri-file-text-line"></i></span> Final Report</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-sm-6"><?= $form->field($model, 'specimen_adequacy_1')->dropDownList(ArrayHelper::map(CytoSpecimenAdequacy1::find()->where(['type' => 'non_gyn'])->all(), 'id', function ($model) {
|
||||
return /*'(' . $model->code . ') ' .*/ $model->name;
|
||||
})); ?>
|
||||
</div>
|
||||
<h6><strong> Diagnosis</strong></h6>
|
||||
<h6><strong>Cytologic Diagnosis</strong></h6>
|
||||
|
||||
<?= $form->field($model, 'diagnosis')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
|
|
|
|||
|
|
@ -156,11 +156,11 @@ class HeController extends Controller
|
|||
Yii::$app->session->setFlash('error', 'มีข้อผิดพลาดในการกรอกข้อมูล');
|
||||
return $this->redirect(['section']);
|
||||
}
|
||||
var_dump($model->id_case_block);
|
||||
var_dump($model->id_case_slide);
|
||||
//var_dump($model->id_case_block);
|
||||
//var_dump($model->id_case_slide);
|
||||
|
||||
|
||||
die();
|
||||
//die();
|
||||
if ($model->id_case_block != $model->id_case_slide) {
|
||||
Yii::$app->session->setFlash('error', 'กรุณาระบุ Block และ Slide ให้ตรงกัน');
|
||||
return $this->redirect(['section']);
|
||||
|
|
@ -684,4 +684,4 @@ class HeController extends Controller
|
|||
$session->remove('he-staining-case');
|
||||
return $this->redirect(['staining']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
use common\models\CytoNonGynDiagnosisLog;
|
||||
use common\models\CytoSpecimenAdequacy1;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
|
||||
$cytoNonGynDiagnosisLog = CytoNonGynDiagnosisLog::find()
|
||||
->where([
|
||||
'id_case' => $case_pap->id_case,
|
||||
])
|
||||
->one(); // ใช้ one() เพื่อดึงรายการเดียว
|
||||
?>
|
||||
|
||||
<?php if ($cytoNonGynDiagnosisLog) { ?>
|
||||
<div class="col-md-12 mt-3">
|
||||
<div class="card shadow">
|
||||
<div class="card-header" role="tab" id="headingPatho">
|
||||
<h5 class="card-title">
|
||||
<?php if ($cytoNonGynDiagnosisLog->user->role === 'cyto') { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion"
|
||||
href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i class="ri-file-user-line"></i>
|
||||
ผลนักเทคโนโลยีเซลล์วิทยา (Cytotechnologist)
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion"
|
||||
href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i class="ri-file-user-line"></i> พยาธิแพทย์
|
||||
(Pathologist)
|
||||
</a>
|
||||
<?php } ?>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapsePatho" class="panel-collapse collapse show in" role="tabpanel" aria-labelledby="headingPatho">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<?= DetailView::widget([
|
||||
'model' => $cytoNonGynDiagnosisLog,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'specimen_adequacy',
|
||||
'value' => function ($model) {
|
||||
$adequacies1 = CytoSpecimenAdequacy1::find()
|
||||
->where(['type' => 'non_gyn'])
|
||||
->andWhere(['<>', 'id', 2])
|
||||
->all();
|
||||
|
||||
$adequacyMap1 = [];
|
||||
foreach ($adequacies1 as $adequacy1) {
|
||||
$adequacyMap1[$adequacy1->id] = $adequacy1->name;
|
||||
}
|
||||
|
||||
return isset($adequacyMap1[$model->specimen_adequacy]) ? $adequacyMap1[$model->specimen_adequacy] : '';
|
||||
}
|
||||
],
|
||||
'gross_description:html',
|
||||
'diagnosis:html',
|
||||
'comment:html',
|
||||
[
|
||||
'attribute' => 'user_id',
|
||||
'label' => 'Cytotech',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
return $model->user->report_name;
|
||||
}
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
|
||||
|
||||
use yii\widgets\DetailView;
|
||||
use common\models\CytoPapDiagnosisLog;
|
||||
use common\models\CytoSpecimenAdequacy1;
|
||||
use common\models\CytoSpecimenAdequacy2;
|
||||
use common\models\CytoSpecimenAdequacy3;
|
||||
use common\models\CytoGeneralCategorization1;
|
||||
use common\models\CytoGeneralCategorization2;
|
||||
|
||||
$cytoPapDiagnosisLog = CytoPapDiagnosisLog::find()
|
||||
->where([
|
||||
'id_case' => $case_pap->id_case,
|
||||
])
|
||||
->one(); // ใช้ one() เพื่อดึงรายการเดียว
|
||||
?>
|
||||
|
||||
<?php if ($cytoPapDiagnosisLog) { ?>
|
||||
<div class="col-md-12">
|
||||
<div class="card shadow">
|
||||
<div class="card-header" role="tab" id="headingPatho">
|
||||
<h5 class="card-title">
|
||||
<?php if ($cytoPapDiagnosisLog->user->role === 'cyto') { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion"
|
||||
href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i class="ri-file-user-line"></i>
|
||||
ผลนักเทคโนโลยีเซลล์วิทยา (Cytotechnologist)
|
||||
</a>
|
||||
<?php } else { ?>
|
||||
<a class="collapsed" role="button" data-bs-toggle="collapse" data-parent="#accordion"
|
||||
href="#collapsePatho" aria-expanded="true" aria-controls="collapsePatho">
|
||||
<i class="ri-file-user-line"></i> พยาธิแพทย์
|
||||
(Pathologist)
|
||||
</a>
|
||||
<?php } ?>
|
||||
</h5>
|
||||
</div>
|
||||
<div id="collapsePatho" class="panel-collapse collapse show in" role="tabpanel" aria-labelledby="headingPatho">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<?= DetailView::widget([
|
||||
'model' => $cytoPapDiagnosisLog,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_1',
|
||||
'value' => function ($model) {
|
||||
$adequacies1 = CytoSpecimenAdequacy1::find()
|
||||
->where(['type' => 'pap'])
|
||||
->andWhere(['<>', 'id', 2])
|
||||
->all();
|
||||
|
||||
$adequacyMap1 = [];
|
||||
foreach ($adequacies1 as $adequacy1) {
|
||||
$adequacyMap1[$adequacy1->id] = $adequacy1->name;
|
||||
}
|
||||
|
||||
return isset($adequacyMap1[$model->specimen_adequacy_1]) ? $adequacyMap1[$model->specimen_adequacy_1] : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'general_categorization_1',
|
||||
'value' => function ($model) {
|
||||
$general1 = CytoGeneralCategorization1::find()
|
||||
->orderBy(['code' => SORT_ASC])->all();
|
||||
|
||||
$generalMap1 = [];
|
||||
foreach ($general1 as $categorization1) {
|
||||
$generalMap1[$categorization1->id] = $categorization1->name;
|
||||
}
|
||||
|
||||
return isset($generalMap1[$model->general_categorization_1]) ? $generalMap1[$model->general_categorization_1] : '';
|
||||
}
|
||||
],
|
||||
/*[
|
||||
'attribute' => 'specimen_adequacy_4',
|
||||
'value' => function ($model) {
|
||||
$adequacies2 = CytoSpecimenAdequacy2::find()->orderBy(['code' => SORT_ASC])->all();
|
||||
|
||||
$adequacyMap2 = [];
|
||||
foreach ($adequacies2 as $adequacy2) {
|
||||
$adequacyMap2[$adequacy2->id] = $adequacy2->name;
|
||||
}
|
||||
|
||||
return isset($adequacyMap2[$model->specimen_adequacy_4]) ? $adequacyMap2[$model->specimen_adequacy_4] : '';
|
||||
}
|
||||
],*/
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_4',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
$adequacies3 = CytoSpecimenAdequacy2::find()->where(['in', 'id', unserialize($model->specimen_adequacy_4)])->all();
|
||||
|
||||
$rt3 = '<ul>';
|
||||
foreach ($adequacies3 as $ad3) {
|
||||
$rt3 .= '<li>' . $ad3->name . '</li>';
|
||||
}
|
||||
$rt3 .= '</ul>';
|
||||
|
||||
return $rt3;
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'specimen_adequacy_3',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
$adequacies3 = CytoSpecimenAdequacy3::find()->where(['in', 'id', unserialize($model->specimen_adequacy_3)])->all();
|
||||
|
||||
$rt3 = '<ul>';
|
||||
foreach ($adequacies3 as $ad3) {
|
||||
$rt3 .= '<li>' . $ad3->name . '</li>';
|
||||
}
|
||||
$rt3 .= '</ul>';
|
||||
|
||||
return $rt3;
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'general_categorization_2',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
$general2 = CytoGeneralCategorization2::find()->where(['in', 'id', unserialize($model->general_categorization_2)])->all();
|
||||
|
||||
$rt3 = '<ul>';
|
||||
foreach ($general2 as $gc2) {
|
||||
$rt3 .= '<li>' . $gc2->name . '</li>';
|
||||
}
|
||||
$rt3 .= '</ul>';
|
||||
|
||||
return $rt3;
|
||||
}
|
||||
],
|
||||
'adequacy_other',
|
||||
'categorization_other',
|
||||
'is_no_comment',
|
||||
'suggestion',
|
||||
[
|
||||
'attribute' => 'user_id',
|
||||
'label' => 'Cytotech',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
return $model->user->report_name;
|
||||
}
|
||||
],
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
|
@ -42,6 +42,46 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
|
||||
<?= $form->errorSummary($case_non_gyn) ?>
|
||||
|
||||
<?= $this->render('_cyto_non_gyn_screener', ['case_pap' => $case_non_gyn]) ?>
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
<i class="ri-file-text-line"></i> Gross Description
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($case_non_gyn, 'volume'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($case_non_gyn, 'color'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($case_non_gyn, 'spin'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($case_non_gyn, 'smear'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($case_non_gyn, 'cell_block'); ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($case_non_gyn, 'method_cell_block')->dropDownList(
|
||||
[1 => 'Fibrin', 2 => 'Gel Foam', 3 => 'Alcohol', 4 => 'Formalin', 5 => 'Other'],
|
||||
['prompt' => 'เลือก Method Cell Block...']
|
||||
) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($case_non_gyn, 'method_cell_block_other')->textarea() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
|
|
@ -69,35 +109,8 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
</ul>
|
||||
<?php } ?>
|
||||
|
||||
<h6 class="mt-4"><strong> Specimen And Clinical Information</strong>
|
||||
</h6>
|
||||
|
||||
<?= $form->field($case_non_gyn, 'clinical_diagnosis')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 150,
|
||||
'removePlugins' => 'scayt',
|
||||
'disableNativeSpellChecker' => false,
|
||||
'extraPlugins' => 'font,justify,colorbutton,iframe,dialogadvtab,liststyle',
|
||||
'removeButtons' => 'Source,Save,NewPage,Preview,Print,Templates,Find,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,PageBreak,Iframe,ShowBlocks,About,Replace,Snippet',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste', 'clipboard']],
|
||||
['name' => 'styles', 'groups' => ['font']],
|
||||
['name' => 'colors', 'groups' => ['TextColor', 'BGColor']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align', 'bidi', 'paragraph']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', /*'spellchecker'*/]],
|
||||
//['name' => 'tools', 'groups' => ['dialogadvtab', 'devtools', 'div']],
|
||||
['name' => 'insert', 'groups' => ['table', 'specialchar']],
|
||||
//['name' => 'tools', 'groups' => ['maximize']],
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
|
||||
<h6 class="mt-4"><strong> Comment/Note</strong>
|
||||
</h6>
|
||||
|
||||
<?= $form->field($model, 'comment')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
<h6 class="mt-4"><strong> Diagnosis</strong></h6>
|
||||
<?= $form->field($model, 'diagnosis')->label(false)->inline()->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
|
|
@ -118,9 +131,32 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
],
|
||||
]
|
||||
]) ?>
|
||||
<?php $this->registerJs("
|
||||
$('#checkDiagButton').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var text = CKEDITOR.instances['cytonongyndiagnosis-diagnosis'].getData();
|
||||
|
||||
$.ajax({
|
||||
url: '" . Url::to(['/site/spell-checker']) . "',
|
||||
type: 'POST',
|
||||
data: { text: text },
|
||||
//dataType: 'json',
|
||||
success: function(data) {
|
||||
//highlightMisspelledWords(data);
|
||||
$('#misspelledDiagWords').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
") ?>
|
||||
<div id="misspelledDiagWords"></div>
|
||||
<a href="javascript:void(0);" id="checkDiagButton" class="btn btn-warning">
|
||||
<i class="ri-list-check-3"></i> Check Spelling
|
||||
</a>
|
||||
<?= Html::button('<i class="ri-file-text-line"></i> Diagnosis Template', ['class' => 'btn btn-info activity-select-diagnosis-template', 'data' => ['bs-toggle' => 'modal', 'bs-target' => '#activity-modal-diagnosis']]) ?>
|
||||
|
||||
<h6 class="mt-4"><strong> Gross
|
||||
Description</strong></h6>
|
||||
|
||||
<h6 class="mt-4"><strong> Cytologic findings</strong></h6>
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'gross_description')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
|
|
@ -173,64 +209,39 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h5><i class="ri-file-text-line"></i> Final Report</h5>
|
||||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h6 class="mb-3"> Microscopic Description</h6>
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'is_no_microscopic')->checkbox() ?>
|
||||
<?= $form->field($model, 'microscopic_description')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::class, [
|
||||
'preset' => 'custom',
|
||||
//'options' => ['id' => 'microscopic_description_editor'],
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
'removePlugins' => 'scayt',
|
||||
'disableNativeSpellChecker' => false,
|
||||
'extraPlugins' => 'font,justify,colorbutton,iframe,dialogadvtab,liststyle',
|
||||
'removeButtons' => 'Source,Save,NewPage,Preview,Print,Templates,Find,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,PageBreak,Iframe,ShowBlocks,About,Replace,Snippet',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste', 'clipboard']],
|
||||
['name' => 'styles', 'groups' => ['font']],
|
||||
['name' => 'colors', 'groups' => ['TextColor', 'BGColor']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align', 'bidi', 'paragraph']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', /*'spellchecker'*/]],
|
||||
//['name' => 'tools', 'groups' => ['dialogadvtab', 'devtools', 'div']],
|
||||
['name' => 'insert', 'groups' => ['table', 'specialchar']],
|
||||
//['name' => 'tools', 'groups' => ['maximize']],
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
|
||||
<div id="misspelledMicroWords"></div>
|
||||
<div class="col-md-6">
|
||||
<?php $this->registerJs("
|
||||
$('#checkMicroButton').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var text = CKEDITOR.instances['cytonongyndiagnosis-microscopic_description'].getData();
|
||||
|
||||
$.ajax({
|
||||
url: '" . Url::to(['/site/spell-checker']) . "',
|
||||
type: 'POST',
|
||||
data: { text: text },
|
||||
//dataType: 'json',
|
||||
success: function(data) {
|
||||
//highlightMisspelledWords(data);
|
||||
$('#misspelledMicroWords').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
") ?>
|
||||
<a href="javascript:void(0);" id="checkMicroButton" class="btn btn-warning">
|
||||
<i class="ri-list-check-3"></i> Check Spelling
|
||||
</a>
|
||||
<?= Html::button('<i class="ri-file-text-line"></i> Microscopic Template', ['class' => 'btn btn-info activity-select-microscopic-template', 'data' => ['bs-toggle' => 'modal', 'bs-target' => '#activity-modal-microscopic']]) ?>
|
||||
<?= Html::submitButton('<i class="ri-image-add-fill"></i> เพิ่มรูปภาพ Micro', ['class' => 'btn btn-danger', 'value' => 'micro', 'name' => 'non-gyn']) ?>
|
||||
</div>
|
||||
<h6 class="mt-4"><strong> Diagnosis</strong></h6>
|
||||
<?= $form->field($model, 'diagnosis')->label(false)->inline()->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
<h6 class="mt-4"><strong> Comment/Note</strong>
|
||||
</h6>
|
||||
|
||||
<?= $form->field($model, 'comment')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
'removePlugins' => 'scayt',
|
||||
'disableNativeSpellChecker' => false,
|
||||
'extraPlugins' => 'font,justify,colorbutton,iframe,dialogadvtab,liststyle',
|
||||
'removeButtons' => 'Source,Save,NewPage,Preview,Print,Templates,Find,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,PageBreak,Iframe,ShowBlocks,About,Replace,Snippet',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste', 'clipboard']],
|
||||
['name' => 'styles', 'groups' => ['font']],
|
||||
['name' => 'colors', 'groups' => ['TextColor', 'BGColor']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align', 'bidi', 'paragraph']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', /*'spellchecker'*/]],
|
||||
//['name' => 'tools', 'groups' => ['dialogadvtab', 'devtools', 'div']],
|
||||
['name' => 'insert', 'groups' => ['table', 'specialchar']],
|
||||
//['name' => 'tools', 'groups' => ['maximize']],
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
|
||||
<h6 class="mt-4"><strong>Suggestion</strong>
|
||||
</h6>
|
||||
|
||||
<?= $form->field($model, 'suggestion')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
|
|
@ -251,29 +262,6 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
],
|
||||
]
|
||||
]) ?>
|
||||
<?php $this->registerJs("
|
||||
$('#checkDiagButton').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var text = CKEDITOR.instances['cytonongyndiagnosis-diagnosis'].getData();
|
||||
|
||||
$.ajax({
|
||||
url: '" . Url::to(['/site/spell-checker']) . "',
|
||||
type: 'POST',
|
||||
data: { text: text },
|
||||
//dataType: 'json',
|
||||
success: function(data) {
|
||||
//highlightMisspelledWords(data);
|
||||
$('#misspelledDiagWords').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
") ?>
|
||||
<div id="misspelledDiagWords"></div>
|
||||
<a href="javascript:void(0);" id="checkDiagButton" class="btn btn-warning">
|
||||
<i class="ri-list-check-3"></i> Check Spelling
|
||||
</a>
|
||||
<?= Html::button('<i class="ri-file-text-line"></i> Diagnosis Template', ['class' => 'btn btn-info activity-select-diagnosis-template', 'data' => ['bs-toggle' => 'modal', 'bs-target' => '#activity-modal-diagnosis']]) ?>
|
||||
|
||||
<div class="mt-4">
|
||||
<?= $this->render('_coder_non_gyn_form', [
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
|
||||
<?= $form->field($case_pap, 'id_case')->label(false)->hiddenInput() ?>
|
||||
|
||||
<div class="row">
|
||||
<?= $this->render('_cyto_screener', ['case_pap' => $case_pap]) ?>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-12">
|
||||
<div class="accordion" id="accordion" role="tablist" aria-multiselectable="true">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
|
||||
use common\models\ConstCancerRegistry;
|
||||
use common\models\SurgicalDiagnosis;
|
||||
use common\models\SurgicalImg;
|
||||
use common\models\User;
|
||||
|
|
@ -49,9 +49,6 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
'case_surgical' => $case_surgical
|
||||
]) */ ?>
|
||||
|
||||
<?php if (Yii::$app->user->identity->username == 'pathologist') { ?>
|
||||
<?= $this->render('_slide', ['case_surgical' => $case_surgical]) ?>
|
||||
<?php } ?>
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
|
|
@ -108,6 +105,16 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
<div style="width: 250px"><?= $case_surgical->getGrossImgs() ?></div><br />
|
||||
<?php } ?>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($case_surgical, 'cancer_registry_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(ConstCancerRegistry::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือก Cancer Registry...'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
|
||||
<h6 class="mb-3"><strong><i class="ri-align-justify"></i> Specimen And Clinical Information</strong></h6>
|
||||
|
||||
|
|
@ -133,6 +140,8 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
]
|
||||
]) ?>
|
||||
|
||||
|
||||
|
||||
<h6 class="mb-3"><strong><i class="ri-align-justify"></i> Gross Description</strong></h6>
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'gross_description')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::class, [
|
||||
|
|
|
|||
|
|
@ -323,6 +323,7 @@ $this->title = 'Pathologist Staining - สั่งย้อมพิเศษ (
|
|||
'allowEmptyList' => true,
|
||||
//'min' => 1,
|
||||
'addButtonPosition' => MultipleInput::POS_FOOTER,
|
||||
'addButtonOptions' => ['class' => 'btn btn-primary'],
|
||||
'attributeOptions' => [],
|
||||
'columns' => [
|
||||
[
|
||||
|
|
@ -401,7 +402,7 @@ $this->title = 'Pathologist Staining - สั่งย้อมพิเศษ (
|
|||
'required' => true,
|
||||
],
|
||||
'clientOptions' => [
|
||||
'source' => ConstServiceCharge::find()->select(['id as id', 'code as value', 'CONCAT(code, \' \', name) as label'])->where(['lab' => 'immuno'])->orderBy(['code' => SORT_ASC])->asArray()->all(),
|
||||
'source' => ConstServiceCharge::find()->select(['id as id', 'code as value', 'CONCAT(code, \' \', name) as label'])->where(['lab' => 'immuno'])/*->orderBy(['code' => SORT_ASC])*/->asArray()->all(),
|
||||
'change' => 'function(){$(this).init_immuno_charge();}',
|
||||
'select' => new JsExpression("function( event, ui ) {
|
||||
$(this).val(ui.item.id);
|
||||
|
|
@ -503,7 +504,7 @@ $this->title = 'Pathologist Staining - สั่งย้อมพิเศษ (
|
|||
|
||||
") ?>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
<?php /*
|
||||
if (substr($case->id_case, 0, 1) == 'C') { ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use yii\base\Exception;
|
|||
use common\models\CaseHpv;
|
||||
use common\models\CasePap;
|
||||
use common\models\Patient;
|
||||
use yii\httpclient\Client;
|
||||
use common\models\CaseDish;
|
||||
use common\models\CaseFish;
|
||||
use common\models\CaseFlow;
|
||||
|
|
@ -42,8 +43,7 @@ use common\models\MolecularDiagnosis;
|
|||
use common\models\CytoNonGynDiagnosis;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use common\models\ConstLookupAddressName;
|
||||
use frontend\modules\immuno\models\CaseExternalSearch;
|
||||
use yii\httpclient\Client;
|
||||
use frontend\modules\register\models\CaseExternalSearch;
|
||||
|
||||
class CaseController extends \yii\web\Controller
|
||||
|
||||
|
|
@ -3003,6 +3003,7 @@ class CaseController extends \yii\web\Controller
|
|||
return isset($subdistrict) ? $subdistrict->zipcode : '';
|
||||
}
|
||||
|
||||
|
||||
public function actionSearchPatient($hn)
|
||||
{
|
||||
Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
|
||||
|
|
|
|||
|
|
@ -2,42 +2,43 @@
|
|||
|
||||
namespace frontend\modules\register\controllers;
|
||||
|
||||
use common\models\AutopsyDiagnosis;
|
||||
use common\models\CaseAutopsy;
|
||||
use Yii;
|
||||
use yii\web\Response;
|
||||
use yii\base\Exception;
|
||||
use common\models\CaseHpv;
|
||||
use common\models\CasePap;
|
||||
use common\models\Patient;
|
||||
use common\models\CaseDish;
|
||||
use common\models\CaseFish;
|
||||
use common\models\CaseFrozen;
|
||||
use common\models\CaseFlow;
|
||||
use common\models\CaseHpv;
|
||||
use common\models\CaseMolecular;
|
||||
use common\models\CaseNecropsy;
|
||||
use common\models\CytoSpecimen;
|
||||
use Yii;
|
||||
use common\models\CaseSurgical;
|
||||
use common\models\HistoStaining;
|
||||
use common\models\ImmunoStaining;
|
||||
use common\models\Patient;
|
||||
use common\models\StainingTest;
|
||||
use yii\base\Exception;
|
||||
use yii\web\Response;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\CasePap;
|
||||
use common\models\CaseFrozen;
|
||||
use common\models\CaseNonGyn;
|
||||
use common\models\CaseAutopsy;
|
||||
use common\models\CaseExternal;
|
||||
use common\models\CaseNecropsy;
|
||||
use common\models\CaseSurgical;
|
||||
use common\models\CytoSpecimen;
|
||||
use common\models\StainingTest;
|
||||
use common\models\CaseMolecular;
|
||||
use common\models\ConstHospital;
|
||||
use common\models\ConstLookupAddressName;
|
||||
use common\models\ConstServiceCharge;
|
||||
use common\models\CytoNonGynContainer;
|
||||
use common\models\CytoNonGynDiagnosis;
|
||||
use common\models\CytoPapDiagnosis;
|
||||
use common\models\DishDiagnosis;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use common\models\FishDiagnosis;
|
||||
use common\models\FlowDiagnosis;
|
||||
use common\models\HistoStaining;
|
||||
use common\models\ImmunoStaining;
|
||||
use common\models\FrozenDiagnosis;
|
||||
use common\models\MolecularDiagnosis;
|
||||
use common\models\AutopsyDiagnosis;
|
||||
use common\models\CytoPapDiagnosis;
|
||||
use common\models\NecropsyDiagnosis;
|
||||
use common\models\SurgicalContainer;
|
||||
use common\models\SurgicalDiagnosis;
|
||||
use common\models\ConstServiceCharge;
|
||||
use common\models\MolecularDiagnosis;
|
||||
use common\models\CytoNonGynContainer;
|
||||
use common\models\CytoNonGynDiagnosis;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use common\models\ConstLookupAddressName;
|
||||
|
||||
/**
|
||||
* Class CaseUpdateController
|
||||
|
|
@ -102,6 +103,9 @@ class CaseUpdateController extends \yii\web\Controller
|
|||
if ($case_type == 'hpv') {
|
||||
return $this->redirect(['hpv', 'id_case' => $id_case]);
|
||||
}
|
||||
if ($case_type == 'external') {
|
||||
return $this->redirect(['external', 'id_case' => $id_case]);
|
||||
}
|
||||
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case นี้');
|
||||
return $this->redirect(['/register/center/case-all']);
|
||||
|
|
@ -116,7 +120,6 @@ class CaseUpdateController extends \yii\web\Controller
|
|||
*/
|
||||
|
||||
public function actionPap($id_case)
|
||||
|
||||
{
|
||||
$model = CasePap::findOne(['id_case' => $id_case]);
|
||||
|
||||
|
|
@ -1300,6 +1303,7 @@ class CaseUpdateController extends \yii\web\Controller
|
|||
|
||||
$cyto_non_gyn_container = new CytoNonGynContainer();
|
||||
$cyto_non_gyn_container->items = CytoNonGynContainer::find()->where(['id_case' => $model->id_case])->all();
|
||||
|
||||
$patient = Patient::findOne($model->patient_id);
|
||||
//$patient->race = 'ไทย';
|
||||
$model->scenario = 'update';
|
||||
|
|
@ -1412,7 +1416,7 @@ class CaseUpdateController extends \yii\web\Controller
|
|||
Yii::$app->session->setFlash('success', 'ลงทะเบียน NonGyn เรียบร้อยแล้ว');
|
||||
return $this->redirect(['/register/case-update/non-gyn', 'id_case' => $model->id_case]);
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
$transaction->rollBack();
|
||||
Yii::$app->session->setFlash('error', 'ไม่สามารถลงทะเบียน Case ได้');
|
||||
/*var_dump($model->getFirstErrors());
|
||||
|
|
@ -1453,7 +1457,7 @@ class CaseUpdateController extends \yii\web\Controller
|
|||
|
||||
$patient = $model->patient;
|
||||
|
||||
$model->scenario = 'update';
|
||||
//$model->scenario = 'update';
|
||||
|
||||
$request = Yii::$app->getRequest();
|
||||
|
||||
|
|
@ -1667,6 +1671,155 @@ class CaseUpdateController extends \yii\web\Controller
|
|||
echo 'success';
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/** */
|
||||
/*
|
||||
* Update Staining Case
|
||||
*/
|
||||
public function actionExternal($id_case)
|
||||
{
|
||||
$time_now = date('Y-m-d H:i:s');
|
||||
$model = CaseExternal::findOne(['id_case' => $id_case]);
|
||||
|
||||
if (!$model) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่มี Case นี้ในระบบ');
|
||||
return $this->redirect(['/site/index']);
|
||||
}
|
||||
|
||||
$model->autocomplete_patient = '-';
|
||||
$model->autocomplete_title = '-55';
|
||||
$patient = isset($model->patient) ? $model->patient : new Patient();
|
||||
|
||||
$request = Yii::$app->getRequest();
|
||||
if ($request->isPost && $request->post('ajax') !== null) {
|
||||
$model->load(Yii::$app->request->post());
|
||||
$patient->load(Yii::$app->request->post());
|
||||
Yii::$app->response->format = Response::FORMAT_JSON;
|
||||
$result = ActiveForm::validate($model, $patient);
|
||||
return $result;
|
||||
}
|
||||
if ($model->load(Yii::$app->request->post())) {
|
||||
$transaction = Yii::$app->db->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
|
||||
|
||||
if ($model->status == 1) {
|
||||
$model->status_id = 16; //ยกเลิกcase
|
||||
}
|
||||
if ($model->status == 0) {
|
||||
$model->status_id = 1; //ยกเลิก การยกเลิกcase
|
||||
}
|
||||
|
||||
|
||||
$valid = true;
|
||||
if ($model->is_histo_staining == 0 && $model->is_immuno_staining == 0) {
|
||||
$model->addError('is_histo_staining', 'กรุณาเลือกการย้อม');
|
||||
$model->addError('is_immuno_staining', 'กรุณาเลือกการย้อม');
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
//บันทึกผู้ป่วย
|
||||
if (intval($model->patient_id)) { // เลือกผู้ป่วยที่มีอยู่แล้ว
|
||||
$patient = Patient::findOne($model->patient_id);
|
||||
$patient->load(Yii::$app->request->post());
|
||||
$patient->save(false);
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
if ($model->autocomplete_patient == '-') {
|
||||
$model->patient_id = null;
|
||||
} else {
|
||||
$patient = new Patient();
|
||||
$patient->load(Yii::$app->request->post()); //เมื่อมีการใส่ชื่อค่อยโหลด
|
||||
$patient->title_id = $_POST['CaseExternal']['autocomplete_title'];
|
||||
$patient->name = $model->autocomplete_patient; // หากเพิ่มผู้ป่วยใหม่ให้กำหนดชื่อให้ patient แล้วบันทึก
|
||||
$patient->create_at = $time_now;
|
||||
if (empty($patient->age)) {
|
||||
$patient->age = 0;
|
||||
}
|
||||
|
||||
$patient->save(false);
|
||||
|
||||
$model->patient_id = $patient->id;
|
||||
}
|
||||
}
|
||||
if ($model->save()) {
|
||||
|
||||
if ($model->is_histo_staining == 1) { //ส่งย้อม Histo
|
||||
$staining = HistoStaining::findOne(['id_case' => $model->id_case]);
|
||||
if (!$staining) {
|
||||
$staining = new HistoStaining();
|
||||
$staining->id_case = $model->id_case;
|
||||
$staining->block_no = '';
|
||||
$staining->note = '';
|
||||
$staining->is_able = 0;
|
||||
$staining->is_routine = 0;
|
||||
$staining->status_1 = 1;
|
||||
$staining->in_at = $time_now;
|
||||
$staining->save();
|
||||
}
|
||||
} else {
|
||||
$histo = HistoStaining::findOne(['id_case' => $model->id_case]);
|
||||
if ($histo) {
|
||||
foreach (HistoStaining::find()->where(['id_case' => $model->id_case])->all() as $hs) {
|
||||
$hifi = FinanceServiceCharge::findOne(['from_id' => $hs->id, 'id_case' => $model->id_case]);
|
||||
if ($hifi) {
|
||||
$hifi->delete();
|
||||
}
|
||||
HistoStaining::findOne(['id_case' => $model->id_case, 'id' => $hs->id])->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($model->is_immuno_staining == 1) { //ส่งย้อม Immuno
|
||||
$staining = new ImmunoStaining();
|
||||
$staining->id_case = $model->id_case;
|
||||
$staining->block_no = '';
|
||||
$staining->note = '';
|
||||
$staining->status_1 = 1;
|
||||
$staining->is_able = 0;
|
||||
$staining->in_at = $time_now;
|
||||
$staining->save();
|
||||
} else {
|
||||
$immu = ImmunoStaining::findOne(['id_case' => $model->id_case]);
|
||||
if ($immu) {
|
||||
foreach (ImmunoStaining::find()->where(['id_case' => $model->id_case])->all() as $is) {
|
||||
$imfi = FinanceServiceCharge::findOne(['from_id' => $is->id, 'id_case' => $model->id_case]);
|
||||
if ($imfi) {
|
||||
$imfi->delete();
|
||||
}
|
||||
ImmunoStaining::findOne(['id_case' => $model->id_case, 'id' => $is->id])->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//หากเปลี่ยน รพ. ให้ update all finance_service_charge ให้เป็น รพ.ใหม่ทั้งหมด
|
||||
FinanceServiceCharge::updateAll(['hospital_id' => $model->hospital_id], 'id_case = \'' . $model->id_case . '\'');
|
||||
|
||||
$transaction->commit();
|
||||
|
||||
Yii::$app->session->setFlash('success', 'แก้ไขข้อมูลเรียบร้อยแล้ว');
|
||||
return $this->redirect(['/register/case-update/external', 'id_case' => $model->id_case]);
|
||||
} catch (Exception $e) {
|
||||
$transaction->rollBack();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('external', [
|
||||
'model' => $model,
|
||||
'patient' => $patient,
|
||||
]);
|
||||
}
|
||||
/** */
|
||||
|
||||
|
||||
|
||||
public function actionSurgicalContainerDelete()
|
||||
{
|
||||
Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\controllers;
|
||||
|
||||
use common\models\ConstCancerRegistry;
|
||||
use frontend\modules\register\models\ConstCancerRegistrySearch;
|
||||
use Yii;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* ConstCancerRegistryController implements the CRUD actions for ConstCancerRegistr model.
|
||||
*/
|
||||
class ConstCancerRegistryController extends Controller
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['POST'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all ConstCancerRegistr models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new ConstCancerRegistrySearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single CytoFixation model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new CytoFixation model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new ConstCancerRegistry();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing ConstCancerRegistry model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing ConstCancerRegistry model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the ConstCancerRegistry model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return ConstCancerRegistry the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = ConstCancerRegistry::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\controllers;
|
||||
|
||||
use common\models\CytoFixation;
|
||||
use frontend\modules\register\models\CytoFixationSearch;
|
||||
use Yii;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* CytoFixationController implements the CRUD actions for CytoFixation model.
|
||||
*/
|
||||
class CytoFixationController extends Controller
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['POST'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all CytoFixation models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new CytoFixationSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single CytoFixation model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new CytoFixation model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new CytoFixation();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing CytoFixation model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing CytoFixation model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the CytoFixation model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return CytoFixation the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = CytoFixation::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\controllers;
|
||||
|
||||
use common\models\CytoSourceOfSpecimen;
|
||||
use frontend\modules\register\models\CytoSourceOfSpecimenSearch;
|
||||
use Yii;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* CytoSourceOfSpecimenController implements the CRUD actions for CytoSourceOfSpecimen model.
|
||||
*/
|
||||
class CytoSourceOfSpecimenController extends Controller
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['POST'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all CytoSourceOfSpecimen models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new CytoSourceOfSpecimenSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single CytoSourceOfSpecimen model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new CytoSourceOfSpecimen model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new CytoSourceOfSpecimen();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing CytoSourceOfSpecimen model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing CytoSourceOfSpecimen model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the CytoSourceOfSpecimen model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return CytoSourceOfSpecimen the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = CytoSourceOfSpecimen::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\controllers;
|
||||
|
||||
use common\models\CytoTypeOfSpecimen;
|
||||
use frontend\modules\register\models\CytoTypeOfSpecimenSearch;
|
||||
use Yii;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
|
||||
/**
|
||||
* CytoTypeOfSpecimenController implements the CRUD actions for CytoTypeOfSpecimen model.
|
||||
*/
|
||||
class CytoTypeOfSpecimenController extends Controller
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['POST'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all CytoTypeOfSpecimen models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
$searchModel = new CytoTypeOfSpecimenSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a single CytoTypeOfSpecimen model.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionView($id)
|
||||
{
|
||||
return $this->render('view', [
|
||||
'model' => $this->findModel($id),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new CytoTypeOfSpecimen model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate()
|
||||
{
|
||||
$model = new CytoTypeOfSpecimen();
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('create', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing CytoTypeOfSpecimen model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id)
|
||||
{
|
||||
$model = $this->findModel($id);
|
||||
|
||||
if ($model->load(Yii::$app->request->post()) && $model->save()) {
|
||||
return $this->redirect(['view', 'id' => $model->id]);
|
||||
}
|
||||
|
||||
return $this->render('update', [
|
||||
'model' => $model,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing CytoTypeOfSpecimen model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id)
|
||||
{
|
||||
$this->findModel($id)->delete();
|
||||
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the CytoTypeOfSpecimen model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return CytoTypeOfSpecimen the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id)
|
||||
{
|
||||
if (($model = CytoTypeOfSpecimen::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
}
|
||||
}
|
||||
|
|
@ -193,7 +193,12 @@ class HospitalImportController extends Controller
|
|||
$const_charge = new ConstServiceCharge();
|
||||
$const_charge->code = $his_import->lab_code;
|
||||
$const_charge->name = $his_import->lab_name;
|
||||
$const_charge->save();
|
||||
if($const_charge->save()) {
|
||||
|
||||
} else {
|
||||
var_dump($const_charge->getFirstErrors());
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -205,7 +210,12 @@ class HospitalImportController extends Controller
|
|||
$his_import_service_charge->req_no = $his_import->req_no;
|
||||
$his_import_service_charge->test_code = $his_import->lab_code;
|
||||
$his_import_service_charge->test_name = $his_import->lab_name;
|
||||
$his_import_service_charge->save();
|
||||
//$his_import_service_charge->save();
|
||||
if ($his_import_service_charge->save()) {
|
||||
} else {
|
||||
var_dump($his_import_service_charge->getFirstErrors());
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
$case = PatientCase::findOne(['his_ln' => $his_import->req_no]);
|
||||
|
|
@ -218,7 +228,12 @@ class HospitalImportController extends Controller
|
|||
$his_finance_service_charge->req_no = $his_import->req_no;
|
||||
$his_finance_service_charge->charge_id = $const_charge->id;
|
||||
$his_finance_service_charge->is_cash = 0;
|
||||
$his_finance_service_charge->save();
|
||||
//$his_finance_service_charge->save();
|
||||
if ($his_finance_service_charge->save()) {
|
||||
} else {
|
||||
var_dump($his_finance_service_charge->getFirstErrors());
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\models;
|
||||
|
||||
use common\models\ConstCancerRegistry;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
|
||||
|
||||
/**
|
||||
* ConstCancerRegistrySearch represents the model behind the search form of `common\models\CytoSourceOfSpecimen`.
|
||||
*/
|
||||
class ConstCancerRegistrySearch extends ConstCancerRegistry
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['name'], '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 = ConstCancerRegistry::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,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'name', $this->name]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\models;
|
||||
|
||||
use common\models\CytoFixation;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
|
||||
|
||||
/**
|
||||
* CytoFixationSearch represents the model behind the search form of `common\models\CytoFixation`.
|
||||
*/
|
||||
class CytoFixationSearch extends CytoFixation
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['name'], '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 = CytoFixation::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,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'name', $this->name]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\models;
|
||||
|
||||
use common\models\CytoSourceOfSpecimen;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
|
||||
|
||||
/**
|
||||
* CytoSourceOfSpecimenSearch represents the model behind the search form of `common\models\CytoSourceOfSpecimen`.
|
||||
*/
|
||||
class CytoSourceOfSpecimenSearch extends CytoSourceOfSpecimen
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['name'], '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 = CytoSourceOfSpecimen::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,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'name', $this->name]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
namespace frontend\modules\register\models;
|
||||
|
||||
use common\models\CytoTypeOfSpecimen;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
|
||||
|
||||
/**
|
||||
* CytoTypeOfSpecimenSearch represents the model behind the search form of `common\models\CytoTypeOfSpecimen`.
|
||||
*/
|
||||
class CytoTypeOfSpecimenSearch extends CytoTypeOfSpecimen
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id'], 'integer'],
|
||||
[['name'], '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 = CytoTypeOfSpecimen::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,
|
||||
]);
|
||||
|
||||
$query->andFilterWhere(['like', 'name', $this->name]);
|
||||
|
||||
return $dataProvider;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
$this->title = 'Edit Case : ' . $model->id_case . '';
|
||||
?>
|
||||
|
||||
<?= $this->render('../case/_form_external', [
|
||||
'model' => $model,
|
||||
'patient' => $patient,
|
||||
]) ?>
|
||||
|
|
@ -5,11 +5,13 @@ use yii\helpers\Html;
|
|||
use yii\jui\AutoComplete;
|
||||
use yii\web\JsExpression;
|
||||
use kartik\select2\Select2;
|
||||
use common\models\ConstRace;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\widgets\MaskedInput;
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use common\models\PatientTitle;
|
||||
use common\models\ConstHospital;
|
||||
use common\models\ConstNationality;
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
|
|
@ -91,82 +93,20 @@ use common\models\ConstHospital;
|
|||
<?= $form->field($patient, 'title_id')->dropDownList(ArrayHelper::map(PatientTitle::find()->all(), 'id', 'name'), ['prompt' => 'เลือกคำนำหน้า']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?php if ($model->isNewRecord) { ?>
|
||||
|
||||
<?= $form->field($model, 'autocomplete_patient')->widget(
|
||||
AutoComplete::class,
|
||||
[
|
||||
//'value' => (!$model->isNewRecord ? $model->patient->name : ''),
|
||||
'options' => [
|
||||
'id' => 'autocomplete-patient',
|
||||
'class' => 'form-control',
|
||||
],
|
||||
'clientOptions' => [
|
||||
'autoFill' => true,
|
||||
'minLength' => 3,
|
||||
'source' => new JsExpression("
|
||||
function( request, response ) {
|
||||
|
||||
$.ajax({
|
||||
url: \"" . Url::to(['/register/case/get-patient-list']) . "\",
|
||||
type: 'post',
|
||||
dataType: \"json\",
|
||||
data: {
|
||||
search: request.term
|
||||
},
|
||||
success: function( data ) {
|
||||
response( data );
|
||||
}
|
||||
});
|
||||
}
|
||||
"),
|
||||
'select' => new JsExpression("
|
||||
function( event, ui ){
|
||||
|
||||
var patient_id = ui.item.id;
|
||||
//console.log($('#" . Html::getInputId($model, 'patient_id') . "').val());
|
||||
$.get(
|
||||
'" . Url::toRoute('/site/patient') . "',
|
||||
{
|
||||
patient_id: patient_id,
|
||||
},
|
||||
function (data)
|
||||
{
|
||||
//alert(data.gender);
|
||||
//set input here
|
||||
$('#" . Html::getInputId($model, 'patient_id') . "').val(data.id);
|
||||
$('#" . Html::getInputId($patient, 'title_id') . "').val(data.title_id);
|
||||
$('#" . Html::getInputId($patient, 'gender') . "').val(data.gender);
|
||||
$('#" . Html::getInputId($patient, 'race') . "').val(data.race);
|
||||
$('#" . Html::getInputId($patient, 'id_card') . "').val(data.id_card);
|
||||
$('#" . Html::getInputId($patient, 'birthdate') . "').val(data.birthdate);
|
||||
$('#" . Html::getInputId($patient, 'age') . "').val(data.age);
|
||||
$('#" . Html::getInputId($patient, 'age_unit') . "').val(data.age_unit);
|
||||
$('#" . Html::getInputId($patient, 'h_n') . "').val(data.h_n);
|
||||
console.log($('#" . Html::getInputId($model, 'patient_id') . "').val());
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
")
|
||||
],
|
||||
|
||||
]
|
||||
); ?>
|
||||
<?php } else { ?>
|
||||
<?php /*=$form->field($model, 'patient_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(Patient::find()->where('id > 1')->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'),
|
||||
'options' => ['placeholder' => 'เลือกผู้ป่วย'],
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
],
|
||||
])*/ ?>
|
||||
<?= $form->field($patient, 'name') ?>
|
||||
<?php } ?>
|
||||
<?= $form->field($patient, 'given_name') ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($patient, 'surname') ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($patient, 'gender')->dropDownList(['U' => '', 'ช' => 'ชาย', 'ญ' => 'หญิง']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($patient, 'nation')->dropDownList(ArrayHelper::map(ConstNationality::find()->all(), 'id', 'name'), ['prompt' => 'Select Nationalily...']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($patient, 'race')->dropDownList(ArrayHelper::map(ConstRace::find()->all(), 'id', 'name'), ['prompt' => 'Select Race...']) ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($patient, 'gender')->dropDownList([3 => '', 0 => 'ชาย', 1 => 'หญิง']) ?></div>
|
||||
<div class="col-md-2"><?= $form->field($patient, 'race')->textInput() ?></div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ use common\models\ConstHospital;
|
|||
use dosamigos\ckeditor\CKEditor;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\ConstNationality;
|
||||
use common\models\CytoFixation;
|
||||
use common\models\CytoSourceOfSpecimen;
|
||||
use common\models\CytoSpecimenType;
|
||||
use common\models\CytoTypeOfSpecimen;
|
||||
use kartik\datetime\DateTimePicker;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
|
|
@ -542,30 +545,55 @@ use unclead\multipleinput\MultipleInputColumn;
|
|||
<?= $form->field($model, 'non_gyn_specimen_other')->textarea() ?>
|
||||
</div>
|
||||
</div>
|
||||
<h6 class="mt-4"><strong> Gross
|
||||
Description</strong></h6>
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'gross_description')->label(false)->textarea(['spellcheck' => true])->widget(CKEditor::className(), [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
'removePlugins' => 'scayt',
|
||||
'disableNativeSpellChecker' => false,
|
||||
'extraPlugins' => 'font,justify,colorbutton,iframe,dialogadvtab,liststyle',
|
||||
'removeButtons' => 'Source,Save,NewPage,Preview,Print,Templates,Find,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,CopyFormatting,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Link,Unlink,Anchor,Image,Flash,HorizontalRule,Smiley,PageBreak,Iframe,ShowBlocks,About,Replace,Snippet',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste', 'clipboard']],
|
||||
['name' => 'styles', 'groups' => ['font']],
|
||||
['name' => 'colors', 'groups' => ['TextColor', 'BGColor']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align', 'bidi', 'paragraph']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', /*'spellchecker'*/]],
|
||||
//['name' => 'tools', 'groups' => ['dialogadvtab', 'devtools', 'div']],
|
||||
['name' => 'insert', 'groups' => ['table', 'specialchar']],
|
||||
//['name' => 'tools', 'groups' => ['maximize']],
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'source_of_specimen_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
CytoSourceOfSpecimen::find()->orderBy(['name' => SORT_ASC])->all(),
|
||||
'id',
|
||||
function ($model) {
|
||||
return $model->name;
|
||||
}
|
||||
), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
'placeholder' => 'เลือก source of specimen...'
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'type_of_specimen_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(CytoTypeOfSpecimen::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
/*'options' => [
|
||||
'placeholder' => 'เลือกสิทธิ์การรักษา ....',
|
||||
],*/
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
'placeholder' => 'เลือก type of specimen...'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'fixation_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
CytoFixation::find()->orderBy(['name' => SORT_ASC])->all(),
|
||||
'id',
|
||||
function ($model) {
|
||||
return $model->name;
|
||||
}
|
||||
), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
'placeholder' => 'เลือก fixation...'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,901 @@
|
|||
<?php
|
||||
|
||||
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use common\models\User;
|
||||
use yii\bootstrap5\Modal;
|
||||
use kartik\date\DatePicker;
|
||||
use kartik\select2\Select2;
|
||||
use common\models\ConstRace;
|
||||
use common\models\ConstWard;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\widgets\MaskedInput;
|
||||
use common\models\ConstDoctor;
|
||||
use common\models\ConstRights;
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use common\models\PatientTitle;
|
||||
use common\models\ConstHospital;
|
||||
use dosamigos\ckeditor\CKEditor;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\ConstNationality;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
use unclead\multipleinput\MultipleInputColumn;
|
||||
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="ri-file-edit-line"></i> <?= $this->title ?></h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'validateOnChange' => true,
|
||||
'validateOnSubmit' => true,
|
||||
'validateOnBlur' => false,
|
||||
]) ?>
|
||||
<?= $form->errorSummary([$model]) ?>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'id_case')->widget(MaskedInput::class, [
|
||||
'mask' => Yii::$app->params['idCaseMask'],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'style' => 'font-weight: bold',
|
||||
'disabled' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'his_ln')->textInput(['readonly' => true]) ?>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'hospital_id')->widget(Select2::classname(), [
|
||||
'data' => ArrayHelper::map(ConstHospital::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
'options' => [
|
||||
'placeholder' => 'เลือกหน่วยงาน ....',
|
||||
],
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
//'initValueText' => (!$model->isNewRecord ? ConstHospital::findOne($model->hospital_id)->name : ''),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
/*'ajax' => [
|
||||
'url' => Url::to(['/site/hospital-list']),
|
||||
'dataType' => 'json',1
|
||||
'data' => new JsExpression('function(params) { return {q:params.term}; }')
|
||||
],*/
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- row
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php /* $form->field($model, 'is_conference')->checkbox() ?>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_conference') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.conference_div').show();
|
||||
}else{
|
||||
$('.conference_div').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
</div>
|
||||
<div class="col-md-4 conference_div"
|
||||
<?= !$model->isNewRecord && $model->is_conference ? '' : 'style="display: none;"' ?>>
|
||||
|
||||
<?= $form->field($model, 'conference_at')->widget(DatePicker::class, [
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
]
|
||||
]) */ ?>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<embed src="<?= Url::to(['sticker/print', 'id_case' => $model->id_case], true) ?>#view=fit"
|
||||
type="application/pdf" width="100%" height="252">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div><!-- row -->
|
||||
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-file-user-line"></i> ข้อมูลผู้ป่วย (Patient)</h5>
|
||||
</div>
|
||||
<?php if ($model->isNewRecord) { ?>
|
||||
<?= $form->field($model, 'patient_id')->label(false)->hiddenInput() ?>
|
||||
<?php } ?>
|
||||
<div class="mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'title_id')->widget(Select2::classname(), [
|
||||
'data' => ArrayHelper::map(PatientTitle::find()->all(), 'id', 'name'), //->where('id > 1')
|
||||
'options' => [
|
||||
'placeholder' => 'เลือกคำนำหน้า ....',
|
||||
],
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
//'initValueText' => (!$model->isNewRecord ? ConstHospital::findOne($model->hospital_id)->name : ''),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
/*'ajax' => [
|
||||
'url' => Url::to(['/site/hospital-list']),
|
||||
'dataType' => 'json',1
|
||||
'data' => new JsExpression('function(params) { return {q:params.term}; }')
|
||||
],*/
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'given_name')->textInput() ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'surname')->textInput() ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'gender')->dropDownList(['U' => '', 'ช' => 'ชาย', 'ญ' => 'หญิง']) ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= Html::button('ค้นหาผู้ป่วย', ['class' => 'btn btn-info', 'data-toggle' => 'modal', 'data-target' => '#patientModal']) ?>
|
||||
|
||||
<?php
|
||||
Modal::begin([
|
||||
'id' => 'patientModal',
|
||||
'title' => '<h4>ค้นหาผู้ป่วย</h4>',
|
||||
]);
|
||||
|
||||
?>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="hn-input">กรอก HN</label>
|
||||
<input type="text" id="hn-input" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::button('ค้นหา', ['class' => 'btn btn-primary', 'id' => 'btn-search-patient']) ?>
|
||||
</div>
|
||||
|
||||
<div id="patient-detail"></div>
|
||||
|
||||
<?php Modal::end(); ?>
|
||||
|
||||
<?php
|
||||
$this->registerJs(<<<JS
|
||||
$('#btn-search-patient').on('click', function() {
|
||||
let hn = $('#hn-input').val();
|
||||
$.get('".Url::to(['controller/search-patient'])."', { hn: hn }, function(response) {
|
||||
if (response.success) {
|
||||
$('#patient-detail').html(response.html);
|
||||
} else {
|
||||
$('#patient-detail').html('<div class="alert alert-danger">' + response.message + '</div>');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function selectPatient(data) {
|
||||
$('#" . Html::getInputId($model, 'patient_id') . "').val(data.id);
|
||||
$('#" . Html::getInputId($model, 'title_id') . "').val(data.title_id);
|
||||
$('#" . Html::getInputId($model, 'gender') . "').val(data.gender);
|
||||
$('#" . Html::getInputId($model, 'race') . "').val(data.race);
|
||||
$('#" . Html::getInputId($model, 'id_card') . "').val(data.id_card);
|
||||
$('#" . Html::getInputId($model, 'birthdate') . "').val(data.birthdate);
|
||||
$('#" . Html::getInputId($model, 'age') . "').val(data.age);
|
||||
$('#" . Html::getInputId($model, 'age_unit') . "').val(data.age_unit);
|
||||
$('#" . Html::getInputId($model, 'h_n') . "').val(data.h_n);
|
||||
|
||||
$('#patientModal').modal('hide');
|
||||
}
|
||||
JS);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'id_card')->widget(MaskedInput::class, [
|
||||
'mask' => '9-9999-99999-99-9'
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-2"><?= $form->field($model, 'birthdate')->widget(MaskedInput::class, [
|
||||
'mask' => '99/99/9999',
|
||||
'options' => [
|
||||
'id' => 'patient-birthdate',
|
||||
],
|
||||
])
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'nation')->dropDownList(ArrayHelper::map(ConstNationality::find()->all(), 'id', 'name'), ['prompt' => 'Select Nationalily...']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'race')->dropDownList(ArrayHelper::map(ConstRace::find()->all(), 'id', 'name'), ['prompt' => 'Select Race...']) ?>
|
||||
</div>
|
||||
<div class="col-md-2"><?= $form->field($model, 'age')->textInput(['id' => 'patient-age']) ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'age_unit')->dropDownList(['ปี' => 'ปี', 'เดือน' => 'เดือน', 'วัน' => 'วัน'], ['id' => 'patient-age_unit']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3"><?= $form->field($model, 'h_n')->textInput() ?></div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'a_n'); ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'v_n'); ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'rights_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(ConstRights::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกสิทธิ์การรักษา....'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'ward_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(ConstWard::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
/*'options' => [
|
||||
'placeholder' => 'เลือกสิทธิ์การรักษา ....',
|
||||
],*/
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกแผนก....'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'doctor_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
ConstDoctor::find()->orderBy(['fullname' => SORT_ASC])->all(),
|
||||
'id',
|
||||
function ($model) {
|
||||
return $model->fullname;
|
||||
}
|
||||
), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกแพทย์เจ้าของคนไข้....'
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php // $form->field($model, 'clinician')->textInput()
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<!--row-->
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-file-edit-line"></i> ข้อมูลการส่งตรวจ (Case)</h5>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<div class="row">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'pathologist_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(User::find()->where(['role' => 'pathologist', 'status' => 10])->orderBy(['realname' => SORT_ASC])->all(), 'id', 'realname'),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือก Pathologist...'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'note_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
User::find()
|
||||
->where(['!=', 'role', 'hospital'])
|
||||
->andWhere(['status' => User::STATUS_ACTIVE])
|
||||
->orderBy(['realname' => SORT_DESC])
|
||||
->all(),
|
||||
'id',
|
||||
'realname'
|
||||
),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'placeholder' => 'กรุณาเลือกผู้จด....',
|
||||
'allowClear' => true, // Optional: allows clearing of the selection
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'cut_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(User::find()->where(['!=', 'role', 'hospital'])->andWhere(['status' => User::STATUS_ACTIVE])->orderBy(['realname' => SORT_DESC])->all(), 'id', 'realname'),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'placeholder' => 'กรุณาเลือกผู้ตัด....',
|
||||
'allowClear' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'collected_at')->widget(DatePicker::class, [
|
||||
'options' => ['placeholder' => 'เลือกวันที่เก็บสิ่งส่งตรวจ ...'],
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
//'todayBtn' => true,
|
||||
]
|
||||
])
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'receive_at')->widget(DatePicker::class, [
|
||||
'options' => ['placeholder' => 'เลือกวันที่รับสิ่งส่งตรวจ ...'],
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
//'todayBtn' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<!--<div class="col-md-2 mt-4">
|
||||
<?php // $form->field($model, 'is_ot')->checkbox()
|
||||
?>
|
||||
</div>-->
|
||||
<?php // }
|
||||
?>
|
||||
<!--<div class="col-md-3"><?php // $form->field($model, 'hos_ref')->textInput()
|
||||
?></div> -->
|
||||
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'clinical_diagnosis')->textarea(['rows' => 5, 'cols' => 50, 'spellcheck' => true])/*->widget(CKEditor::class, [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 120,
|
||||
'extraPlugins' => 'font',
|
||||
//'extraPlugins' => 'mentions,autocomplete,textwatcher',
|
||||
'removeButtons' => '',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']],
|
||||
['name' => 'insert', 'groups' => ['table']],
|
||||
['name' => 'tools', 'groups' => ['maximize']],
|
||||
//['name' => 'styles', 'groups' => ['font']],
|
||||
],
|
||||
]
|
||||
])*/ ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'remark')->textarea(['rows' => 5, 'cols' => 50]) ?>
|
||||
</div>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_express') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.express_div').show();
|
||||
}else{
|
||||
$('.express_div').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
<div class="col-md-3 mt-4">
|
||||
<?= $form->field($model, 'is_express')->checkbox() ?>
|
||||
</div>
|
||||
<div class="row express_div"
|
||||
<?= !$model->isNewRecord && $model->is_express ? '' : 'style="display: none;"' ?>>
|
||||
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'express_day')->dropDownList(['' => '', '3' => 'ผลด่วน 3 วัน', '5' => 'ผลด่วน 5 วัน', '7' => 'ผลด่วน 7 วัน']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'express_at')->widget(\kartik\date\DatePicker::class, [
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
'todayBtn' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('#" . Html::getInputId($model, 'express_day') . "').on('change', function() {
|
||||
// Get the selected value
|
||||
var selectedValue = $(this).val();
|
||||
//alert(selectedValue);
|
||||
var currentDate = new Date();
|
||||
if(selectedValue == 3){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 3);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
if(selectedValue == 5){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 5);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
if(selectedValue == 7){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 7);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
// Update the content of the <span> with the selected value
|
||||
//$('#selectedValue').text(selectedValue);
|
||||
|
||||
function formatDate(date) {
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1; // Months are zero-based
|
||||
var year = date.getFullYear();
|
||||
|
||||
// Add leading zeros if needed
|
||||
day = (day < 10) ? '0' + day : day;
|
||||
month = (month < 10) ? '0' + month : month;
|
||||
|
||||
// Return the formatted date
|
||||
return day + '/' + month + '/' + year; new date
|
||||
}
|
||||
});
|
||||
"); ?>
|
||||
|
||||
|
||||
<!-- ไม่นับวัน เสาร์ - อาทิต-->
|
||||
<?php /*
|
||||
$this->registerJs("
|
||||
$('#" . Html::getInputId($model, 'express_day') . "').on('change', function() {
|
||||
// Get the selected value
|
||||
var selectedValue = $(this).val();
|
||||
//alert(selectedValue);
|
||||
var currentDate = new Date();
|
||||
if (selectedValue == 3 || selectedValue == 5 || selectedValue == 7) {
|
||||
// Determine the number of days to add based on the selected value
|
||||
var daysToAdd;
|
||||
if (selectedValue == 3) {
|
||||
daysToAdd = 3;
|
||||
} else if (selectedValue == 5) {
|
||||
daysToAdd = 5;
|
||||
} else if (selectedValue == 7) {
|
||||
daysToAdd = 7;
|
||||
}
|
||||
|
||||
// Add the specified number of days to the current date, skipping holidays, Saturdays, and Sundays
|
||||
var newDate = addBusinessDays(currentDate, daysToAdd);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
|
||||
// Update the content of the <span> with the selected value
|
||||
//$('#selectedValue').text(selectedValue);
|
||||
|
||||
function addBusinessDays(date, days) {
|
||||
var count = 0;
|
||||
while (count < days) {
|
||||
date.setDate(date.getDate() + 1);
|
||||
if (isWorkingDay(date)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
function isWorkingDay(date) {
|
||||
// Check if the date is a Saturday or Sunday
|
||||
if (date.getDay() === 0 || date.getDay() === 6) {
|
||||
return false;
|
||||
}
|
||||
// Add logic here to check if the date is a holiday
|
||||
// You need to implement the logic to determine holidays based on your requirements
|
||||
// For simplicity, I'm leaving this part for you to implement
|
||||
return true;
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1; // Months are zero-based
|
||||
var year = date.getFullYear();
|
||||
|
||||
// Add leading zeros if needed
|
||||
day = (day < 10) ? '0' + day : day;
|
||||
month = (month < 10) ? '0' + month : month;
|
||||
|
||||
// Return the formatted date
|
||||
return day + '/' + month + '/' + year;
|
||||
}
|
||||
});
|
||||
");
|
||||
*/ ?>
|
||||
<div class="row">
|
||||
<div class="col-md-2 mt-4">
|
||||
<?= $form->field($model, 'is_molecular')->checkbox() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-draft-line"></i> รายการ Specimen</h5>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div class="table-responsive">
|
||||
<?= $form->field($sc_surgical_container, 'items')->label(false)->widget(MultipleInput::class, [
|
||||
'max' => 50,
|
||||
'id' => 'surgicalcontainer-items',
|
||||
'allowEmptyList' => true,
|
||||
'addButtonOptions' => ['class' => 'btn btn-primary'],
|
||||
//'min' => 1,
|
||||
'addButtonPosition' => MultipleInput::POS_FOOTER,
|
||||
'attributeOptions' => [],
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'id_case',
|
||||
'title' => 'ID Case',
|
||||
'value' => function ($data) {
|
||||
return isset($data['id_case']) ? $data['id_case'] : '';
|
||||
},
|
||||
'enableError' => true,
|
||||
'type' => MultipleInputColumn::TYPE_HIDDEN_INPUT,
|
||||
],
|
||||
[
|
||||
'name' => 'id',
|
||||
'title' => 'ID',
|
||||
'value' => function ($data) {
|
||||
return isset($data['id']) ? $data['id'] : '';
|
||||
},
|
||||
'enableError' => true,
|
||||
'type' => MultipleInputColumn::TYPE_HIDDEN_INPUT,
|
||||
],
|
||||
[
|
||||
'name' => 'container_type',
|
||||
'title' => 'รายการ',
|
||||
'type' => MultipleInputColumn::TYPE_DROPDOWN,
|
||||
'value' => function ($data) {
|
||||
return isset($data['container_type']) ? $data['container_type'] : null;
|
||||
},
|
||||
'items' => [
|
||||
1 => 'ขวด',
|
||||
2 => 'ถุง',
|
||||
3 => 'Block',
|
||||
4 => 'Slide'
|
||||
],
|
||||
'enableError' => true,
|
||||
'options' => [
|
||||
'class' => 'new_class',
|
||||
'prompt' => 'เลือกรายการ.....',
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'amount',
|
||||
'title' => 'จำนวน',
|
||||
'options' => ['class' => 'uppercase-input'],
|
||||
//'enableError' => true,
|
||||
'value' => function ($data) {
|
||||
return strtoupper(isset($data['amount'])) ? $data['amount'] : '';
|
||||
},
|
||||
],
|
||||
[
|
||||
'name' => 'specimen_size',
|
||||
'title' => 'ขนาดชิ้นเนื้อ',
|
||||
'type' => MultipleInputColumn::TYPE_DROPDOWN,
|
||||
'value' => function ($data) {
|
||||
return isset($data['specimen_size']) ? $data['specimen_size'] : null;
|
||||
},
|
||||
'items' => [
|
||||
1 => 'smc(เนื้อเล็ก)',
|
||||
2 => 'smc(เนื้อกลาง)',
|
||||
3 => 'smc(เนื้อใหญ่)'
|
||||
],
|
||||
'enableError' => true,
|
||||
'options' => [
|
||||
'class' => 'new_class',
|
||||
'prompt' => 'เลือกขนาดชิ้นเนื้อ',
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'remark',
|
||||
'title' => 'remark',
|
||||
'enableError' => true,
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('.uppercase-input').on('keyup', function() {
|
||||
var input = $(this);
|
||||
var value = input.val().toUpperCase();
|
||||
input.val(value);
|
||||
});
|
||||
"); ?>
|
||||
|
||||
<!-- Delete รายการระบุขนาดชิ้นเนื้อ -->
|
||||
<?php $this->registerJs("
|
||||
$('#surgicalcontainer-items').on('afterInit', function(){
|
||||
//console.log('calls on after initialization event');
|
||||
}).on('beforeAddRow', function(e) {
|
||||
//console.log('calls on before add row event');
|
||||
}).on('afterAddRow', function(e) {
|
||||
//console.log('calls on after add row event');
|
||||
}).on('beforeDeleteRow', function(e, item){
|
||||
//console.log(item);
|
||||
return confirm('คุณแน่ใจนะว่าต้องการลบ?');
|
||||
}).on('afterDeleteRow', function(e, item){
|
||||
//console.log(item);#surgicalcontainer-items-0-from_id
|
||||
var id_case = item.find('.list-cell__block_no').find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id_case\"]').val();
|
||||
var id = item.find('.list-cell__block_no').find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id\"]').val();
|
||||
//alert(id_case + from_id);
|
||||
$.post(\"" . Url::to(['/register/case-update/surgical-container-delete']) . "\",
|
||||
{
|
||||
id_case: id_case,
|
||||
hs_id: hs_id
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
") ?>
|
||||
|
||||
<?php $this->registerJs(
|
||||
"$('#surgicalcontainer-items').on('afterInit', function() {
|
||||
// Initialization event if needed
|
||||
}).on('beforeAddRow', function(e) {
|
||||
// Before adding a row event if needed
|
||||
}).on('afterAddRow', function(e) {
|
||||
// After adding a row event if needed
|
||||
}).on('beforeDeleteRow', function(e, item) {
|
||||
return confirm('คุณแน่ใจนะว่าต้องการลบ?'); // Confirm deletion
|
||||
}).on('afterDeleteRow', function(e, item) {
|
||||
var id_case = item.find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id_case\"]').val();
|
||||
var id = item.find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id\"]').val();
|
||||
|
||||
// Make sure id_case and id are not empty or undefined before sending the request
|
||||
if (id_case && id) {
|
||||
$.post(\"" . Url::to(['/register/case-update/surgical-container-delete']) . "\", {
|
||||
id_case: id_case,
|
||||
id: id
|
||||
}).done(function(response) {
|
||||
if (response.status === 'success') {
|
||||
alert('ลบรายการเรียบร้อยแล้ว');
|
||||
} else {
|
||||
alert('Error: ' + response.message);
|
||||
}
|
||||
}).fail(function() {
|
||||
alert('An error occurred while trying to delete the item.');
|
||||
});
|
||||
} else {
|
||||
alert('Invalid id_case or id.');
|
||||
}
|
||||
});
|
||||
"
|
||||
) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'review_remark')->textarea(['rows' => 5, 'cols' => 50]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mt-3">
|
||||
<h6><i class="ri-bill-line"></i>
|
||||
รายการ Test Order</h6>
|
||||
</div>
|
||||
<?= GridView::widget([
|
||||
'summary' => false,
|
||||
'tableOptions' => ['class' => 'table table-striped truncate m-0'],
|
||||
'dataProvider' => new ActiveDataProvider([
|
||||
'query' => FinanceServiceCharge::find()
|
||||
->where(['id_case' => $model->id_case])
|
||||
]),
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
'charge.code',
|
||||
'charge.name',
|
||||
],
|
||||
'layout' => "<div class='table-outer'>\n{items}\n</div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-file-text-line"></i> ใบส่งตรวจ
|
||||
(Request File)
|
||||
</h6>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'files[]')->label(false)->fileInput(['multiple' => true])->label(false) ?>
|
||||
</div>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($model->getFiles() as $file => $val) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/file/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'file-del',
|
||||
'file' => $val,
|
||||
'id' => $model->id,
|
||||
'id_case' => $model->id_case
|
||||
], [
|
||||
'class' => 'btn btn-sm btn-danger',
|
||||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-image-2-fill"></i> บันทึกภาพ Specimen
|
||||
Container
|
||||
</h6>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'specimen_container_img[]')->fileInput(['multiple' => true])->label(false) ?>
|
||||
</div>
|
||||
<?php if (!empty($model->specimen_container_img)) { ?>
|
||||
|
||||
<div class="mb-3">
|
||||
<h6><i class="ri-file-image-line"></i> Specimen Container
|
||||
List</h6>
|
||||
</div>
|
||||
<div style="width: 250px"><?= $model->getSpecimenDelImgs() ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<!--<div class="row">
|
||||
<?php /*
|
||||
$directoryPath = Yii::getAlias('@webroot') . '/uploads/surgical/specimen_container/' . $model->id_case;
|
||||
if (is_dir($directoryPath)) {
|
||||
$files = \yii\helpers\FileHelper::findFiles($directoryPath);
|
||||
|
||||
if (!empty($files)) {
|
||||
foreach ($files as $index => $file) {
|
||||
$nameFicheiro = basename($file);
|
||||
$filePath = Yii::getAlias('@web') . '/uploads/surgical/specimen_container/' . $model->id_case . '/' . $nameFicheiro;
|
||||
echo "<div class=\"col-md-2\">" . Html::a(Html::img($filePath, ['class' => 'img-fluid']), $filePath, ['target' => '_blank']) . "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
*/ ?>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-file-copy-2-fill"></i> Outsource Data</h6>
|
||||
</strong>
|
||||
<?= $form->field($model, 'is_outlab')->checkbox() ?>
|
||||
<div class="outlab_report" <?= !$model->isNewRecord && $model->is_outlab ? '' : 'style="display: none;"' ?>>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'outlab_report[]')->fileInput(['multiple' => true]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'remark_outlab')->textarea(['spellcheck' => true])->widget(CKEditor::class, [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
'extraPlugins' => 'font',
|
||||
//'extraPlugins' => 'mentions,autocomplete,textwatcher',
|
||||
'removeButtons' => '',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']],
|
||||
['name' => 'insert', 'groups' => ['table']],
|
||||
['name' => 'tools', 'groups' => ['maximize']],
|
||||
//['name' => 'styles', 'groups' => ['font']],
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_outlab') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.outlab_report').show();
|
||||
}else{
|
||||
$('.outlab_report').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
|
||||
<ul>
|
||||
|
||||
<?php
|
||||
foreach ($model->getReport() as $file => $val) {
|
||||
if (!empty($val)) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/report/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'report-del',
|
||||
'file' => $val,
|
||||
'id' => $model->id,
|
||||
'id_case' => $model->id_case
|
||||
], [
|
||||
'class' => 'btn btn-sm btn-danger',
|
||||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
} ?>
|
||||
</ul>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="mb-3">
|
||||
<?= Html::submitButton('<i class="ri-save-line"></i> บันทึกข้อมูล', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert bg-info text-white alert-dismissible d-flex align-items-center fade show" role="alert">
|
||||
<i class="ri-alarm-warning-line fs-3 me-2 lh-1"></i>หมายเหตุ: กรุณาบันทึกข้อมูลก่อนการ Print
|
||||
Sticker
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end() ?>
|
||||
</div>
|
||||
</div>
|
||||
<!--card-body-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->render('_js') ?>
|
||||
|
|
@ -0,0 +1,851 @@
|
|||
<?php
|
||||
|
||||
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use common\models\User;
|
||||
use yii\bootstrap5\Modal;
|
||||
use kartik\date\DatePicker;
|
||||
use kartik\select2\Select2;
|
||||
use common\models\ConstRace;
|
||||
use common\models\ConstWard;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\widgets\MaskedInput;
|
||||
use common\models\ConstDoctor;
|
||||
use common\models\ConstRights;
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use common\models\PatientTitle;
|
||||
use common\models\ConstHospital;
|
||||
use dosamigos\ckeditor\CKEditor;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\ConstNationality;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
use unclead\multipleinput\MultipleInputColumn;
|
||||
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="ri-file-edit-line"></i> <?= $this->title ?></h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'validateOnChange' => true,
|
||||
'validateOnSubmit' => true,
|
||||
'validateOnBlur' => false,
|
||||
]) ?>
|
||||
<?= $form->errorSummary([$model]) ?>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'id_case')->widget(MaskedInput::class, [
|
||||
'mask' => Yii::$app->params['idCaseMask'],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'style' => 'font-weight: bold',
|
||||
'disabled' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'his_ln')->textInput(['readonly' => true]) ?>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'hospital_id')->widget(Select2::classname(), [
|
||||
'data' => ArrayHelper::map(ConstHospital::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
'options' => [
|
||||
'placeholder' => 'เลือกหน่วยงาน ....',
|
||||
],
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
//'initValueText' => (!$model->isNewRecord ? ConstHospital::findOne($model->hospital_id)->name : ''),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
/*'ajax' => [
|
||||
'url' => Url::to(['/site/hospital-list']),
|
||||
'dataType' => 'json',1
|
||||
'data' => new JsExpression('function(params) { return {q:params.term}; }')
|
||||
],*/
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- row
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php /* $form->field($model, 'is_conference')->checkbox() ?>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_conference') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.conference_div').show();
|
||||
}else{
|
||||
$('.conference_div').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
</div>
|
||||
<div class="col-md-4 conference_div"
|
||||
<?= !$model->isNewRecord && $model->is_conference ? '' : 'style="display: none;"' ?>>
|
||||
|
||||
<?= $form->field($model, 'conference_at')->widget(DatePicker::class, [
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
]
|
||||
]) */ ?>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<embed src="<?= Url::to(['sticker/print', 'id_case' => $model->id_case], true) ?>#view=fit"
|
||||
type="application/pdf" width="100%" height="252">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div><!-- row -->
|
||||
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-file-user-line"></i> ข้อมูลผู้ป่วย (Patient)</h5>
|
||||
</div>
|
||||
<?php if ($model->isNewRecord) { ?>
|
||||
<?= $form->field($model, 'patient_id')->label(false)->hiddenInput() ?>
|
||||
<?php } ?>
|
||||
<div class="mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'title_id')->widget(Select2::classname(), [
|
||||
'data' => ArrayHelper::map(PatientTitle::find()->all(), 'id', 'name'), //->where('id > 1')
|
||||
'options' => [
|
||||
'placeholder' => 'เลือกคำนำหน้า ....',
|
||||
],
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
//'initValueText' => (!$model->isNewRecord ? ConstHospital::findOne($model->hospital_id)->name : ''),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
/*'ajax' => [
|
||||
'url' => Url::to(['/site/hospital-list']),
|
||||
'dataType' => 'json',1
|
||||
'data' => new JsExpression('function(params) { return {q:params.term}; }')
|
||||
],*/
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'given_name')->textInput() ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'surname')->textInput() ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'gender')->dropDownList(['U' => '', 'ช' => 'ชาย', 'ญ' => 'หญิง']) ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'id_card')->widget(MaskedInput::class, [
|
||||
'mask' => '9-9999-99999-99-9'
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-2"><?= $form->field($model, 'birthdate')->widget(MaskedInput::class, [
|
||||
'mask' => '99/99/9999',
|
||||
'options' => [
|
||||
'id' => 'patient-birthdate',
|
||||
],
|
||||
])
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'nation')->dropDownList(ArrayHelper::map(ConstNationality::find()->all(), 'id', 'name'), ['prompt' => 'Select Nationalily...']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'race')->dropDownList(ArrayHelper::map(ConstRace::find()->all(), 'id', 'name'), ['prompt' => 'Select Race...']) ?>
|
||||
</div>
|
||||
<div class="col-md-2"><?= $form->field($model, 'age')->textInput(['id' => 'patient-age']) ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'age_unit')->dropDownList(['ปี' => 'ปี', 'เดือน' => 'เดือน', 'วัน' => 'วัน'], ['id' => 'patient-age_unit']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3"><?= $form->field($model, 'h_n')->textInput() ?></div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'a_n'); ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'v_n'); ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'rights_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(ConstRights::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกสิทธิ์การรักษา....'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'ward_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(ConstWard::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
/*'options' => [
|
||||
'placeholder' => 'เลือกสิทธิ์การรักษา ....',
|
||||
],*/
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกแผนก....'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'doctor_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
ConstDoctor::find()->orderBy(['fullname' => SORT_ASC])->all(),
|
||||
'id',
|
||||
function ($model) {
|
||||
return $model->fullname;
|
||||
}
|
||||
), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกแพทย์เจ้าของคนไข้....'
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php // $form->field($model, 'clinician')->textInput()
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<!--row-->
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-file-edit-line"></i> ข้อมูลการส่งตรวจ (Case)</h5>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<div class="row">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'pathologist_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(User::find()->where(['role' => 'pathologist', 'status' => 10])->orderBy(['realname' => SORT_ASC])->all(), 'id', 'realname'),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือก Pathologist...'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'note_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
User::find()
|
||||
->where(['!=', 'role', 'hospital'])
|
||||
->andWhere(['status' => User::STATUS_ACTIVE])
|
||||
->orderBy(['realname' => SORT_DESC])
|
||||
->all(),
|
||||
'id',
|
||||
'realname'
|
||||
),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'placeholder' => 'กรุณาเลือกผู้จด....',
|
||||
'allowClear' => true, // Optional: allows clearing of the selection
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'cut_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(User::find()->where(['!=', 'role', 'hospital'])->andWhere(['status' => User::STATUS_ACTIVE])->orderBy(['realname' => SORT_DESC])->all(), 'id', 'realname'),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'placeholder' => 'กรุณาเลือกผู้ตัด....',
|
||||
'allowClear' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'collected_at')->widget(DatePicker::class, [
|
||||
'options' => ['placeholder' => 'เลือกวันที่เก็บสิ่งส่งตรวจ ...'],
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
//'todayBtn' => true,
|
||||
]
|
||||
])
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'receive_at')->widget(DatePicker::class, [
|
||||
'options' => ['placeholder' => 'เลือกวันที่รับสิ่งส่งตรวจ ...'],
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
//'todayBtn' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<!--<div class="col-md-2 mt-4">
|
||||
<?php // $form->field($model, 'is_ot')->checkbox()
|
||||
?>
|
||||
</div>-->
|
||||
<?php // }
|
||||
?>
|
||||
<!--<div class="col-md-3"><?php // $form->field($model, 'hos_ref')->textInput()
|
||||
?></div> -->
|
||||
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'clinical_diagnosis')->textarea(['rows' => 5, 'cols' => 50, 'spellcheck' => true])/*->widget(CKEditor::class, [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 120,
|
||||
'extraPlugins' => 'font',
|
||||
//'extraPlugins' => 'mentions,autocomplete,textwatcher',
|
||||
'removeButtons' => '',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']],
|
||||
['name' => 'insert', 'groups' => ['table']],
|
||||
['name' => 'tools', 'groups' => ['maximize']],
|
||||
//['name' => 'styles', 'groups' => ['font']],
|
||||
],
|
||||
]
|
||||
])*/ ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'remark')->textarea(['rows' => 5, 'cols' => 50]) ?>
|
||||
</div>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_express') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.express_div').show();
|
||||
}else{
|
||||
$('.express_div').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
<div class="col-md-3 mt-4">
|
||||
<?= $form->field($model, 'is_express')->checkbox() ?>
|
||||
</div>
|
||||
<div class="row express_div"
|
||||
<?= !$model->isNewRecord && $model->is_express ? '' : 'style="display: none;"' ?>>
|
||||
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'express_day')->dropDownList(['' => '', '3' => 'ผลด่วน 3 วัน', '5' => 'ผลด่วน 5 วัน', '7' => 'ผลด่วน 7 วัน']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'express_at')->widget(\kartik\date\DatePicker::class, [
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
'todayBtn' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('#" . Html::getInputId($model, 'express_day') . "').on('change', function() {
|
||||
// Get the selected value
|
||||
var selectedValue = $(this).val();
|
||||
//alert(selectedValue);
|
||||
var currentDate = new Date();
|
||||
if(selectedValue == 3){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 3);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
if(selectedValue == 5){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 5);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
if(selectedValue == 7){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 7);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
// Update the content of the <span> with the selected value
|
||||
//$('#selectedValue').text(selectedValue);
|
||||
|
||||
function formatDate(date) {
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1; // Months are zero-based
|
||||
var year = date.getFullYear();
|
||||
|
||||
// Add leading zeros if needed
|
||||
day = (day < 10) ? '0' + day : day;
|
||||
month = (month < 10) ? '0' + month : month;
|
||||
|
||||
// Return the formatted date
|
||||
return day + '/' + month + '/' + year; new date
|
||||
}
|
||||
});
|
||||
"); ?>
|
||||
|
||||
|
||||
<!-- ไม่นับวัน เสาร์ - อาทิต-->
|
||||
<?php /*
|
||||
$this->registerJs("
|
||||
$('#" . Html::getInputId($model, 'express_day') . "').on('change', function() {
|
||||
// Get the selected value
|
||||
var selectedValue = $(this).val();
|
||||
//alert(selectedValue);
|
||||
var currentDate = new Date();
|
||||
if (selectedValue == 3 || selectedValue == 5 || selectedValue == 7) {
|
||||
// Determine the number of days to add based on the selected value
|
||||
var daysToAdd;
|
||||
if (selectedValue == 3) {
|
||||
daysToAdd = 3;
|
||||
} else if (selectedValue == 5) {
|
||||
daysToAdd = 5;
|
||||
} else if (selectedValue == 7) {
|
||||
daysToAdd = 7;
|
||||
}
|
||||
|
||||
// Add the specified number of days to the current date, skipping holidays, Saturdays, and Sundays
|
||||
var newDate = addBusinessDays(currentDate, daysToAdd);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
|
||||
// Update the content of the <span> with the selected value
|
||||
//$('#selectedValue').text(selectedValue);
|
||||
|
||||
function addBusinessDays(date, days) {
|
||||
var count = 0;
|
||||
while (count < days) {
|
||||
date.setDate(date.getDate() + 1);
|
||||
if (isWorkingDay(date)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
function isWorkingDay(date) {
|
||||
// Check if the date is a Saturday or Sunday
|
||||
if (date.getDay() === 0 || date.getDay() === 6) {
|
||||
return false;
|
||||
}
|
||||
// Add logic here to check if the date is a holiday
|
||||
// You need to implement the logic to determine holidays based on your requirements
|
||||
// For simplicity, I'm leaving this part for you to implement
|
||||
return true;
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1; // Months are zero-based
|
||||
var year = date.getFullYear();
|
||||
|
||||
// Add leading zeros if needed
|
||||
day = (day < 10) ? '0' + day : day;
|
||||
month = (month < 10) ? '0' + month : month;
|
||||
|
||||
// Return the formatted date
|
||||
return day + '/' + month + '/' + year;
|
||||
}
|
||||
});
|
||||
");
|
||||
*/ ?>
|
||||
<div class="row">
|
||||
<div class="col-md-2 mt-4">
|
||||
<?= $form->field($model, 'is_molecular')->checkbox() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-draft-line"></i> รายการ Specimen</h5>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div class="table-responsive">
|
||||
<?= $form->field($sc_surgical_container, 'items')->label(false)->widget(MultipleInput::class, [
|
||||
'max' => 50,
|
||||
'id' => 'surgicalcontainer-items',
|
||||
'allowEmptyList' => true,
|
||||
'addButtonOptions' => ['class' => 'btn btn-primary'],
|
||||
//'min' => 1,
|
||||
'addButtonPosition' => MultipleInput::POS_FOOTER,
|
||||
'attributeOptions' => [],
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'id_case',
|
||||
'title' => 'ID Case',
|
||||
'value' => function ($data) {
|
||||
return isset($data['id_case']) ? $data['id_case'] : '';
|
||||
},
|
||||
'enableError' => true,
|
||||
'type' => MultipleInputColumn::TYPE_HIDDEN_INPUT,
|
||||
],
|
||||
[
|
||||
'name' => 'id',
|
||||
'title' => 'ID',
|
||||
'value' => function ($data) {
|
||||
return isset($data['id']) ? $data['id'] : '';
|
||||
},
|
||||
'enableError' => true,
|
||||
'type' => MultipleInputColumn::TYPE_HIDDEN_INPUT,
|
||||
],
|
||||
[
|
||||
'name' => 'container_type',
|
||||
'title' => 'รายการ',
|
||||
'type' => MultipleInputColumn::TYPE_DROPDOWN,
|
||||
'value' => function ($data) {
|
||||
return isset($data['container_type']) ? $data['container_type'] : null;
|
||||
},
|
||||
'items' => [
|
||||
1 => 'ขวด',
|
||||
2 => 'ถุง',
|
||||
3 => 'Block',
|
||||
4 => 'Slide'
|
||||
],
|
||||
'enableError' => true,
|
||||
'options' => [
|
||||
'class' => 'new_class',
|
||||
'prompt' => 'เลือกรายการ.....',
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'amount',
|
||||
'title' => 'จำนวน',
|
||||
'options' => ['class' => 'uppercase-input'],
|
||||
//'enableError' => true,
|
||||
'value' => function ($data) {
|
||||
return strtoupper(isset($data['amount'])) ? $data['amount'] : '';
|
||||
},
|
||||
],
|
||||
[
|
||||
'name' => 'specimen_size',
|
||||
'title' => 'ขนาดชิ้นเนื้อ',
|
||||
'type' => MultipleInputColumn::TYPE_DROPDOWN,
|
||||
'value' => function ($data) {
|
||||
return isset($data['specimen_size']) ? $data['specimen_size'] : null;
|
||||
},
|
||||
'items' => [
|
||||
1 => 'smc(เนื้อเล็ก)',
|
||||
2 => 'smc(เนื้อกลาง)',
|
||||
3 => 'smc(เนื้อใหญ่)'
|
||||
],
|
||||
'enableError' => true,
|
||||
'options' => [
|
||||
'class' => 'new_class',
|
||||
'prompt' => 'เลือกขนาดชิ้นเนื้อ',
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'remark',
|
||||
'title' => 'remark',
|
||||
'enableError' => true,
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('.uppercase-input').on('keyup', function() {
|
||||
var input = $(this);
|
||||
var value = input.val().toUpperCase();
|
||||
input.val(value);
|
||||
});
|
||||
"); ?>
|
||||
|
||||
<!-- Delete รายการระบุขนาดชิ้นเนื้อ -->
|
||||
<?php $this->registerJs("
|
||||
$('#surgicalcontainer-items').on('afterInit', function(){
|
||||
//console.log('calls on after initialization event');
|
||||
}).on('beforeAddRow', function(e) {
|
||||
//console.log('calls on before add row event');
|
||||
}).on('afterAddRow', function(e) {
|
||||
//console.log('calls on after add row event');
|
||||
}).on('beforeDeleteRow', function(e, item){
|
||||
//console.log(item);
|
||||
return confirm('คุณแน่ใจนะว่าต้องการลบ?');
|
||||
}).on('afterDeleteRow', function(e, item){
|
||||
//console.log(item);#surgicalcontainer-items-0-from_id
|
||||
var id_case = item.find('.list-cell__block_no').find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id_case\"]').val();
|
||||
var id = item.find('.list-cell__block_no').find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id\"]').val();
|
||||
//alert(id_case + from_id);
|
||||
$.post(\"" . Url::to(['/register/case-update/surgical-container-delete']) . "\",
|
||||
{
|
||||
id_case: id_case,
|
||||
hs_id: hs_id
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
") ?>
|
||||
|
||||
<?php $this->registerJs(
|
||||
"$('#surgicalcontainer-items').on('afterInit', function() {
|
||||
// Initialization event if needed
|
||||
}).on('beforeAddRow', function(e) {
|
||||
// Before adding a row event if needed
|
||||
}).on('afterAddRow', function(e) {
|
||||
// After adding a row event if needed
|
||||
}).on('beforeDeleteRow', function(e, item) {
|
||||
return confirm('คุณแน่ใจนะว่าต้องการลบ?'); // Confirm deletion
|
||||
}).on('afterDeleteRow', function(e, item) {
|
||||
var id_case = item.find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id_case\"]').val();
|
||||
var id = item.find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id\"]').val();
|
||||
|
||||
// Make sure id_case and id are not empty or undefined before sending the request
|
||||
if (id_case && id) {
|
||||
$.post(\"" . Url::to(['/register/case-update/surgical-container-delete']) . "\", {
|
||||
id_case: id_case,
|
||||
id: id
|
||||
}).done(function(response) {
|
||||
if (response.status === 'success') {
|
||||
alert('ลบรายการเรียบร้อยแล้ว');
|
||||
} else {
|
||||
alert('Error: ' + response.message);
|
||||
}
|
||||
}).fail(function() {
|
||||
alert('An error occurred while trying to delete the item.');
|
||||
});
|
||||
} else {
|
||||
alert('Invalid id_case or id.');
|
||||
}
|
||||
});
|
||||
"
|
||||
) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'review_remark')->textarea(['rows' => 5, 'cols' => 50]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mt-3">
|
||||
<h6><i class="ri-bill-line"></i>
|
||||
รายการ Test Order</h6>
|
||||
</div>
|
||||
<?= GridView::widget([
|
||||
'summary' => false,
|
||||
'tableOptions' => ['class' => 'table table-striped truncate m-0'],
|
||||
'dataProvider' => new ActiveDataProvider([
|
||||
'query' => FinanceServiceCharge::find()
|
||||
->where(['id_case' => $model->id_case])
|
||||
]),
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
'charge.code',
|
||||
'charge.name',
|
||||
],
|
||||
'layout' => "<div class='table-outer'>\n{items}\n</div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-file-text-line"></i> ใบส่งตรวจ
|
||||
(Request File)
|
||||
</h6>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'files[]')->label(false)->fileInput(['multiple' => true])->label(false) ?>
|
||||
</div>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($model->getFiles() as $file => $val) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/file/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'file-del',
|
||||
'file' => $val,
|
||||
'id' => $model->id,
|
||||
'id_case' => $model->id_case
|
||||
], [
|
||||
'class' => 'btn btn-sm btn-danger',
|
||||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-image-2-fill"></i> บันทึกภาพ Specimen
|
||||
Container
|
||||
</h6>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'specimen_container_img[]')->fileInput(['multiple' => true])->label(false) ?>
|
||||
</div>
|
||||
<?php if (!empty($model->specimen_container_img)) { ?>
|
||||
|
||||
<div class="mb-3">
|
||||
<h6><i class="ri-file-image-line"></i> Specimen Container
|
||||
List</h6>
|
||||
</div>
|
||||
<div style="width: 250px"><?= $model->getSpecimenDelImgs() ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<!--<div class="row">
|
||||
<?php /*
|
||||
$directoryPath = Yii::getAlias('@webroot') . '/uploads/surgical/specimen_container/' . $model->id_case;
|
||||
if (is_dir($directoryPath)) {
|
||||
$files = \yii\helpers\FileHelper::findFiles($directoryPath);
|
||||
|
||||
if (!empty($files)) {
|
||||
foreach ($files as $index => $file) {
|
||||
$nameFicheiro = basename($file);
|
||||
$filePath = Yii::getAlias('@web') . '/uploads/surgical/specimen_container/' . $model->id_case . '/' . $nameFicheiro;
|
||||
echo "<div class=\"col-md-2\">" . Html::a(Html::img($filePath, ['class' => 'img-fluid']), $filePath, ['target' => '_blank']) . "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
*/ ?>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-file-copy-2-fill"></i> Outsource Data</h6>
|
||||
</strong>
|
||||
<?= $form->field($model, 'is_outlab')->checkbox() ?>
|
||||
<div class="outlab_report" <?= !$model->isNewRecord && $model->is_outlab ? '' : 'style="display: none;"' ?>>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'outlab_report[]')->fileInput(['multiple' => true]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'remark_outlab')->textarea(['spellcheck' => true])->widget(CKEditor::class, [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
'extraPlugins' => 'font',
|
||||
//'extraPlugins' => 'mentions,autocomplete,textwatcher',
|
||||
'removeButtons' => '',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']],
|
||||
['name' => 'insert', 'groups' => ['table']],
|
||||
['name' => 'tools', 'groups' => ['maximize']],
|
||||
//['name' => 'styles', 'groups' => ['font']],
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_outlab') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.outlab_report').show();
|
||||
}else{
|
||||
$('.outlab_report').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
|
||||
<ul>
|
||||
|
||||
<?php
|
||||
foreach ($model->getReport() as $file => $val) {
|
||||
if (!empty($val)) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/report/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'report-del',
|
||||
'file' => $val,
|
||||
'id' => $model->id,
|
||||
'id_case' => $model->id_case
|
||||
], [
|
||||
'class' => 'btn btn-sm btn-danger',
|
||||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
} ?>
|
||||
</ul>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="mb-3">
|
||||
<?= Html::submitButton('<i class="ri-save-line"></i> บันทึกข้อมูล', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert bg-info text-white alert-dismissible d-flex align-items-center fade show" role="alert">
|
||||
<i class="ri-alarm-warning-line fs-3 me-2 lh-1"></i>หมายเหตุ: กรุณาบันทึกข้อมูลก่อนการ Print
|
||||
Sticker
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end() ?>
|
||||
</div>
|
||||
</div>
|
||||
<!--card-body-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->render('_js') ?>
|
||||
|
|
@ -1,10 +1,14 @@
|
|||
<?php
|
||||
|
||||
|
||||
use common\models\ConstCancerRegistry;
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use common\models\User;
|
||||
use yii\bootstrap5\Modal;
|
||||
use kartik\date\DatePicker;
|
||||
use kartik\select2\Select2;
|
||||
use common\models\ConstRace;
|
||||
use common\models\ConstWard;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\widgets\MaskedInput;
|
||||
|
|
@ -13,15 +17,12 @@ use common\models\ConstRights;
|
|||
use yii\bootstrap5\ActiveForm;
|
||||
use common\models\PatientTitle;
|
||||
use common\models\ConstHospital;
|
||||
use common\models\ConstNationality;
|
||||
use common\models\ConstRace;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use dosamigos\ckeditor\CKEditor;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use kartik\select2\Select2;
|
||||
use common\models\ConstNationality;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
use unclead\multipleinput\MultipleInputColumn;
|
||||
use yii\helpers\Url;
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -108,8 +109,8 @@ use yii\helpers\Url;
|
|||
</div>
|
||||
<div class="col-md-6">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<embed src="<?= Url::to(['sticker/print', 'id_case' => $model->id_case], true) ?>#view=fit"
|
||||
type="application/pdf" width="100%" height="252">
|
||||
<embed src="<?= Url::to(['sticker/print', 'id_case' => $model->id_case], true) ?>#view=fit"
|
||||
type="application/pdf" width="100%" height="252">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div><!-- row -->
|
||||
|
|
@ -118,7 +119,7 @@ use yii\helpers\Url;
|
|||
<h5><i class="ri-file-user-line"></i> ข้อมูลผู้ป่วย (Patient)</h5>
|
||||
</div>
|
||||
<?php if ($model->isNewRecord) { ?>
|
||||
<?= $form->field($model, 'patient_id')->label(false)->hiddenInput() ?>
|
||||
<?= $form->field($model, 'patient_id')->label(false)->hiddenInput() ?>
|
||||
<?php } ?>
|
||||
<div class="mt-4">
|
||||
<div class="row">
|
||||
|
|
@ -151,34 +152,37 @@ use yii\helpers\Url;
|
|||
<?= $form->field($model, 'gender')->dropDownList(['U' => '', 'ช' => 'ชาย', 'ญ' => 'หญิง']) ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= Html::button('ค้นหาผู้ป่วย', ['class' => 'btn btn-info', 'data-toggle' => 'modal', 'data-target' => '#patientModal']) ?>
|
||||
<?= Html::button('ค้นหาผู้ป่วย', ['class' => 'btn btn-info', 'data-bs-toggle' => 'modal', 'data-bs-target' => '#patientModal']) ?>
|
||||
|
||||
<?php
|
||||
Modal::begin([
|
||||
'id' => 'patientModal',
|
||||
'header' => '<h4>ค้นหาผู้ป่วย</h4>',
|
||||
]);
|
||||
|
||||
?>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="hn-input">กรอก HN</label>
|
||||
<input type="text" id="hn-input" class="form-control">
|
||||
<div class="modal fade" id="patientModal" tabindex="-1" aria-labelledby="patientModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="patientModalLabel">ค้นหาผู้ป่วย</h4>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="hn-input">กรอก HN</label>
|
||||
<input type="text" id="hn-input" class="form-control">
|
||||
</div>
|
||||
<div class="form-group mt-3">
|
||||
<?= Html::button('ค้นหา', ['class' => 'btn btn-primary', 'id' => 'btn-search-patient']) ?>
|
||||
</div>
|
||||
<div id="patient-detail" class="mt-3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::button('ค้นหา', ['class' => 'btn btn-primary', 'id' => 'btn-search-patient']) ?>
|
||||
</div>
|
||||
|
||||
<div id="patient-detail"></div>
|
||||
|
||||
<?php Modal::end(); ?>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('#btn-search-patient').on('click', function() {
|
||||
let hn = $('#hn-input').val();
|
||||
$.get('".Url::to(['case/search-patient'])."', { hn: hn }, function(response) {
|
||||
$.get('" . Url::to(['case/search-patient']) . "', { hn: hn }, function(response) {
|
||||
if (response.success) {
|
||||
$('#patient-detail').html(response.html);
|
||||
} else {
|
||||
|
|
@ -290,8 +294,8 @@ function selectPatient(data) {
|
|||
<div class="mt-3">
|
||||
<div class="row">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'pathologist_id')->widget(Select2::class, [
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'pathologist_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(User::find()->where(['role' => 'pathologist', 'status' => 10])->orderBy(['realname' => SORT_ASC])->all(), 'id', 'realname'),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
|
|
@ -299,7 +303,7 @@ function selectPatient(data) {
|
|||
'placeholder' => 'เลือก Pathologist...'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'note_id')->widget(Select2::class, [
|
||||
|
|
@ -357,6 +361,7 @@ function selectPatient(data) {
|
|||
]
|
||||
]) ?>
|
||||
</div>
|
||||
|
||||
<!--<div class="col-md-2 mt-4">
|
||||
<?php // $form->field($model, 'is_ot')->checkbox()
|
||||
?>
|
||||
|
|
@ -555,12 +560,12 @@ function selectPatient(data) {
|
|||
</div>
|
||||
</div>
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-draft-line"></i> รายการ Specimen</h5>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div class="table-responsive">
|
||||
<?= $form->field($sc_surgical_container, 'items')->label(false)->widget(MultipleInput::class, [
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-draft-line"></i> รายการ Specimen</h5>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div class="table-responsive">
|
||||
<?= $form->field($sc_surgical_container, 'items')->label(false)->widget(MultipleInput::class, [
|
||||
'max' => 50,
|
||||
'id' => 'surgicalcontainer-items',
|
||||
'allowEmptyList' => true,
|
||||
|
|
@ -640,8 +645,8 @@ function selectPatient(data) {
|
|||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
|
|
@ -720,13 +725,13 @@ function selectPatient(data) {
|
|||
</div>
|
||||
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mt-3">
|
||||
<h6><i class="ri-bill-line"></i>
|
||||
รายการ Test Order</h6>
|
||||
</div>
|
||||
<?= GridView::widget([
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mt-3">
|
||||
<h6><i class="ri-bill-line"></i>
|
||||
รายการ Test Order</h6>
|
||||
</div>
|
||||
<?= GridView::widget([
|
||||
'summary' => false,
|
||||
'tableOptions' => ['class' => 'table table-striped truncate m-0'],
|
||||
'dataProvider' => new ActiveDataProvider([
|
||||
|
|
@ -740,8 +745,8 @@ function selectPatient(data) {
|
|||
],
|
||||
'layout' => "<div class='table-outer'>\n{items}\n</div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="mt-4">
|
||||
|
|
@ -756,8 +761,8 @@ function selectPatient(data) {
|
|||
<?php
|
||||
foreach ($model->getFiles() as $file => $val) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/file/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/file/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'file-del',
|
||||
'file' => $val,
|
||||
|
|
@ -768,7 +773,7 @@ function selectPatient(data) {
|
|||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -783,11 +788,11 @@ function selectPatient(data) {
|
|||
</div>
|
||||
<?php if (!empty($model->specimen_container_img)) { ?>
|
||||
|
||||
<div class="mb-3">
|
||||
<h6><i class="ri-file-image-line"></i> Specimen Container
|
||||
List</h6>
|
||||
</div>
|
||||
<div style="width: 250px"><?= $model->getSpecimenDelImgs() ?></div>
|
||||
<div class="mb-3">
|
||||
<h6><i class="ri-file-image-line"></i> Specimen Container
|
||||
List</h6>
|
||||
</div>
|
||||
<div style="width: 250px"><?= $model->getSpecimenDelImgs() ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<!--<div class="row">
|
||||
|
|
@ -856,8 +861,8 @@ function selectPatient(data) {
|
|||
foreach ($model->getReport() as $file => $val) {
|
||||
if (!empty($val)) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/report/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/report/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'report-del',
|
||||
'file' => $val,
|
||||
|
|
@ -868,7 +873,7 @@ function selectPatient(data) {
|
|||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
} ?>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,913 @@
|
|||
<?php
|
||||
|
||||
|
||||
use yii\helpers\Url;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use common\models\User;
|
||||
use yii\bootstrap5\Modal;
|
||||
use kartik\date\DatePicker;
|
||||
use kartik\select2\Select2;
|
||||
use common\models\ConstRace;
|
||||
use common\models\ConstWard;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\widgets\MaskedInput;
|
||||
use common\models\ConstDoctor;
|
||||
use common\models\ConstRights;
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use common\models\PatientTitle;
|
||||
use common\models\ConstHospital;
|
||||
use dosamigos\ckeditor\CKEditor;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\ConstNationality;
|
||||
use common\models\FinanceServiceCharge;
|
||||
use unclead\multipleinput\MultipleInput;
|
||||
use unclead\multipleinput\MultipleInputColumn;
|
||||
|
||||
?>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="ri-file-edit-line"></i> <?= $this->title ?></h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php $form = ActiveForm::begin([
|
||||
'enableAjaxValidation' => true,
|
||||
'enableClientValidation' => false,
|
||||
'validateOnChange' => true,
|
||||
'validateOnSubmit' => true,
|
||||
'validateOnBlur' => false,
|
||||
]) ?>
|
||||
<?= $form->errorSummary([$model]) ?>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'id_case')->widget(MaskedInput::class, [
|
||||
'mask' => Yii::$app->params['idCaseMask'],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'style' => 'font-weight: bold',
|
||||
'disabled' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'his_ln')->textInput(['readonly' => true]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="mb-3">
|
||||
<?= $form->field($model, 'hospital_id')->widget(Select2::classname(), [
|
||||
'data' => ArrayHelper::map(ConstHospital::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
'options' => [
|
||||
'placeholder' => 'เลือกหน่วยงาน ....',
|
||||
],
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
//'initValueText' => (!$model->isNewRecord ? ConstHospital::findOne($model->hospital_id)->name : ''),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
/*'ajax' => [
|
||||
'url' => Url::to(['/site/hospital-list']),
|
||||
'dataType' => 'json',1
|
||||
'data' => new JsExpression('function(params) { return {q:params.term}; }')
|
||||
],*/
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'h_n')->textInput() ?>
|
||||
<?= Html::a('<span class="fa fa-check"></span>', 'javascript:void(0);', ['id' => 'check-patient', 'class' => 'btn btn-sm btn-success']) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('#check-patient').click(function(){
|
||||
var hn = $('#" . Html::getInputId($model, 'h_n') . "').val();
|
||||
if (!hn) {
|
||||
alert('กรุณากรอก HN ก่อน');
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '" . \yii\helpers\Url::to(['case/check-patient']) . "',
|
||||
type: 'POST',
|
||||
data: { h_n: hn },
|
||||
success: function(response) {
|
||||
if (response.error) {
|
||||
alert(response.error);
|
||||
return;
|
||||
}
|
||||
|
||||
// เติมข้อมูลจาก API response ลงในฟอร์ม
|
||||
$('#" . Html::getInputId($model, 'patient_id') . "').val(response.req_no);
|
||||
$('#" . Html::getInputId($model, 'title_id') . "').val(response.title);
|
||||
$('#" . Html::getInputId($model, 'given_name') . "').val(response.firstName);
|
||||
$('#" . Html::getInputId($model, 'surname') . "').val(response.lastName);
|
||||
$('#" . Html::getInputId($model, 'hospital_id') . "').val(response.title);
|
||||
$('#" . Html::getInputId($model, 'gender') . "').val(response.sex);
|
||||
$('#" . Html::getInputId($model, 'race') . "').val(response.RACE);
|
||||
$('#" . Html::getInputId($model, 'id_card') . "').val(response.CardID);
|
||||
|
||||
// การจัดการวันที่ birthDay
|
||||
if (response.birthDay) {
|
||||
var birthdate = response.birthDay;
|
||||
var formattedDate = birthdate.substr(0, 4) + '-' + birthdate.substr(4, 2) + '-' + birthdate.substr(6, 2);
|
||||
$('#" . Html::getInputId($model, 'birthdate') . "').val(formattedDate);
|
||||
} else {
|
||||
$('#" . Html::getInputId($model, 'birthdate') . "').val(''); // ถ้าไม่มีข้อมูล birthDay ให้ใส่ค่าว่าง
|
||||
}
|
||||
|
||||
// การคำนวณอายุ
|
||||
if (response.req_date && response.birthDay) {
|
||||
var birthYear = response.birthDay.substr(0, 4);
|
||||
var reqYear = response.req_date.substr(0, 4);
|
||||
var age = reqYear - birthYear;
|
||||
$('#" . Html::getInputId($model, 'age') . "').val(age);
|
||||
} else {
|
||||
$('#" . Html::getInputId($model, 'age') . "').val(''); // ถ้าไม่มีข้อมูล birthDay หรือ req_date ให้ใส่ค่าว่าง
|
||||
}
|
||||
|
||||
// เติมข้อมูลในช่อง HN
|
||||
$('#" . Html::getInputId($model, 'h_n') . "').val(response.hn);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX Error:', xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
");
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- row
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php /* $form->field($model, 'is_conference')->checkbox() ?>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_conference') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.conference_div').show();
|
||||
}else{
|
||||
$('.conference_div').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
</div>
|
||||
<div class="col-md-4 conference_div"
|
||||
<?= !$model->isNewRecord && $model->is_conference ? '' : 'style="display: none;"' ?>>
|
||||
|
||||
<?= $form->field($model, 'conference_at')->widget(DatePicker::class, [
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
]
|
||||
]) */ ?>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<embed src="<?= Url::to(['sticker/print', 'id_case' => $model->id_case], true) ?>#view=fit"
|
||||
type="application/pdf" width="100%" height="252">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div><!-- row -->
|
||||
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-file-user-line"></i> ข้อมูลผู้ป่วย (Patient)</h5>
|
||||
</div>
|
||||
<?php if ($model->isNewRecord) { ?>
|
||||
<?= $form->field($model, 'patient_id')->label(false)->hiddenInput() ?>
|
||||
<?php } ?>
|
||||
<div class="mt-4">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'title_id')->widget(Select2::classname(), [
|
||||
'data' => ArrayHelper::map(PatientTitle::find()->all(), 'id', 'name'), //->where('id > 1')
|
||||
'options' => [
|
||||
'placeholder' => 'เลือกคำนำหน้า ....',
|
||||
],
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
//'initValueText' => (!$model->isNewRecord ? ConstHospital::findOne($model->hospital_id)->name : ''),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
//'minimumInputLength' => 3,
|
||||
/*'ajax' => [
|
||||
'url' => Url::to(['/site/hospital-list']),
|
||||
'dataType' => 'json',1
|
||||
'data' => new JsExpression('function(params) { return {q:params.term}; }')
|
||||
],*/
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'given_name')->textInput() ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'surname')->textInput() ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'gender')->dropDownList(['U' => '', 'ช' => 'ชาย', 'ญ' => 'หญิง']) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'id_card')->widget(MaskedInput::class, [
|
||||
'mask' => '9-9999-99999-99-9'
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-2"><?= $form->field($model, 'birthdate')->widget(MaskedInput::class, [
|
||||
'mask' => '99/99/9999',
|
||||
'options' => [
|
||||
'id' => 'patient-birthdate',
|
||||
],
|
||||
])
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'nation')->dropDownList(ArrayHelper::map(ConstNationality::find()->all(), 'id', 'name'), ['prompt' => 'Select Nationalily...']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'race')->dropDownList(ArrayHelper::map(ConstRace::find()->all(), 'id', 'name'), ['prompt' => 'Select Race...']) ?>
|
||||
</div>
|
||||
<div class="col-md-2"><?= $form->field($model, 'age')->textInput(['id' => 'patient-age']) ?>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'age_unit')->dropDownList(['ปี' => 'ปี', 'เดือน' => 'เดือน', 'วัน' => 'วัน'], ['id' => 'patient-age_unit']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'a_n'); ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'v_n'); ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'rights_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(ConstRights::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกสิทธิ์การรักษา....'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'ward_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(ConstWard::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'), //->where('id > 1')
|
||||
/*'options' => [
|
||||
'placeholder' => 'เลือกสิทธิ์การรักษา ....',
|
||||
],*/
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกแผนก....'
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'doctor_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
ConstDoctor::find()->orderBy(['fullname' => SORT_ASC])->all(),
|
||||
'id',
|
||||
function ($model) {
|
||||
return $model->fullname;
|
||||
}
|
||||
), //->where('id > 1')
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือกแพทย์เจ้าของคนไข้....'
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php // $form->field($model, 'clinician')->textInput()
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<!--row-->
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-file-edit-line"></i> ข้อมูลการส่งตรวจ (Case)</h5>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
<div class="row">
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'pathologist_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(User::find()->where(['role' => 'pathologist', 'status' => 10])->orderBy(['realname' => SORT_ASC])->all(), 'id', 'realname'),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'placeholder' => 'เลือก Pathologist...'
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'note_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(
|
||||
User::find()
|
||||
->where(['!=', 'role', 'hospital'])
|
||||
->andWhere(['status' => User::STATUS_ACTIVE])
|
||||
->orderBy(['realname' => SORT_DESC])
|
||||
->all(),
|
||||
'id',
|
||||
'realname'
|
||||
),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'placeholder' => 'กรุณาเลือกผู้จด....',
|
||||
'allowClear' => true, // Optional: allows clearing of the selection
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'cut_id')->widget(Select2::class, [
|
||||
'data' => ArrayHelper::map(User::find()->where(['!=', 'role', 'hospital'])->andWhere(['status' => User::STATUS_ACTIVE])->orderBy(['realname' => SORT_DESC])->all(), 'id', 'realname'),
|
||||
'theme' => Select2::THEME_BOOTSTRAP,
|
||||
'pluginOptions' => [
|
||||
'placeholder' => 'กรุณาเลือกผู้ตัด....',
|
||||
'allowClear' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'collected_at')->widget(DatePicker::class, [
|
||||
'options' => ['placeholder' => 'เลือกวันที่เก็บสิ่งส่งตรวจ ...'],
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
//'todayBtn' => true,
|
||||
]
|
||||
])
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'receive_at')->widget(DatePicker::class, [
|
||||
'options' => ['placeholder' => 'เลือกวันที่รับสิ่งส่งตรวจ ...'],
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
//'todayBtn' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
<!--<div class="col-md-2 mt-4">
|
||||
<?php // $form->field($model, 'is_ot')->checkbox()
|
||||
?>
|
||||
</div>-->
|
||||
<?php // }
|
||||
?>
|
||||
<!--<div class="col-md-3"><?php // $form->field($model, 'hos_ref')->textInput()
|
||||
?></div> -->
|
||||
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'clinical_diagnosis')->textarea(['rows' => 5, 'cols' => 50, 'spellcheck' => true])/*->widget(CKEditor::class, [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 120,
|
||||
'extraPlugins' => 'font',
|
||||
//'extraPlugins' => 'mentions,autocomplete,textwatcher',
|
||||
'removeButtons' => '',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']],
|
||||
['name' => 'insert', 'groups' => ['table']],
|
||||
['name' => 'tools', 'groups' => ['maximize']],
|
||||
//['name' => 'styles', 'groups' => ['font']],
|
||||
],
|
||||
]
|
||||
])*/ ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'remark')->textarea(['rows' => 5, 'cols' => 50]) ?>
|
||||
</div>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_express') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.express_div').show();
|
||||
}else{
|
||||
$('.express_div').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
<div class="col-md-3 mt-4">
|
||||
<?= $form->field($model, 'is_express')->checkbox() ?>
|
||||
</div>
|
||||
<div class="row express_div"
|
||||
<?= !$model->isNewRecord && $model->is_express ? '' : 'style="display: none;"' ?>>
|
||||
|
||||
<div class="col-md-2">
|
||||
<?= $form->field($model, 'express_day')->dropDownList(['' => '', '3' => 'ผลด่วน 3 วัน', '5' => 'ผลด่วน 5 วัน', '7' => 'ผลด่วน 7 วัน']) ?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'express_at')->widget(\kartik\date\DatePicker::class, [
|
||||
'pluginOptions' => [
|
||||
'format' => 'dd/mm/yyyy',
|
||||
'allowClear' => true,
|
||||
'autoclose' => true,
|
||||
'todayHighlight' => true,
|
||||
'todayBtn' => true,
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('#" . Html::getInputId($model, 'express_day') . "').on('change', function() {
|
||||
// Get the selected value
|
||||
var selectedValue = $(this).val();
|
||||
//alert(selectedValue);
|
||||
var currentDate = new Date();
|
||||
if(selectedValue == 3){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 3);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
if(selectedValue == 5){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 5);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
if(selectedValue == 7){
|
||||
|
||||
// Add 3 days to the current date
|
||||
var newDate = new Date(currentDate);
|
||||
newDate.setDate(currentDate.getDate() + 7);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
// Update the content of the <span> with the selected value
|
||||
//$('#selectedValue').text(selectedValue);
|
||||
|
||||
function formatDate(date) {
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1; // Months are zero-based
|
||||
var year = date.getFullYear();
|
||||
|
||||
// Add leading zeros if needed
|
||||
day = (day < 10) ? '0' + day : day;
|
||||
month = (month < 10) ? '0' + month : month;
|
||||
|
||||
// Return the formatted date
|
||||
return day + '/' + month + '/' + year; new date
|
||||
}
|
||||
});
|
||||
"); ?>
|
||||
|
||||
|
||||
<!-- ไม่นับวัน เสาร์ - อาทิต-->
|
||||
<?php /*
|
||||
$this->registerJs("
|
||||
$('#" . Html::getInputId($model, 'express_day') . "').on('change', function() {
|
||||
// Get the selected value
|
||||
var selectedValue = $(this).val();
|
||||
//alert(selectedValue);
|
||||
var currentDate = new Date();
|
||||
if (selectedValue == 3 || selectedValue == 5 || selectedValue == 7) {
|
||||
// Determine the number of days to add based on the selected value
|
||||
var daysToAdd;
|
||||
if (selectedValue == 3) {
|
||||
daysToAdd = 3;
|
||||
} else if (selectedValue == 5) {
|
||||
daysToAdd = 5;
|
||||
} else if (selectedValue == 7) {
|
||||
daysToAdd = 7;
|
||||
}
|
||||
|
||||
// Add the specified number of days to the current date, skipping holidays, Saturdays, and Sundays
|
||||
var newDate = addBusinessDays(currentDate, daysToAdd);
|
||||
|
||||
// Display the new date
|
||||
$('#" . Html::getInputId($model, 'express_at') . "').val(formatDate(newDate));
|
||||
|
||||
//alert(formatDate(newDate));
|
||||
}
|
||||
|
||||
// Update the content of the <span> with the selected value
|
||||
//$('#selectedValue').text(selectedValue);
|
||||
|
||||
function addBusinessDays(date, days) {
|
||||
var count = 0;
|
||||
while (count < days) {
|
||||
date.setDate(date.getDate() + 1);
|
||||
if (isWorkingDay(date)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
function isWorkingDay(date) {
|
||||
// Check if the date is a Saturday or Sunday
|
||||
if (date.getDay() === 0 || date.getDay() === 6) {
|
||||
return false;
|
||||
}
|
||||
// Add logic here to check if the date is a holiday
|
||||
// You need to implement the logic to determine holidays based on your requirements
|
||||
// For simplicity, I'm leaving this part for you to implement
|
||||
return true;
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth() + 1; // Months are zero-based
|
||||
var year = date.getFullYear();
|
||||
|
||||
// Add leading zeros if needed
|
||||
day = (day < 10) ? '0' + day : day;
|
||||
month = (month < 10) ? '0' + month : month;
|
||||
|
||||
// Return the formatted date
|
||||
return day + '/' + month + '/' + year;
|
||||
}
|
||||
});
|
||||
");
|
||||
*/ ?>
|
||||
<div class="row">
|
||||
<div class="col-md-2 mt-4">
|
||||
<?= $form->field($model, 'is_molecular')->checkbox() ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="mt-4">
|
||||
<h5><i class="ri-draft-line"></i> รายการ Specimen</h5>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<div class="table-responsive">
|
||||
<?= $form->field($sc_surgical_container, 'items')->label(false)->widget(MultipleInput::class, [
|
||||
'max' => 50,
|
||||
'id' => 'surgicalcontainer-items',
|
||||
'allowEmptyList' => true,
|
||||
'addButtonOptions' => ['class' => 'btn btn-primary'],
|
||||
//'min' => 1,
|
||||
'addButtonPosition' => MultipleInput::POS_FOOTER,
|
||||
'attributeOptions' => [],
|
||||
'columns' => [
|
||||
[
|
||||
'name' => 'id_case',
|
||||
'title' => 'ID Case',
|
||||
'value' => function ($data) {
|
||||
return isset($data['id_case']) ? $data['id_case'] : '';
|
||||
},
|
||||
'enableError' => true,
|
||||
'type' => MultipleInputColumn::TYPE_HIDDEN_INPUT,
|
||||
],
|
||||
[
|
||||
'name' => 'id',
|
||||
'title' => 'ID',
|
||||
'value' => function ($data) {
|
||||
return isset($data['id']) ? $data['id'] : '';
|
||||
},
|
||||
'enableError' => true,
|
||||
'type' => MultipleInputColumn::TYPE_HIDDEN_INPUT,
|
||||
],
|
||||
[
|
||||
'name' => 'container_type',
|
||||
'title' => 'รายการ',
|
||||
'type' => MultipleInputColumn::TYPE_DROPDOWN,
|
||||
'value' => function ($data) {
|
||||
return isset($data['container_type']) ? $data['container_type'] : null;
|
||||
},
|
||||
'items' => [
|
||||
1 => 'ขวด',
|
||||
2 => 'ถุง',
|
||||
3 => 'Block',
|
||||
4 => 'Slide'
|
||||
],
|
||||
'enableError' => true,
|
||||
'options' => [
|
||||
'class' => 'new_class',
|
||||
'prompt' => 'เลือกรายการ.....',
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'amount',
|
||||
'title' => 'จำนวน',
|
||||
'options' => ['class' => 'uppercase-input'],
|
||||
//'enableError' => true,
|
||||
'value' => function ($data) {
|
||||
return strtoupper(isset($data['amount'])) ? $data['amount'] : '';
|
||||
},
|
||||
],
|
||||
[
|
||||
'name' => 'specimen_size',
|
||||
'title' => 'ขนาดชิ้นเนื้อ',
|
||||
'type' => MultipleInputColumn::TYPE_DROPDOWN,
|
||||
'value' => function ($data) {
|
||||
return isset($data['specimen_size']) ? $data['specimen_size'] : null;
|
||||
},
|
||||
'items' => [
|
||||
1 => 'smc(เนื้อเล็ก)',
|
||||
2 => 'smc(เนื้อกลาง)',
|
||||
3 => 'smc(เนื้อใหญ่)'
|
||||
],
|
||||
'enableError' => true,
|
||||
'options' => [
|
||||
'class' => 'new_class',
|
||||
'prompt' => 'เลือกขนาดชิ้นเนื้อ',
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'remark',
|
||||
'title' => 'remark',
|
||||
'enableError' => true,
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
$this->registerJs("
|
||||
$('.uppercase-input').on('keyup', function() {
|
||||
var input = $(this);
|
||||
var value = input.val().toUpperCase();
|
||||
input.val(value);
|
||||
});
|
||||
"); ?>
|
||||
|
||||
<!-- Delete รายการระบุขนาดชิ้นเนื้อ -->
|
||||
<?php $this->registerJs("
|
||||
$('#surgicalcontainer-items').on('afterInit', function(){
|
||||
//console.log('calls on after initialization event');
|
||||
}).on('beforeAddRow', function(e) {
|
||||
//console.log('calls on before add row event');
|
||||
}).on('afterAddRow', function(e) {
|
||||
//console.log('calls on after add row event');
|
||||
}).on('beforeDeleteRow', function(e, item){
|
||||
//console.log(item);
|
||||
return confirm('คุณแน่ใจนะว่าต้องการลบ?');
|
||||
}).on('afterDeleteRow', function(e, item){
|
||||
//console.log(item);#surgicalcontainer-items-0-from_id
|
||||
var id_case = item.find('.list-cell__block_no').find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id_case\"]').val();
|
||||
var id = item.find('.list-cell__block_no').find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id\"]').val();
|
||||
//alert(id_case + from_id);
|
||||
$.post(\"" . Url::to(['/register/case-update/surgical-container-delete']) . "\",
|
||||
{
|
||||
id_case: id_case,
|
||||
hs_id: hs_id
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
") ?>
|
||||
|
||||
<?php $this->registerJs(
|
||||
"$('#surgicalcontainer-items').on('afterInit', function() {
|
||||
// Initialization event if needed
|
||||
}).on('beforeAddRow', function(e) {
|
||||
// Before adding a row event if needed
|
||||
}).on('afterAddRow', function(e) {
|
||||
// After adding a row event if needed
|
||||
}).on('beforeDeleteRow', function(e, item) {
|
||||
return confirm('คุณแน่ใจนะว่าต้องการลบ?'); // Confirm deletion
|
||||
}).on('afterDeleteRow', function(e, item) {
|
||||
var id_case = item.find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id_case\"]').val();
|
||||
var id = item.find('input[id*=\"surgicalcontainer-items-\"][id$=\"-id\"]').val();
|
||||
|
||||
// Make sure id_case and id are not empty or undefined before sending the request
|
||||
if (id_case && id) {
|
||||
$.post(\"" . Url::to(['/register/case-update/surgical-container-delete']) . "\", {
|
||||
id_case: id_case,
|
||||
id: id
|
||||
}).done(function(response) {
|
||||
if (response.status === 'success') {
|
||||
alert('ลบรายการเรียบร้อยแล้ว');
|
||||
} else {
|
||||
alert('Error: ' + response.message);
|
||||
}
|
||||
}).fail(function() {
|
||||
alert('An error occurred while trying to delete the item.');
|
||||
});
|
||||
} else {
|
||||
alert('Invalid id_case or id.');
|
||||
}
|
||||
});
|
||||
"
|
||||
) ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'review_remark')->textarea(['rows' => 5, 'cols' => 50]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$model->isNewRecord) { ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="mt-3">
|
||||
<h6><i class="ri-bill-line"></i>
|
||||
รายการ Test Order</h6>
|
||||
</div>
|
||||
<?= GridView::widget([
|
||||
'summary' => false,
|
||||
'tableOptions' => ['class' => 'table table-striped truncate m-0'],
|
||||
'dataProvider' => new ActiveDataProvider([
|
||||
'query' => FinanceServiceCharge::find()
|
||||
->where(['id_case' => $model->id_case])
|
||||
]),
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
'charge.code',
|
||||
'charge.name',
|
||||
],
|
||||
'layout' => "<div class='table-outer'>\n{items}\n</div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-file-text-line"></i> ใบส่งตรวจ
|
||||
(Request File)
|
||||
</h6>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'files[]')->label(false)->fileInput(['multiple' => true])->label(false) ?>
|
||||
</div>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($model->getFiles() as $file => $val) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/file/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'file-del',
|
||||
'file' => $val,
|
||||
'id' => $model->id,
|
||||
'id_case' => $model->id_case
|
||||
], [
|
||||
'class' => 'btn btn-sm btn-danger',
|
||||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-image-2-fill"></i> บันทึกภาพ Specimen
|
||||
Container
|
||||
</h6>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'specimen_container_img[]')->fileInput(['multiple' => true])->label(false) ?>
|
||||
</div>
|
||||
<?php if (!empty($model->specimen_container_img)) { ?>
|
||||
|
||||
<div class="mb-3">
|
||||
<h6><i class="ri-file-image-line"></i> Specimen Container
|
||||
List</h6>
|
||||
</div>
|
||||
<div style="width: 250px"><?= $model->getSpecimenDelImgs() ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<!--<div class="row">
|
||||
<?php /*
|
||||
$directoryPath = Yii::getAlias('@webroot') . '/uploads/surgical/specimen_container/' . $model->id_case;
|
||||
if (is_dir($directoryPath)) {
|
||||
$files = \yii\helpers\FileHelper::findFiles($directoryPath);
|
||||
|
||||
if (!empty($files)) {
|
||||
foreach ($files as $index => $file) {
|
||||
$nameFicheiro = basename($file);
|
||||
$filePath = Yii::getAlias('@web') . '/uploads/surgical/specimen_container/' . $model->id_case . '/' . $nameFicheiro;
|
||||
echo "<div class=\"col-md-2\">" . Html::a(Html::img($filePath, ['class' => 'img-fluid']), $filePath, ['target' => '_blank']) . "</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
*/ ?>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<h6><i class="ri-file-copy-2-fill"></i> Outsource Data</h6>
|
||||
</strong>
|
||||
<?= $form->field($model, 'is_outlab')->checkbox() ?>
|
||||
<div class="outlab_report" <?= !$model->isNewRecord && $model->is_outlab ? '' : 'style="display: none;"' ?>>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?= $form->field($model, 'outlab_report[]')->fileInput(['multiple' => true]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?= $form->field($model, 'remark_outlab')->textarea(['spellcheck' => true])->widget(CKEditor::class, [
|
||||
'preset' => 'custom',
|
||||
'clientOptions' => [
|
||||
'height' => 200,
|
||||
'extraPlugins' => 'font',
|
||||
//'extraPlugins' => 'mentions,autocomplete,textwatcher',
|
||||
'removeButtons' => '',
|
||||
'toolbarGroups' => [
|
||||
['name' => 'clipboard', 'groups' => ['undo', 'redo', 'cut', 'copy', 'paste']],
|
||||
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
|
||||
['name' => 'paragraph', 'groups' => ['list', 'align']],
|
||||
['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']],
|
||||
['name' => 'insert', 'groups' => ['table']],
|
||||
['name' => 'tools', 'groups' => ['maximize']],
|
||||
//['name' => 'styles', 'groups' => ['font']],
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->registerJs("
|
||||
$(\"input[name='" . Html::getInputName($model, 'is_outlab') . "']\").change(function() {
|
||||
if(this.checked == true){
|
||||
$('.outlab_report').show();
|
||||
}else{
|
||||
$('.outlab_report').hide();
|
||||
}
|
||||
});
|
||||
") ?>
|
||||
|
||||
<ul>
|
||||
|
||||
<?php
|
||||
foreach ($model->getReport() as $file => $val) {
|
||||
if (!empty($val)) {
|
||||
?>
|
||||
<li><?= Html::a($val, Yii::getAlias('@web') . '/uploads/surgical/report/' . $val, ['target' => '_blank']); ?>
|
||||
<?php
|
||||
echo Html::a('<i class="ri-close-fill"></i>', [
|
||||
'report-del',
|
||||
'file' => $val,
|
||||
'id' => $model->id,
|
||||
'id_case' => $model->id_case
|
||||
], [
|
||||
'class' => 'btn btn-sm btn-danger',
|
||||
'data-confirm' => 'ต้องการลบ?'
|
||||
]);
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
} ?>
|
||||
</ul>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="mb-3">
|
||||
<?= Html::submitButton('<i class="ri-save-line"></i> บันทึกข้อมูล', ['class' => 'btn btn-success']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert bg-info text-white alert-dismissible d-flex align-items-center fade show" role="alert">
|
||||
<i class="ri-alarm-warning-line fs-3 me-2 lh-1"></i>หมายเหตุ: กรุณาบันทึกข้อมูลก่อนการ Print
|
||||
Sticker
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end() ?>
|
||||
</div>
|
||||
</div>
|
||||
<!--card-body-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->render('_js') ?>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CancerRegistry */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? 'เพิ่มข้อมูล' : 'แก้ไข', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-danger']) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\modules\register\models\CytoSpecimenTypeSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="cyto-specimen-type-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'group_case') ?>
|
||||
|
||||
<?= $form->field($model, 'is_view') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-outline-secondary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Create Cancer Registry';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cancer Registry', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\modules\register\models\CancerRegistry */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Cancer Registry';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><i class="ri-file-text-line"></i> <?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
<?= Html::a('<i class="ri-add-fill"></i> เพิ่ม Cancer Registry', ['create'], ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]);
|
||||
?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget([
|
||||
'pager' => ['class' => 'yii\bootstrap5\LinkPager'],
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
|
||||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
//'id',
|
||||
'name',
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'headerOptions' => ['class' => 'custom-action-column-header'],
|
||||
'contentOptions' => ['class' => 'custom-action-column'],
|
||||
'template' => '{view} {update} {delete}', // Customize buttons if needed
|
||||
'buttons' => [
|
||||
'view' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-eye-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'View'),
|
||||
'class' => 'btn btn-outline-info btn-sm'
|
||||
]);
|
||||
},
|
||||
'update' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-pencil-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Update'),
|
||||
'class' => 'btn btn-outline-warning btn-sm'
|
||||
]);
|
||||
},
|
||||
'delete' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-delete-bin-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Delete'),
|
||||
'data-confirm' => Yii::t('app', 'คุณแน่ใจว่าต้องการลบรายการนี้หรือไม่ ?'),
|
||||
'data-method' => 'post',
|
||||
'class' => 'btn btn-outline-danger btn-sm'
|
||||
]);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Update Cyto Source of Specimens: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Cyto Source of Specimens', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'แก้ไข';
|
||||
?>
|
||||
<div class="cyto-specimen-type-update">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"></h4>
|
||||
|
||||
<div class="heading-elements">
|
||||
<ul class="list-inline mb-0">
|
||||
<li><a data-action="expand"><i class="ft-maximize"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Specimen Types', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><?= Html::encode($this->title) ?></h5>
|
||||
<div class="d-flex gap-2 justify-content-end">
|
||||
<?= Html::a('แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
'group_case',
|
||||
[
|
||||
//'attribute' => 'charge_id',
|
||||
'format' => 'raw',
|
||||
'label' => 'สถานะ',
|
||||
'value' => function ($model) {
|
||||
$arr = [1 => '<span class="badge badge-success"> ใช้งาน</span>', 0 => '<span class="badge badge-danger"> ไม่ใช้งาน</span>'];
|
||||
return isset($model->is_view) ? ($arr[$model->is_view]) : '';
|
||||
},
|
||||
],
|
||||
//'is_view',
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? 'เพิ่มข้อมูล' : 'แก้ไข', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-danger']) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\modules\register\models\CytoSpecimenTypeSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="cyto-specimen-type-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'group_case') ?>
|
||||
|
||||
<?= $form->field($model, 'is_view') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-outline-secondary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Create Cyto Fixation';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Fixations', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\modules\register\models\CytoFixationSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Cyto Fixation';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><i class="ri-file-text-line"></i> <?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
<?= Html::a('<i class="ri-add-fill"></i> เพิ่ม Cyto Fixation', ['create'], ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]);
|
||||
?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget([
|
||||
'pager' => ['class' => 'yii\bootstrap5\LinkPager'],
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
|
||||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
|
||||
'columns' => [
|
||||
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
//'id',
|
||||
'name',
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'headerOptions' => ['class' => 'custom-action-column-header'],
|
||||
'contentOptions' => ['class' => 'custom-action-column'],
|
||||
'template' => '{view} {update} {delete}', // Customize buttons if needed
|
||||
'buttons' => [
|
||||
'view' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-eye-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'View'),
|
||||
'class' => 'btn btn-outline-info btn-sm'
|
||||
]);
|
||||
},
|
||||
'update' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-pencil-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Update'),
|
||||
'class' => 'btn btn-outline-warning btn-sm'
|
||||
]);
|
||||
},
|
||||
'delete' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-delete-bin-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Delete'),
|
||||
'data-confirm' => Yii::t('app', 'คุณแน่ใจว่าต้องการลบรายการนี้หรือไม่ ?'),
|
||||
'data-method' => 'post',
|
||||
'class' => 'btn btn-outline-danger btn-sm'
|
||||
]);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Update Cyto Source of Specimens: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Cyto Source of Specimens', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'แก้ไข';
|
||||
?>
|
||||
<div class="cyto-specimen-type-update">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"></h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Specimen Types', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><?= Html::encode($this->title) ?></h5>
|
||||
<div class="d-flex gap-2 justify-content-end">
|
||||
<?= Html::a('แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
'group_case',
|
||||
[
|
||||
//'attribute' => 'charge_id',
|
||||
'format' => 'raw',
|
||||
'label' => 'สถานะ',
|
||||
'value' => function ($model) {
|
||||
$arr = [1 => '<span class="badge badge-success"> ใช้งาน</span>', 0 => '<span class="badge badge-danger"> ไม่ใช้งาน</span>'];
|
||||
return isset($model->is_view) ? ($arr[$model->is_view]) : '';
|
||||
},
|
||||
],
|
||||
//'is_view',
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? 'เพิ่มข้อมูล' : 'แก้ไข', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-danger']) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\modules\register\models\CytoSpecimenTypeSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="cyto-specimen-type-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'group_case') ?>
|
||||
|
||||
<?= $form->field($model, 'is_view') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-outline-secondary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Create Cyto Source of Specimen';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Source of Specimens', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\modules\register\models\CytoSourceOfSpecimenSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Cyto Source of Specimen';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><i class="ri-file-text-line"></i> <?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
<?= Html::a('<i class="ri-add-fill"></i> เพิ่ม Cyto Source of Specimen', ['create'], ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]);
|
||||
?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget([
|
||||
'pager' => ['class' => 'yii\bootstrap5\LinkPager'],
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
|
||||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
|
||||
'columns' => [
|
||||
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
//'id',
|
||||
'name',
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'headerOptions' => ['class' => 'custom-action-column-header'],
|
||||
'contentOptions' => ['class' => 'custom-action-column'],
|
||||
'template' => '{view} {update} {delete}', // Customize buttons if needed
|
||||
'buttons' => [
|
||||
'view' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-eye-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'View'),
|
||||
'class' => 'btn btn-outline-info btn-sm'
|
||||
]);
|
||||
},
|
||||
'update' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-pencil-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Update'),
|
||||
'class' => 'btn btn-outline-warning btn-sm'
|
||||
]);
|
||||
},
|
||||
'delete' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-delete-bin-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Delete'),
|
||||
'data-confirm' => Yii::t('app', 'คุณแน่ใจว่าต้องการลบรายการนี้หรือไม่ ?'),
|
||||
'data-method' => 'post',
|
||||
'class' => 'btn btn-outline-danger btn-sm'
|
||||
]);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Update Cyto Source of Specimens: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Cyto Source of Specimens', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'แก้ไข';
|
||||
?>
|
||||
<div class="cyto-specimen-type-update">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"></h4>
|
||||
|
||||
<div class="heading-elements">
|
||||
<ul class="list-inline mb-0">
|
||||
<li><a data-action="expand"><i class="ft-maximize"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Specimen Types', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><?= Html::encode($this->title) ?></h5>
|
||||
<div class="d-flex gap-2 justify-content-end">
|
||||
<?= Html::a('แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
'group_case',
|
||||
[
|
||||
//'attribute' => 'charge_id',
|
||||
'format' => 'raw',
|
||||
'label' => 'สถานะ',
|
||||
'value' => function ($model) {
|
||||
$arr = [1 => '<span class="badge badge-success"> ใช้งาน</span>', 0 => '<span class="badge badge-danger"> ไม่ใช้งาน</span>'];
|
||||
return isset($model->is_view) ? ($arr[$model->is_view]) : '';
|
||||
},
|
||||
],
|
||||
//'is_view',
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -27,7 +27,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
'pager' => ['class' => 'yii\bootstrap5\LinkPager'],
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'tableOptions' => ['class' => 'table table-striped truncate m-0'],
|
||||
'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
|
||||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
|
||||
'columns' => [
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? 'เพิ่มข้อมูล' : 'แก้ไข', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-danger']) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\modules\register\models\CytoSpecimenTypeSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="cyto-specimen-type-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'group_case') ?>
|
||||
|
||||
<?= $form->field($model, 'is_view') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-outline-secondary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Create Cyto Specimen';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Specimens', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="cyto-specimen-type-create">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -10,22 +10,22 @@ use yii\grid\GridView;
|
|||
$this->title = 'Cyto Specimens';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="row gx-3">
|
||||
<div class="col-sm-12">
|
||||
<div class="card md-3">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><i class="ri-file-list-line"></i>
|
||||
<?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
<?= Html::a('<i class="ri-add-fill"></i> เพิ่ม Cyto Specimen', ['create'], ['class' => 'btn btn-primary ms-auto']) ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]);
|
||||
|
||||
<div class="card md-3">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><i class="ri-file-list-line"></i>
|
||||
<?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
<?= Html::a('<i class="ri-add-fill"></i> เพิ่ม Cyto Specimen', ['create'], ['class' => 'btn btn-primary ms-auto']) ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]);
|
||||
?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget([
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget([
|
||||
'pager' => ['class' => 'yii\bootstrap5\LinkPager'],
|
||||
'tableOptions' => ['class' => ' table truncate align-middle'],
|
||||
'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
|
||||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'columns' => [
|
||||
|
|
@ -68,8 +68,6 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Update Cyto Specimen Type: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Specimen Types', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'แก้ไข';
|
||||
?>
|
||||
<div class="cyto-specimen-type-update">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><?= Html::encode($this->title) ?></h5>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Specimen', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><?= Html::encode($this->title) ?></h5>
|
||||
<div class="d-flex gap-2 justify-content-end">
|
||||
<?= Html::a('แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
/*[
|
||||
//'attribute' => 'charge_id',
|
||||
'format' => 'raw',
|
||||
'label' => 'สถานะ',
|
||||
'value' => function ($model) {
|
||||
$arr = [1 => '<span class="badge badge-success"> ใช้งาน</span>', 0 => '<span class="badge badge-danger"> ไม่ใช้งาน</span>'];
|
||||
return isset($model->is_view) ? ($arr[$model->is_view]) : '';
|
||||
},
|
||||
],*/
|
||||
//'is_view',
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
|
||||
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton($model->isNewRecord ? 'เพิ่มข้อมูล' : 'แก้ไข', ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-danger']) ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\modules\register\models\CytoSpecimenTypeSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<div class="cyto-specimen-type-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['index'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id') ?>
|
||||
|
||||
<?= $form->field($model, 'name') ?>
|
||||
|
||||
<?= $form->field($model, 'group_case') ?>
|
||||
|
||||
<?= $form->field($model, 'is_view') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton('Reset', ['class' => 'btn btn-outline-secondary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Create Cyto Type of Specimen';
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Type of Specimens', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
<?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\modules\register\models\CytoTypeOfSpecimenSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = 'Cyto Type of Specimen';
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><i class="ri-file-text-line"></i> <?= Html::encode($this->title) ?>
|
||||
</h5>
|
||||
<?= Html::a('<i class="ri-add-fill"></i> เพิ่ม Cyto Type of Specimen', ['create'], ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]);
|
||||
?>
|
||||
<div class="table-responsive">
|
||||
<?= GridView::widget([
|
||||
'pager' => ['class' => 'yii\bootstrap5\LinkPager'],
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'tableOptions' => ['class' => 'table align-middle table-hover m-0 truncate'],
|
||||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
|
||||
'columns' => [
|
||||
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
|
||||
//'id',
|
||||
'name',
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'headerOptions' => ['class' => 'custom-action-column-header'],
|
||||
'contentOptions' => ['class' => 'custom-action-column'],
|
||||
'template' => '{view} {update} {delete}', // Customize buttons if needed
|
||||
'buttons' => [
|
||||
'view' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-eye-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'View'),
|
||||
'class' => 'btn btn-outline-info btn-sm'
|
||||
]);
|
||||
},
|
||||
'update' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-pencil-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Update'),
|
||||
'class' => 'btn btn-outline-warning btn-sm'
|
||||
]);
|
||||
},
|
||||
'delete' => function ($url, $model, $key) {
|
||||
return Html::a('<i class="ri-delete-bin-line"></i>', $url, [
|
||||
'title' => Yii::t('app', 'Delete'),
|
||||
'data-confirm' => Yii::t('app', 'คุณแน่ใจว่าต้องการลบรายการนี้หรือไม่ ?'),
|
||||
'data-method' => 'post',
|
||||
'class' => 'btn btn-outline-danger btn-sm'
|
||||
]);
|
||||
},
|
||||
],
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = 'Update Cyto Source of Specimens: ' . $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Cyto Source of Specimens', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]];
|
||||
$this->params['breadcrumbs'][] = 'แก้ไข';
|
||||
?>
|
||||
<div class="cyto-specimen-type-update">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"></h4>
|
||||
|
||||
<div class="heading-elements">
|
||||
<ul class="list-inline mb-0">
|
||||
<li><a data-action="expand"><i class="ft-maximize"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= $this->render('_form', [
|
||||
'model' => $model,
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\CytoSpecimenType */
|
||||
|
||||
$this->title = $model->name;
|
||||
$this->params['breadcrumbs'][] = ['label' => 'Cyto Specimen Types', 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
\yii\web\YiiAsset::register($this);
|
||||
?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<h5 class="card-title"><?= Html::encode($this->title) ?></h5>
|
||||
<div class="d-flex gap-2 justify-content-end">
|
||||
<?= Html::a('แก้ไข', ['update', 'id' => $model->id], ['class' => 'btn btn-warning']) ?>
|
||||
<?= Html::a('กลับ', ['index', 'id' => $model->id], ['class' => 'btn btn-info']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id',
|
||||
'name',
|
||||
'group_case',
|
||||
[
|
||||
//'attribute' => 'charge_id',
|
||||
'format' => 'raw',
|
||||
'label' => 'สถานะ',
|
||||
'value' => function ($model) {
|
||||
$arr = [1 => '<span class="badge badge-success"> ใช้งาน</span>', 0 => '<span class="badge badge-danger"> ไม่ใช้งาน</span>'];
|
||||
return isset($model->is_view) ? ($arr[$model->is_view]) : '';
|
||||
},
|
||||
],
|
||||
//'is_view',
|
||||
],
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -5,6 +5,7 @@ use yii\helpers\Html;
|
|||
use yii\grid\GridView;
|
||||
use kartik\date\DatePicker;
|
||||
use yii\bootstrap5\ActiveForm;
|
||||
use common\models\HospitalImport;
|
||||
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
|
|
@ -95,6 +96,11 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'rowOptions' => function ($model) {
|
||||
// ตรวจสอบว่ามี req_no ใน HospitalImport หรือไม่
|
||||
$imported = HospitalImport::find()->where(['req_no' => $model['req_no']])->exists();
|
||||
return $imported ? ['class' => 'table-success'] : [];
|
||||
},
|
||||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
'tableOptions' => [
|
||||
'class' => 'table table-striped truncate m-0',
|
||||
|
|
@ -153,6 +159,15 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
return isset($model->importBy) ? $model->importBy->realname : '';
|
||||
}
|
||||
],
|
||||
[
|
||||
'label' => 'สถานะ',
|
||||
'value' => function ($model) {
|
||||
return HospitalImport::find()->where(['req_no' => $model['req_no']])->exists() ? 'นำเข้าแล้ว' : 'รอนำเข้า';
|
||||
},
|
||||
'contentOptions' => function ($model) {
|
||||
return HospitalImport::find()->where(['req_no' => $model['req_no']])->exists() ? ['class' => 'text-success'] : [];
|
||||
},
|
||||
],
|
||||
]
|
||||
]) ?>
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ class CaseController extends Controller
|
|||
],
|
||||
'marginLeft' => 12,
|
||||
'marginRight' => 10,
|
||||
'marginTop' => 110,
|
||||
'marginTop' => 95,
|
||||
'marginBottom' => 15,
|
||||
'marginFooter' => 3,
|
||||
]);
|
||||
|
|
@ -1242,313 +1242,329 @@ class CaseController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public function header($id_case, $name, $vn = null, $is_critical_diagnosis = null, $is_first_diagnosis = null)
|
||||
{
|
||||
|
||||
$case_type = Yii::$app->pathology->getCaseType($id_case);
|
||||
|
||||
if ($is_critical_diagnosis == 1) {
|
||||
$alert = '<tr>
|
||||
<td align="right" vertical="middle" style="">
|
||||
<div style="width:350px;background-color:#FF0000;font-size:12pt;color:#FFF;" class="prompt">
|
||||
แจ้งแพทย์ด่วน
|
||||
</div>
|
||||
</td>
|
||||
</tr>';
|
||||
} else {
|
||||
$alert = null;
|
||||
$case_type = Yii::$app->pathology->getCaseType($id_case);
|
||||
|
||||
$case = null;
|
||||
$alert = null; // กำหนดค่าเริ่มต้น
|
||||
|
||||
// ค้นหาข้อมูลจากตารางที่เกี่ยวข้อง
|
||||
if ($case_type == 'surgical') {
|
||||
$case = SurgicalDiagnosis::findOne(['id_case' => $id_case]);
|
||||
} elseif ($case_type == 'non-gyn') {
|
||||
$case = CytoNonGynDiagnosis::findOne(['id_case' => $id_case]);
|
||||
} elseif ($case_type == 'pap') {
|
||||
$case = CytoPapDiagnosis::findOne(['id_case' => $id_case]);
|
||||
}
|
||||
|
||||
|
||||
if ($alert) {
|
||||
$height = "1.3cm";
|
||||
} else {
|
||||
$height = "1.81cm";
|
||||
}
|
||||
|
||||
|
||||
$vn_text = null;
|
||||
if ($vn != '') {
|
||||
|
||||
if (preg_match('/^[a-z0-9-_+.]+$/i', $vn)) { // ห้าม key ไทย
|
||||
$vn_text = '<div style="font-size:10pt;">VN : ' . $vn . '</div>';
|
||||
}
|
||||
}
|
||||
return '
|
||||
|
||||
<table class="demTable">
|
||||
<tbody>
|
||||
// ตรวจสอบว่ามีการตั้งค่า critical diagnosis หรือไม่
|
||||
if (!empty($case) && $case->is_critical_diagnosis == 1) {
|
||||
$alert = '<table>
|
||||
<tr>
|
||||
<td width="30%" align="left">' . Html::img(Yii::getAlias('@webroot') . '/img/logo_report/logo.png', ['width' => '', 'height' => '2.8cm']) . '<br/>
|
||||
<strong style="font-size: 12px;">
|
||||
Suratthani Hospital, Muang Suratthani, <br/>
|
||||
Suratthani 84000 Tel. 077 952 900<br/>
|
||||
</strong>
|
||||
<td style="border: 1px solid red; padding: 4px; color:red; font-size: 14pt; text-align: left;">
|
||||
<strong>CRITICAL REPORT<br>
|
||||
แจ้งแพทย์ด่วน</strong>
|
||||
</td>
|
||||
<td width="40%" align="center">
|
||||
<strong style="font-size: 34px; color: #2d6bb6; text-align:center;">PATHOLOGY REPORT</strong><br/>
|
||||
<strong style="font-size: 20px; color: #2d6bb6;">Department of Anatomical Pathology</strong><br/>
|
||||
|
||||
</td>
|
||||
<td class="id_case" align="right" width="30%"><strong>' . $id_case . '</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" class="report_header">
|
||||
</table>';
|
||||
}
|
||||
|
||||
// กำหนดความสูงของ element
|
||||
$height = ($alert !== null) ? "1.3cm" : "1.81cm";
|
||||
$vn_text = null;
|
||||
if ($vn != '') {
|
||||
|
||||
if (preg_match('/^[a-z0-9-_+.]+$/i', $vn)) { // ห้าม key ไทย
|
||||
$vn_text = '<div style="font-size:10pt;">VN : ' . $vn . '</div>';
|
||||
}
|
||||
}
|
||||
return '
|
||||
|
||||
<table class="demTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="font-size:20pt;">
|
||||
<strong>' . strtoupper($name) . ' PATHOLOGY REPORT</strong>
|
||||
</th>
|
||||
<td width="30%" align="left">
|
||||
' . Html::img(Yii::getAlias('@webroot') . '/img/logo_report/logo.png', ['width' => '', 'height' => '2.8cm']) . '<br />
|
||||
<strong style="font-size: 12px;">
|
||||
Suratthani Hospital, Muang Suratthani, <br />
|
||||
Suratthani 84000 Tel. 077 952 900 ต่อ 7322, 7328<br />
|
||||
</strong>
|
||||
</td>
|
||||
<td width="40%" align="center">
|
||||
<strong style="font-size: 34px; color: #2d6bb6; text-align:center;">PATHOLOGY REPORT</strong><br />
|
||||
<strong style="font-size: 20px; color: #2d6bb6;">Department of Anatomical Pathology</strong><br />
|
||||
</td>
|
||||
<td>
|
||||
<h6>' . $alert . '</h6>
|
||||
<strong class="id_case">' . Html::encode($id_case) . '</strong>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>';
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" class="report_header">
|
||||
<tr>
|
||||
<th style="font-size:20pt;">
|
||||
<strong>' . strtoupper($name) . ' PATHOLOGY REPORT</strong>
|
||||
</th>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @return string|Response
|
||||
*/
|
||||
public function actionFlow($id_case, $mode = null)
|
||||
{
|
||||
$case_non_gyn = CaseFlow::findOne(['id_case' => $id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
if (!$case_non_gyn) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่ค้นหา หรือยังไม่ได้ออก Final Report');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
Yii::$app->session->setFlash('info', 'กำลังสร้างรายงาน Case : ' . $id_case);
|
||||
return $this->render('flow', [
|
||||
'case_non_gyn' => $case_non_gyn,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @param $file
|
||||
* @return mixed|void|Response
|
||||
* @throws \Mpdf\MpdfException
|
||||
* @throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException
|
||||
* @throws \setasign\Fpdi\PdfParser\PdfParserException
|
||||
* @throws \setasign\Fpdi\PdfParser\Type\PdfTypeException
|
||||
* @throws \yii\base\Exception
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function actionFlowPdf($id_case, $id, $report_type, $mode = 'preview', $file = false, $watermark = true)
|
||||
{
|
||||
$case = CaseFlow::findOne(['id_case' => $id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
//var_dump($case_non_gyn);
|
||||
//die();
|
||||
if (!$case) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่เลือก');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
//$cyto_operate = CytoOperate::findOne(['id_case' => $case_non_gyn->id_case]);
|
||||
//$model = $case_non_gyn;
|
||||
$flow_diagnosis = FlowDiagnosis::findOne([
|
||||
'id_case' => $case->id_case,
|
||||
'report_type' => $report_type,
|
||||
'id' => $id,
|
||||
]);
|
||||
|
||||
// get your HTML raw content without any layouts or scripts
|
||||
$content = $this->renderPartial('_preview_flow', [
|
||||
'model' => $case,
|
||||
'mode' => $mode,
|
||||
'diagnosis' => $flow_diagnosis
|
||||
]);
|
||||
|
||||
|
||||
$header = $this->renderPartial('_header_report', [
|
||||
'model' => $case,
|
||||
'diagnosis' => $flow_diagnosis,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
|
||||
// setup kartik\mpdf\Pdf component
|
||||
$pdf = new Pdf([
|
||||
// set to use core fonts only
|
||||
'mode' => Pdf::MODE_UTF8,
|
||||
// A4 paper format
|
||||
'format' => Pdf::FORMAT_A4,
|
||||
// portrait orientation
|
||||
'orientation' => Pdf::ORIENT_PORTRAIT,
|
||||
// stream to browser inline
|
||||
'destination' => Pdf::DEST_BROWSER,
|
||||
// your html content input
|
||||
'content' => $content,
|
||||
// format content from your own css file if needed or use the
|
||||
// enhanced bootstrap css built by Krajee for mPDF formatting
|
||||
'cssFile' => '@frontend/web/css/pdf.css',
|
||||
// any css to be embedded if required
|
||||
'cssInline' => '.bd{border:1.5px solid; text-align: center;} .ar{text-align:right} .imgbd{border:1px solid}',
|
||||
// set mPDF properties on the fly
|
||||
'options' => [
|
||||
'title' => 'Preview Report Case: ' . $case->id_case,
|
||||
'defaultheaderline' => 0,
|
||||
'defaultfooterline' => 0,
|
||||
'showWatermarkText' => ($watermark == true ? true : false),
|
||||
'watermark_font' => 'browallia',
|
||||
'setAutoTopMargin' => false, //pad
|
||||
'autoMarginPadding' => 2,
|
||||
'useSubstitutions' => true
|
||||
],
|
||||
// call mPDF methods on the fly
|
||||
'methods' => [
|
||||
'SetWatermarkText' => ['COPY', 0.05],
|
||||
'SetHtmlHeader' => [$this->header($case->id_case, 'FLOW') . $header],
|
||||
'SetFooter' => ['<span style="font-size: 13pt;">' . $case->id_case . '|<small style="font-size: 13pt;">' .
|
||||
Yii::$app->params['settings']['non_gyn_rev'] . '</small>|<span style="font-size: 13pt;">Report Page
|
||||
{PAGENO}/{nbpg}</span>'],
|
||||
],
|
||||
'marginLeft' => 12,
|
||||
'marginRight' => 10,
|
||||
'marginTop' => 85,
|
||||
'marginBottom' => 15,
|
||||
'marginFooter' => 3,
|
||||
]);
|
||||
|
||||
$defaultConfig = (new ConfigVariables())->getDefaults();
|
||||
$fontDirs = $defaultConfig['fontDir'];
|
||||
|
||||
$defaultFontConfig = (new FontVariables())->getDefaults();
|
||||
$fontData = $defaultFontConfig['fontdata'];
|
||||
|
||||
$pdf->options['fontDir'] = array_merge($fontDirs, [
|
||||
Yii::getAlias('@webroot') . '/fonts'
|
||||
]);
|
||||
|
||||
|
||||
$pdf->options['fontdata'] = $fontData + [
|
||||
'angsananew' => [
|
||||
'R' => 'AngsanaNew.ttf',
|
||||
'TTCfontID' => [
|
||||
'R' => 1,
|
||||
],
|
||||
],
|
||||
'sarabun' => [
|
||||
'R' => 'THSarabunNew.ttf',
|
||||
],
|
||||
'browallia' => [
|
||||
'R' => 'Browallia.ttf',
|
||||
],
|
||||
];
|
||||
|
||||
if ($file == true) {
|
||||
FileHelper::createDirectory(Yii::getAlias('@webroot') . '/patho_reports/');
|
||||
$pdf->Output($content, Yii::getAlias('@webroot') . '/patho_reports/' . $case->id_case . '_' . $case->h_n . '_' .
|
||||
$flow_diagnosis->report_type . '.pdf', Destination::FILE);
|
||||
} else {
|
||||
return $pdf->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @return string|Response
|
||||
*/
|
||||
public function actionFlow($id_case, $mode = null)
|
||||
{
|
||||
$case_non_gyn = CaseFlow::findOne(['id_case' => $id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
if (!$case_non_gyn) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่ค้นหา หรือยังไม่ได้ออก Final Report');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
Yii::$app->session->setFlash('info', 'กำลังสร้างรายงาน Case : ' . $id_case);
|
||||
return $this->render('flow', [
|
||||
'case_non_gyn' => $case_non_gyn,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @param $file
|
||||
* @return mixed|void|Response
|
||||
* @throws \Mpdf\MpdfException
|
||||
* @throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException
|
||||
* @throws \setasign\Fpdi\PdfParser\PdfParserException
|
||||
* @throws \setasign\Fpdi\PdfParser\Type\PdfTypeException
|
||||
* @throws \yii\base\Exception
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function actionFlowPdf($id_case, $id, $report_type, $mode = 'preview', $file = false, $watermark = true)
|
||||
{
|
||||
$case = CaseFlow::findOne(['id_case' => $id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
//var_dump($case_non_gyn);
|
||||
//die();
|
||||
if (!$case) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่เลือก');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
//$cyto_operate = CytoOperate::findOne(['id_case' => $case_non_gyn->id_case]);
|
||||
//$model = $case_non_gyn;
|
||||
$flow_diagnosis = FlowDiagnosis::findOne([
|
||||
'id_case' => $case->id_case,
|
||||
'report_type' => $report_type,
|
||||
'id' => $id,
|
||||
]);
|
||||
|
||||
// get your HTML raw content without any layouts or scripts
|
||||
$content = $this->renderPartial('_preview_flow', [
|
||||
'model' => $case,
|
||||
'mode' => $mode,
|
||||
'diagnosis' => $flow_diagnosis
|
||||
]);
|
||||
|
||||
|
||||
$header = $this->renderPartial('_header_report', [
|
||||
'model' => $case,
|
||||
'diagnosis' => $flow_diagnosis,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
|
||||
// setup kartik\mpdf\Pdf component
|
||||
$pdf = new Pdf([
|
||||
// set to use core fonts only
|
||||
'mode' => Pdf::MODE_UTF8,
|
||||
// A4 paper format
|
||||
'format' => Pdf::FORMAT_A4,
|
||||
// portrait orientation
|
||||
'orientation' => Pdf::ORIENT_PORTRAIT,
|
||||
// stream to browser inline
|
||||
'destination' => Pdf::DEST_BROWSER,
|
||||
// your html content input
|
||||
'content' => $content,
|
||||
// format content from your own css file if needed or use the
|
||||
// enhanced bootstrap css built by Krajee for mPDF formatting
|
||||
'cssFile' => '@frontend/web/css/pdf.css',
|
||||
// any css to be embedded if required
|
||||
'cssInline' => '.bd{border:1.5px solid; text-align: center;} .ar{text-align:right} .imgbd{border:1px solid}',
|
||||
// set mPDF properties on the fly
|
||||
'options' => [
|
||||
'title' => 'Preview Report Case: ' . $case->id_case,
|
||||
'defaultheaderline' => 0,
|
||||
'defaultfooterline' => 0,
|
||||
'showWatermarkText' => ($watermark == true ? true : false),
|
||||
'watermark_font' => 'browallia',
|
||||
'setAutoTopMargin' => false, //pad
|
||||
'autoMarginPadding' => 2,
|
||||
'useSubstitutions' => true
|
||||
],
|
||||
// call mPDF methods on the fly
|
||||
'methods' => [
|
||||
'SetWatermarkText' => ['COPY', 0.05],
|
||||
'SetHtmlHeader' => [$this->header($case->id_case, 'FLOW') . $header],
|
||||
'SetFooter' => ['<span style="font-size: 13pt;">' . $case->id_case . '|<small style="font-size: 13pt;">' . Yii::$app->params['settings']['non_gyn_rev'] . '</small>|<span style="font-size: 13pt;">Report Page {PAGENO}/{nbpg}</span>'],
|
||||
],
|
||||
'marginLeft' => 12,
|
||||
'marginRight' => 10,
|
||||
'marginTop' => 85,
|
||||
'marginBottom' => 15,
|
||||
'marginFooter' => 3,
|
||||
]);
|
||||
|
||||
$defaultConfig = (new ConfigVariables())->getDefaults();
|
||||
$fontDirs = $defaultConfig['fontDir'];
|
||||
|
||||
$defaultFontConfig = (new FontVariables())->getDefaults();
|
||||
$fontData = $defaultFontConfig['fontdata'];
|
||||
|
||||
$pdf->options['fontDir'] = array_merge($fontDirs, [
|
||||
Yii::getAlias('@webroot') . '/fonts'
|
||||
]);
|
||||
|
||||
|
||||
$pdf->options['fontdata'] = $fontData + [
|
||||
'angsananew' => [
|
||||
'R' => 'AngsanaNew.ttf',
|
||||
'TTCfontID' => [
|
||||
'R' => 1,
|
||||
],
|
||||
],
|
||||
'sarabun' => [
|
||||
'R' => 'THSarabunNew.ttf',
|
||||
],
|
||||
'browallia' => [
|
||||
'R' => 'Browallia.ttf',
|
||||
],
|
||||
];
|
||||
|
||||
if ($file == true) {
|
||||
FileHelper::createDirectory(Yii::getAlias('@webroot') . '/patho_reports/');
|
||||
$pdf->Output($content, Yii::getAlias('@webroot') . '/patho_reports/' . $case->id_case . '_' . $case->h_n . '_' . $flow_diagnosis->report_type . '.pdf', Destination::FILE);
|
||||
} else {
|
||||
return $pdf->render();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @return string|Response
|
||||
*/
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @return string|Response
|
||||
*/
|
||||
public function actionMolecular($id_case, $mode = null)
|
||||
{
|
||||
$case = CaseMolecular::findOne(['id_case' => $id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
if (!$case) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่ค้นหา หรือยังไม่ได้ออก Final Report');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
Yii::$app->session->setFlash('info', 'กำลังสร้างรายงาน Case : ' . $id_case);
|
||||
return $this->render('molecular', [
|
||||
'case_non_gyn' => $case,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
$case = CaseMolecular::findOne(['id_case' => $id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
if (!$case) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่ค้นหา หรือยังไม่ได้ออก Final Report');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
Yii::$app->session->setFlash('info', 'กำลังสร้างรายงาน Case : ' . $id_case);
|
||||
return $this->render('molecular', [
|
||||
'case_non_gyn' => $case,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @param $file
|
||||
* @return mixed|void|Response
|
||||
* @throws \Mpdf\MpdfException
|
||||
* @throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException
|
||||
* @throws \setasign\Fpdi\PdfParser\PdfParserException
|
||||
* @throws \setasign\Fpdi\PdfParser\Type\PdfTypeException
|
||||
* @throws \yii\base\Exception
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @param $file
|
||||
* @return mixed|void|Response
|
||||
* @throws \Mpdf\MpdfException
|
||||
* @throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException
|
||||
* @throws \setasign\Fpdi\PdfParser\PdfParserException
|
||||
* @throws \setasign\Fpdi\PdfParser\Type\PdfTypeException
|
||||
* @throws \yii\base\Exception
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function actionMolecularPdf($id_case, $id, $report_type, $mode = 'preview', $file = false, $watermark = true)
|
||||
{
|
||||
$case = CaseMolecular::findOne(['id_case' => $id_case]);
|
||||
$finance = FinanceServiceCharge::findOne(['id_case' => $case->id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
//var_dump($case_non_gyn);
|
||||
//die();
|
||||
if (!$case) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่เลือก');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
//$cyto_operate = CytoOperate::findOne(['id_case' => $case_non_gyn->id_case]);
|
||||
//$model = $case_non_gyn;
|
||||
$molecular_diagnosis = MolecularDiagnosis::findOne([
|
||||
'id_case' => $case->id_case,
|
||||
'report_type' => $report_type,
|
||||
'id' => $id,
|
||||
]);
|
||||
$case = CaseMolecular::findOne(['id_case' => $id_case]);
|
||||
$finance = FinanceServiceCharge::findOne(['id_case' => $case->id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
//var_dump($case_non_gyn);
|
||||
//die();
|
||||
if (!$case) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่เลือก');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
//$cyto_operate = CytoOperate::findOne(['id_case' => $case_non_gyn->id_case]);
|
||||
//$model = $case_non_gyn;
|
||||
$molecular_diagnosis = MolecularDiagnosis::findOne([
|
||||
'id_case' => $case->id_case,
|
||||
'report_type' => $report_type,
|
||||
'id' => $id,
|
||||
]);
|
||||
|
||||
// get your HTML raw content without any layouts or scripts
|
||||
$content = $this->renderPartial('_preview_molecular', [
|
||||
'model' => $case,
|
||||
'finance' => $finance,
|
||||
'mode' => $mode,
|
||||
'diagnosis' => $molecular_diagnosis
|
||||
]);
|
||||
// get your HTML raw content without any layouts or scripts
|
||||
$content = $this->renderPartial('_preview_molecular', [
|
||||
'model' => $case,
|
||||
'finance' => $finance,
|
||||
'mode' => $mode,
|
||||
'diagnosis' => $molecular_diagnosis
|
||||
]);
|
||||
|
||||
|
||||
$header = $this->renderPartial('_header_report', [
|
||||
'model' => $case,
|
||||
'diagnosis' => $molecular_diagnosis,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
$header = $this->renderPartial('_header_report', [
|
||||
'model' => $case,
|
||||
'diagnosis' => $molecular_diagnosis,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
|
||||
// setup kartik\mpdf\Pdf component
|
||||
$pdf = new Pdf([
|
||||
// set to use core fonts only
|
||||
'mode' => Pdf::MODE_UTF8,
|
||||
// A4 paper format
|
||||
'format' => Pdf::FORMAT_A4,
|
||||
// portrait orientation
|
||||
'orientation' => Pdf::ORIENT_PORTRAIT,
|
||||
// stream to browser inline
|
||||
'destination' => Pdf::DEST_BROWSER,
|
||||
// your html content input
|
||||
'content' => $content,
|
||||
// format content from your own css file if needed or use the
|
||||
// enhanced bootstrap css built by Krajee for mPDF formatting
|
||||
'cssFile' => '@frontend/web/css/pdf.css',
|
||||
// any css to be embedded if required
|
||||
'cssInline' => '.bd{border:1.5px solid; text-align: center;} .ar{text-align:right} .imgbd{border:1px solid}',
|
||||
// set mPDF properties on the fly
|
||||
'options' => [
|
||||
'title' => 'Preview Report Case: ' . $case->id_case,
|
||||
'defaultheaderline' => 0,
|
||||
'defaultfooterline' => 0,
|
||||
'showWatermarkText' => ($watermark == true ? true : false),
|
||||
'watermark_font' => 'browallia',
|
||||
'setAutoTopMargin' => false, //pad
|
||||
'autoMarginPadding' => 2,
|
||||
'useSubstitutions' => true
|
||||
],
|
||||
// call mPDF methods on the fly
|
||||
'methods' => [
|
||||
'SetWatermarkText' => ['COPY', 0.05],
|
||||
'SetHtmlHeader' => [$this->header($case->id_case, 'Molecular') . $header],
|
||||
'SetFooter' => ['<span style="font-size: 13pt;">' . $case->id_case . '|<small style="font-size: 13pt;">' . Yii::$app->params['settings']['non_gyn_rev'] . '</small>|<span style="font-size: 13pt;">Report Page {PAGENO}/{nbpg}</span>'],
|
||||
],
|
||||
'marginLeft' => 12,
|
||||
'marginRight' => 10,
|
||||
'marginTop' => 85,
|
||||
'marginBottom' => 15,
|
||||
'marginFooter' => 3,
|
||||
// setup kartik\mpdf\Pdf component
|
||||
$pdf = new Pdf([
|
||||
// set to use core fonts only
|
||||
'mode' => Pdf::MODE_UTF8,
|
||||
// A4 paper format
|
||||
'format' => Pdf::FORMAT_A4,
|
||||
// portrait orientation
|
||||
'orientation' => Pdf::ORIENT_PORTRAIT,
|
||||
// stream to browser inline
|
||||
'destination' => Pdf::DEST_BROWSER,
|
||||
// your html content input
|
||||
'content' => $content,
|
||||
// format content from your own css file if needed or use the
|
||||
// enhanced bootstrap css built by Krajee for mPDF formatting
|
||||
'cssFile' => '@frontend/web/css/pdf.css',
|
||||
// any css to be embedded if required
|
||||
'cssInline' => '.bd{border:1.5px solid; text-align: center;} .ar{text-align:right} .imgbd{border:1px solid}',
|
||||
// set mPDF properties on the fly
|
||||
'options' => [
|
||||
'title' => 'Preview Report Case: ' . $case->id_case,
|
||||
'defaultheaderline' => 0,
|
||||
'defaultfooterline' => 0,
|
||||
'showWatermarkText' => ($watermark == true ? true : false),
|
||||
'watermark_font' => 'browallia',
|
||||
'setAutoTopMargin' => false, //pad
|
||||
'autoMarginPadding' => 2,
|
||||
'useSubstitutions' => true
|
||||
],
|
||||
// call mPDF methods on the fly
|
||||
'methods' => [
|
||||
'SetWatermarkText' => ['COPY', 0.05],
|
||||
'SetHtmlHeader' => [$this->header($case->id_case, 'Molecular') . $header],
|
||||
'SetFooter' => ['<span style="font-size: 13pt;">' . $case->id_case . '|<small style="font-size: 13pt;">' .
|
||||
Yii::$app->params['settings']['non_gyn_rev'] . '</small>|<span style="font-size: 13pt;">Report Page
|
||||
{PAGENO}/{nbpg}</span>'],
|
||||
],
|
||||
'marginLeft' => 12,
|
||||
'marginRight' => 10,
|
||||
'marginTop' => 85,
|
||||
'marginBottom' => 15,
|
||||
'marginFooter' => 3,
|
||||
]);
|
||||
|
||||
$defaultConfig = (new ConfigVariables())->getDefaults();
|
||||
|
|
@ -1558,219 +1574,224 @@ class CaseController extends Controller
|
|||
$fontData = $defaultFontConfig['fontdata'];
|
||||
|
||||
$pdf->options['fontDir'] = array_merge($fontDirs, [
|
||||
Yii::getAlias('@webroot') . '/fonts'
|
||||
Yii::getAlias('@webroot') . '/fonts'
|
||||
]);
|
||||
|
||||
|
||||
$pdf->options['fontdata'] = $fontData + [
|
||||
'angsananew' => [
|
||||
'R' => 'AngsanaNew.ttf',
|
||||
'TTCfontID' => [
|
||||
'R' => 1,
|
||||
],
|
||||
],
|
||||
'sarabun' => [
|
||||
'R' => 'THSarabunNew.ttf',
|
||||
],
|
||||
'browallia' => [
|
||||
'R' => 'Browallia.ttf',
|
||||
],
|
||||
'angsananew' => [
|
||||
'R' => 'AngsanaNew.ttf',
|
||||
'TTCfontID' => [
|
||||
'R' => 1,
|
||||
],
|
||||
],
|
||||
'sarabun' => [
|
||||
'R' => 'THSarabunNew.ttf',
|
||||
],
|
||||
'browallia' => [
|
||||
'R' => 'Browallia.ttf',
|
||||
],
|
||||
];
|
||||
|
||||
if ($file == true) {
|
||||
FileHelper::createDirectory(Yii::getAlias('@webroot') . '/patho_reports/');
|
||||
$pdf->Output($content, Yii::getAlias('@webroot') . '/patho_reports/' . $case->id_case . '_' . $case->h_n . '_' . $molecular_diagnosis->report_type . '.pdf', Destination::FILE);
|
||||
FileHelper::createDirectory(Yii::getAlias('@webroot') . '/patho_reports/');
|
||||
$pdf->Output($content, Yii::getAlias('@webroot') . '/patho_reports/' . $case->id_case . '_' . $case->h_n . '_' .
|
||||
$molecular_diagnosis->report_type . '.pdf', Destination::FILE);
|
||||
} else {
|
||||
return $pdf->render();
|
||||
return $pdf->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @return string|Response
|
||||
*/
|
||||
public function actionNecropsy($id_case, $mode = null)
|
||||
{
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @return string|Response
|
||||
*/
|
||||
public function actionNecropsy($id_case, $mode = null)
|
||||
{
|
||||
$case_necropsy = CaseNecropsy::findOne(['id_case' => $id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
if (!$case_necropsy) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่ค้นหา หรือยังไม่ได้ออก Final Report');
|
||||
return $this->redirect(['/report']);
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่ค้นหา หรือยังไม่ได้ออก Final Report');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
Yii::$app->session->setFlash('info', 'กำลังสร้างรายงาน Case : ' . $id_case);
|
||||
return $this->render('necropsy', [
|
||||
'case_necropsy' => $case_necropsy,
|
||||
'mode' => $mode,
|
||||
'case_necropsy' => $case_necropsy,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @param $file
|
||||
* @return mixed|void|Response
|
||||
* @throws \Mpdf\MpdfException
|
||||
* @throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException
|
||||
* @throws \setasign\Fpdi\PdfParser\PdfParserException
|
||||
* @throws \setasign\Fpdi\PdfParser\Type\PdfTypeException
|
||||
* @throws \yii\base\Exception
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function actionNecropsyPdf($id_case, $id, $report_type, $mode = 'preview', $file = false, $watermark = true)
|
||||
{
|
||||
/**
|
||||
* @param $id_case
|
||||
* @param $mode
|
||||
* @param $file
|
||||
* @return mixed|void|Response
|
||||
* @throws \Mpdf\MpdfException
|
||||
* @throws \setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException
|
||||
* @throws \setasign\Fpdi\PdfParser\PdfParserException
|
||||
* @throws \setasign\Fpdi\PdfParser\Type\PdfTypeException
|
||||
* @throws \yii\base\Exception
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function actionNecropsyPdf($id_case, $id, $report_type, $mode = 'preview', $file = false, $watermark =
|
||||
true)
|
||||
{
|
||||
$case_necropsy = CaseNecropsy::findOne(['id_case' => $id_case]);
|
||||
$finance = FinanceServiceCharge::findOne(['id_case' => $case_necropsy->id_case]);
|
||||
//$patient_case_approve = PatientCaseApprove::findOne(['id_case' => $id_case]);
|
||||
//var_dump($case_necropsy);
|
||||
//die();
|
||||
if (!$case_necropsy) {
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่เลือก');
|
||||
return $this->redirect(['/report']);
|
||||
Yii::$app->session->setFlash('error', 'ไม่พบ Case ที่เลือก');
|
||||
return $this->redirect(['/report']);
|
||||
}
|
||||
//$cyto_operate = CytoOperate::findOne(['id_case' => $case_necropsy->id_case]);
|
||||
//$model = $case_necropsy;
|
||||
$necropsy_diagnosis = NecropsyDiagnosis::findOne([
|
||||
'id_case' => $case_necropsy->id_case,
|
||||
'report_type' => $report_type,
|
||||
'id' => $id,
|
||||
'id_case' => $case_necropsy->id_case,
|
||||
'report_type' => $report_type,
|
||||
'id' => $id,
|
||||
]);
|
||||
|
||||
// get your HTML raw content without any layouts or scripts
|
||||
$content = $this->renderPartial('_preview_necropsy', [
|
||||
'model' => $case_necropsy,
|
||||
'finance' => $finance,
|
||||
'mode' => $mode,
|
||||
'diagnosis' => $necropsy_diagnosis,
|
||||
'model' => $case_necropsy,
|
||||
'finance' => $finance,
|
||||
'mode' => $mode,
|
||||
'diagnosis' => $necropsy_diagnosis,
|
||||
]);
|
||||
|
||||
|
||||
$header = $this->renderPartial('_header_report', [
|
||||
'model' => $case_necropsy,
|
||||
'diagnosis' => $necropsy_diagnosis,
|
||||
'mode' => $mode,
|
||||
'model' => $case_necropsy,
|
||||
'diagnosis' => $necropsy_diagnosis,
|
||||
'mode' => $mode,
|
||||
]);
|
||||
|
||||
// setup kartik\mpdf\Pdf component
|
||||
$pdf = new Pdf([
|
||||
// set to use core fonts only
|
||||
'mode' => Pdf::MODE_UTF8,
|
||||
// A4 paper format
|
||||
'format' => Pdf::FORMAT_A4,
|
||||
// portrait orientation
|
||||
'orientation' => Pdf::ORIENT_PORTRAIT,
|
||||
// stream to browser inline
|
||||
'destination' => Pdf::DEST_BROWSER,
|
||||
// your html content input
|
||||
'content' => $content,
|
||||
// format content from your own css file if needed or use the
|
||||
// enhanced bootstrap css built by Krajee for mPDF formatting
|
||||
'cssFile' => '@frontend/web/css/pdf.css',
|
||||
// any css to be embedded if required
|
||||
'cssInline' => '.bd{border:1.5px solid; text-align: center;} .ar{text-align:right} .imgbd{border:1px solid}',
|
||||
// set mPDF properties on the fly
|
||||
'options' => [
|
||||
'title' => 'Preview Report Case: ' . $case_necropsy->id_case,
|
||||
'defaultheaderline' => 0,
|
||||
'defaultfooterline' => 0,
|
||||
'showWatermarkText' => ($watermark == true ? true : false),
|
||||
'watermark_font' => 'browallia',
|
||||
'setAutoTopMargin' => false, //pad
|
||||
'autoMarginPadding' => 2,
|
||||
'useSubstitutions' => true
|
||||
],
|
||||
// call mPDF methods on the fly
|
||||
'methods' => [
|
||||
'SetWatermarkText' => ['COPY', 0.05],
|
||||
'SetHtmlHeader' => [$this->header($case_necropsy->id_case, 'Necropsy') . $header],
|
||||
'SetFooter' => ['<span style="font-size: 13pt;">' . $case_necropsy->id_case . '|<small style="font-size: 13pt;">' . Yii::$app->params['settings']['non_gyn_rev'] . '</small>|<span style="font-size: 13pt;">Report Page {PAGENO}/{nbpg}</span>'],
|
||||
// set to use core fonts only
|
||||
'mode' => Pdf::MODE_UTF8,
|
||||
// A4 paper format
|
||||
'format' => Pdf::FORMAT_A4,
|
||||
// portrait orientation
|
||||
'orientation' => Pdf::ORIENT_PORTRAIT,
|
||||
// stream to browser inline
|
||||
'destination' => Pdf::DEST_BROWSER,
|
||||
// your html content input
|
||||
'content' => $content,
|
||||
// format content from your own css file if needed or use the
|
||||
// enhanced bootstrap css built by Krajee for mPDF formatting
|
||||
'cssFile' => '@frontend/web/css/pdf.css',
|
||||
// any css to be embedded if required
|
||||
'cssInline' => '.bd{border:1.5px solid; text-align: center;} .ar{text-align:right} .imgbd{border:1px solid}',
|
||||
// set mPDF properties on the fly
|
||||
'options' => [
|
||||
'title' => 'Preview Report Case: ' . $case_necropsy->id_case,
|
||||
'defaultheaderline' => 0,
|
||||
'defaultfooterline' => 0,
|
||||
'showWatermarkText' => ($watermark == true ? true : false),
|
||||
'watermark_font' => 'browallia',
|
||||
'setAutoTopMargin' => false, //pad
|
||||
'autoMarginPadding' => 2,
|
||||
'useSubstitutions' => true
|
||||
],
|
||||
// call mPDF methods on the fly
|
||||
'methods' => [
|
||||
'SetWatermarkText' => ['COPY', 0.05],
|
||||
'SetHtmlHeader' => [$this->header($case_necropsy->id_case, 'Necropsy') . $header],
|
||||
'SetFooter' => ['<span style="font-size: 13pt;">' . $case_necropsy->id_case . '|<small
|
||||
style="font-size: 13pt;">' . Yii::$app->params['settings']['non_gyn_rev'] . '</small>|<span
|
||||
style="font-size: 13pt;">Report Page {PAGENO}/{nbpg}</span>'],
|
||||
],
|
||||
'marginLeft' => 12,
|
||||
'marginRight' => 10,
|
||||
'marginTop' => 90,
|
||||
'marginBottom' => 15,
|
||||
'marginFooter' => 3,
|
||||
]);
|
||||
]);
|
||||
|
||||
$defaultConfig = (new ConfigVariables())->getDefaults();
|
||||
$fontDirs = $defaultConfig['fontDir'];
|
||||
$defaultConfig = (new ConfigVariables())->getDefaults();
|
||||
$fontDirs = $defaultConfig['fontDir'];
|
||||
|
||||
$defaultFontConfig = (new FontVariables())->getDefaults();
|
||||
$fontData = $defaultFontConfig['fontdata'];
|
||||
$defaultFontConfig = (new FontVariables())->getDefaults();
|
||||
$fontData = $defaultFontConfig['fontdata'];
|
||||
|
||||
$pdf->options['fontDir'] = array_merge($fontDirs, [
|
||||
$pdf->options['fontDir'] = array_merge($fontDirs, [
|
||||
Yii::getAlias('@webroot') . '/fonts'
|
||||
]);
|
||||
]);
|
||||
|
||||
|
||||
$pdf->options['fontdata'] = $fontData + [
|
||||
$pdf->options['fontdata'] = $fontData + [
|
||||
'angsananew' => [
|
||||
'R' => 'AngsanaNew.ttf',
|
||||
'TTCfontID' => [
|
||||
'R' => 1,
|
||||
],
|
||||
'R' => 'AngsanaNew.ttf',
|
||||
'TTCfontID' => [
|
||||
'R' => 1,
|
||||
],
|
||||
],
|
||||
'sarabun' => [
|
||||
'R' => 'THSarabunNew.ttf',
|
||||
'R' => 'THSarabunNew.ttf',
|
||||
],
|
||||
'browallia' => [
|
||||
'R' => 'Browallia.ttf',
|
||||
'R' => 'Browallia.ttf',
|
||||
],
|
||||
];
|
||||
];
|
||||
|
||||
if ($file == true) {
|
||||
if ($file == true) {
|
||||
FileHelper::createDirectory(Yii::getAlias('@webroot') . '/patho_reports/');
|
||||
$pdf->Output($content, Yii::getAlias('@webroot') . '/patho_reports/' . $case_necropsy->id_case . '_' . $case_necropsy->h_n . '_' . $necropsy_diagnosis->report_type . '.pdf', Destination::FILE);
|
||||
} else {
|
||||
$pdf->Output($content, Yii::getAlias('@webroot') . '/patho_reports/' . $case_necropsy->id_case . '_' .
|
||||
$case_necropsy->h_n . '_' . $necropsy_diagnosis->report_type . '.pdf', Destination::FILE);
|
||||
} else {
|
||||
return $pdf->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search Surgical
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function actionSearchSurgical()
|
||||
{
|
||||
$searchModel = new SurgicalDiagnosisSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
/**
|
||||
* Search Surgical
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function actionSearchSurgical()
|
||||
{
|
||||
$searchModel = new SurgicalDiagnosisSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('search-surgical', [
|
||||
return $this->render('search-surgical', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search Surgical
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function actionSearchNonGyn()
|
||||
{
|
||||
$searchModel = new CytoNonGynDiagnosisSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
/**
|
||||
* Search Surgical
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function actionSearchNonGyn()
|
||||
{
|
||||
$searchModel = new CytoNonGynDiagnosisSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('search-surgical', [
|
||||
return $this->render('search-surgical', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search Surgical
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function actionSearchPap()
|
||||
{
|
||||
$searchModel = new CytoPapDiagnosisSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
/**
|
||||
* Search Surgical
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function actionSearchPap()
|
||||
{
|
||||
$searchModel = new CytoPapDiagnosisSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
|
||||
return $this->render('search-surgical', [
|
||||
return $this->render('search-surgical', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
]);
|
||||
}
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -14,11 +14,10 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td><strong>Hospital</strong>
|
||||
<span><?= isset($model->hospital) ? $model->hospital->name : null ?><?= ' ' . $model->his_ln ?></span>
|
||||
<span><?= isset($model->hospital) ? $model->hospital->name : null ?>
|
||||
</td>
|
||||
<td><strong>HN.</strong><span> <?= $model->h_n ?></span></td>
|
||||
<td colspan="2"><strong>Birthdate
|
||||
</strong><span> <?= Yii::$app->pathology->thaiToDateOnly($model->birthdate) ?></span></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Collection Date</strong><span> <?php if ($model->collected_at) {
|
||||
|
|
|
|||
|
|
@ -17,16 +17,6 @@ $final_report = CytoNonGynDiagnosis::findOne(['id_case' => $model->id_case, 'rep
|
|||
<!--<h3 style="margin-left: 0px"><strong style="color: #2d6bb6">FINAL DIAGNOSIS:</strong></h3>-->
|
||||
</td>
|
||||
<td align="right" valign="top">
|
||||
<?php if ($diagnosis->is_critical_diagnosis == 1) { ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="border: 1px solid red; padding: 4px; color:red; font-size: 14pt; text-align: left;">
|
||||
<strong>CRITICAL REPORT<br>
|
||||
แจ้งแพทย์ด่วน</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php if ($diagnosis->is_conference == 1) { ?>
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -53,56 +43,54 @@ $final_report = CytoNonGynDiagnosis::findOne(['id_case' => $model->id_case, 'rep
|
|||
<div class="d-flex align-items-center">
|
||||
<span style="color: #2d6bb6; font-size: 16pt; font-weight: bold;">Source of specimen:</span>
|
||||
<span style="font-size: 14pt; margin-right: 20px;">
|
||||
<em>Fine Needle Aspiration</em>
|
||||
<?= isset($model->sourceSpecimen) ? $model->sourceSpecimen->name : '' ?>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
<span style="color: #2d6bb6; font-size: 16pt; font-weight: bold;">Site:</span>
|
||||
<span style="font-size: 14pt;">
|
||||
<em>Thyroid nodule</em>
|
||||
<span style="font-size: 14pt;"><?= isset($model->specimen) ? $model->specimen->name : '' ?>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
<span style="color: #2d6bb6; font-size: 16pt; font-weight: bold;">Appearance:</span>
|
||||
<span style="font-size: 14pt;">
|
||||
<em></em>
|
||||
<?= isset($model->volume) && isset($model->color) ? $model->volume . ' ml, ' . $model->color : '' ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center">
|
||||
<span style="color: #2d6bb6; font-size: 16pt; font-weight: bold;">Type of specimen received:</span>
|
||||
<span style="font-size: 14pt; margin-right: 20px;">
|
||||
<em>Smear slides</em>
|
||||
<?= isset($model->typeSpecimen) ? $model->typeSpecimen->name : '' ?>
|
||||
</span>
|
||||
|
||||
|
||||
|
||||
<span style="color: #2d6bb6; font-size: 16pt; font-weight: bold;">Number of slides:</span>
|
||||
<span style="font-size: 14pt;">
|
||||
<em>6</em>
|
||||
</span>
|
||||
<?= isset($model->spin) ? $model->spin : '' ?> </span>
|
||||
|
||||
|
||||
|
||||
<span style="color: #2d6bb6; font-size: 16pt; font-weight: bold;">Fixation:</span>
|
||||
<span style="font-size: 14pt;">
|
||||
<em>in 95% alcohol</em>
|
||||
<?= isset($model->fixation) ? $model->fixation->name : '' ?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<span style="color: #2d6bb6; font-size: 16pt; font-weight: bold;">Adequacy of specimen: </span>
|
||||
<span style="font-size: 14pt;">
|
||||
<em><?= isset($diagnosis->specimenAdequacy1) ? ($diagnosis->specimenAdequacy1->name == '-' ? null : $diagnosis->specimenAdequacy1->name) : null ?></em>
|
||||
<?= isset($diagnosis->specimenAdequacy1) ? ($diagnosis->specimenAdequacy1->name == '-' ? null : $diagnosis->specimenAdequacy1->name) : null ?>
|
||||
</span>
|
||||
|
||||
<?php if (isset($diagnosis->diagnosis) ? $diagnosis->diagnosis : '') { ?>
|
||||
<h3 style="margin-left: 0px; font-size: 16pt;">
|
||||
<strong style="color: #2d6bb6"><?php // strtoupper($diagnosis->report_type) ?>
|
||||
<?php if ($diagnosis->report_type != 'addendum') { ?><?php if ($diagnosis->report_type == 'corrected') { ?>
|
||||
REPORT<?php } else { ?>Cytologic Diagnosis:<?php } ?><?php } else {
|
||||
REPORT<?php } else { ?>Cytologic diagnosis:<?php } ?><?php } else {
|
||||
echo strtoupper($diagnosis->report_type) .' ' . $diagnosis->pathologist_at;
|
||||
} ?></strong>
|
||||
</h3>
|
||||
|
|
@ -116,14 +104,21 @@ $final_report = CytoNonGynDiagnosis::findOne(['id_case' => $model->id_case, 'rep
|
|||
<div style="font-size: 14pt !important;"><?= $diagnosis->gross_description ?></div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div>
|
||||
<?php if (!empty($diagnosis->comment) && $diagnosis->report_type != 'addendum') { ?>
|
||||
<h3 style="margin-left: 0px; font-size: 16pt;"><strong style="color: #2d6bb6">
|
||||
Note:
|
||||
</strong></h3>
|
||||
<div style="font-size: 14pt !important;"><?= $diagnosis->comment ?></div>
|
||||
<br />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<?php if (!empty($diagnosis->suggestion) && $diagnosis->report_type != 'addendum') { ?>
|
||||
<h3 style="margin-left: 0px; font-size: 16pt;"><strong style="color: #2d6bb6">
|
||||
Suggestion:
|
||||
</strong></h3>
|
||||
<div style="font-size: 14pt !important;"><?= $diagnosis->suggestion ?></div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,35 +16,33 @@ $hospital = ConstHospital::findOne($model->hospital_id);
|
|||
//$type = ['EP' => 'Conventional Pap smear', 'RP' => 'Conventional Pap smear', 'TP' => 'Thin prep', 'NP' => 'Nova prep', 'CP' => 'Clear prep', 'PT' => 'Path tezt'];
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?= $this->render('__pap', ['model' => $model, 'cyto_pap_diagnosis' => $cyto_pap_diagnosis]) ?>
|
||||
|
||||
|
||||
<?php if (!empty($cyto_pap_diagnosis->pathologist_id)) { ?>
|
||||
<!--<hr width="60%">-->
|
||||
<br />
|
||||
<p>
|
||||
Authorized by: <br />
|
||||
<strong><?= isset($cyto_pap_diagnosis->cytotech1) ? $cyto_pap_diagnosis->cytotech1->report_name : null ?></strong><br />
|
||||
<?= isset($cyto_pap_diagnosis->cytotech2) ? '<strong>' . $cyto_pap_diagnosis->cytotech2->report_name . '</strong><br />' : null ?>
|
||||
<span>ATTENDING CYTOTECHNOLOGIST<br />
|
||||
<strong><?= isset($cyto_pap_diagnosis->pathologist) ? $cyto_pap_diagnosis->pathologist->report_name : null ?></strong><br />
|
||||
ATTENDING PATHOLOGIST (Electronically signed)
|
||||
<?= Yii::$app->pathology->engToDateOnly($cyto_pap_diagnosis->pathologist_at) ?></span><br />
|
||||
</p>
|
||||
<!--<hr width="60%">-->
|
||||
<br />
|
||||
<p>
|
||||
Authorized by: <br />
|
||||
<strong><?= isset($cyto_pap_diagnosis->cytotech1) ? $cyto_pap_diagnosis->cytotech1->report_name : null ?></strong><br />
|
||||
<?= isset($cyto_pap_diagnosis->cytotech2) ? '<strong>' . $cyto_pap_diagnosis->cytotech2->report_name . '</strong><br />' : null ?>
|
||||
<span>ATTENDING CYTOTECHNOLOGIST<br />
|
||||
<strong><?= isset($cyto_pap_diagnosis->pathologist) ? $cyto_pap_diagnosis->pathologist->report_name : null ?></strong><br />
|
||||
ATTENDING PATHOLOGIST (Electronically signed)
|
||||
<?= Yii::$app->pathology->engToDateOnly($cyto_pap_diagnosis->pathologist_at) ?></span><br />
|
||||
</p>
|
||||
|
||||
<?php } else { ?>
|
||||
<!--<hr width="60%">-->
|
||||
<br />
|
||||
<p>
|
||||
Authorized by: <br />
|
||||
<strong><?= isset($cyto_pap_diagnosis->cytotech1) ? $cyto_pap_diagnosis->cytotech1->report_name : null ?></strong><br />
|
||||
<?= isset($cyto_pap_diagnosis->cytotech2) ? '<strong>' . $cyto_pap_diagnosis->cytotech2->report_name . '</strong><br />' : null ?>
|
||||
<span style="font-size: 16px">ATTENDING CYTOTECHNOLOGIST,
|
||||
<?= Yii::$app->pathology->engToDateOnly(isset($cyto_pap_diagnosis->cytotech2) ? $cyto_pap_diagnosis->cytotech2_at : $cyto_pap_diagnosis->cytotech1_at) ?></span><br />
|
||||
<!--<hr width="60%">-->
|
||||
<br />
|
||||
<p>
|
||||
Authorized by: <br />
|
||||
<strong><?= isset($cyto_pap_diagnosis->cytotech1) ? $cyto_pap_diagnosis->cytotech1->report_name : null ?></strong><br />
|
||||
<?= isset($cyto_pap_diagnosis->cytotech2) ? '<strong>' . $cyto_pap_diagnosis->cytotech2->report_name . '</strong><br />' : null ?>
|
||||
<span style="font-size: 16px">ATTENDING CYTOTECHNOLOGIST,
|
||||
<?= Yii::$app->pathology->engToDateOnly(isset($cyto_pap_diagnosis->cytotech2) ? $cyto_pap_diagnosis->cytotech2_at : $cyto_pap_diagnosis->cytotech1_at) ?></span><br />
|
||||
|
||||
</p>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
<hr width="60%">
|
||||
|
|
|
|||
|
|
@ -25,16 +25,6 @@ die();*/
|
|||
<!--<h3 style="margin-left: 0px"><strong style="color: #2d6bb6">FINAL DIAGNOSIS:</strong></h3>-->
|
||||
</td>
|
||||
<td align="right" valign="top">
|
||||
<?php if ($surgical_diagnosis->is_critical_diagnosis == 1) { ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="border: 1px solid red; padding: 4px; color:red; font-size: 14pt; text-align: left;">
|
||||
<strong>CRITICAL REPORT<br>
|
||||
แจ้งแพทย์ด่วน</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php if ($surgical_diagnosis->is_conference == 1) { ?>
|
||||
<table>
|
||||
<tr>
|
||||
|
|
@ -66,7 +56,6 @@ die();*/
|
|||
<!-- DIAGNOSIS -->
|
||||
|
||||
|
||||
|
||||
<?php // ($model->is_critical_diagnosis ? '<div style="color: red; font-size: 14pt; text-align: right;">(แจ้งแพทย์ด่วน)</div>' : '')
|
||||
?>
|
||||
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ class PrintController extends \yii\web\Controller
|
|||
//$print_arr = [1 => 'SR LIS'];
|
||||
$print_arr = [1 => 'HANUMAN'];
|
||||
//$content = $result . ',' . $surgical_slide->no_slide . ',' . 'SR. PATH' . ',Hopper' . $surgical_slide_print['items'][$value]['hopper'] . ',Outlet' . $surgical_slide_print['items'][$value]['outlet'] . ',' . $print_arr[$surgical_slide_print['items'][$value]['printer']];
|
||||
$content = $result . ',' . $surgical_slide->no_slide . ',' . 'SRTH' . ',Hopper ' . $surgical_slide_print['items'][$value]['hopper'] . ',Outlet' . $surgical_slide_print['items'][$value]['outlet'] . ',' . $print_arr[$surgical_slide_print['items'][$value]['printer']];
|
||||
$content = $result . ',' . $surgical_slide->no_slide . ',' . 'surattani hospital' . ',Hopper ' . $surgical_slide_print['items'][$value]['hopper'] . ',Outlet' . $surgical_slide_print['items'][$value]['outlet'] . ',' . $print_arr[$surgical_slide_print['items'][$value]['printer']];
|
||||
// }
|
||||
|
||||
//$content = implode("\n", $content);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use kartik\select2\Select2;
|
|||
use yii\grid\GridView;
|
||||
use common\models\ConstStatus;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\MaskedInput;
|
||||
|
||||
|
||||
|
|
@ -26,6 +27,13 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||
'layout' => "{summary}<div class='table-outer'><div class='table-responsive'>\n{items}\n</div></div><div class='d-flex justify-content-between align-items-center mt-4'>{pager}</div>",
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
[
|
||||
'label' => 'Sticker',
|
||||
'format' => 'raw',
|
||||
'value' => function ($model) {
|
||||
return Html::a('<i class="ri-sticky-note-line"></i> Print Slides Sticker', ['/histo/case/he-sticker-auto', 'id_case' => $model->id_case], ['class' => 'btn btn-sm btn-info btn-block', 'target' => '_blank']);
|
||||
}
|
||||
],
|
||||
[
|
||||
'attribute' => 'status_id',
|
||||
'filter' => ArrayHelper::map(ConstStatus::find()->all(), 'id', 'status'),
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ if (Yii::$app->user->can('center')) {
|
|||
],
|
||||
];
|
||||
*/
|
||||
|
||||
$menuItems[] = [
|
||||
'label' => '<i class="ri-article-line"></i> <span class="menu-text">Outsource Lab</span>',
|
||||
'url' => 'javascript:void()',
|
||||
|
|
@ -186,7 +187,6 @@ if (Yii::$app->user->can('center')) {
|
|||
];*/
|
||||
|
||||
$menuItems[] = ['label' => '<i class="ri-user-received-2-line"></i> <span class="menu-text">พยาธิแพทย์คืน Case <span class="badge border border-danger bg-danger-subtle text-danger ms-auto">' . PathologistTransfer::find()->where(['transfer_status' => 1])->count() . '</span>', 'url' => ['/register/pathologist-transfer/index']];
|
||||
|
||||
$menuItems[] = [
|
||||
'label' => '<i class="ri-file-close-line"></i> <span class="menu-text">อุบัติการณ์(ปฏิเสธ)</span>',
|
||||
'url' => 'javascript:void()',
|
||||
|
|
@ -216,11 +216,6 @@ if (Yii::$app->user->can('center')) {
|
|||
['label' => '<i class="ri-git-commit-fill"></i> การประเมินคุณภาพสไลด์ <br> Special Staining', 'url' => ['/slideqa/surgical/special-staining']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> การประเมินคุณภาพสไลด์ <br> Immuno Staining', 'url' => ['/slideqa/surgical/immuno-staining']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> การประเมินคุณภาพสไลด์ <br> กลุ่มงานพยาธิวิทยากายวิภาค', 'url' => ['/slideqa/surgical/immuno']],
|
||||
//['label' => 'การประเมินคุณภาพสไลด์ <br> Cyto Block', 'url' => ['/slideqa/cyto/cyto-block']],
|
||||
//['label' => 'การประเมินคุณภาพสไลด์ <br> Fluid specimens', 'url' => ['/slideqa/cyto/fluid-specimens']],
|
||||
//['label' => 'การประเมินคุณภาพสไลด์ <br> FNA & PAP Smear', 'url' => ['/slideqa/cyto/slide-specimens']],
|
||||
//['label' => 'การประเมินคุณภาพสไลด์ <br> กลุ่มงานจุลพยาธิ', 'url' => ['/slideqa/cyto/slide-specimens']],
|
||||
//['label' => 'การแบบประเมินคุณภาพ <br> งานย้อมสี <br> Immunohistochemistry', 'url' => ['/slideqa/cyto/slide-specimens']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> การประเมินคุณภาพสไลด์ <br> งานเชลล์วิทยา', 'url' => ['/slideqa/cyto/slide-qa-1']],
|
||||
],
|
||||
];
|
||||
|
|
@ -230,10 +225,7 @@ if (Yii::$app->user->can('center')) {
|
|||
'url' => 'javascript:void()',
|
||||
'options' => ['class' => 'treeview'],
|
||||
'items' => [
|
||||
//['label' => '<i class="ri-git-commit-fill"></i> รายการค่าตรวจ HIS', 'url' => ['/register/service-charge-his/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> รายการค่าตรวจ', 'url' => ['/register/service-charge/index']],
|
||||
//['label' => '<i class="ri-git-commit-fill"></i> รายการค่าตรวจ Mapping', 'url' => ['/register/hospital-import-service-charge-mapping/index']],
|
||||
//['label' => '<i class="ri-git-commit-fill"></i> ค่าตรวจแต่ละหน่วยงาน', 'url' => ['/register/hospital-service-charge/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> โรงพยาบาล/หน่วยงาน <br> (ลูกค้า)', 'url' => ['/register/hospital/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ประเภทหน่วยงาน', 'url' => ['/register/hospital-type/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> รายชื่อแพทย์เจ้าของคนไข้', 'url' => ['/register/const-doctor/index']],
|
||||
|
|
@ -241,6 +233,17 @@ if (Yii::$app->user->can('center')) {
|
|||
['label' => '<i class="ri-git-commit-fill"></i> รายการ Ward', 'url' => ['/register/const-ward/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> คำนำหน้า', 'url' => ['/register/patient-title/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูลวันหยุด</span>', 'url' => ['/stat/hr-day-off/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cancer Registry', 'url' => ['/register/const-cancer-registry/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto Specimen Types', 'url' => ['/register/cyto-specimen-type/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto Specimen', 'url' => ['/register/cyto-specimen/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto Source of Specimen', 'url' => ['/register/cyto-source-of-specimen/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto type of Specimen', 'url' => ['/register/cyto-type-of-specimen/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto Fixation', 'url' => ['/register/cyto-fixation/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto Specimen<br>Adequacy 1', 'url' => ['/cyto/cyto-specimen-adequacy-1/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto Specimen<br>Adequacy 2', 'url' => ['/cyto/cyto-specimen-adequacy-2/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto Specimen<br>Adequacy 3', 'url' => ['/cyto/cyto-specimen-adequacy-3/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto General<br>Categorization 1', 'url' => ['/cyto/cyto-general-categorization-1/index']],
|
||||
['label' => '<i class="ri-git-commit-fill"></i> ข้อมูล Cyto General<br>Categorization 2', 'url' => ['/cyto/cyto-general-categorization-2/index']],
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue