diff --git a/common/config/main-local.php b/common/config/main-local.php index 9a4978e2..9836ed11 100755 --- a/common/config/main-local.php +++ b/common/config/main-local.php @@ -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', diff --git a/common/models/CaseNonGyn.php b/common/models/CaseNonGyn.php index 311aa528..f9f94d47 100755 --- a/common/models/CaseNonGyn.php +++ b/common/models/CaseNonGyn.php @@ -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; } -} +} \ No newline at end of file diff --git a/common/models/CaseSurgical.php b/common/models/CaseSurgical.php index ce66304e..8e7e4922 100755 --- a/common/models/CaseSurgical.php +++ b/common/models/CaseSurgical.php @@ -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' ]; } diff --git a/common/models/ConstCancerRegistry.php b/common/models/ConstCancerRegistry.php new file mode 100644 index 00000000..1a15938b --- /dev/null +++ b/common/models/ConstCancerRegistry.php @@ -0,0 +1,46 @@ + 500], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'name' => 'Name', + ]; + } +} \ No newline at end of file diff --git a/common/models/CytoFixation.php b/common/models/CytoFixation.php new file mode 100644 index 00000000..8c1d07e7 --- /dev/null +++ b/common/models/CytoFixation.php @@ -0,0 +1,46 @@ + 500], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'name' => 'Name', + ]; + } +} \ No newline at end of file diff --git a/common/models/CytoNonGynDiagnosis.php b/common/models/CytoNonGynDiagnosis.php index bb8361a4..b14f0334 100755 --- a/common/models/CytoNonGynDiagnosis.php +++ b/common/models/CytoNonGynDiagnosis.php @@ -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' ]; } diff --git a/common/models/CytoNonGynDiagnosisLog.php b/common/models/CytoNonGynDiagnosisLog.php new file mode 100644 index 00000000..6620c510 --- /dev/null +++ b/common/models/CytoNonGynDiagnosisLog.php @@ -0,0 +1,76 @@ + 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']); + } +} \ No newline at end of file diff --git a/common/models/CytoPapDiagnosisLog.php b/common/models/CytoPapDiagnosisLog.php index 4435a19e..f28f0219 100755 --- a/common/models/CytoPapDiagnosisLog.php +++ b/common/models/CytoPapDiagnosisLog.php @@ -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', diff --git a/common/models/CytoSourceOfSpecimen.php b/common/models/CytoSourceOfSpecimen.php new file mode 100644 index 00000000..579af3b6 --- /dev/null +++ b/common/models/CytoSourceOfSpecimen.php @@ -0,0 +1,46 @@ + 500], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'name' => 'Name', + ]; + } +} \ No newline at end of file diff --git a/common/models/CytoTypeOfSpecimen.php b/common/models/CytoTypeOfSpecimen.php new file mode 100644 index 00000000..3ff3d351 --- /dev/null +++ b/common/models/CytoTypeOfSpecimen.php @@ -0,0 +1,46 @@ + 500], + ]; + } + + /** + * {@inheritdoc} + */ + public function attributeLabels() + { + return [ + 'id' => 'ID', + 'name' => 'Name', + ]; + } +} \ No newline at end of file diff --git a/frontend/modules/approve/views/center-approve-gyn/_cyto_screener.php b/frontend/modules/approve/views/center-approve-gyn/_cyto_screener.php index afa22e99..21d96a28 100755 --- a/frontend/modules/approve/views/center-approve-gyn/_cyto_screener.php +++ b/frontend/modules/approve/views/center-approve-gyn/_cyto_screener.php @@ -1,7 +1,6 @@ where([ 'id_case' => $case_pap->id_case, ]) - ->all(); + ->one(); // ใช้ one() เพื่อดึงรายการเดียว ?> -
| ' . Html::img(Yii::getAlias('@webroot') . '/img/logo_report/logo.png', ['width' => '', 'height' => '2.8cm']) . ' - - Suratthani Hospital, Muang Suratthani, - Suratthani 84000 Tel. 077 952 900 - + |
+ CRITICAL REPORT + แจ้งแพทย์ด่วน |
-
- PATHOLOGY REPORT - Department of Anatomical Pathology - - |
- ' . $id_case . ' |
| - ' . strtoupper($name) . ' PATHOLOGY REPORT - | +
+ ' . Html::img(Yii::getAlias('@webroot') . '/img/logo_report/logo.png', ['width' => '', 'height' => '2.8cm']) . ' + + Suratthani Hospital, Muang Suratthani, + Suratthani 84000 Tel. 077 952 900 ต่อ 7322, 7328 + + |
+
+ PATHOLOGY REPORT + Department of Anatomical Pathology + |
+
+ ' . $alert . '+ ' . Html::encode($id_case) . ' + |
+
|---|
| + ' . strtoupper($name) . ' PATHOLOGY REPORT + | +
|---|
|
- CRITICAL REPORT - แจ้งแพทย์ด่วน - |
-
- is_critical_diagnosis == 1) { ?>
-
|