2025-12-29 16:57:46 +07:00
|
|
|
<!-- Patient Form Modal -->
|
2025-12-30 14:30:35 +07:00
|
|
|
<div
|
|
|
|
|
x-show="showModal"
|
|
|
|
|
x-cloak
|
|
|
|
|
class="modal-overlay"
|
|
|
|
|
@click.self="closeModal()"
|
|
|
|
|
x-transition:enter="transition ease-out duration-200"
|
|
|
|
|
x-transition:enter-start="opacity-0"
|
|
|
|
|
x-transition:enter-end="opacity-100"
|
|
|
|
|
x-transition:leave="transition ease-in duration-150"
|
|
|
|
|
x-transition:leave-start="opacity-100"
|
|
|
|
|
x-transition:leave-end="opacity-0"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="modal-content p-6 max-w-4xl w-full max-h-[90vh] overflow-y-auto"
|
|
|
|
|
@click.stop
|
|
|
|
|
x-transition:enter="transition ease-out duration-200"
|
|
|
|
|
x-transition:enter-start="opacity-0 transform scale-95"
|
|
|
|
|
x-transition:enter-end="opacity-100 transform scale-100"
|
|
|
|
|
x-transition:leave="transition ease-in duration-150"
|
|
|
|
|
x-transition:leave-start="opacity-100 transform scale-100"
|
|
|
|
|
x-transition:leave-end="opacity-0 transform scale-95"
|
|
|
|
|
>
|
2025-12-29 16:57:46 +07:00
|
|
|
<!-- Header -->
|
2025-12-30 14:30:35 +07:00
|
|
|
<div class="flex items-center justify-between mb-6">
|
|
|
|
|
<h3 class="font-bold text-xl flex items-center gap-2" style="color: rgb(var(--color-text));">
|
|
|
|
|
<i class="fa-solid fa-user-plus" style="color: rgb(var(--color-primary));"></i>
|
2025-12-29 16:57:46 +07:00
|
|
|
<span x-text="isEditing ? 'Edit Patient' : 'New Patient'"></span>
|
|
|
|
|
</h3>
|
|
|
|
|
<button class="btn btn-ghost btn-sm btn-square" @click="closeModal()">
|
|
|
|
|
<i class="fa-solid fa-times"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Form -->
|
2025-12-30 14:30:35 +07:00
|
|
|
<div class="space-y-5">
|
2025-12-29 16:57:46 +07:00
|
|
|
<!-- Patient ID -->
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Patient ID (MRN)</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
placeholder="Auto-generated if empty"
|
|
|
|
|
x-model="form.PatientID"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Name Row -->
|
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
2025-12-30 14:30:35 +07:00
|
|
|
<span class="label-text font-medium">First Name <span style="color: rgb(var(--color-error));">*</span></span>
|
2025-12-29 16:57:46 +07:00
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
:class="errors.NameFirst && 'input-error'"
|
|
|
|
|
x-model="form.NameFirst"
|
|
|
|
|
/>
|
|
|
|
|
<label class="label" x-show="errors.NameFirst">
|
2025-12-30 14:30:35 +07:00
|
|
|
<span class="label-text-alt" style="color: rgb(var(--color-error));" x-text="errors.NameFirst"></span>
|
2025-12-29 16:57:46 +07:00
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Middle Name</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
x-model="form.NameMiddle"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
2025-12-30 14:30:35 +07:00
|
|
|
<span class="label-text font-medium">Last Name <span style="color: rgb(var(--color-error));">*</span></span>
|
2025-12-29 16:57:46 +07:00
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
:class="errors.NameLast && 'input-error'"
|
|
|
|
|
x-model="form.NameLast"
|
|
|
|
|
/>
|
|
|
|
|
<label class="label" x-show="errors.NameLast">
|
2025-12-30 14:30:35 +07:00
|
|
|
<span class="label-text-alt" style="color: rgb(var(--color-error));" x-text="errors.NameLast"></span>
|
2025-12-29 16:57:46 +07:00
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Gender & Birthdate -->
|
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Gender</span>
|
|
|
|
|
</label>
|
2025-12-30 14:30:35 +07:00
|
|
|
<select class="select" x-model="form.Gender">
|
2025-12-29 16:57:46 +07:00
|
|
|
<option value="1">Male</option>
|
|
|
|
|
<option value="2">Female</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Birth Date</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="date"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
x-model="form.Birthdate"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Contact Info -->
|
|
|
|
|
<div class="divider">Contact Information</div>
|
|
|
|
|
|
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Mobile Phone</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="tel"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
placeholder="+62..."
|
|
|
|
|
x-model="form.MobilePhone"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Email</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="email"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
placeholder="patient@email.com"
|
|
|
|
|
x-model="form.EmailAddress1"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Address -->
|
|
|
|
|
<div class="divider">Address</div>
|
|
|
|
|
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Street Address</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
x-model="form.Street_1"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">City</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
x-model="form.City"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">Province</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
x-model="form.Province"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-30 14:30:35 +07:00
|
|
|
<div>
|
2025-12-29 16:57:46 +07:00
|
|
|
<label class="label">
|
|
|
|
|
<span class="label-text font-medium">ZIP Code</span>
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2025-12-30 14:30:35 +07:00
|
|
|
class="input"
|
2025-12-29 16:57:46 +07:00
|
|
|
x-model="form.ZIP"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Actions -->
|
2025-12-30 14:30:35 +07:00
|
|
|
<div class="flex gap-3 mt-8 pt-6" style="border-top: 1px solid rgb(var(--color-border));">
|
|
|
|
|
<button class="btn btn-ghost flex-1" @click="closeModal()">Cancel</button>
|
|
|
|
|
<button class="btn btn-primary flex-1" @click="save()" :disabled="saving">
|
|
|
|
|
<span x-show="saving" class="spinner spinner-sm"></span>
|
|
|
|
|
<i x-show="!saving" class="fa-solid fa-save mr-2"></i>
|
2025-12-29 16:57:46 +07:00
|
|
|
<span x-text="saving ? 'Saving...' : 'Save Patient'"></span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-30 14:30:35 +07:00
|
|
|
</div>
|