From 4838c45289f2545233a72564b931e9b6fd95048e Mon Sep 17 00:00:00 2001 From: Masroor Ehsan Date: Mon, 6 Jan 2025 19:15:25 +0600 Subject: [PATCH] UI --- app/DataTables/WorklistDataTable.php | 6 +- .../Controllers/Staff/StudiesController.php | 12 +++- resources/views/staff/history/edit.blade.php | 2 + .../staff/history/partials/_history.blade.php | 33 +++++++++ resources/views/staff/history/view.blade.php | 33 ++------- .../staff/studies/show-details.blade.php | 4 +- .../views/staff/worklist/index.blade.php | 34 ++++++++-- .../partials/_study-info-header.blade.php | 67 +++++++++++++++++++ routes/web.php | 1 + 9 files changed, 154 insertions(+), 38 deletions(-) create mode 100644 resources/views/staff/history/partials/_history.blade.php create mode 100644 resources/views/staff/worklist/partials/_study-info-header.blade.php diff --git a/app/DataTables/WorklistDataTable.php b/app/DataTables/WorklistDataTable.php index 6e049b3..2f09c24 100644 --- a/app/DataTables/WorklistDataTable.php +++ b/app/DataTables/WorklistDataTable.php @@ -57,9 +57,9 @@ public function dataTable(QueryBuilder $query): EloquentDataTable }) ->editColumn('history', function (Study $study) { return sprintf(' - - - + + + ', blank($study->body_part_examined) ? 'text-muted' : 'text-primary'); }) ->orderColumn('patient_name', 'patient_name $1') diff --git a/app/Http/Controllers/Staff/StudiesController.php b/app/Http/Controllers/Staff/StudiesController.php index 3e80528..28c30b5 100644 --- a/app/Http/Controllers/Staff/StudiesController.php +++ b/app/Http/Controllers/Staff/StudiesController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Staff; use App\Http\Controllers\HashidControllerBase; +use App\Models\Enums\Permission; use App\Models\Study; use App\Services\AuditTrail\Activity; @@ -51,6 +52,15 @@ public function show() $data['Station'] = $properties->get('station_name'); $data['Operator'] = $properties->get('operators_name'); - return view('staff.studies.show-details', compact('data')); + return view('staff.studies.show-details', compact('data', 'study')); + } + + public function attachments() + { + $this->decodeKeys(); + $study = Study::findOrFail($this->key); + $allow_delete = auth()->user()->may(Permission::AttachmentUpload); + + return view('staff.history.partials._uploaded-studies-list', compact('study', 'allow_delete')); } } diff --git a/resources/views/staff/history/edit.blade.php b/resources/views/staff/history/edit.blade.php index 3973b4d..268aba4 100644 --- a/resources/views/staff/history/edit.blade.php +++ b/resources/views/staff/history/edit.blade.php @@ -94,6 +94,8 @@ @section('content') + @include('staff.worklist.partials._study-info-header', ['study' => $study]) +
diff --git a/resources/views/staff/history/partials/_history.blade.php b/resources/views/staff/history/partials/_history.blade.php new file mode 100644 index 0000000..1f3fc96 --- /dev/null +++ b/resources/views/staff/history/partials/_history.blade.php @@ -0,0 +1,33 @@ +
+
+
Clinical History
+ {!! $details->clinical_history !!} +
+
+ +@if(!blank($details->surgical_history)) +
+
+
Surgical History
+ {!! $details->surgical_history !!} +
+
+@endif + +@if(!blank($details->lab_results)) +
+
+
Lab Results
+ {!! $details->lab_results !!} +
+
+@endif + +@if(!blank($details->clinical_diagnosis)) +
+
+
Clinical Diagnosis
+ {!! $details->clinical_diagnosis !!} +
+
+@endif diff --git a/resources/views/staff/history/view.blade.php b/resources/views/staff/history/view.blade.php index fa24e80..07afa9c 100644 --- a/resources/views/staff/history/view.blade.php +++ b/resources/views/staff/history/view.blade.php @@ -25,36 +25,13 @@ @endsection @section('content') -

- {{ __('History') }} -

-
-
-
-
Clinical History
- {!! $details->clinical_history !!} -
-
-
-
-
Surgical History
- {!! $details->surgical_history !!} -
-
-
-
-
Lab Results
- {!! $details->lab_results !!} -
-
-
-
-
Clinical Diagnosis
- {!! $details->clinical_diagnosis !!} -
-
+

+ {{ __('History') }} +

+ + @include('staff.history.partials._history', ['details' => $details])
diff --git a/resources/views/staff/studies/show-details.blade.php b/resources/views/staff/studies/show-details.blade.php index b21f2ab..76cc144 100644 --- a/resources/views/staff/studies/show-details.blade.php +++ b/resources/views/staff/studies/show-details.blade.php @@ -3,7 +3,7 @@ @endphp
- +
@foreach ($chunks as $chunk) @@ -15,4 +15,6 @@ @endforeach
+ + @include('staff.history.partials._history', ['details' => $study->details])
diff --git a/resources/views/staff/worklist/index.blade.php b/resources/views/staff/worklist/index.blade.php index d8960fa..c595e36 100644 --- a/resources/views/staff/worklist/index.blade.php +++ b/resources/views/staff/worklist/index.blade.php @@ -43,11 +43,20 @@ $('body').on('click', '.showStudy', function () { var study_id = $(this).data('id'); $.get("{{ route('staff.studies.show') }}", {hashid: study_id}, function (data) { - $('#studyDetails').html(data); - $('#studyModal').modal('show'); + $('#study-details').html(data); + $('#study-modal').modal('show'); + }); + }); + + $('body').on('click', '.show-attach', function () { + var study_id = $(this).data('id'); + $.get("{{ route('staff.studies.attach') }}", {hashid: study_id}, function (data) { + $('#study-details').html(data); + $('#study-modal').modal('show'); }); }); }); + @endsection @@ -58,15 +67,30 @@ {{ $dataTable->table(['class' => 'table table-sm'], true) }}
-