Browse Source

RHS sidebar - move measurements to top

Vijayakrishnan 3 năm trước cách đây
mục cha
commit
8bc66f3347
1 tập tin đã thay đổi với 47 bổ sung43 xóa
  1. 47 43
      resources/views/app/patient/note/rhs-sidebar.blade.php

+ 47 - 43
resources/views/app/patient/note/rhs-sidebar.blade.php

@@ -1,4 +1,51 @@
 <div class="note-rhs-sidebar" id="note-rhs-sidebar">
+
+    <?php
+    $cmStartDate = date('Y-m-01', strtotime($note->effective_dateest));
+    $careMonth = \App\Models\CareMonth::where('client_id', $patient->id)->where('start_date', $cmStartDate)->first();
+    ?>
+    <div id="recent-measurements"
+         class="p-2 border-bottom c-pointer on-hover-aliceblue {{$note->is_signed_by_hcp ? 'events-none' : ''}}"
+         open-in-stag-popup
+         mc-initer="care-month-dashboard-{{$patient->uid}}"
+         title="Care Month: {{friendly_month($careMonth->start_date)}}"
+         popup-style="overflow-visible"
+         href="/patients/view/{{ $note->client->uid }}/care-months/view/{{$careMonth->uid}}">
+        <div class="font-weight-bold">
+            Recent Measurements
+        </div>
+        <?php
+        $date = date('Y-m-d');
+        $end = strtotime($date);
+        $start = date_sub(date_create($date), date_interval_create_from_date_string("12 days"))->getTimestamp();
+        $start *= 1000;
+        $end *= 1000;
+        $recentMeasurements = \App\Models\Measurement
+            ::where('client_id', $patient->id)
+            ->whereRaw("(is_removed IS NULL OR is_removed = FALSE)")
+            ->whereNotNull('ts')
+            ->whereRaw("(is_cellular_zero IS NULL OR is_cellular_zero = FALSE)")
+            ->whereRaw("(label = 'BP' OR label = 'Wt. (lbs.)')")
+            ->where('ts', '>=', $start)
+            ->where('ts', '<=', $end)
+            ->orderBy('ts', 'desc')
+            ->skip(0)
+            ->take(10)
+            ->get();
+        ?>
+        @if($recentMeasurements && count($recentMeasurements))
+            <div class="pt-2">
+                @foreach($recentMeasurements as $m)
+                    @if($m->label === 'BP')
+                        <div class="text-sm text-nowrap">BP: {{round($m->sbp_mm_hg)}}/{{round($m->dbp_mm_hg)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
+                    @elseif($m->label === 'Wt. (lbs.)')
+                        <div class="text-sm text-nowrap">Wt: {{round($m->value, 1)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
+                    @endif
+                @endforeach
+            </div>
+        @endif
+    </div>
+
     <?php
     $allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
     $medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
@@ -163,48 +210,5 @@
             @endforeach
         @endif
     </div>
-    <?php
-    $cmStartDate = date('Y-m-01', strtotime($note->effective_dateest));
-    $careMonth = \App\Models\CareMonth::where('client_id', $patient->id)->where('start_date', $cmStartDate)->first();
-    ?>
-    <div id="recent-measurements"
-         class="p-2 border-bottom c-pointer on-hover-aliceblue {{$note->is_signed_by_hcp ? 'events-none' : ''}}"
-         open-in-stag-popup
-         mc-initer="care-month-dashboard-{{$patient->uid}}"
-         title="Care Month: {{friendly_month($careMonth->start_date)}}"
-         popup-style="overflow-visible"
-         href="/patients/view/{{ $note->client->uid }}/care-months/view/{{$careMonth->uid}}">
-        <div class="font-weight-bold">
-            Recent Measurements
-        </div>
-        <?php
-        $date = date('Y-m-d');
-        $end = strtotime($date);
-        $start = date_sub(date_create($date), date_interval_create_from_date_string("12 days"))->getTimestamp();
-        $start *= 1000;
-        $end *= 1000;
-        $recentMeasurements = \App\Models\Measurement
-            ::where('client_id', $patient->id)
-            ->whereRaw("(is_removed IS NULL OR is_removed = FALSE)")
-            ->whereNotNull('ts')
-            ->whereRaw("(is_cellular_zero IS NULL OR is_cellular_zero = FALSE)")
-            ->whereRaw("(label = 'BP' OR label = 'Wt. (lbs.)')")
-            ->where('ts', '>=', $start)
-            ->where('ts', '<=', $end)
-            ->orderBy('ts', 'desc')
-            ->get();
-        ?>
-        @if($recentMeasurements && count($recentMeasurements))
-            <div class="pt-2">
-                @foreach($recentMeasurements as $m)
-                    @if($m->label === 'BP')
-                        <div class="text-sm text-nowrap">BP: {{round($m->sbp_mm_hg)}}/{{round($m->dbp_mm_hg)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
-                    @elseif($m->label === 'Wt. (lbs.)')
-                        <div class="text-sm text-nowrap">Wt: {{round($m->value, 1)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
-                    @endif
-                @endforeach
-            </div>
-        @endif
-    </div>
 
 </div>