Sfoglia il codice sorgente

Plain rich text reviews for problems

Vijayakrishnan 3 anni fa
parent
commit
a36dc53c7a

+ 0 - 5
resources/views/app/patient/note/review-log.blade.php

@@ -13,13 +13,8 @@
                 </div>
                 <div class="p-2">
                     <?php
-                    if (file_exists(resource_path('views/app/patient/segment-templates/_review/' . strtolower($record->parent_category) . '/view.php'))) {
-                        $review = json_decode($record->data);
-                        include resource_path('views/app/patient/segment-templates/_review/problem/view.php');
-                    } else {
                         $review = json_decode($record->data);
                         echo $review->value;
-                    }
                     ?>
                 </div>
             </div>

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

@@ -30,7 +30,7 @@ else {
     }
 }
 ?>
-<div visit-moe relative class="d-inline">
+<div visit-moe large relative class="d-inline">
     <a start show href="#"><i class="fa fa-plus-square"></i></a>
     <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1" right>
         <input type="hidden" name="uid" value="<?= $point->uid ?>">
@@ -49,7 +49,9 @@ else {
         <?php endif; ?>
 
         <div class="mb-2">
-            <textarea data-name="value" class="form-control form-control-sm" rows="3"><?= $currentValue ?></textarea>
+            <div note-rte
+                 class="form-group mb-2 border-left border-right rte-holder"
+                 data-field-name="value"><?= $currentValue ?></div>
         </div>
         <div>
             <button submit class="btn btn-sm btn-primary mr-2">Save</button>

+ 0 - 71
resources/views/app/patient/segment-templates/_review/problem/edit-review.php

@@ -1,71 +0,0 @@
-<?php
-$parsedReview = null;
-if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-    $parsedReview = json_decode($point->lastChildReview->data);
-}
-?>
-<div visit-moe relative>
-    <a start show href="#">Edit</a>
-    <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 min-width-500px" right>
-        <input type="hidden" name="uid" value="<?= $point->uid ?>">
-        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <input type="hidden" name="data">
-
-        <p class="mb-2"><b>Review</b></p>
-
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">Explain the problem.</label>
-            <textarea data-name="problem_explanation" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->problem_explanation : '' ?></textarea>
-        </div>
-        <?php if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id !== $note->id): ?>
-            <div class="mb-2">
-                <label class="text-secondary text-sm mb-1">What happened between today and our last visit?</label>
-                <textarea data-name="events_between_last_visit_and_this" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->events_between_last_visit_and_this : '' ?></textarea>
-            </div>
-            <div class="mb-2">
-                <label class="text-secondary text-sm mb-1">How did it go with the plan I gave you?</label>
-                <textarea data-name="current_plan_status" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->current_plan_status : '' ?></textarea>
-            </div>
-            <div class="mb-2">
-                <label class="text-secondary text-sm mb-1">What barriers have you felt following the plan?</label>
-                <textarea data-name="barriers_following_current_plan" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->barriers_following_current_plan : '' ?></textarea>
-            </div>
-        <?php endif; ?>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">How long have you had this?</label>
-            <textarea data-name="how_long" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->how_long : '' ?></textarea>
-        </div>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">When does it get worse?</label>
-            <textarea data-name="when_worse" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->when_worse : '' ?></textarea>
-        </div>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">When does it get better?</label>
-            <textarea data-name="when_better" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->when_better : '' ?></textarea>
-        </div>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">What have you done for treatment?</label>
-            <textarea data-name="treatments_done" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->treatments_done : '' ?></textarea>
-        </div>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">How does it affect your ADLs?</label>
-            <textarea data-name="how_it_affects_ADLs" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->how_it_affects_ADLs : '' ?></textarea>
-        </div>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">How do you cope?</label>
-            <textarea data-name="how_cope" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->how_cope : '' ?></textarea>
-        </div>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">How does this affect you emotionally?</label>
-            <textarea data-name="how_affect_emotionally" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->how_affect_emotionally : '' ?></textarea>
-        </div>
-        <div class="mb-2">
-            <label class="text-secondary text-sm mb-1">Memo</label>
-            <textarea data-name="memo" class="form-control form-control-sm" rows="1"><?= $parsedReview ? @$parsedReview->memo : '' ?></textarea>
-        </div>
-        <div>
-            <button submit class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
-</div>

+ 0 - 19
resources/views/app/patient/segment-templates/_review/problem/last-review.php

@@ -1,19 +0,0 @@
-<?php if ($point->lastChildReview): ?>
-    <?php
-    $review = json_decode($point->lastChildReview->data);
-    include resource_path('views/app/patient/segment-templates/_review/problem/view.php');
-    ?>
-    <div class="mb-2 <?= $point->last_child_review_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2' : '' ?>">
-        <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
-            <span class="text-sm">(reviewed on this note)</span>
-        <?php else: ?>
-            <span class="text-sm">Reviewed on:</span>
-            <a native target="_blank" class="text-sm"
-               href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>">
-                <?= friendlier_date_time($point->last_child_review_effective_date) ?>
-            </a>
-        <?php endif; ?>
-    </div>
-<?php else: ?>
-    <span class="text-secondary text-sm">None</span>
-<?php endif; ?>

+ 0 - 50
resources/views/app/patient/segment-templates/_review/problem/view.php

@@ -1,50 +0,0 @@
-<table class="table table-sm table-striped m-0 bg-white">
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">Explain the problem.</td>
-        <td class="ml-2" data-name="problem_explanation"><?= $review && @$review->problem_explanation ? @$review->problem_explanation : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">What happened between today and our last visit?</td>
-        <td class="ml-2" data-name="events_between_last_visit_and_this"><?= $review && @$review->events_between_last_visit_and_this ? @$review->events_between_last_visit_and_this : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">How did it go with the plan I gave you?</td>
-        <td class="ml-2" data-name="current_plan_status"><?= $review && @$review->current_plan_status ? @$review->current_plan_status : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">What barriers have you felt following the plan?</td>
-        <td class="ml-2" data-name="barriers_following_current_plan"><?= $review && @$review->barriers_following_current_plan ? @$review->barriers_following_current_plan : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">How long have you had this?</td>
-        <td class="ml-2" data-name="how_long"><?= $review && @$review->how_long ? @$review->how_long : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">When does it get worse?</td>
-        <td class="ml-2" data-name="when_worse"><?= $review && @$review->when_worse ? @$review->when_worse : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">When does it get better?</td>
-        <td class="ml-2" data-name="when_better"><?= $review && @$review->when_better ? @$review->when_better : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">What have you done for treatment?</td>
-        <td class="ml-2" data-name="treatments_done"><?= $review && @$review->treatments_done ? @$review->treatments_done : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">How does it affect your ADLs?</td>
-        <td class="ml-2" data-name="how_it_affects_ADLs"><?= $review && @$review->how_it_affects_ADLs ? @$review->how_it_affects_ADLs : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">How do you cope?</td>
-        <td class="ml-2" data-name="how_cope"><?= $review && @$review->how_cope ? @$review->how_cope : '-' ?></td>
-    </tr>
-    <tr class="mb-1">
-        <td class="w-50 text-secondary text-sm mb-0">How does this affect you emotionally?</td>
-        <td class="ml-2" data-name="how_affect_emotionally"><?= $review && @$review->how_affect_emotionally ? @$review->how_affect_emotionally : '-' ?></td>
-    </tr>
-    <div class="">
-        <td class="w-50 text-secondary text-sm mb-0">Memo</td>
-        <td class="ml-2" data-name="memo"><?= $review && @$review->memo ? @$review->memo : '-' ?></td>
-    </div>
-</table>

+ 1 - 1
resources/views/app/patient/segment-templates/intake_problems/edit.blade.php

@@ -99,7 +99,7 @@ $problems = Point::getIntakePointsOfCategory($patient, 'PROBLEM', $note);
                         <div class="flex-grow-1">
                             <?php
                             $point = $problem;
-                            include resource_path('views/app/patient/segment-templates/_review/problem/last-review.php');
+                            include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">

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

@@ -41,10 +41,7 @@ $numRelevant = 0;
             <?php if(!!$review): ?>
             <div class="pl-3 mt-1">
                 <div class="text-secondary font-weight-bold">Review</div>
-                <?php
-                $review = $review->data;
-                include resource_path('views/app/patient/segment-templates/_review/problem/view.php');
-                ?>
+                <div>{!! $review->data->value !!}</div>
             </div>
             <?php elseif($rel): ?>
             <div class="relevant-without-review block-signing text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>

+ 1 - 1
resources/views/app/patient/segment-templates/plan_problems/edit.blade.php

@@ -99,7 +99,7 @@ $intakeOrVisit = 'PLAN';
                     <div class="d-flex align-items-start">
                         <div class="flex-grow-1">
                             <?php
-                            include resource_path('views/app/patient/segment-templates/_review/problem/last-review.php');
+                            include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                             ?>
                         </div>
                         <a class="px-2 view-review-log"