Răsfoiți Sursa

Disallow ordering bp/weight device - without first completing bp/weight settings

Vijayakrishnan 3 ani în urmă
părinte
comite
f76386f3c9

+ 20 - 1
resources/views/app/patient/supply-orders.blade.php

@@ -13,6 +13,18 @@
                             <p class="font-weight-bold alert alert-warning border-warning mb-2">You need to complete the patient's comprehensive care plan before ordering cellular devices.</p>
                         @endif
 
+                        @if(!$patient->is_bp_and_pulse_updated)
+                            <p class="font-weight-bold alert alert-warning border-warning mb-2">
+                                You need to complete the patient's BP settings before ordering cellular BP device.
+                            </p>
+                        @endif
+
+                        @if(!$patient->is_weight_and_bmi_settings_updated)
+                            <p class="font-weight-bold alert alert-warning border-warning mb-2">
+                                You need to complete the patient's Weight/BMI settings before ordering cellular weight scale.
+                            </p>
+                        @endif
+
                         <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
                         <input type="hidden" name="noteUid" value="{{ request()->input('note-uid') }}">
                         <label class="text-secondary font-weight-bold">Add Supply Order</label>
@@ -21,8 +33,15 @@
                             <select name="productUid" class="form-control form-control-sm">
                                 <option value=""> --select--</option>
                                 @foreach($products as $product)
-                                    @if($patient->has_cm_setup_been_performed || !$product->has_imei_number)
+                                    @if(!$product->has_imei_number)
                                         <option value="{{$product->uid}}">{{$product->title}}</option>
+                                    @elseif($patient->has_cm_setup_been_performed)
+                                        @if($product->bdt_device_category === 'BP' && $patient->is_bp_and_pulse_updated)
+                                            <option value="{{$product->uid}}">{{$product->title}}</option>
+                                        @endif
+                                        @if($product->bdt_device_category === 'WEIGHT' && $patient->is_weight_and_bmi_settings_updated)
+                                            <option value="{{$product->uid}}">{{$product->title}}</option>
+                                        @endif
                                     @endif
                                 @endforeach
                             </select>

+ 9 - 2
resources/views/app/patient/vitals-settings/bmi-management-form.blade.php

@@ -1,5 +1,5 @@
-<div moe wide id="bmi-management-settings">
-    <a href="#" start show>Update</a>
+<div moe wide center id="bmi-management-settings">
+    <a href="#" start show>{{@$label ?: 'Update'}}</a>
     <form url="/api/client/updateBmiManagementSettingsValue">
         <input type="hidden" name="uid" value="{{$patient->uid}}">
         <p class="text-secondary font-weight-bold font-size-14">BMI/Weight Management</p>
@@ -150,6 +150,13 @@
         <div class="text-secondary min-width-140px mb-1">Remarks on clinical need:</div>
         <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeeded" value="{{$patient->why_is_weight_monitoring_needed}}">
 
+        <div class="border mt-2 px-2 py-1 bg-aliceblue border border-info">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" name="isWeightAndBmiSettingsUpdated" {{$patient->is_weight_and_bmi_settings_updated ? 'checked' : ''}}>
+                <span class="ml-2">I confirm that the above settings are correct.</span>
+            </label>
+        </div>
+
         <div class="pt-2">
             <button class="btn btn-primary btn-sm" submit>Submit</button>
             <button class="btn btn-default border btn-sm" cancel>Cancel</button>

+ 8 - 1
resources/views/app/patient/vitals-settings/bp-management-form.blade.php

@@ -1,5 +1,5 @@
 <div moe wide center id="bp-management-settings">
-    <a href="#" start show>Update</a>
+    <a href="#" start show>{{@$label ?: 'Update'}}</a>
     <form url="/api/client/updateBpManagementSettingsValue">
         <input type="hidden" name="uid" value="{{$patient->uid}}">
         <p class="text-secondary font-weight-bold font-size-14">BP Management</p>
@@ -193,6 +193,13 @@
             </div>
         </div>
 
+        <div class="border mt-2 px-2 py-1 bg-aliceblue border border-info">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" name="isBpAndPulseUpdated" {{$patient->is_bp_and_pulse_updated ? 'checked' : ''}}>
+                <span class="ml-2">I confirm that the above settings are correct.</span>
+            </label>
+        </div>
+
         <div class="pt-2">
             <button class="btn btn-primary btn-sm" submit>Submit</button>
             <button class="btn btn-default border btn-sm" cancel>Cancel</button>