fix: add patient history back navigation and restore patient search datatable
This commit is contained in:
parent
e575ee8522
commit
fdd3256ecb
|
|
@ -1,8 +1,22 @@
|
||||||
|
<?php
|
||||||
|
$request = service('request');
|
||||||
|
$defaultBackUrl = base_url('billing/patient/person_record') . '/' . (int) ($patient->id ?? 0) . '/0';
|
||||||
|
$backUrl = trim((string) $request->getGet('back_url'));
|
||||||
|
$backTitle = trim((string) $request->getGet('back_title'));
|
||||||
|
|
||||||
|
if ($backUrl === '') {
|
||||||
|
$backUrl = $defaultBackUrl;
|
||||||
|
}
|
||||||
|
if ($backTitle === '') {
|
||||||
|
$backTitle = 'Profile';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<div class="pagetitle">
|
<div class="pagetitle">
|
||||||
<h1>Consult History</h1>
|
<h1>Consult History</h1>
|
||||||
<nav>
|
<nav>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="javascript:load_form('<?= base_url('billing/patient/person_record') ?>/<?= esc($patient->id) ?>/0');">Profile</a></li>
|
<li class="breadcrumb-item"><a href="javascript:load_form('<?= esc($backUrl, 'js') ?>','<?= esc($backTitle, 'js') ?>');"><?= esc($backTitle) ?></a></li>
|
||||||
<li class="breadcrumb-item active">Consult History</li>
|
<li class="breadcrumb-item active">Consult History</li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
@ -15,7 +29,10 @@
|
||||||
<h3 class="card-title mb-0">Old Prescription With Scanned Records</h3>
|
<h3 class="card-title mb-0">Old Prescription With Scanned Records</h3>
|
||||||
<div class="small text-muted mt-1">Patient: <?= esc($patient->p_fname ?? '') ?></div>
|
<div class="small text-muted mt-1">Patient: <?= esc($patient->p_fname ?? '') ?></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="badge bg-secondary"><?= count($opdGroups ?? []) ?> OPD Record(s)</span>
|
<div class="d-flex align-items-center gap-2">
|
||||||
|
<a href="javascript:load_form('<?= esc($backUrl, 'js') ?>','<?= esc($backTitle, 'js') ?>');" class="btn btn-outline-secondary btn-sm">Back</a>
|
||||||
|
<span class="badge bg-secondary"><?= count($opdGroups ?? []) ?> OPD Record(s)</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?php if (empty($opdGroups)) { ?>
|
<?php if (empty($opdGroups)) { ?>
|
||||||
|
|
|
||||||
|
|
@ -58,4 +58,44 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
var table = document.getElementById('example1');
|
||||||
|
if (!table) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevent duplicate initialization when this partial is loaded repeatedly.
|
||||||
|
if (table.dataset.dtInit === '1') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prefer simple-datatables for static HTML tables loaded via load_form.
|
||||||
|
if (window.simpleDatatables && window.simpleDatatables.DataTable) {
|
||||||
|
try {
|
||||||
|
new window.simpleDatatables.DataTable(table);
|
||||||
|
table.dataset.dtInit = '1';
|
||||||
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('simple-datatables init failed for patient search table', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to full jQuery DataTables plugin only (not the local shim).
|
||||||
|
if (window.jQuery && $.fn && $.fn.DataTable && $.fn.dataTable && $.fn.dataTable.defaults) {
|
||||||
|
try {
|
||||||
|
if (!$.fn.DataTable.isDataTable('#example1')) {
|
||||||
|
$('#example1').DataTable({
|
||||||
|
order: [[0, 'asc']],
|
||||||
|
pageLength: 25
|
||||||
|
});
|
||||||
|
}
|
||||||
|
table.dataset.dtInit = '1';
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('jQuery DataTables init failed for patient search table', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
@ -116,6 +116,22 @@ $mergedGroups = [
|
||||||
<td><?= esc($row->p_code ?? '') ?></td>
|
<td><?= esc($row->p_code ?? '') ?></td>
|
||||||
<td><?= esc($row->opd_type ?? '') ?> / Amt: <?= esc($row->opd_fee_amount ?? '') ?></td>
|
<td><?= esc($row->opd_type ?? '') ?> / Amt: <?= esc($row->opd_fee_amount ?? '') ?></td>
|
||||||
<td>
|
<td>
|
||||||
|
<?php $patientId = (int) ($row->id ?? 0); ?>
|
||||||
|
<?php
|
||||||
|
$historyBackUrl = base_url('Opd/get_appointment_list') . '/' . (int) ($doc_id ?? 0) . '/' . (string) ($opd_date ?? '');
|
||||||
|
$historyUrl = base_url('billing/patient/show_profile_opd') . '/' . $patientId . '/1?' . http_build_query([
|
||||||
|
'back_url' => $historyBackUrl,
|
||||||
|
'back_title' => 'OPD Appointment List',
|
||||||
|
]);
|
||||||
|
?>
|
||||||
|
<?php if ($patientId > 0) : ?>
|
||||||
|
<a class="btn btn-info btn-sm"
|
||||||
|
href="javascript:load_form('<?= esc($historyUrl, 'js') ?>','Consult History');"
|
||||||
|
title="Patient History"
|
||||||
|
aria-label="Patient History">
|
||||||
|
<i class="bi bi-clock-history"></i>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
<?php if ($tabType === 'booking') : ?>
|
<?php if ($tabType === 'booking') : ?>
|
||||||
<?php if ($isConfirmedForQueue) : ?>
|
<?php if ($isConfirmedForQueue) : ?>
|
||||||
<button type="button" class="btn btn-outline-success btn-sm btn-opd-create-queue" data-opdid="<?= $opdId ?>" title="Add to Queue">
|
<button type="button" class="btn btn-outline-success btn-sm btn-opd-create-queue" data-opdid="<?= $opdId ?>" title="Add to Queue">
|
||||||
|
|
|
||||||
|
|
@ -316,6 +316,19 @@
|
||||||
</select>
|
</select>
|
||||||
<button type="button" class="btn btn-outline-warning btn-sm" id="btn_new_opd_session_reset" title="Start clean OPD session view (clear Advice/Investigation/Medicine list)">New OPD Session</button>
|
<button type="button" class="btn btn-outline-warning btn-sm" id="btn_new_opd_session_reset" title="Start clean OPD session view (clear Advice/Investigation/Medicine list)">New OPD Session</button>
|
||||||
<button type="button" class="btn btn-outline-secondary btn-sm" id="btn_restore_draft">Restore Draft</button>
|
<button type="button" class="btn btn-outline-secondary btn-sm" id="btn_restore_draft">Restore Draft</button>
|
||||||
|
<?php
|
||||||
|
$historyBackUrl = base_url('Opd_prescription/Prescription') . '/' . (int) ($opd_id ?? 0);
|
||||||
|
$historyUrl = base_url('billing/patient/show_profile_opd') . '/' . (int) ($patient_master[0]->id ?? 0) . '/1?' . http_build_query([
|
||||||
|
'back_url' => $historyBackUrl,
|
||||||
|
'back_title' => 'Consult',
|
||||||
|
]);
|
||||||
|
?>
|
||||||
|
<a href="javascript:load_form('<?= esc($historyUrl, 'js') ?>','Consult History');"
|
||||||
|
class="btn btn-info btn-sm"
|
||||||
|
title="Patient History"
|
||||||
|
aria-label="Patient History">
|
||||||
|
<i class="bi bi-clock-history"></i>
|
||||||
|
</a>
|
||||||
<button type="button" class="btn btn-outline-success btn-sm" id="btn_local_clinical_assist" title="Local rule-based support using complaints + vitals">Clinical Assist (Local)</button>
|
<button type="button" class="btn btn-outline-success btn-sm" id="btn_local_clinical_assist" title="Local rule-based support using complaints + vitals">Clinical Assist (Local)</button>
|
||||||
<button type="button" class="btn btn-outline-primary btn-sm" id="btn_ai_full_draft" title="Use complete OPD data to generate draft notes">AI Draft (Full Form)</button>
|
<button type="button" class="btn btn-outline-primary btn-sm" id="btn_ai_full_draft" title="Use complete OPD data to generate draft notes">AI Draft (Full Form)</button>
|
||||||
<button type="button" class="btn btn-primary btn-sm" id="btn_save_rx">Save Consult</button>
|
<button type="button" class="btn btn-primary btn-sm" id="btn_save_rx">Save Consult</button>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user