Add Echo modality to diagnosis navigation and charge group setup
This commit is contained in:
parent
2b391705fe
commit
7b04c8e419
|
|
@ -757,6 +757,7 @@ $routes->get('diagnosis', 'Diagnosis::index', ['filter' => 'permission:diagnosis
|
|||
$routes->get('diagnosis/pathology', 'Diagnosis::pathology', ['filter' => 'permission:diagnosis.access']);
|
||||
$routes->get('diagnosis/biopsy', 'Diagnosis::biopsy', ['filter' => 'permission:diagnosis.access']);
|
||||
$routes->get('diagnosis/ultrasound', 'Diagnosis::ultrasound', ['filter' => 'permission:diagnosis.access']);
|
||||
$routes->get('diagnosis/echo', 'Diagnosis::echo', ['filter' => 'permission:diagnosis.access']);
|
||||
$routes->get('diagnosis/xray', 'Diagnosis::xray', ['filter' => 'permission:diagnosis.access']);
|
||||
$routes->get('diagnosis/mri', 'Diagnosis::mri', ['filter' => 'permission:diagnosis.access']);
|
||||
$routes->get('diagnosis/ctscan', 'Diagnosis::ctscan', ['filter' => 'permission:diagnosis.access']);
|
||||
|
|
|
|||
|
|
@ -63,6 +63,11 @@ class Diagnosis extends BaseController
|
|||
return $this->labPath(4);
|
||||
}
|
||||
|
||||
public function echo()
|
||||
{
|
||||
return $this->labPath(6);
|
||||
}
|
||||
|
||||
public function labMaster()
|
||||
{
|
||||
return $this->index();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class EnsureEchoChargeGroup extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
if (! $this->db->tableExists('hc_item_type')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$builder = $this->db->table('hc_item_type');
|
||||
|
||||
$rowById = $builder->where('itype_id', 6)->get(1)->getRowArray();
|
||||
if (! empty($rowById)) {
|
||||
$groupDesc = strtolower(trim((string) ($rowById['group_desc'] ?? '')));
|
||||
if ($groupDesc !== 'echo') {
|
||||
$builder->where('itype_id', 6)->update(['group_desc' => 'Echo']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$echoByName = $this->db->query("SELECT itype_id FROM hc_item_type WHERE LOWER(TRIM(group_desc)) = 'echo' LIMIT 1")
|
||||
->getRowArray();
|
||||
|
||||
if (! empty($echoByName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$insert = [
|
||||
'itype_id' => 6,
|
||||
'group_desc' => 'Echo',
|
||||
];
|
||||
|
||||
// Keep consistency with existing item type visibility flags when available.
|
||||
$columns = array_map(
|
||||
static fn (array $col): string => (string) ($col['Field'] ?? ''),
|
||||
$this->db->query('SHOW COLUMNS FROM hc_item_type')->getResultArray()
|
||||
);
|
||||
|
||||
if (in_array('is_ipd_opd', $columns, true)) {
|
||||
$insert['is_ipd_opd'] = 0;
|
||||
}
|
||||
|
||||
$this->db->table('hc_item_type')->insert($insert);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
if (! $this->db->tableExists('hc_item_type')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->db->query("DELETE FROM hc_item_type WHERE itype_id = 6 AND LOWER(TRIM(group_desc)) = 'echo'");
|
||||
}
|
||||
}
|
||||
|
|
@ -93,5 +93,19 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Echo -->
|
||||
<div class="col-xxl-2 col-md-4 col-sm-6 mb-4">
|
||||
<div class="card">
|
||||
<a href="javascript:load_form('<?= base_url('diagnosis/echo') ?>','Echo');" class="text-decoration-none">
|
||||
<div class="card-body text-center" style="min-height: 200px; display: flex; flex-direction: column; justify-content: center;">
|
||||
<div class="mb-3">
|
||||
<i class="bi bi-heart-pulse" style="font-size: 3rem; color: #0ea5e9;"></i>
|
||||
</div>
|
||||
<h5 class="card-title mb-0">Echo</h5>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -348,6 +348,12 @@ if (! $canDiagnosis && $user && method_exists($user, 'inGroup')) {
|
|||
<span>Ultrasound</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link collapsed" href="javascript:load_form('<?= base_url('diagnosis/echo') ?>','Echo')">
|
||||
<i class="bi bi-heart-pulse"></i>
|
||||
<span>Echo</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-heading">Admin & Settings</li>
|
||||
<li class="nav-item">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user