39414-vm/nursing.php
2026-03-31 10:39:17 +00:00

71 lines
4.2 KiB
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/queue_bootstrap.php';
qh_boot();
qh_nursing_handle_request();
$waitingTickets = qh_fetch_tickets(['waiting_vitals'], null, 20);
qh_page_start(
'nursing',
qh_t('Nursing vitals queue', 'طابور التمريض للعلامات الحيوية'),
qh_t('Nursing workspace with separate English and Arabic views.', 'مساحة عمل التمريض مع فصل بين الواجهة العربية والإنجليزية.')
);
?>
<div class="container-xxl px-3 px-lg-4">
<section class="page-header-panel mb-4">
<div>
<span class="section-kicker"><?= qh_h(qh_t('Nursing', 'التمريض')) ?></span>
<div class="locale-chip mt-3"><?= qh_h(qh_current_language_badge()) ?></div>
<h1 class="section-title-xl mt-2"><?= qh_h(qh_t('Capture vitals and release patients to doctors.', 'سجّل العلامات الحيوية ثم حوّل المرضى إلى الأطباء.')) ?></h1>
<p class="section-copy mb-0"><?= qh_h(qh_t('Only clinics configured for vitals-first appear here.', 'تظهر هنا فقط العيادات التي تم إعدادها لتبدأ بالعلامات الحيوية.')) ?></p>
</div>
</section>
<div class="panel-card">
<div class="d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3">
<div>
<h2 class="section-title mb-1"><?= qh_h(qh_t('Waiting for vitals', 'بانتظار العلامات الحيوية')) ?></h2>
<p class="section-copy mb-0"><?= qh_h(qh_t('Add a short note, then send the patient to the doctor queue.', 'أضف ملاحظة قصيرة ثم أرسل المريض إلى طابور الطبيب.')) ?></p>
</div>
<span class="badge rounded-pill text-bg-dark"><?= qh_h(count($waitingTickets) . ' ' . qh_t('patients', 'مرضى')) ?></span>
</div>
<?php if ($waitingTickets): ?>
<div class="vstack gap-3">
<?php foreach ($waitingTickets as $ticket): ?>
<article class="list-row-form">
<div class="d-flex justify-content-between align-items-start flex-wrap gap-3">
<div>
<div class="ticket-code"><?= qh_h($ticket['ticket_number']) ?></div>
<div class="fw-semibold mt-1"><?= qh_h($ticket['patient_name']) ?></div>
<div class="small text-secondary mt-1"><?= qh_h(qh_name($ticket, 'clinic_name')) ?> · <?= qh_h(qh_name($ticket, 'doctor_name')) ?> · <?= qh_h(qh_t('Room', 'غرفة')) ?> <?= qh_h($ticket['doctor_room'] ?? '--') ?></div>
</div>
<div class="d-flex gap-2 flex-wrap align-items-center">
<?= qh_status_badge($ticket['status']) ?>
<a class="btn btn-sm btn-outline-dark" href="<?= qh_h(qh_url('ticket.php', ['id' => (int) $ticket['id']])) ?>"><?= qh_h(qh_t('Ticket detail', 'تفاصيل التذكرة')) ?></a>
</div>
</div>
<form method="post" class="row g-3 align-items-end mt-1">
<input type="hidden" name="ticket_id" value="<?= qh_h((string) $ticket['id']) ?>">
<div class="col-lg-9">
<label class="form-label"><?= qh_h(qh_t('Vitals note', 'ملاحظة العلامات الحيوية')) ?></label>
<textarea class="form-control" name="vitals_notes" rows="2" placeholder="<?= qh_h(qh_t('Blood pressure, pulse, temperature...', 'الضغط والنبض والحرارة...')) ?>" required></textarea>
</div>
<div class="col-lg-3 d-grid">
<button class="btn btn-dark" type="submit"><?= qh_h(qh_t('Send to doctor', 'إرسال إلى الطبيب')) ?></button>
</div>
</form>
</article>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="empty-state">
<strong><?= qh_h(qh_t('No patients are waiting for vitals.', 'لا يوجد مرضى بانتظار العلامات الحيوية.')) ?></strong>
<span><?= qh_h(qh_t('New vitals-first tickets from reception will appear here.', 'ستظهر هنا التذاكر الجديدة التي تتطلب العلامات الحيوية أولاً.')) ?></span>
</div>
<?php endif; ?>
</div>
</div>
<?php qh_page_end(); ?>