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

Note disclaimers segment content updates

Vijayakrishnan 3 жил өмнө
parent
commit
f9b822c701

+ 6 - 0
resources/views/app/patient/note/dashboard.blade.php

@@ -2608,6 +2608,12 @@
                         }
                         return false;
                     });
+
+                // update disclaimers on fastReload()
+                // NOTE: this is NOT the ideal place to put this
+                @if(!$note->is_signed_by_hcp)
+                $('.visit-segment[data-segment-template-name="disclaimers"]').find('.refresh-segment').trigger('click');
+                @endif
             }
             function fixTreeTopAndHeight() {
                 let tree = $('#note-lhs-tree'), rhsSidebar = $('#note-rhs-sidebar'), noteCardHeader = $('#note-card-header');

+ 67 - 2
resources/views/app/patient/segment-templates/disclaimers/edit.blade.php

@@ -66,14 +66,79 @@ if (!!@$point->data) {
             <span>Patient understands this assessment was completed using the information they provided only. All questions addressed.</span>
         </label>
 
-        @if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_cm)
+        @if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_cm === 'YES')
             <p class="mb-2">Patient elects to participate in Chronic Care Management.</p>
         @endif
 
-        @if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_rm)
+        @if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_rm === 'YES')
             <p class="mb-2">Patient elects to participate in Remote Patient Monitoring.</p>
         @endif
 
+        <?php
+        $supplyOrders = \App\Models\SupplyOrder::where('client_id', $note->client->id)
+            ->where('is_cancelled', false)
+            ->where('note_id', $note->id)
+            ->get();
+        ?>
+        @if($supplyOrders && count($supplyOrders))
+            <p class="mb-2">The following supplies were ordered during this visit:</p>
+            <ol class="mb-2">
+                @foreach($supplyOrders as $so)
+                    <li>{{$so->product->title}}</li>
+                @endforeach
+            </ol>
+        @endif
+
+        <?php
+        $erxs = \App\Models\Erx::where('client_id', $note->client->id)
+            ->where('note_id', $note->id)
+            ->orderBy('created_at', 'desc')
+            ->where(function ($q) {
+                $q->whereNull('pro_declared_status')
+                    ->orWhere('pro_declared_status', '<>', 'CANCELLED');
+            })
+            ->get();
+        ?>
+        @if($erxs && count($erxs))
+            <p class="mb-2">The following e-prescriptions were ordered during this visit:</p>
+            <ol class="mb-2">
+                @foreach($erxs as $erx)
+                    <?php $parsed = json_decode($erx->clinical_detail_json); ?>
+                    @if($erx->erx_category === 'LAB' || $erx->erx_category === 'IMAGING' || $erx->erx_category === 'DRUG')
+                        <li>
+                            @if($erx->erx_category === 'LAB' || $erx->erx_category === 'IMAGING')
+                                <div class="d-flex align-items-baseline">
+                                    <span>{{$erx->erx_category}}:</span>
+                                    <div class="pl-2 flex-grow-1">
+                                        @if($parsed && @($parsed->items) && count($parsed->items))
+                                            @foreach($parsed->items as $t)
+                                                @if(@($t->tests) && count($t->tests))
+                                                    @foreach($t->tests as $tx)
+                                                        <div>{{$tx->desc}}</div>
+                                                    @endforeach
+                                                @endif
+                                            @endforeach
+                                        @endif
+                                    </div>
+                                </div>
+                            @elseif($erx->erx_category === 'DRUG')
+                                <div class="d-flex align-items-baseline">
+                                    <span>{{$erx->erx_category}}:</span>
+                                    <div class="pl-2 flex-grow-1">
+                                        @if($parsed && @($parsed->items) && count($parsed->items))
+                                            @foreach($parsed->items as $t)
+                                                <div>{{$t->medication}}</div>
+                                            @endforeach
+                                        @endif
+                                    </div>
+                                </div>
+                            @endif
+                        </li>
+                    @endif
+                @endforeach
+            </ol>
+        @endif
+
         @if($note->method == 'AUDIO' || $note->method == 'VIDEO')
             <p class="mb-2">The visit was conducted with the use of an interactive <b>{{$note->method}}</b> telecommunications system that permits real time communication
                 between the patient and the provider. Patient consent for telehealth visit was obtained.</p>

+ 67 - 2
resources/views/app/patient/segment-templates/disclaimers/summary.blade.php

@@ -85,14 +85,79 @@ if (!!@$point->data) {
     <span class="flex-grow-1">Patient understands this assessment was completed using the information they provided only. All questions addressed.</span>
 </div>
 
-@if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_cm)
+@if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_cm === 'YES')
     <p class="mb-2">Patient elects to participate in Chronic Care Management.</p>
 @endif
 
-@if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_rm)
+@if($note->hcp_pro_id == $patient->mcp_pro_id && $patient->is_enrolled_in_rm === 'YES')
     <p class="mb-2">Patient elects to participate in Remote Patient Monitoring.</p>
 @endif
 
+<?php
+$supplyOrders = \App\Models\SupplyOrder::where('client_id', $note->client->id)
+    ->where('is_cancelled', false)
+    ->where('note_id', $note->id)
+    ->get();
+?>
+@if($supplyOrders && count($supplyOrders))
+    <p>The following supplies were ordered during this visit:</p>
+    <ol class="mb-2">
+        @foreach($supplyOrders as $so)
+            <li>{{$so->product->title}}</li>
+        @endforeach
+    </ol>
+@endif
+
+<?php
+$erxs = \App\Models\Erx::where('client_id', $note->client->id)
+    ->where('note_id', $note->id)
+    ->orderBy('created_at', 'desc')
+    ->where(function ($q) {
+        $q->whereNull('pro_declared_status')
+            ->orWhere('pro_declared_status', '<>', 'CANCELLED');
+    })
+    ->get();
+?>
+@if($erxs && count($erxs))
+    <p>The following e-prescriptions were ordered during this visit:</p>
+    <ol class="mb-2">
+        @foreach($erxs as $erx)
+            <?php $parsed = json_decode($erx->clinical_detail_json); ?>
+            @if($erx->erx_category === 'LAB' || $erx->erx_category === 'IMAGING' || $erx->erx_category === 'DRUG')
+                <li>
+                    @if($erx->erx_category === 'LAB' || $erx->erx_category === 'IMAGING')
+                        <div class="d-flex align-items-baseline">
+                            <span>{{$erx->erx_category}}:</span>
+                            <div class="pl-2 flex-grow-1">
+                                @if($parsed && @($parsed->items) && count($parsed->items))
+                                    @foreach($parsed->items as $t)
+                                        @if(@($t->tests) && count($t->tests))
+                                            @foreach($t->tests as $tx)
+                                                <div>{{$tx->desc}}</div>
+                                            @endforeach
+                                        @endif
+                                    @endforeach
+                                @endif
+                            </div>
+                        </div>
+                    @elseif($erx->erx_category === 'DRUG')
+                        <div class="d-flex align-items-baseline">
+                            <span>{{$erx->erx_category}}:</span>
+                            <div class="pl-2 flex-grow-1">
+                                @if($parsed && @($parsed->items) && count($parsed->items))
+                                    @foreach($parsed->items as $t)
+                                        <div>{{$t->medication}}</div>
+                                    @endforeach
+                                @endif
+                            </div>
+                        </div>
+                    @endif
+                </li>
+            @endif
+        @endforeach
+    </ol>
+@endif
+
 @if($note->method == 'AUDIO' || $note->method == 'VIDEO')
     <p class="mb-2">The visit was conducted with the use of an interactive <b>{{$note->method}}</b> telecommunications system that permits real time communication
         between the patient and the provider. Patient consent for telehealth visit was obtained.</p>