瀏覽代碼

Point - cope plan/review logic impl

Vijayakrishnan 3 年之前
父節點
當前提交
6a0623656b

+ 2 - 1
resources/views/app/patient/wizard-partials/common-fields.blade.php

@@ -223,7 +223,8 @@
                     }
                 }
                 ?>
-                <label class="text-sm mb-0 font-weight-bold">Changes to {{@$planLabel ? $planLabel : 'Plan'}} during this visit (as part of my plan)</label>
+                <label if-active-and-pre-existing-or-not-active class="d-none text-sm mb-0 font-weight-bold">Changes to {{@$planLabel ? $planLabel : 'Plan'}} during this visit (as part of my plan)</label>
+                <label if-active-and-not-pre-existing class="d-none text-sm mb-0 font-weight-bold">{{@$planLabel ? $planLabel : 'Plan'}}</label>
                 <div note-rte
                      class="form-group mb-2 rte-holder bg-white border rounded"
                      data-field-name="planValue"><?= $currentValue ?></div>

+ 8 - 2
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -79,7 +79,7 @@ parentSegment.find('[name="isRemoved"]')
     .off('change')
     .on('change', function () {
         let form = $(this).closest('form');
-        form.find('[if-active-or-not-active], [if-active], [if-not-active], [if-active-and-pre-existing-or-not-active]').addClass('d-none');
+        form.find('[if-active-or-not-active], [if-active], [if-not-active], [if-active-and-pre-existing-or-not-active], [if-active-and-not-pre-existing]').addClass('d-none');
         if(form.find('[name="isRemoved"]:checked').length) form.find('[if-active-or-not-active]').removeClass('d-none');
         if(form.find('[name="isRemoved"]:checked').val() === '1') form.find('[if-not-active]').removeClass('d-none');
         else if(form.find('[name="isRemoved"]:checked').val() === '0') {
@@ -90,6 +90,9 @@ parentSegment.find('[name="isRemoved"]')
         if(form.find('[name="isRemoved"]:checked').val() === '1' || form.find('[name="additionReasonCategory"]:checked').val() === 'ON_INTAKE') {
             form.find('[if-active-and-pre-existing-or-not-active]').removeClass('d-none');
         }
+        if(form.find('[name="isRemoved"]:checked').val() === '0' && form.find('[name="additionReasonCategory"]:checked').val() !== 'ON_INTAKE') {
+            form.find('[if-active-and-not-pre-existing]').removeClass('d-none');
+        }
         return false;
     })
     .trigger('change');
@@ -98,7 +101,7 @@ parentSegment.find('[name="additionReasonCategory"]')
     .off('change')
     .on('change', function () {
         let form = $(this).closest('form');
-        form.find('[if-addition-on-intake-or-during-visit], [if-addition-on-intake], [if-addition-during-visit], [if-active-and-pre-existing-or-not-active]').addClass('d-none');
+        form.find('[if-addition-on-intake-or-during-visit], [if-addition-on-intake], [if-addition-during-visit], [if-active-and-pre-existing-or-not-active], [if-active-and-not-pre-existing]').addClass('d-none');
         if(form.find('[name="additionReasonCategory"]:checked').length) form.find('[if-addition-on-intake-or-during-visit]').removeClass('d-none');
         form.find('[if-addition-or-removal-on-intake-or-during-visit]').addClass('d-none');
         if(form.find('[name="additionReasonCategory"]:checked').length || form.find('[name="removalReasonCategory"]:checked').length) {
@@ -117,6 +120,9 @@ parentSegment.find('[name="additionReasonCategory"]')
         if(form.find('[name="isRemoved"]:checked').val() === '1' || form.find('[name="additionReasonCategory"]:checked').val() === 'ON_INTAKE') {
             form.find('[if-active-and-pre-existing-or-not-active]').removeClass('d-none');
         }
+        if(form.find('[name="isRemoved"]:checked').val() === '0' && form.find('[name="additionReasonCategory"]:checked').val() !== 'ON_INTAKE') {
+            form.find('[if-active-and-not-pre-existing]').removeClass('d-none');
+        }
         return false;
     })
     .trigger('change');