Просмотр исходного кода

Visit UI - show added review in summary => intake segments

Vijayakrishnan 3 лет назад
Родитель
Сommit
6bf2b42247

+ 13 - 0
app/Models/Point.php

@@ -15,6 +15,19 @@ class Point extends Model
             ->orderBy('created_at', 'DESC');
     }
 
+    public function childReviewAddedInNote($_note)
+    {
+        $review = Point::where('added_in_note_id', $_note->id)
+            ->where('category', 'REVIEW')
+            ->where('parent_point_id', $this->id)
+            ->orderBy('created_at', 'DESC')
+            ->first();
+        if(!!$review) {
+            $review->data = json_decode($review->data);
+        }
+        return $review;
+    }
+
     public function lastChildReview()
     {
         return $this->hasOne(Point::class, 'id', 'last_child_review_point_id');

+ 17 - 8
resources/views/app/patient/segment-templates/intake_allergies/summary.blade.php

@@ -12,15 +12,24 @@ $allergies = Point::getIntakePointsOfCategory($patient, 'ALLERGY', $note);
     <div class="text-secondary">No allergies</div>
 <?php else: ?>
     <?php foreach ($allergies as $allergy): ?>
-        <div class="d-flex align-items-baseline mb-2">
-            <div class="<?= $allergy->is_removed ? 'strike-through' : '' ?>">
-                <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
-                <?= !!@($allergy->data->description) ? '/&nbsp;' . @($allergy->data->description) : '' ?>
+        <div class="mb-2">
+            <div class="d-flex align-items-baseline">
+                <div class="<?= $allergy->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
+                    <?= !!@($allergy->data->description) ? '/&nbsp;' . @($allergy->data->description) : '' ?>
+                </div>
+                <?php if ($allergy->is_removed): ?>
+                    <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                <?php elseif ($allergy->added_in_note_id === $note->id): ?>
+                    <span class="ml-2 text-sm text-success">* Added on intake</span>
+                <?php endif; ?>
             </div>
-            <?php if ($allergy->is_removed): ?>
-                <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-            <?php elseif ($allergy->added_in_note_id === $note->id): ?>
-                <span class="ml-2 text-sm text-success">* Added on intake</span>
+            <?php $review = $allergy->childReviewAddedInNote($note); ?>
+            <?php if(!!$review): ?>
+                <div class="pl-3 mt-1">
+                    <div class="text-secondary font-weight-bold">Review</div>
+                    <div>{!! $review->data->value !!}</div>
+                </div>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

+ 21 - 14
resources/views/app/patient/segment-templates/intake_care_team/summary.blade.php

@@ -12,21 +12,28 @@ $careTeamMembers = Point::getIntakePointsOfCategory($patient, 'CARE_TEAM_MEMBER'
     <div class="text-secondary">No care team members</div>
 <?php else: ?>
     <?php foreach($careTeamMembers as $careTeamMember): ?>
-        <div class="mb-2 d-flex align-items-baseline">
-            <div class="<?= $careTeamMember->is_removed ? 'strike-through' : '' ?>">
-                <b><?= !!@($careTeamMember->data->name) ? @($careTeamMember->data->name) : '-' ?></b>
-                <?= !!@($careTeamMember->data->spacialty) ? '/&nbsp;' . @($careTeamMember->data->spacialty) : '' ?>
-                <?= !!@($careTeamMember->data->organization) ? '/&nbsp;' . @($careTeamMember->data->organization) : '' ?>
-                <br>
-                <?= !!@($careTeamMember->data->phone) ? 'Ph: ' . @($careTeamMember->data->phone) : '' ?>
-                <?= !!@($careTeamMember->data->fax) ? '/&nbsp;Fax: ' . @($careTeamMember->data->fax) : '' ?>
-                <br>
-                <?= !!@($careTeamMember->data->date) ? 'Date: ' . @($careTeamMember->data->date) : '' ?>
+        <div class="mb-2">
+            <div class="d-flex align-items-baseline">
+                <div class="<?= $careTeamMember->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($careTeamMember->data->name) ? @($careTeamMember->data->name) : '-' ?></b>
+                    <?= !!@($careTeamMember->data->spacialty) ? '/&nbsp;' . @($careTeamMember->data->spacialty) . '<br>' : '' ?>
+                    <?= !!@($careTeamMember->data->organization) ? '/&nbsp;' . @($careTeamMember->data->organization) . '<br>' : '' ?>
+                    <?= !!@($careTeamMember->data->phone) ? 'Ph: ' . @($careTeamMember->data->phone) . '<br>' : '' ?>
+                    <?= !!@($careTeamMember->data->fax) ? '/&nbsp;Fax: ' . @($careTeamMember->data->fax) . '<br>' : '' ?>
+                    <?= !!@($careTeamMember->data->date) ? 'Date: ' . @($careTeamMember->data->date) : '' ?>
+                </div>
+                <?php if ($careTeamMember->is_removed): ?>
+                <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                <?php elseif ($careTeamMember->added_in_note_id === $note->id): ?>
+                <span class="ml-2 text-sm text-success">* Added on intake</span>
+                <?php endif; ?>
+            </div>
+            <?php $review = $careTeamMember->childReviewAddedInNote($note); ?>
+            <?php if(!!$review): ?>
+            <div class="pl-3 mt-1">
+                <div class="text-secondary font-weight-bold">Review</div>
+                <div>{!! $review->data->value !!}</div>
             </div>
-            <?php if ($careTeamMember->is_removed): ?>
-            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-            <?php elseif ($careTeamMember->added_in_note_id === $note->id): ?>
-            <span class="ml-2 text-sm text-success">* Added on intake</span>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

+ 19 - 9
resources/views/app/patient/segment-templates/intake_goals/summary.blade.php

@@ -12,16 +12,26 @@ $goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
     <div class="text-secondary">No care team members</div>
 <?php else: ?>
     <?php foreach ($goals as $goal): ?>
-        <div class="d-flex align-items-baseline mb-2">
-            <div class="<?= $goal->is_removed ? 'strike-through' : '' ?>">
-                <b><?= !!@($goal->data->name) ? @($goal->data->name) : '-' ?></b>
-                <?= !!@($goal->data->description) ? '/&nbsp;' . @($goal->data->description) : '' ?>
+        <div class="mb-2">
+            <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) : '' ?>
+                </div>
+                <?php if ($goal->is_removed): ?>
+                    <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                <?php elseif ($goal->added_in_note_id === $note->id): ?>
+                    <span class="ml-2 text-sm text-success">* Added on intake</span>
+                <?php endif; ?>
+            </div>
+            <?php $review = $goal->childReviewAddedInNote($note); ?>
+            <?php if(!!$review): ?>
+            <div class="pl-3 mt-1">
+                <div class="text-secondary font-weight-bold">Review</div>
+                <div>{!! $review->data->value !!}</div>
             </div>
-            <?php if ($goal->is_removed): ?>
-                <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-            <?php elseif ($goal->added_in_note_id === $note->id): ?>
-                <span class="ml-2 text-sm text-success">* Added on intake</span>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>
-<?php endif; ?>
+<?php endif; ?>
+

+ 18 - 9
resources/views/app/patient/segment-templates/intake_interventions/summary.blade.php

@@ -21,16 +21,25 @@ foreach($interventions as $intervention) {
     <?php foreach($grouped as $k => $group): ?>
         <b><?= $k ?></b>
         <?php foreach($group as $intervention): ?>
-            <div class="mb-2 d-flex align-items-baseline pl-3">
-                <div class="<?= $intervention->is_removed ? 'strike-through' : '' ?>">
-                    <?= !!@($intervention->data->intervention) ? @($intervention->data->intervention) : '' ?>
-                    <br>
-                    <span class="text-secondary"><?= !!@($intervention->data->description) ? @($intervention->data->description) : '' ?></span>
+            <div class="mb-2 pl-3">
+                <div class="d-flex align-items-baseline">
+                    <div class="<?= $intervention->is_removed ? 'strike-through' : '' ?>">
+                        <?= !!@($intervention->data->intervention) ? @($intervention->data->intervention) : '' ?>
+                        <br>
+                        <span class="text-secondary"><?= !!@($intervention->data->description) ? @($intervention->data->description) : '' ?></span>
+                    </div>
+                    <?php if ($intervention->is_removed): ?>
+                    <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                    <?php elseif ($intervention->added_in_note_id === $note->id): ?>
+                    <span class="ml-2 text-sm text-success">* Added on intake</span>
+                    <?php endif; ?>
+                </div>
+                <?php $review = $intervention->childReviewAddedInNote($note); ?>
+                <?php if(!!$review): ?>
+                <div class="pl-3 mt-1">
+                    <div class="text-secondary font-weight-bold">Review</div>
+                    <div>{!! $review->data->value !!}</div>
                 </div>
-                <?php if ($intervention->is_removed): ?>
-                <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-                <?php elseif ($intervention->added_in_note_id === $note->id): ?>
-                <span class="ml-2 text-sm text-success">* Added on intake</span>
                 <?php endif; ?>
             </div>
         <?php endforeach; ?>

+ 18 - 9
resources/views/app/patient/segment-templates/intake_medications/summary.blade.php

@@ -12,16 +12,25 @@ $medications = Point::getIntakePointsOfCategory($patient, 'MEDICATION', $note);
     <div class="text-secondary">No medications</div>
 <?php else: ?>
     <?php foreach ($medications as $medication): ?>
-        <div class="d-flex align-items-baseline mb-2">
-            <div class="<?= $medication->is_removed ? 'strike-through' : '' ?>">
-                <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
-                <?= !!@($medication->data->strength) ? '/&nbsp;' . @($medication->data->strength) : '' ?>
-                <?= !!@($medication->data->frequency) ? '/&nbsp;' . @($medication->data->frequency) : '' ?>
+        <div class="mb-2">
+            <div class="d-flex align-items-baseline">
+                <div class="<?= $medication->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
+                    <?= !!@($medication->data->strength) ? '/&nbsp;' . @($medication->data->strength) : '' ?>
+                    <?= !!@($medication->data->frequency) ? '/&nbsp;' . @($medication->data->frequency) : '' ?>
+                </div>
+                <?php if ($medication->is_removed): ?>
+                    <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                <?php elseif ($medication->added_in_note_id === $note->id): ?>
+                    <span class="ml-2 text-sm text-success">* Added on intake</span>
+                <?php endif; ?>
+            </div>
+            <?php $review = $medication->childReviewAddedInNote($note); ?>
+            <?php if(!!$review): ?>
+            <div class="pl-3 mt-1">
+                <div class="text-secondary font-weight-bold">Review</div>
+                <div>{!! $review->data->value !!}</div>
             </div>
-            <?php if ($medication->is_removed): ?>
-                <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-            <?php elseif ($medication->added_in_note_id === $note->id): ?>
-                <span class="ml-2 text-sm text-success">* Added on intake</span>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

+ 21 - 9
resources/views/app/patient/segment-templates/intake_problems/summary.blade.php

@@ -12,16 +12,28 @@ $problems = Point::getIntakePointsOfCategory($patient, 'PROBLEM', $note);
     <div class="text-secondary">No problems</div>
 <?php else: ?>
     <?php foreach ($problems as $problem): ?>
-        <div class="d-flex align-items-baseline mb-2">
-            <div class="<?= $problem->is_removed ? 'strike-through' : '' ?>">
-                <b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
-                <?= !!@($problem->data->icd) ? '/&nbsp;' . @($problem->data->icd) : '' ?>
-                <?= !!@($problem->data->description) ? '/&nbsp;' . @($problem->data->description) : '' ?>
+        <div class="mb-2">
+            <div class="d-flex align-items-baseline">
+                <div class="<?= $problem->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
+                    <?= !!@($problem->data->icd) ? '/&nbsp;' . @($problem->data->icd) : '' ?>
+                    <?= !!@($problem->data->description) ? '/&nbsp;' . @($problem->data->description) : '' ?>
+                </div>
+                <?php if ($problem->is_removed): ?>
+                    <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                <?php elseif ($problem->added_in_note_id === $note->id): ?>
+                    <span class="ml-2 text-sm text-success">* Added on intake</span>
+                <?php endif; ?>
+            </div>
+            <?php $review = $problem->childReviewAddedInNote($note); ?>
+            <?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>
-            <?php if ($problem->is_removed): ?>
-                <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-            <?php elseif ($problem->added_in_note_id === $note->id): ?>
-                <span class="ml-2 text-sm text-success">* Added on intake</span>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>