Sfoglia il codice sorgente

Visit UI - goals - plan

Vijayakrishnan 3 anni fa
parent
commit
14e33de973

+ 94 - 7
resources/views/app/patient/segment-templates/plan_goals/edit.blade.php

@@ -29,13 +29,16 @@ else {
             <thead>
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
+                <th class="border-bottom-0">Category</th>
                 <th class="border-bottom-0">Goal</th>
                 <th class="border-bottom-0">Last Review</th>
                 <th class="border-bottom-0">Last Plan</th>
                 <th class="border-bottom-0">Plan Today</th>
             </tr>
             </thead>
+            <?php $previousCategory = null; ?>
             <?php foreach($goals as $goal): ?>
+                <?php if(@($goal->data->category)): ?>
                 <?php $point = $goal; ?>
                 <tr>
                     <td>
@@ -45,11 +48,17 @@ else {
                             <span>&nbsp;</span>
                         </div>
                     </td>
+                    <td>
+                        <?php if($previousCategory === $goal->data->category): ?>
+                        <span class="text-secondary"><?= $goal->data->category ?></span>
+                        <?php else: ?>
+                        <span class="font-weight-bold"><?= $goal->data->category ?></span>
+                        <?php endif; ?>
+                    </td>
                     <td>
                         <div class="d-flex align-items-baseline">
                             <div class="<?= $goal->is_removed ? 'strike-through' : '' ?>">
-                                <b><?= !!@($goal->data->name) ? @($goal->data->name) : '-' ?></b>
-                                <?= !!@($goal->data->description) ? '/&nbsp;' . @($goal->data->description) : '' ?>
+                                <?= !!@($goal->data->goal) ? @($goal->data->goal) : '' ?>
                             </div>
 
                             <!-- common actions -->
@@ -102,6 +111,8 @@ else {
                         ?>
                     </td>
                 </tr>
+                <?php $previousCategory = $goal->data->category; ?>
+                <?php endif; ?>
             <?php endforeach; ?>
         </table>
 
@@ -116,7 +127,7 @@ else {
         </div>
         <div visit-moe large class="ml-auto mt-1 max-width-500px">
             <a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add new goal, added during this visit</a>
-            <form url="/api/visitPoint/addTopLevelDuringVisit" class="mcp-theme-1" right>
+            <form url="/api/visitPoint/addTopLevelDuringVisit" class="mcp-theme-1 max-width-500px min-width-500px" right>
                 <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
                 <input type="hidden" name="category" value="GOAL">
                 <input type="hidden" name="data">
@@ -124,12 +135,80 @@ else {
                 <p class="mb-2"><b>Add Goal (plan)</b></p>
 
                 <div class="mb-2">
-                    <label class="text-sm text-secondary mb-1">Name</label>
-                    <input type="text" data-name="name" class="form-control form-control-sm">
+                    <label class="text-sm text-secondary mb-1">Category</label>
+                    <select type="text" data-name="category" class="form-control form-control-sm">
+                        <option value="">-- select --</option>
+                        <option value="NUTRITION">NUTRITION</option>
+                        <option value="ACTIVITY">ACTIVITY</option>
+                        <option value="SLEEP">SLEEP</option>
+                        <option value="SOCIAL CONNECTION">SOCIAL CONNECTION</option>
+                        <option value="STRESS REDUCTION">STRESS REDUCTION</option>
+                        <option value="RISKY SUBSTANCE AVOIDANCE">RISKY SUBSTANCE AVOIDANCE</option>
+                        <option value="OTHER">OTHER</option>
+                    </select>
+                </div>
+
+                <div class="bg-light border mb-2 p-2 help-text d-none" data-category="NUTRITION">
+                    <div class="mb-1">Specific - What specific food would you like to add/change?</div>
+                    <div class="mb-1">Measurable - How much or how many will you add or change?</div>
+                    <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
+                    <div class="mb-1">Realistic - What can you do? (improvement over perfection)</div>
+                    <div class="mb-2">Time-Connected - How often or for how long will you make this change?</div>
+                    <div class="font-italic"><b>Example:</b> "I will add 1 cup of berries to breakfast and a small apple or orange as an afternoon snack at least five days this week."</div>
+                </div>
+
+                <div class="bg-light border mb-2 p-2 help-text d-none" data-category="ACTIVITY">
+                    <div class="mb-1">Specific - What specific activity would you like to add/change?</div>
+                    <div class="mb-1">Measurable - How much activity, how many sessions?</div>
+                    <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
+                    <div class="mb-1">Realistic - What can you actually do? (know your limits, start small, build)</div>
+                    <div class="mb-2">Time-Connected - How frequent or how long will you do the activity?</div>
+                    <div class="font-italic"><b>Example:</b> "I will walk with a friend or family member for at least 20 minutes after dinner, every weekday for the next two months."</div>
+                </div>
+
+                <div class="bg-light border mb-2 p-2 help-text d-none" data-category="SLEEP">
+                    <div class="mb-1">Specific - What are you going to do to improve your sleep quality/quantity?</div>
+                    <div class="mb-1">Measurable - How much time, how many sessions?</div>
+                    <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
+                    <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
+                    <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
+                    <div class="font-italic"><b>Example:</b> "I will begin a new bedtime routine of shutting off the television and instead, read a book for at least 30 minutes before bed, four nights this week."</div>
+                </div>
+
+                <div class="bg-light border mb-2 p-2 help-text d-none" data-category="SOCIAL CONNECTION">
+                    <div class="mb-1">Specific - What are you going to do to improve feelings of connectedness?</div>
+                    <div class="mb-1">Measurable - How much time, how many sessions?</div>
+                    <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
+                    <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
+                    <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
+                    <div class="font-italic"><b>Example:</b> "I will increase my feeling of social connectedness by joining a group fitness class that meets for an hour, three nights of the week."</div>
+                </div>
+
+                <div class="bg-light border mb-2 p-2 help-text d-none" data-category="STRESS REDUCTION">
+                    <div class="mb-1">Specific - What are you going to do to manage your stress?</div>
+                    <div class="mb-1">Measurable - How much time, how many sessions?</div>
+                    <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
+                    <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
+                    <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
+                    <div class="font-italic"><b>Example:</b> "I will write about what I am thankful for at least 10 minutes three times per week."</div>
+                </div>
+
+                <div class="bg-light border mb-2 p-2 help-text d-none" data-category="RISKY SUBSTANCE AVOIDANCE">
+                    <div class="mb-1">Specific - What are you going to do to decrease your substance use?</div>
+                    <div class="mb-1">Measurable - How much will you reduce it by?</div>
+                    <div class="mb-1">Attainable - Do you have what it takes to follow through?</div>
+                    <div class="mb-1">Realistic - What can you actually do? (improvement over perfection)</div>
+                    <div class="mb-2">Time-Connected - How frequent? How long will you commit?</div>
+                    <div class="font-italic"><b>Example:</b> "I will swap my morning cigarette with chewing gum at least 5 days this week for the next four weeks. I will ask my partner to help keep me on track and use the free texting service for more support."</div>
                 </div>
+
+                <div class="bg-light border mb-2 p-2 help-text d-none" data-category="OTHER">
+                    <div class="">Ensure that the goal is Specific, Measurable, Attainable, Realistic and Time-Connected.</div>
+                </div>
+
                 <div class="mb-2">
-                    <label class="text-sm text-secondary mb-1">Description</label>
-                    <textarea type="text" data-name="description" class="form-control form-control-sm"></textarea>
+                <label class="text-sm text-secondary mb-1">Goal</label>
+                <textarea type="text" data-name="goal" class="form-control form-control-sm" rows="3"></textarea>
                 </div>
 
                 <div>
@@ -172,5 +251,13 @@ else {
             return false;
         });
 
+        parentSegment.find('select[data-name="category"]')
+            .off('change')
+            .on('change', function() {
+                parentSegment.find('.help-text').addClass('d-none');
+                parentSegment.find('.help-text[data-category="' + this.value + '"]').removeClass('d-none');
+            });
+
+        parentSegment.find('.chk-relevance').trigger('change');
     };
 </script>

+ 40 - 29
resources/views/app/patient/segment-templates/plan_goals/summary.blade.php

@@ -6,6 +6,15 @@ use App\Models\Point;
 
 $goals = Point::getPlanPointsOfCategory($patient, 'GOAL', $note);
 
+$grouped = [];
+foreach($goals as $goal) {
+    if(!@($goal->data->category)) continue;
+    if(!isset($grouped[$goal->data->category])) {
+        $grouped[$goal->data->category] = [];
+    }
+    $grouped[$goal->data->category][] = $goal;
+}
+
 $relevance = Point::where('added_in_segment_id', $segment->id)
     ->where('category', 'GOALS_RELEVANT_TO_NOTE')
     ->orderBy('id', 'DESC')
@@ -20,40 +29,42 @@ else {
 $numRelevant = 0;
 ?>
 
-<?php if (!count($goals)): ?>
+<?php if (!count($grouped)): ?>
     <div class="text-secondary">No goals</div>
 <?php else: ?>
-    <?php foreach ($goals as $goal): ?>
-        <div class="mb-2">
-            <div class="d-flex align-items-baseline">
-                @if(in_array($goal->uid, $relevance))
-                    <span class="text-info mr-1 text-sm">
-                        <i class="fa fa-star text-sm"></i>
-                    </span>
-                    <?php $numRelevant++; ?>
-                @endif
-                <div class="<?= $goal->is_removed ? 'strike-through' : '' ?>">
-                    <b><?= !!@($goal->data->name) ? @($goal->data->name) : '-' ?></b>
-                    <?= !!@($goal->data->description) ? '/&nbsp;' . @($goal->data->description) : '' ?>
+    <?php foreach($grouped as $k => $group): ?>
+        <b><?= $k ?></b>
+        <?php foreach ($group as $goal): ?>
+            <div class="pl-2 mb-2">
+                <div class="d-flex align-items-baseline">
+                    @if(in_array($goal->uid, $relevance))
+                        <span class="text-info mr-1 text-sm">
+                            <i class="fa fa-star text-sm"></i>
+                        </span>
+                        <?php $numRelevant++; ?>
+                    @endif
+                    <div class="<?= $goal->is_removed ? 'strike-through' : '' ?>">
+                        <?= !!@($goal->data->goal) ? @($goal->data->goal) : '' ?>
+                    </div>
+                    <?php if ($goal->is_removed): ?>
+                        <span class="ml-2 text-sm text-secondary">Removed during visit</span>
+                    <?php elseif ($goal->added_in_note_id === $note->id): ?>
+                        <?php if ($goal->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="ml-2 text-sm text-success">* Added during visit</span>
+                        <?php else: ?>
+                            <span class="ml-2 text-sm text-info">* Added on intake</span>
+                        <?php endif;?>
+                    <?php endif; ?>
+                </div>
+                <?php $review = $goal->childPlanAddedInNote($note); ?>
+                <?php if(!!$review): ?>
+                <div class="pl-3 mt-1">
+                    <div class="text-secondary font-weight-bold">Plan</div>
+                    <div>{!! $review->data->value !!}</div>
                 </div>
-                <?php if ($goal->is_removed): ?>
-                    <span class="ml-2 text-sm text-secondary">Removed during visit</span>
-                <?php elseif ($goal->added_in_note_id === $note->id): ?>
-                    <?php if ($goal->addition_reason_category === 'DURING_VISIT'): ?>
-                        <span class="ml-2 text-sm text-success">* Added during visit</span>
-                    <?php else: ?>
-                        <span class="ml-2 text-sm text-info">* Added on intake</span>
-                    <?php endif;?>
                 <?php endif; ?>
             </div>
-            <?php $review = $goal->childPlanAddedInNote($note); ?>
-            <?php if(!!$review): ?>
-            <div class="pl-3 mt-1">
-                <div class="text-secondary font-weight-bold">Plan</div>
-                <div>{!! $review->data->value !!}</div>
-            </div>
-            <?php endif; ?>
-        </div>
+        <?php endforeach; ?>
     <?php endforeach; ?>
     @if($numRelevant)
         <div class="d-flex align-items-baseline text-info mr-1 mt-3">