Explorar o código

Merge branch 'master' of rav.triplestart.com:jmudaka/stagfe2

= %!s(int64=3) %!d(string=hai) anos
pai
achega
800929144f

+ 1 - 1
app/Http/Controllers/NoteController.php

@@ -467,7 +467,7 @@ SELECT p.id,
        p.last_child_review_point_scoped_note_uid as last_child_review_note_uid,
        p.last_child_plan_point_scoped_note_uid as last_child_plan_note_uid
 FROM point p 
-    left join note_point np on p.id = np.point_id and np.note_id = {$_note->id}
+    left join note_point np on p.id = np.point_id and np.note_id = {$_note->id} and np.is_active = TRUE
 WHERE p.client_id = {$_patient->id} AND p.category = '{$_category}'
     ORDER BY ((p.data)::json->'{$_sortKey}')::text
 ";

+ 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);

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

@@ -1,5 +1,6 @@
 <?php $iName = $segment->segmentTemplate->internal_name; ?>
 <?php $isLSSegment = strpos($iName, 'lifestyle_') === 0; ?>
+<?php $isOmegaHistorySegment = strpos($iName, 'omega_history_') === 0; ?>
 
 <div class="border-bottom note-section visit-segment {{$note->is_signed_by_hcp ? '' : 'edit-trigger'}} {{strpos($iName, 'lifestyle_') === 0 && $iName !== 'lifestyle_general' ? 'zero-height' : ''}}"
      data-segment-uid="{{ $segment->uid }}"
@@ -136,8 +137,9 @@
         'plan_care_team',
         'intake_supplements',
         'plan_supplements',
+        'omega_'
     ];
-    if(!in_array($iName, $wizardPowered) && $iName !== 'ros') { ?>
+    if(!in_array($iName, $wizardPowered) && $iName !== 'ros' && $iName !== 'omega_ros' && !$isOmegaHistorySegment) { ?>
     <div class="d-none if-edit edit-container">
         {!! $segment->edit_html !!}
     </div>

+ 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>

+ 1 - 1
resources/views/app/patient/segment-templates/omega_allergies/summary.blade.php

@@ -4,7 +4,7 @@ use App\Models\Point;
 
 /** @var \App\Models\Client $patient */
 
-$points = Point::getIntakePointsOfCategory($patient, 'ALLERGY', $note);
+$points = Point::getPointsOfCategory($patient, 'ALLERGY');
 $tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
 $numRelevant = 0;
 $plural = 'Allergies';

+ 1 - 1
resources/views/app/patient/segment-templates/omega_medications/summary.blade.php

@@ -4,7 +4,7 @@ use App\Models\Point;
 
 /** @var \App\Models\Client $patient */
 
-$points = Point::getIntakePointsOfCategory($patient, 'MEDICATION', $note);
+$points = Point::getPointsOfCategory($patient, 'MEDICATION');
 $tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
 $numRelevant = 0;
 $plural = 'Medications';