소스 검색

Rx wizard - require "plan" for updates during-visit

Vijayakrishnan 3 년 전
부모
커밋
18508d7de8
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      resources/views/app/patient/wizard-partials/common-script.blade.php

+ 10 - 0
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -217,6 +217,16 @@ parentSegment.find('.frm-edit-{{$label}}')
                 value: planContent
             })
         }
+        // if added/removed during-visit, require plan
+        if(form.find('[name="isRemovedDueToEntryError"]:checked').val() !== '1' &&
+            ((form.find('[name="isRemoved"]:checked').val() === '0' && form.find('[name="additionReasonCategory"]:checked').val() === 'DURING_VISIT') ||
+            (form.find('[name="isRemoved"]:checked').val() === '1' && form.find('[name="removalReasonCategory"]:checked').val() === 'DURING_VISIT'))
+        ) {
+            if(!planContent) {
+                alert('Updates during visit require an accompanying plan!');
+                return false;
+            }
+        }
         @endif
 
         $.post(form.attr('url'), payload, _data => {