Эх сурвалжийг харах

Notes with pending suggestions UI updates

Vijayakrishnan 3 жил өмнө
parent
commit
3956fcc7fa

+ 10 - 0
app/Models/Note.php

@@ -187,4 +187,14 @@ class Note extends Model
         return !!$bills;
     }
 
+    public function segmentsWithPendingSummarySuggestion() {
+        return $this->hasMany(Segment::class, 'note_id', 'id')
+            ->where('id', '!=', $this->core_segment_id) // dont include core-segment
+            ->where('is_active', true)
+            ->whereHas('proposedSegmentSummarySuggestion', function($sugQuery) {
+                return $sugQuery->where('status', '=', 'PENDING');
+            })
+            ->orderBy('position_index', 'asc');
+    }
+
 }

+ 4 - 1
app/Models/SegmentSummarySuggestion.php

@@ -8,6 +8,9 @@ class SegmentSummarySuggestion extends Model
 {
     protected $table = 'segment_summary_suggestion';
 
-   
+    public function creator()
+    {
+        return $this->hasOne(Pro::class, 'id', 'created_by_pro_id');
+    }
 
 }

+ 34 - 0
resources/views/app/admin/notes_pending_summary_suggestion.blade.php

@@ -16,6 +16,7 @@
                     <th class="border-0">Patient</th>
                     <th class="border-0">ICD</th>
                     <th class="border-0">Status</th>
+                    <th class="border-0">Suggestions</th>
                 </tr>
                 </thead>
                 <tbody>
@@ -38,6 +39,39 @@
                         <td>
                             {{$row->overallStatus()}}
                         </td>
+                        <td class="p-0">
+                            @php $segments = $row->segmentsWithPendingSummarySuggestion; @endphp
+                            <table class="table table-sm m-0">
+                                @foreach($segments as $segment)
+                                    <tr>
+                                        <td class="width-100px">
+                                            <div class="d-flex align-items-baseline grow-till-300px">
+                                                <span>{{$segment->display_title}}</span>
+                                                <div class="on-hover-show left on-hover-opaque">
+                                                    <i class="fa fa-info-circle ml-1"></i>
+                                                    <div class="on-hover-content p-2 text-sm">
+                                                        <div class="d-flex align-items-start border p-1 mb-2">
+                                                            <span class="mr-1 width-70px">Original:</span>
+                                                            <div class="bg-light inline-html-container max-height-100px max-width-300px overflow-hidden">
+                                                                {!! $segment->summary_html !!}
+                                                            </div>
+                                                        </div>
+                                                        <div class="d-flex align-items-start border p-1">
+                                                            <span class="mr-1 width-70px">Suggested:</span>
+                                                            <div class="bg-light inline-html-container max-height-100px max-width-300px overflow-hidden">
+                                                                {!! $segment->proposedSegmentSummarySuggestion->summary_html !!}
+                                                            </div>
+                                                        </div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </td>
+                                        <td>{{$segment->proposedSegmentSummarySuggestion->creator->displayName()}}</td>
+                                        <td>{{friendlier_date($segment->proposedSegmentSummarySuggestion->created_at)}}</td>
+                                    </tr>
+                                @endforeach
+                            </table>
+                        </td>
                     </tr>
                 @endforeach
                 </tbody>

+ 1 - 1
resources/views/app/dashboard-admin.blade.php

@@ -42,7 +42,7 @@
                                         <a href="{{ route('admin.notes_pending_summary_suggestion') }}"
                                            native target="_blank"
                                            open-in-stag-popup
-                                           popup-style="tall"
+                                           popup-style="tall stag-popup-md"
                                            title="Notes With Pending Summary Suggestion">
                                             Notes With Pending Summary Suggestion
                                         </a>

+ 1 - 1
resources/views/app/dashboard-mcp.blade.php

@@ -70,7 +70,7 @@
                                         <a href="{{ route('mcp.notes_pending_summary_suggestion') }}"
                                            native target="_blank"
                                            open-in-stag-popup
-                                           popup-style="tall"
+                                           popup-style="tall stag-popup-md"
                                            title="Notes With Pending Summary Suggestion">
                                             Notes With Pending Summary Suggestion
                                         </a>