瀏覽代碼

Bring back manual measurements

Vijayakrishnan Krishnan 4 年之前
父節點
當前提交
a8671fa2b7
共有 2 個文件被更改,包括 109 次插入3 次删除
  1. 5 0
      resources/views/app/patient/dashboard.blade.php
  2. 104 3
      resources/views/app/patient/measurements.blade.php

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

@@ -220,6 +220,11 @@
                 <div class="mt-2 pb-1">
                     <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
                         <h6 class="my-0 font-weight-bold text-secondary">Cellular Measurements</h6>
+                        <span class="mx-2 text-secondary">|</span>
+                        <a start show class="py-0 font-weight-normal"
+                           href="/patients/view/{{ $patient->uid }}/measurements">
+                            View All
+                        </a>
                     </div>
                     <table class="table table-sm border-0 my-0 mx-2">
                         <tbody>

+ 104 - 3
resources/views/app/patient/measurements.blade.php

@@ -1,16 +1,117 @@
 @extends ('layouts.patient')
 @section('inner-content')
+
+    <?php $vitalLabels = ['Ht. (in.)','Wt. (lbs.)','Temp. (F)','Pulse','Resp.','Pulse Ox.','SBP','DBP','Smoking Status', 'BMI']; ?>
+
+    <div class="mb-3">
+        <div class="mt-0 pb-1">
+            <div class="d-flex align-items-center mb-2">
+                <h6 class="my-0 font-weight-bold text-dark">Measurements</h6>
+                <span class="mx-2 text-secondary">|</span>
+                <div moe>
+                    <a start show class="py-0 font-weight-normal">Add</a>
+                    <form url="/api/measurement/create">
+                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                        <div class="mb-2">
+                            <input autofocus type="text" class="form-control form-control-sm" name="label" value="" placeholder="Type">
+                        </div>
+                        <div class="mb-2">
+                            <input type="text" class="form-control form-control-sm" name="value" value="" placeholder="Value">
+                        </div>
+                        <div class="mb-2">
+                            <input type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
+                        </div>
+                        <div class="d-flex align-items-center">
+                            <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <table class="table table-striped table-sm table-bordered mt-2 mb-0">
+                <thead>
+                <tr>
+                    <th class="px-2 text-secondary w-25">Created</th>
+                    <th class="px-2 text-secondary w-25">Category</th>
+                    <th class="px-2 text-secondary w-25">Value</th>
+                    {{--<th class="px-2 text-secondary">Status</th>
+                    <th class="px-2 text-secondary">Memo</th>--}}
+                    <th class="px-2 text-secondary"></th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($patient->measurements as $measurement)
+                    @if(!empty($measurement->label) && !in_array($measurement->label, $vitalLabels))
+                        <tr>
+                            <td class="px-2">{{ friendly_date_time($measurement->created_at) }}</td>
+                            <td class="px-2">{{ $measurement->label }}</td>
+                            <td class="px-2">{{ $measurement->value }}</td>
+                            {{--<td></td>
+                            <td></td>--}}
+                            <td class="px-2">
+                                <span moe relative class="mr-2">
+                                    <a class="on-hover-opaque" start show title="Delete">
+                                        <i class="font-size-11 fa fa-trash-alt text-danger"></i>
+                                    </a>
+                                    <form url="/api/measurement/remove">
+                                        <input type="hidden" name="uid" value="{{ $measurement->uid }}">
+                                        <p class="small min-width-200px">Are you sure you want to delete this entry?</p>
+                                        <div class="d-flex align-items-center">
+                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
+                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                                <span moe class="mr-2">
+                                    <a class="on-hover-opaque" start show title="Update">
+                                        <i class="font-size-11 fa fa-edit text-primary"></i>
+                                    </a>
+                                    <form url="/api/measurement/create">
+                                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                                        <div class="mb-2">
+                                            <input type="text" class="form-control form-control-sm" name="label" value="{{ $measurement->label }}" placeholder="Type">
+                                        </div>
+                                        <div class="mb-2">
+                                            <input autofocus type="text" class="form-control form-control-sm" name="value" value="{{ $measurement->value }}" placeholder="Value">
+                                        </div>
+                                        <div class="mb-2">
+                                            <input type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
+                                        </div>
+                                        <div class="d-flex align-items-center">
+                                            <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                            </td>
+                        </tr>
+                    @endif
+                @endforeach
+                @if(!$patient->measurements || !count($patient->measurements) === 0)
+                    <tr>
+                        <td class="text-secondary p-0 border-0">
+                            No items to show
+                        </td>
+                    </tr>
+                @endif
+                </tbody>
+            </table>
+        </div>
+    </div>
+
+    <hr class="m-negator mt-4 mb-3">
+
     <div class="">
         <div class="d-flex align-items-start pb-2">
-            <h4 class="font-weight-bold m-0">Measurements</h4>
+            <h4 class="font-weight-bold m-0">Cellular Measurements</h4>
         </div>
         <table class="table table-striped table-sm table-bordered mb-0">
             @if($patient->measurements && count($patient->measurements))
                 <thead>
                 <tr>
-                    <th class="px-2 text-secondary">Created</th>
+                    <th class="px-2 text-secondary w-25">Created</th>
                     <th class="px-2 text-secondary w-25">Category</th>
-                    <th class="px-2 text-secondary w-50">Value</th>
+                    <th class="px-2 text-secondary w-25">Value</th>
                     <th class="px-2 text-secondary">Status</th>
                 </tr>
                 </thead>