IPD discharge: add edit action for prescribed medicines
This commit is contained in:
parent
c22c21d36c
commit
c2f1f76dcb
|
|
@ -5447,6 +5447,8 @@ class Ipd_discharge extends BaseController
|
|||
if (strtolower($this->request->getMethod()) === 'post') {
|
||||
$action = (string) ($this->request->getPost('action') ?? 'save_main');
|
||||
$savedAny = false;
|
||||
$ajaxRowId = 0;
|
||||
$ajaxRowSource = '';
|
||||
|
||||
if ((int) ($this->request->getPost('dietary_autosave') ?? 0) === 1) {
|
||||
$instructionFoodIds = $this->readInstructionFoodIdsFromRequest();
|
||||
|
|
@ -5769,9 +5771,71 @@ class Ipd_discharge extends BaseController
|
|||
$day = trim((string) ($this->request->getPost('new_drug_day') ?? ''));
|
||||
$qty = trim((string) ($this->request->getPost('new_drug_qty') ?? ''));
|
||||
$remark = trim((string) ($this->request->getPost('new_drug_remark') ?? ''));
|
||||
$editId = (int) ($this->request->getPost('drug_edit_id') ?? 0);
|
||||
$editSource = strtolower(trim((string) ($this->request->getPost('drug_edit_source') ?? 'legacy')));
|
||||
|
||||
$legacyDrugTable = $this->findFirstExistingTable(['ipd_discharge_prescrption_prescribed', 'ipd_discharge_prescription_prescribed']);
|
||||
if ($name !== '' && $legacyDrugTable !== null && $this->tableHasColumns($legacyDrugTable, ['ipd_id', 'med_name'])) {
|
||||
if ($name !== '' && $editId > 0) {
|
||||
$updated = false;
|
||||
|
||||
if ($editSource === 'legacy' && $legacyDrugTable !== null && $this->tableHasColumns($legacyDrugTable, ['id', 'ipd_id'])) {
|
||||
$update = [
|
||||
'med_name' => $name,
|
||||
'med_type' => $type,
|
||||
'dosage' => $dose,
|
||||
'dosage_when' => $when,
|
||||
'dosage_freq' => $freq,
|
||||
'no_of_days' => $day,
|
||||
'qty' => $qty,
|
||||
'remark' => $remark,
|
||||
'update_by' => $userLabel,
|
||||
];
|
||||
|
||||
$allowed = [];
|
||||
foreach ($update as $field => $value) {
|
||||
if ($this->db->fieldExists($field, $legacyDrugTable)) {
|
||||
$allowed[$field] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($allowed)) {
|
||||
$updated = (bool) $this->db->table($legacyDrugTable)
|
||||
->where('id', $editId)
|
||||
->where('ipd_id', $ipdId)
|
||||
->update($allowed);
|
||||
}
|
||||
|
||||
if ($updated) {
|
||||
$ajaxRowId = $editId;
|
||||
$ajaxRowSource = 'legacy';
|
||||
}
|
||||
}
|
||||
|
||||
if (! $updated && $this->tableHasColumns('ipd_discharge_drug', ['id', 'ipd_id'])) {
|
||||
$doseText = trim(implode(' ', array_filter([$type, $dose, $when, $freq], static fn ($v) => trim((string) $v) !== '')));
|
||||
$dayText = trim(implode(' ', array_filter([$day, $qty !== '' ? ('Qty:' . $qty) : '', $remark], static fn ($v) => trim((string) $v) !== '')));
|
||||
$update = [
|
||||
'drug_name' => $name,
|
||||
'drug_dose' => $doseText,
|
||||
'drug_day' => $dayText,
|
||||
'update_by' => $userLabel,
|
||||
];
|
||||
|
||||
$updated = (bool) $this->db->table('ipd_discharge_drug')
|
||||
->where('id', $editId)
|
||||
->where('ipd_id', $ipdId)
|
||||
->update($update);
|
||||
|
||||
if ($updated) {
|
||||
$ajaxRowId = $editId;
|
||||
$ajaxRowSource = 'classic';
|
||||
}
|
||||
}
|
||||
|
||||
$savedAny = $updated;
|
||||
$notice = $savedAny ? 'Medicine row updated.' : 'Unable to update medicine row.';
|
||||
$noticeType = $savedAny ? 'success' : 'warning';
|
||||
} elseif ($name !== '' && $legacyDrugTable !== null && $this->tableHasColumns($legacyDrugTable, ['ipd_id', 'med_name'])) {
|
||||
$insert = [
|
||||
'ipd_id' => $ipdId,
|
||||
'med_id' => 0,
|
||||
|
|
@ -5799,6 +5863,10 @@ class Ipd_discharge extends BaseController
|
|||
$savedAny = ! empty($allowed)
|
||||
? (bool) $this->db->table($legacyDrugTable)->insert($allowed)
|
||||
: false;
|
||||
if ($savedAny) {
|
||||
$ajaxRowId = (int) ($this->db->insertID() ?? 0);
|
||||
$ajaxRowSource = 'legacy';
|
||||
}
|
||||
$notice = $savedAny ? 'Medicine row added.' : 'Unable to add medicine row.';
|
||||
$noticeType = $savedAny ? 'success' : 'warning';
|
||||
} elseif ($name !== '' && $this->tableHasColumns('ipd_discharge_drug', ['ipd_id', 'drug_name'])) {
|
||||
|
|
@ -5817,6 +5885,10 @@ class Ipd_discharge extends BaseController
|
|||
$insert['order_id'] = 0;
|
||||
}
|
||||
$savedAny = (bool) $this->db->table('ipd_discharge_drug')->insert($insert);
|
||||
if ($savedAny) {
|
||||
$ajaxRowId = (int) ($this->db->insertID() ?? 0);
|
||||
$ajaxRowSource = 'classic';
|
||||
}
|
||||
$notice = $savedAny ? 'Drug row added.' : 'Unable to add drug row.';
|
||||
$noticeType = $savedAny ? 'success' : 'warning';
|
||||
} else {
|
||||
|
|
@ -6442,6 +6514,8 @@ class Ipd_discharge extends BaseController
|
|||
'update' => $savedAny ? 1 : 0,
|
||||
'error_text' => $notice,
|
||||
'notice_type' => $noticeType,
|
||||
'row_id' => $ajaxRowId,
|
||||
'row_source' => $ajaxRowSource,
|
||||
'csrfName' => csrf_token(),
|
||||
'csrfHash' => csrf_hash(),
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -101,14 +101,23 @@ $getDoseLabel = function ($id, $type) use ($doseMasterMaps) {
|
|||
$medicineRows = [];
|
||||
if (! empty($legacyDrugRows)) {
|
||||
foreach ($legacyDrugRows as $row) {
|
||||
$doseId = (int) ($row['dosage'] ?? 0);
|
||||
$whenId = (int) ($row['dosage_when'] ?? 0);
|
||||
$freqId = (int) ($row['dosage_freq'] ?? 0);
|
||||
$doseLabel = $getDoseLabel($doseId, 'dose');
|
||||
$whenLabel = $getDoseLabel($whenId, 'when');
|
||||
$freqLabel = $getDoseLabel($freqId, 'freq');
|
||||
$medicineRows[] = [
|
||||
'id' => (int) ($row['id'] ?? 0),
|
||||
'source' => 'legacy',
|
||||
'med_name' => (string) ($row['med_name'] ?? ''),
|
||||
'med_type' => (string) ($row['med_type'] ?? ''),
|
||||
'dosage' => $getDoseLabel($row['dosage'] ?? 0, 'dose'),
|
||||
'dosage_when' => $getDoseLabel($row['dosage_when'] ?? 0, 'when'),
|
||||
'dosage_freq' => $getDoseLabel($row['dosage_freq'] ?? 0, 'freq'),
|
||||
'dosage' => $doseLabel !== '' ? $doseLabel : (string) ($row['dosage'] ?? ''),
|
||||
'dosage_when' => $whenLabel !== '' ? $whenLabel : (string) ($row['dosage_when'] ?? ''),
|
||||
'dosage_freq' => $freqLabel !== '' ? $freqLabel : (string) ($row['dosage_freq'] ?? ''),
|
||||
'dosage_id' => $doseId,
|
||||
'dosage_when_id' => $whenId,
|
||||
'dosage_freq_id' => $freqId,
|
||||
'no_of_days' => (string) ($row['no_of_days'] ?? ''),
|
||||
'qty' => (string) ($row['qty'] ?? ''),
|
||||
'remark' => (string) ($row['remark'] ?? ''),
|
||||
|
|
@ -124,6 +133,9 @@ if (! empty($legacyDrugRows)) {
|
|||
'dosage' => (string) ($row['drug_dose'] ?? ''),
|
||||
'dosage_when' => '',
|
||||
'dosage_freq' => '',
|
||||
'dosage_id' => 0,
|
||||
'dosage_when_id' => 0,
|
||||
'dosage_freq_id' => 0,
|
||||
'no_of_days' => (string) ($row['drug_day'] ?? ''),
|
||||
'qty' => '',
|
||||
'remark' => '',
|
||||
|
|
@ -1220,7 +1232,7 @@ $historyFields = [
|
|||
<td colspan="9" class="text-muted text-center">No medicine added</td>
|
||||
</tr>
|
||||
<?php else: foreach ($medicineRows as $row): ?>
|
||||
<tr>
|
||||
<tr data-row-id="<?= (int) ($row['id'] ?? 0) ?>" data-row-source="<?= esc((string) ($row['source'] ?? 'legacy')) ?>">
|
||||
<td><?= esc((string) ($row['med_type'] ?? '')) ?></td>
|
||||
<td><?= esc((string) ($row['med_name'] ?? '')) ?></td>
|
||||
<td><?= esc((string) ($row['dosage'] ?? '')) ?></td>
|
||||
|
|
@ -1229,7 +1241,25 @@ $historyFields = [
|
|||
<td><?= esc((string) ($row['no_of_days'] ?? '')) ?></td>
|
||||
<td><?= esc((string) ($row['qty'] ?? '')) ?></td>
|
||||
<td><?= esc((string) ($row['remark'] ?? '')) ?></td>
|
||||
<td><button type="submit" class="btn btn-outline-danger btn-sm" name="action" value="remove_drug" data-reload-section="section-medicine" onclick="document.getElementById('drug_remove_id').value='<?= (int) ($row['id'] ?? 0) ?>';document.getElementById('drug_remove_source').value='<?= esc((string) ($row['source'] ?? 'legacy')) ?>';">Remove</button></td>
|
||||
<td class="d-flex gap-1">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-primary btn-sm btn-edit-discharge-med"
|
||||
data-id="<?= (int) ($row['id'] ?? 0) ?>"
|
||||
data-source="<?= esc((string) ($row['source'] ?? 'legacy')) ?>"
|
||||
data-med-name="<?= esc((string) ($row['med_name'] ?? '')) ?>"
|
||||
data-med-type="<?= esc((string) ($row['med_type'] ?? '')) ?>"
|
||||
data-dose-id="<?= (int) ($row['dosage_id'] ?? 0) ?>"
|
||||
data-dose-when-id="<?= (int) ($row['dosage_when_id'] ?? 0) ?>"
|
||||
data-dose-freq-id="<?= (int) ($row['dosage_freq_id'] ?? 0) ?>"
|
||||
data-dose-label="<?= esc((string) ($row['dosage'] ?? '')) ?>"
|
||||
data-dose-when-label="<?= esc((string) ($row['dosage_when'] ?? '')) ?>"
|
||||
data-dose-freq-label="<?= esc((string) ($row['dosage_freq'] ?? '')) ?>"
|
||||
data-days="<?= esc((string) ($row['no_of_days'] ?? '')) ?>"
|
||||
data-qty="<?= esc((string) ($row['qty'] ?? '')) ?>"
|
||||
data-remark="<?= esc((string) ($row['remark'] ?? '')) ?>">Edit</button>
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm" name="action" value="remove_drug" data-reload-section="section-medicine" onclick="document.getElementById('drug_remove_id').value='<?= (int) ($row['id'] ?? 0) ?>';document.getElementById('drug_remove_source').value='<?= esc((string) ($row['source'] ?? 'legacy')) ?>';">Remove</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
|
|
@ -1251,6 +1281,7 @@ $historyFields = [
|
|||
</div>
|
||||
<div class="card-body">
|
||||
<input type="hidden" id="discharge_med_item_id" value="0">
|
||||
<input type="hidden" id="discharge_med_item_source" value="legacy">
|
||||
<input type="hidden" id="discharge_med_id" value="0">
|
||||
<div class="row g-2 mb-2">
|
||||
<div class="col-8">
|
||||
|
|
@ -4352,6 +4383,91 @@ $historyFields = [
|
|||
}
|
||||
}
|
||||
|
||||
function resetMedicineFormState() {
|
||||
$('#discharge_med_item_id').val('0');
|
||||
$('#discharge_med_item_source').val('legacy');
|
||||
$('#btn_discharge_med_add').text('+ADD / Update');
|
||||
}
|
||||
|
||||
function medicineActionButtonsHtml(rowId, rowSource) {
|
||||
var id = parseInt(rowId || 0, 10);
|
||||
var source = String(rowSource || 'legacy').trim() || 'legacy';
|
||||
return '<td class="d-flex gap-1">'
|
||||
+ '<button type="button" class="btn btn-outline-primary btn-sm btn-edit-discharge-med" data-id="' + id + '" data-source="' + $('<div>').text(source).html() + '">Edit</button>'
|
||||
+ '<button type="submit" class="btn btn-outline-danger btn-sm" name="action" value="remove_drug" data-reload-section="section-medicine" onclick="document.getElementById(\'drug_remove_id\').value=\'' + id + '\';document.getElementById(\'drug_remove_source\').value=\'' + $('<div>').text(source).html() + '\';">Remove</button>'
|
||||
+ '</td>';
|
||||
}
|
||||
|
||||
$(document).on('click', '.btn-edit-discharge-med', function() {
|
||||
var row = $(this).closest('tr');
|
||||
if (!row.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rowId = parseInt($(this).data('id') || row.data('row-id') || 0, 10);
|
||||
var rowSource = String($(this).data('source') || row.data('row-source') || 'legacy').trim() || 'legacy';
|
||||
|
||||
var medName = String($(this).data('med-name') || row.find('td:eq(1)').text() || '').trim();
|
||||
var medType = String($(this).data('med-type') || row.find('td:eq(0)').text() || '').trim();
|
||||
var doseId = String($(this).data('dose-id') || '').trim();
|
||||
var whenId = String($(this).data('dose-when-id') || '').trim();
|
||||
var freqId = String($(this).data('dose-freq-id') || '').trim();
|
||||
var doseLabel = String($(this).data('dose-label') || row.find('td:eq(2)').text() || '').trim();
|
||||
var whenLabel = String($(this).data('dose-when-label') || row.find('td:eq(3)').text() || '').trim();
|
||||
var freqLabel = String($(this).data('dose-freq-label') || row.find('td:eq(4)').text() || '').trim();
|
||||
var noOfDays = String($(this).data('days') || row.find('td:eq(5)').text() || '').trim();
|
||||
var qty = String($(this).data('qty') || row.find('td:eq(6)').text() || '').trim();
|
||||
var remark = String($(this).data('remark') || row.find('td:eq(7)').text() || '').trim();
|
||||
|
||||
$('#discharge_med_item_id').val(rowId > 0 ? rowId : 0);
|
||||
$('#discharge_med_item_source').val(rowSource);
|
||||
$('#discharge_med_name').val(medName);
|
||||
$('#discharge_med_type').val(medType);
|
||||
|
||||
if (doseId !== '' && doseId !== '0') {
|
||||
$('#discharge_dosage').val(doseId);
|
||||
} else {
|
||||
ensureDoseOption('#discharge_dosage', doseLabel);
|
||||
$('#discharge_dosage').val(doseLabel);
|
||||
}
|
||||
|
||||
if (whenId !== '' && whenId !== '0') {
|
||||
$('#discharge_dosage_when').val(whenId);
|
||||
} else {
|
||||
ensureDoseOption('#discharge_dosage_when', whenLabel);
|
||||
$('#discharge_dosage_when').val(whenLabel);
|
||||
}
|
||||
|
||||
if (freqId !== '' && freqId !== '0') {
|
||||
$('#discharge_dosage_freq').val(freqId);
|
||||
} else {
|
||||
ensureDoseOption('#discharge_dosage_freq', freqLabel);
|
||||
$('#discharge_dosage_freq').val(freqLabel);
|
||||
}
|
||||
|
||||
$('#discharge_no_of_days').val(noOfDays);
|
||||
$('#discharge_qty').val(qty);
|
||||
$('#discharge_remark').val(remark);
|
||||
|
||||
$('#btn_discharge_med_add').text('Update Medicine');
|
||||
setMedicineStatus('Edit mode: update fields and click Update Medicine.', 'info');
|
||||
$('#discharge_med_name').trigger('focus');
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-remove-discharge-med', function() {
|
||||
var row = $(this).closest('tr');
|
||||
var tbody = section.querySelector('#discharge_medicine_tbody');
|
||||
if (!row.length || !tbody) {
|
||||
return;
|
||||
}
|
||||
|
||||
row.remove();
|
||||
if (!tbody.querySelector('tr')) {
|
||||
tbody.innerHTML = '<tr><td colspan="9" class="text-muted text-center">No medicine added</td></tr>';
|
||||
}
|
||||
setMedicineStatus('Medicine removed from current view.', 'info');
|
||||
});
|
||||
|
||||
// Handle quick buttons
|
||||
section.querySelectorAll('.discharge-quick-btn').forEach(function(btn) {
|
||||
btn.addEventListener('click', function() {
|
||||
|
|
@ -4384,6 +4500,8 @@ $historyFields = [
|
|||
var qty = $('#discharge_qty').val().trim();
|
||||
var doseWhere = $('#discharge_dose_where').val();
|
||||
var remark = $('#discharge_remark').val().trim();
|
||||
var editRowId = parseInt($('#discharge_med_item_id').val() || '0', 10);
|
||||
var editRowSource = String($('#discharge_med_item_source').val() || 'legacy').trim() || 'legacy';
|
||||
|
||||
if (medName === '') {
|
||||
setMedicineStatus('Please enter medicine name.', 'error');
|
||||
|
|
@ -4439,6 +4557,8 @@ $historyFields = [
|
|||
var payload = {
|
||||
action: 'add_drug',
|
||||
ajax_mode: 'json',
|
||||
drug_edit_id: editRowId,
|
||||
drug_edit_source: editRowSource,
|
||||
new_drug_name: medName,
|
||||
new_drug_type: medType,
|
||||
new_drug_dose: dosage,
|
||||
|
|
@ -4462,7 +4582,6 @@ $historyFields = [
|
|||
updateFormCsrf(activeForm, data || {});
|
||||
|
||||
if (data && parseInt(data.update || '0', 10) === 1) {
|
||||
// Add row to table
|
||||
var tbody = section.querySelector('#discharge_medicine_tbody');
|
||||
if (!tbody) {
|
||||
setMedicineStatus('Medicine table not found.', 'error');
|
||||
|
|
@ -4475,8 +4594,11 @@ $historyFields = [
|
|||
emptyRow.closest('tr').remove();
|
||||
}
|
||||
|
||||
var tr = document.createElement('tr');
|
||||
tr.innerHTML = '<td>' + $('<div>').text(medType).html() + '</td>' +
|
||||
var responseRowId = parseInt((data && data.row_id) ? data.row_id : 0, 10);
|
||||
var responseRowSource = String((data && data.row_source) ? data.row_source : (editRowSource || 'legacy')).trim() || 'legacy';
|
||||
var rowIdToUse = responseRowId > 0 ? responseRowId : editRowId;
|
||||
|
||||
var rowHtml = '<td>' + $('<div>').text(medType).html() + '</td>' +
|
||||
'<td>' + $('<div>').text(medName).html() + '</td>' +
|
||||
'<td>' + $('<div>').text(doseLabel).html() + '</td>' +
|
||||
'<td>' + $('<div>').text(whenLabel).html() + '</td>' +
|
||||
|
|
@ -4484,26 +4606,55 @@ $historyFields = [
|
|||
'<td>' + $('<div>').text(formattedDuration).html() + '</td>' +
|
||||
'<td>' + $('<div>').text(qty).html() + '</td>' +
|
||||
'<td>' + $('<div>').text(remark).html() + '</td>' +
|
||||
'<td><button type="button" class="btn btn-outline-danger btn-sm btn-remove-discharge-med">Remove</button></td>';
|
||||
tbody.appendChild(tr);
|
||||
medicineActionButtonsHtml(rowIdToUse, responseRowSource);
|
||||
|
||||
if (editRowId > 0) {
|
||||
var existingRow = tbody.querySelector('tr[data-row-id="' + editRowId + '"][data-row-source="' + editRowSource + '"]');
|
||||
if (existingRow) {
|
||||
existingRow.innerHTML = rowHtml;
|
||||
existingRow.setAttribute('data-row-id', String(rowIdToUse));
|
||||
existingRow.setAttribute('data-row-source', responseRowSource);
|
||||
} else {
|
||||
var updatedRow = document.createElement('tr');
|
||||
updatedRow.setAttribute('data-row-id', String(rowIdToUse));
|
||||
updatedRow.setAttribute('data-row-source', responseRowSource);
|
||||
updatedRow.innerHTML = rowHtml;
|
||||
tbody.appendChild(updatedRow);
|
||||
}
|
||||
} else {
|
||||
var tr = document.createElement('tr');
|
||||
tr.setAttribute('data-row-id', String(rowIdToUse));
|
||||
tr.setAttribute('data-row-source', responseRowSource);
|
||||
tr.innerHTML = rowHtml;
|
||||
tbody.appendChild(tr);
|
||||
}
|
||||
|
||||
// Keep fresh values on edit button for repeated edits without reload
|
||||
var targetRow = tbody.querySelector('tr[data-row-id="' + rowIdToUse + '"][data-row-source="' + responseRowSource + '"]');
|
||||
if (targetRow) {
|
||||
var editBtn = targetRow.querySelector('.btn-edit-discharge-med');
|
||||
if (editBtn) {
|
||||
editBtn.setAttribute('data-med-name', medName);
|
||||
editBtn.setAttribute('data-med-type', medType);
|
||||
editBtn.setAttribute('data-dose-id', dosage || '');
|
||||
editBtn.setAttribute('data-dose-when-id', dosageWhen || '');
|
||||
editBtn.setAttribute('data-dose-freq-id', dosageFreq || '');
|
||||
editBtn.setAttribute('data-dose-label', doseLabel || '');
|
||||
editBtn.setAttribute('data-dose-when-label', whenLabel || '');
|
||||
editBtn.setAttribute('data-dose-freq-label', freqLabel || '');
|
||||
editBtn.setAttribute('data-days', noOfDays || '');
|
||||
editBtn.setAttribute('data-qty', qty || '');
|
||||
editBtn.setAttribute('data-remark', remark || '');
|
||||
}
|
||||
}
|
||||
|
||||
// Clear form
|
||||
$('#discharge_med_name, #discharge_med_type, #discharge_no_of_days, #discharge_qty, #discharge_remark').val('');
|
||||
$('#discharge_dosage, #discharge_dosage_when, #discharge_dosage_freq, #discharge_dose_where').val('');
|
||||
resetMedicineFormState();
|
||||
$('#discharge_med_name').focus();
|
||||
|
||||
setMedicineStatus('Medicine saved successfully.', 'success');
|
||||
|
||||
// Bind remove button (Note: Remove is not yet AJAX - medicines load from DB on page reload)
|
||||
tr.querySelector('.btn-remove-discharge-med').addEventListener('click', function() {
|
||||
if (confirm('Remove this medicine? This will only remove from the current view. Reload the page to see saved medicines.')) {
|
||||
tr.remove();
|
||||
if (tbody.children.length === 0) {
|
||||
tbody.innerHTML = '<tr><td colspan="9" class="text-muted text-center">No medicine added</td></tr>';
|
||||
}
|
||||
setMedicineStatus('Medicine removed from view. Reload to see saved data.', 'info');
|
||||
}
|
||||
});
|
||||
setMedicineStatus(editRowId > 0 ? 'Medicine updated successfully.' : 'Medicine saved successfully.', 'success');
|
||||
} else {
|
||||
var errorMsg = (data && data.error_text) ? data.error_text : 'Unable to save medicine.';
|
||||
setMedicineStatus(errorMsg, 'error');
|
||||
|
|
@ -4524,6 +4675,7 @@ $historyFields = [
|
|||
if (tbody) {
|
||||
tbody.innerHTML = '<tr><td colspan="9" class="text-muted text-center">No medicine added</td></tr>';
|
||||
}
|
||||
resetMedicineFormState();
|
||||
setMedicineStatus('All medicines removed.', 'info');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user