Jelajahi Sumber

Reconcile Active Medications (housing)

Vijayakrishnan 3 tahun lalu
induk
melakukan
6de3e51f24

+ 4 - 0
app/Http/Controllers/NoteController.php

@@ -312,6 +312,10 @@ class NoteController extends Controller
         return view('app.patient.medications-center', compact('patient', 'note'));
     }
 
+    public function medicationsReconcile(Request $request, Client $patient, Note $note) {
+        return view('app.patient.medications-reconcile', compact('patient', 'note'));
+    }
+
     public function problemsCenter(Request $request, Client $patient, Note $note) {
         return view('app.patient.problems-center', compact('patient', 'note'));
     }

+ 15 - 1
resources/views/app/patient/medications-center.blade.php

@@ -50,7 +50,7 @@ $medications = $points;
                         @if($medication->is_removed)
                             <i class="text-warning-mellow fa fa-circle text-sm on-hover-opaque mr-2"></i>
                         @else
-                            <i class="text-success fa fa-circle text-sm on-hover-opaque mr-2"></i>
+                            <i class="text-success fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
                         @endif
                         <div>
                             <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
@@ -555,6 +555,20 @@ $medications = $points;
             initStagSuggest();
 
             $('.additionReasonCategory_ui').trigger('change');
+
+            // add button for "reconcile active medications"
+            if($('.active-record').length) {
+                let titleElem = $('#medications-center-{{$note->id}}').closest('.stag-popup').find('.stag-popup-title>span');
+                titleElem.next().removeClass('ml-auto');
+                $('.btn-reconcile-active').remove();
+                $('<a ' +
+                    'href="/medications-reconcile/{{$patient->uid}}/{{$note->uid}}" ' +
+                    'title="Reconcile Active Medications" ' +
+                    'open-in-stag-popup ' +
+                    'popup-style="stag-popup-md" ' +
+                    'class="btn-reconcile-active ml-auto mr-3 btn btn-sm btn-info text-white font-weight-bold">Reconcile Active Medications</a>').insertAfter(titleElem);
+                titleElem.parent().addClass('align-items-baseline');
+            }
         }
         addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}')
     }).call(window);

+ 12 - 0
resources/views/app/patient/medications-reconcile.blade.php

@@ -0,0 +1,12 @@
+<div class="mt-3 p-3 border-top min-height-500px" id="medications-reconcile-{{$note->id}}">
+    TODO
+</div>
+
+<script>
+    (function() {
+        function init() {
+            // TODO
+        }
+        addMCInitializer('medications-reconcile-{{$note->id}}', init, '#medications-reconcile-{{$note->id}}')
+    }).call(window);
+</script>

+ 1 - 0
routes/web.php

@@ -317,6 +317,7 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('/note/pdf/{note}', 'NoteController@downloadAsPdf')->name('note-pdf');
     Route::get('/segment-summary/{segment}', 'NoteController@segmentSummary')->name('segment-summary');
     Route::get('/medications-center/{patient}/{note}', 'NoteController@medicationsCenter')->name('medications-center');
+    Route::get('/medications-reconcile/{patient}/{note}', 'NoteController@medicationsReconcile')->name('medications-reconcile');
     Route::get('/problems-center/{patient}/{note}', 'NoteController@problemsCenter')->name('problems-center');
     Route::get('/goals-center/{patient}/{note}', 'NoteController@goalsCenter')->name('goals-center');