Răsfoiți Sursa

Wizard speed optimization round 1

Vijayakrishnan 3 ani în urmă
părinte
comite
71b2253135

+ 4 - 2
resources/views/app/patient/medications-center.blade.php

@@ -431,7 +431,6 @@ if(!@$summaryView) {
         buttonContainer.insertAfter(titleElem);
 
         initSegmentMoes(parentSegment);
-        __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
 
         // if there are active items, and it is marked NKAM, auto-unmark it
         @if($numActiveItems && $tracker && @($tracker->data->no_known_medications))
@@ -470,13 +469,16 @@ if(!@$summaryView) {
 
         buttonContainer.insertAfter(titleElem);
 
+        setTimeout(() => {
+        __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
         <?php
         if(@$note && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
             ?>
-            button.trigger('click');
+            // button.trigger('click');
             <?php
         }
         ?>
+        }, 0);
     }
     addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}');
 }).call(window);

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/edit-plan-in-place-optimized.php

@@ -2,7 +2,7 @@
 $currentValue = '';
 $previousValue = '';
 $previousChildPlan = null;
-if ($point->last_child_plan_point_id && $point->last_child_plan_point_scoped_note_id === $note->id) {
+if ($point->last_child_plan_point_id && $point->last_child_plan_data && $point->last_child_plan_point_scoped_note_id === $note->id) {
     $parsedPlan = json_decode($point->last_child_plan_data);
     $currentValue = $parsedPlan->value;
     $previousChildPlan = \App\Models\Point::where('id', '<', $point->last_child_plan_point_id)

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/edit-plan-optimized.php

@@ -2,7 +2,7 @@
 $currentValue = '';
 $previousValue = '';
 $previousChildPlan = null;
-if ($point->last_child_plan_point_id && $point->last_child_plan_point_scoped_note_id === $note->id) {
+if ($point->last_child_plan_point_id && $point->last_child_plan_data && $point->last_child_plan_point_scoped_note_id === $note->id) {
     $parsedPlan = json_decode($point->last_child_plan_data);
     $currentValue = $parsedPlan->value;
     $previousChildPlan = \App\Models\Point::where('id', '<', $point->last_child_plan_point_id)

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/last-plan-optimized.php

@@ -1,4 +1,4 @@
-<?php if ($point->last_child_plan_point_id): ?>
+<?php if ($point->last_child_plan_point_id && $point->last_child_plan_data): ?>
     <?php $parsedPlan = json_decode($point->last_child_plan_data); ?>
     <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/edit-review-in-place-optimized.php

@@ -2,7 +2,7 @@
 $currentValue = '';
 $previousValue = '';
 $previousChildReview = null;
-if ($point->last_child_review_point_id && $point->last_child_review_point_scoped_note_id === $note->id) {
+if ($point->last_child_review_point_id && $point->last_child_review_data && $point->last_child_review_point_scoped_note_id === $note->id) {
     $parsedReview = json_decode($point->last_child_review_data);
     if(@$parsedReview->value) {
         $currentValue = $parsedReview->value;

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/edit-review-optimized.php

@@ -2,7 +2,7 @@
 $currentValue = '';
 $previousValue = '';
 $previousChildReview = null;
-if ($point->last_child_review_point_id && $point->last_child_review_point_scoped_note_id === $note->id) {
+if ($point->last_child_review_point_id && $point->last_child_review_data && $point->last_child_review_point_scoped_note_id === $note->id) {
     $parsedReview = json_decode($point->last_child_review_data);
     if(@$parsedReview->value) {
         $currentValue = $parsedReview->value;

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/last-review-optimized.php

@@ -1,4 +1,4 @@
-<?php if ($point->last_child_review_point_id): ?>
+<?php if ($point->last_child_review_point_id && $point->last_child_review_data): ?>
     <?php $parsedReview = json_decode($point->last_child_review_data); ?>
     <div class="<?= $point->last_child_review_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= @$parsedReview->value ?></div>