Răsfoiți Sursa

Dx wizard - enforce content difference for review

Vijayakrishnan 3 ani în urmă
părinte
comite
2a9b4778f6

+ 3 - 3
resources/views/app/patient/note/segment_script.blade.php

@@ -142,16 +142,16 @@
                 compareWith = $.trim(form.find('.disallow-if-value-same-as').text());
                 if(compareWith && parsed) {
                     if(!parsed.value) {
-                        alert('Plan cannot be empty!');
+                        alert('Value cannot be empty!');
                         return false;
                     }
                     let newValue = $('<div/>').html(parsed.value).text().replace(/[^a-zA-Z0-9]/g, '');
                     if(newValue === '') {
-                        alert('Plan cannot be empty!');
+                        alert('Value cannot be empty!');
                         return false;
                     }
                     if(newValue === compareWith) {
-                        alert('New plan should be different from the previous plan!');
+                        alert('New value should be different from the previous value!');
                         return false;
                     }
                 }

+ 4 - 0
resources/views/app/patient/segment-templates/_child_review/edit-review.php

@@ -37,6 +37,10 @@ else {
         <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
         <input type="hidden" name="data">
 
+        <?php if($segment->segmentTemplate->internal_name === 'intake_problems' && $previousValue): ?>
+            <div class="d-none disallow-if-value-same-as"><?= str_compact($previousValue) ?></div>
+        <?php endif; ?>
+
         <p class="mb-2"><b>Review</b></p>
 
         <?php if($previousValue): ?>