Forráskód Böngészése

Patient dashboard - manage for all history sections

Vijayakrishnan 3 éve
szülő
commit
f435fa3209

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

@@ -317,6 +317,14 @@ class NoteController extends Controller
         return '<div class="mrv-content border-top px-3 pt-2 mt-3">' . @$segment->summary_html . '</div>';
     }
 
+    public function chartSegmentView(Request $request, Client $patient, $segmentInternalName, $view) {
+        return view("app.patient.segment-templates.{$segmentInternalName}.{$view}", [
+            'patient' => $patient,
+            'note' => $patient->coreNote,
+            'segmentInternalName' => $segmentInternalName
+        ]);
+    }
+
     public function medicationsCenter(Request $request, Client $patient, Note $note) {
         return view('app.patient.medications-center', compact('patient', 'note'));
     }

+ 54 - 1
resources/views/app/patient/dashboard.blade.php

@@ -25,7 +25,7 @@
         <?php $infoLines = json_decode($patient->info_lines);?>
         <?php $infoLines = !$infoLines ? [] : $infoLines; ?>
         <?php $vitalLabels = ['Ht. (in.)','Wt. (lbs.)','Temp. (F)','Pulse','Resp.','Pulse Ox.','SBP','DBP','Smoking Status', 'BMI']; ?>
-        <?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
+        <?php $isOldClient = 0 && (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
 
 	    <div class="row client-single-dashboard">
             <div class="col-6">
@@ -420,6 +420,15 @@
                         @if($isOldClient)
                         <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
                         @endif
+                        <a native="" target="_blank"
+                           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none pmhx-trigger"
+                           open-in-stag-popup="" update-parent=""
+                           mc-initer="past_medical_history_{{$patient->id}}"
+                           title="Past Medical History" popup-style="wide overflow-visible"
+                           href="/chart-segment-view/{{$patient->uid}}/past_medical_history/edit">
+                            <i class="fa fa-bolt mr-1"></i>
+                            <span>Manage</span>
+                        </a>
                     </div>
                     <div class="bg-light border p-2 mb-3">
                         @include('app.patient.segment-templates.past_medical_history.summary', compact('patient'))
@@ -446,6 +455,15 @@
                         @if($isOldClient)
                         <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
                         @endif
+                        <a native="" target="_blank"
+                           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none shx-trigger"
+                           open-in-stag-popup="" update-parent=""
+                           mc-initer="history_surgical_{{$patient->id}}"
+                           title="Surgical History" popup-style="wide overflow-visible"
+                           href="/chart-segment-view/{{$patient->uid}}/history_surgical/edit">
+                            <i class="fa fa-bolt mr-1"></i>
+                            <span>Manage</span>
+                        </a>
                     </div>
                     <div class="bg-light border p-2 mb-3">
                         @include('app.patient.segment-templates.history_surgical.summary', compact('patient'))
@@ -472,6 +490,15 @@
                         @if($isOldClient)
                         <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
                         @endif
+                        <a native="" target="_blank"
+                           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none fhx-trigger"
+                           open-in-stag-popup="" update-parent=""
+                           mc-initer="history_family_{{$patient->id}}"
+                           title="Family History" popup-style="wide overflow-visible"
+                           href="/chart-segment-view/{{$patient->uid}}/history_family/edit">
+                            <i class="fa fa-bolt mr-1"></i>
+                            <span>Manage</span>
+                        </a>
                     </div>
                     <div class="bg-light border p-2 mb-3">
                         @include('app.patient.segment-templates.history_family.summary', compact('patient'))
@@ -498,6 +525,15 @@
                         @if($isOldClient)
                         <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
                         @endif
+                        <a native="" target="_blank"
+                           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none sochx-trigger"
+                           open-in-stag-popup="" update-parent=""
+                           mc-initer="history_social_{{$patient->id}}"
+                           title="Social History" popup-style="wide overflow-visible"
+                           href="/chart-segment-view/{{$patient->uid}}/history_social/edit">
+                            <i class="fa fa-bolt mr-1"></i>
+                            <span>Manage</span>
+                        </a>
                     </div>
                     <div class="bg-light border p-2 mb-3">
                         @include('app.patient.segment-templates.history_social.summary', compact('patient'))
@@ -859,6 +895,23 @@
 
             }
             addMCInitializer('patient-dashboard-devices', init, '#patient-dashboard-devices');
+
+            window.segmentInitializers = {};
+            addMCInitializer('past_medical_history_{{$patient->id}}', function() {
+                window.segmentInitializers['past_medical_history'].call(window);
+            }, '.pmhx-trigger');
+            addMCInitializer('history_family_{{$patient->id}}', function() {
+                window.segmentInitializers['history_family'].call(window);
+            }, '.fhx-trigger');
+            addMCInitializer('history_social_{{$patient->id}}', function() {
+                window.segmentInitializers['history_social'].call(window);
+            }, '.sochx-trigger');
+            addMCInitializer('history_surgical_{{$patient->id}}', function() {
+                window.segmentInitializers['history_surgical'].call(window);
+            }, '.shx-trigger');
+            addMCInitializer('history_screenings_{{$patient->id}}', function() {
+                window.segmentInitializers['history_screenings'].call(window);
+            }, '.screenhx-trigger');
         }).call(window);
     </script>
 @endsection

+ 10 - 4
resources/views/app/patient/segment-templates/history_family/edit.blade.php

@@ -6,6 +6,8 @@ use App\Models\Note;
 /** @var Client $patient */
 /** @var Note $note */
 
+if(!@$segment) $segment = null;
+
 // try loading afresh - since base section might have gotten dynamically updated
 $point = Point::getGlobalSingletonOfCategory($patient, 'FAMILY_HISTORY', true);
 
@@ -47,9 +49,13 @@ if(!$contentData) {
 ?>
 
 <div class="p-3 border-top mt-3 mcp-theme-1">
-    <div visit-moe close-on-save close-on-cancel class="d-block">
+    <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="FAMILY_HISTORY">
             <input type="hidden" name="data">
 
@@ -273,7 +279,7 @@ if(!$contentData) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                <button cancel class="btn btn-sm btn-default border">Close</button>
             </div>
 
         </form>
@@ -282,7 +288,7 @@ if(!$contentData) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             new Vue({
                 el: '#edit-univ_history_family-container',

+ 10 - 3
resources/views/app/patient/segment-templates/history_social/edit.blade.php

@@ -7,6 +7,8 @@ use App\Models\Note;
 /** @var Note $note */
 /** @var Segment $segment */
 
+if(!@$segment) $segment = null;
+
 $fields = [
     [
         "Tobacco" => ["Current every day smoker", "Current some day smoker", "Former smoker", "Heavy tobacco smoker", "Light tobacco smoker", "Never smoker", "Smoker, current status unknown", "Unknown if ever smoked "],
@@ -56,9 +58,13 @@ for ($i = 0; $i < count($fields); $i++) {
 ?>
 
 <div class="p-3 border-top mt-3 mcp-theme-1">
-    <div visit-moe close-on-save close-on-cancel class="d-block">
+    <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="SOCIAL_HISTORY">
             <input type="hidden" name="data">
 
@@ -176,10 +182,11 @@ for ($i = 0; $i < count($fields); $i++) {
         </form>
     </div>
 </div>
+<?php dd($segment); ?>
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';

+ 6 - 2
resources/views/app/patient/segment-templates/history_surgical/edit.blade.php

@@ -55,7 +55,11 @@ for ($i = 0; $i < count($fields); $i++) {
 <div class="p-3 border-top mt-3 mcp-theme-1">
     <div visit-moe close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="SURGICAL_HISTORY">
             <input type="hidden" name="data">
 
@@ -179,7 +183,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';

+ 10 - 4
resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php

@@ -7,6 +7,8 @@ use App\Models\Note;
 /** @var Note $note */
 /** @var Segment $segment */
 
+if(!@$segment) $segment = null;
+
 $fields = [
     [
         "Head" => ["Trauma"],
@@ -66,9 +68,13 @@ for ($i = 0; $i < count($fields); $i++) {
 ?>
 
 <div class="p-3 border-top mt-3 mcp-theme-1">
-    <div visit-moe close-on-save close-on-cancel class="d-block">
+    <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="PAST_MEDICAL_HISTORY">
             <input type="hidden" name="data">
 
@@ -210,7 +216,7 @@ for ($i = 0; $i < count($fields); $i++) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                <button cancel class="btn btn-sm btn-default border">Close</button>
             </div>
 
         </form>
@@ -219,7 +225,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';

+ 1 - 0
routes/web.php

@@ -383,6 +383,7 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('/point/plan-log/{point}', 'NoteController@planLog')->name('point-plan-log');
     Route::get('/note/pdf/{note}', 'NoteController@downloadAsPdf')->name('note-pdf');
     Route::get('/segment-summary/{segment}', 'NoteController@segmentSummary')->name('segment-summary');
+    Route::get('/chart-segment-view/{patient}/{segmentInternalName}/{view}', 'NoteController@chartSegmentView')->name('chart-segment-view');
     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');