瀏覽代碼

Update add-bp/weight moes to new input params

Vijayakrishnan 4 年之前
父節點
當前提交
039ce47c4c

+ 35 - 20
resources/views/app/patient/measurements.blade.php

@@ -7,14 +7,36 @@
                 <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">
+                    <a start show class="py-0 font-weight-normal">Add BP</a>
+                    <form url="/api/measurement/createForBP">
                         <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                        <p class="font-weight-bold text-secondary mb-2">Add BP Measurement</p>
+                        <div class="mb-2">
+                            <label class="text-secondary text-sm mb-1">Systolic BP (mmHg)</label>
+                            <input required autofocus type="number" class="form-control form-control-sm" name="sbpMmHg" value="" placeholder="Systolic BP">
+                        </div>
+                        <div class="mb-2">
+                            <label class="text-secondary text-sm mb-1">Diastolic BP (mmHg)</label>
+                            <input required autofocus type="number" class="form-control form-control-sm" name="dbpMmHg" value="" placeholder="Diastolic BP">
+                        </div>
                         <div class="mb-2">
-                            <input required autofocus type="text" class="form-control form-control-sm" name="label" value="" placeholder="Type">
+                            <input required 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>
+                <span class="mx-2 text-secondary">|</span>
+                <div moe>
+                    <a start show class="py-0 font-weight-normal">Add Weight</a>
+                    <form url="/api/measurement/create">
+                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                        <input type="hidden" name="label" value="Wt. (lbs.)">
+                        <p class="font-weight-bold text-secondary mb-2">Add Weight Measurement</p>
                         <div class="mb-2">
-                            <input required type="text" class="form-control form-control-sm" name="value" value="" placeholder="Value">
+                            <input required type="number" class="form-control form-control-sm" name="value" value="" placeholder="Weight">
                         </div>
                         <div class="mb-2">
                             <input required type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
@@ -49,8 +71,8 @@
                     <th class="px-2 text-secondary w-25">Effective Date</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">Source</th>
+                    {{--<th class="px-2 text-secondary">Memo</th>--}}
                     <th class="px-2 text-secondary"></th>
                 </tr>
                 </thead>
@@ -70,24 +92,17 @@
                             </td>
                             <td class="px-2">{{ $measurement->label }}</td>
                             <td class="px-2">
-                                @if(empty($measurement->client_bdt_measurement_id))
-                                    {{ $measurement->value }}
-                                @elseif($measurement->is_cellular_zero)
+                                @if($measurement->is_cellular_zero)
                                     <i class="font-size-11 fa fa-rss"></i>
+                                @elseif($measurement->label === 'BP')
+                                    {{ $measurement->sbp_mm_hg }}/{{ $measurement->dbp_mm_hg }} mmHg
+                                @elseif($measurement->label === 'Wt. (lbs.)')
+                                    {{ $measurement->numeric_value }} lbs
                                 @else
-                                    @if($measurement->label === 'BP')
-                                        {{ $measurement->clientBDTMeasurement->measurement->systolic_bp_in_mm_hg }}/{{ $measurement->clientBDTMeasurement->measurement->diastolic_bp_in_mm_hg }} mmHg
-                                    @elseif($measurement->label === 'SBP')
-                                        {{ $measurement->clientBDTMeasurement->measurement->systolic_bp_in_mm_hg }} mmHg
-                                    @elseif($measurement->label === 'DBP')
-                                        {{ $measurement->clientBDTMeasurement->measurement->diastolic_bp_in_mm_hg }} mmHg
-                                    @elseif($measurement->label === 'Wt. (lbs.)')
-                                        {{ round($measurement->clientBDTMeasurement->measurement->weight_in_pounds, 1) }} lbs
-                                    @endif
+                                    {{ $measurement->value }}
                                 @endif
                             </td>
-                            {{--<td></td>
-                            <td></td>--}}
+                            <td class="px-2">{{$measurement->source}}</td>
                             <td class="px-2">
                                 <span moe relative class="mr-2">
                                     <a class="on-hover-opaque" start show title="Delete">

+ 28 - 4
resources/views/app/patient/partials/measurements.blade.php

@@ -1,16 +1,39 @@
 <div class="mt-2 mb-3">
     <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
         <h6 class="my-0 font-weight-bold text-secondary">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">
+            <a start show class="py-0 font-weight-normal">Add BP</a>
+            <form url="/api/measurement/createForBP">
                 <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <p class="font-weight-bold text-secondary mb-2">Add BP Measurement</p>
+                <div class="mb-2">
+                    <label class="text-secondary text-sm mb-1">Systolic BP (mmHg)</label>
+                    <input required autofocus type="number" class="form-control form-control-sm" name="sbpMmHg" value="" placeholder="Systolic BP">
+                </div>
+                <div class="mb-2">
+                    <label class="text-secondary text-sm mb-1">Diastolic BP (mmHg)</label>
+                    <input required autofocus type="number" class="form-control form-control-sm" name="dbpMmHg" value="" placeholder="Diastolic BP">
+                </div>
                 <div class="mb-2">
-                    <input required autofocus type="text" class="form-control form-control-sm" name="label" value="" placeholder="Type">
+                    <input required 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>
+        <span class="mx-2 text-secondary">|</span>
+        <div moe>
+            <a start show class="py-0 font-weight-normal">Add Weight</a>
+            <form url="/api/measurement/create">
+                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <input type="hidden" name="label" value="Wt. (lbs.)">
+                <p class="font-weight-bold text-secondary mb-2">Add Weight Measurement</p>
                 <div class="mb-2">
-                    <input required type="text" class="form-control form-control-sm" name="value" value="" placeholder="Value">
+                    <input required type="number" class="form-control form-control-sm" name="value" value="" placeholder="Weight">
                 </div>
                 <div class="mb-2">
                     <input required type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
@@ -21,6 +44,7 @@
                 </div>
             </form>
         </div>
+
         <span class="mx-2 text-secondary">|</span>
         <a start show class="py-0 font-weight-normal"
            href="/patients/view/{{ $patient->uid }}/measurements">