Files
ladill-care/resources/views/care/prescriptions/create.blade.php
T
isaaccladandCursor 94e53d05bf
Deploy Ladill Care / deploy (push) Successful in 1m7s
Keep consultation context on nested clinical pages and add Call again on patient queue cards.
Doctors can return to the active consultation from forms, lab, prescriptions, pathways, and bills; queue cards can re-announce called/serving tickets via the existing Queue recall bridge.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 17:48:34 +00:00

47 lines
3.8 KiB
PHP

<x-app-layout :title="'Prescription · '.$consultation->patient->fullName()">
<x-care.consultation-return :consultation="$consultation" />
<h1 class="text-xl font-semibold text-slate-900">New prescription</h1>
<p class="mt-1 text-sm text-slate-500">{{ $consultation->patient->fullName() }} ({{ $consultation->patient->patient_number }})</p>
<form method="POST" action="{{ route('care.prescriptions.store', $consultation) }}" class="mt-6 space-y-6" x-data="{ items: [{ is_procedure: false, name: '', dosage: '', frequency: '', duration: '', route: 'oral', quantity: '', instructions: '' }] }">
@csrf
<section class="rounded-2xl border border-slate-200 bg-white p-6">
<div class="flex items-center justify-between">
<h2 class="text-sm font-semibold uppercase text-slate-500">Medications & procedures</h2>
<button type="button" @click="items.push({ is_procedure: false, name: '', dosage: '', frequency: '', duration: '', route: 'oral', quantity: '', instructions: '' })" class="text-sm text-sky-600">Add line</button>
</div>
<template x-for="(item, index) in items" :key="index">
<div class="mt-4 grid gap-3 rounded-xl border border-slate-100 bg-slate-50 p-4 sm:grid-cols-2">
<div class="sm:col-span-2 flex items-center gap-4">
<label class="inline-flex items-center gap-2 text-sm"><input type="checkbox" :name="'items['+index+'][is_procedure]'" value="1" x-model="item.is_procedure" class="rounded border-slate-300"> Procedure</label>
</div>
<div class="sm:col-span-2">
<input type="text" :name="'items['+index+'][name]'" x-model="item.name" required placeholder="Medication or procedure name" class="w-full rounded-lg border-slate-300 text-sm">
</div>
<input type="text" :name="'items['+index+'][dosage]'" x-model="item.dosage" placeholder="Dosage" class="rounded-lg border-slate-300 text-sm">
<input type="text" :name="'items['+index+'][frequency]'" x-model="item.frequency" placeholder="Frequency" class="rounded-lg border-slate-300 text-sm">
<input type="text" :name="'items['+index+'][duration]'" x-model="item.duration" placeholder="Duration" class="rounded-lg border-slate-300 text-sm">
<select :name="'items['+index+'][route]'" x-model="item.route" class="rounded-lg border-slate-300 text-sm">
@foreach ($routes as $value => $label)
<option value="{{ $value }}">{{ $label }}</option>
@endforeach
</select>
<input type="text" :name="'items['+index+'][quantity]'" x-model="item.quantity" placeholder="Quantity" class="rounded-lg border-slate-300 text-sm">
<input type="text" :name="'items['+index+'][instructions]'" x-model="item.instructions" placeholder="Instructions" class="sm:col-span-2 rounded-lg border-slate-300 text-sm">
</div>
</template>
</section>
<section class="rounded-2xl border border-slate-200 bg-white p-6">
<label class="block text-sm font-medium text-slate-700">Notes</label>
<textarea name="notes" rows="2" class="mt-1 w-full rounded-lg border-slate-300 text-sm"></textarea>
<input type="hidden" name="activate" value="1">
<input type="hidden" name="from_consultation" value="{{ $consultation->uuid }}">
</section>
<div class="flex gap-3">
<button type="submit" class="btn-primary">Create prescription</button>
<a href="{{ route('care.consultations.show', $consultation) }}" class="rounded-lg border border-slate-200 px-4 py-2 text-sm text-slate-600">Cancel</a>
</div>
</form>
</x-app-layout>