浏览代码

plan_free_text_v2

Vijayakrishnan 3 年之前
父节点
当前提交
6289ef35bc

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

@@ -88,7 +88,7 @@
 
             <!-- if plan - link to intake segment-->
             <?php
-            $isPlan = strpos($iName, 'plan_') === 0 && $iName !== 'plan_free_text';
+            $isPlan = strpos($iName, 'plan_') === 0 && $iName !== 'plan_free_text' && $iName !== 'plan_free_text_v2';
             ?>
             @if($isPlan)
                 <?php

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

@@ -80,7 +80,7 @@
 
             <!-- if plan - link to intake segment-->
             <?php
-            $isPlan = strpos($iName, 'plan_') === 0 && $iName !== 'plan_free_text';
+            $isPlan = strpos($iName, 'plan_') === 0 && $iName !== 'plan_free_text' && $iName !== 'plan_free_text_v2';
             ?>
             @if($isPlan)
                 <?php

+ 69 - 0
resources/views/app/patient/segment-templates/plan_free_text_v2/allergies.blade.php

@@ -0,0 +1,69 @@
+<?php
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+
+$points = Point::getPlanPointsOfCategory($patient, 'ALLERGY', $note);
+$tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
+$numRelevant = 0;
+$numVisible = 0;
+$plural = 'Allergies';
+?>
+
+<?php if(!$tracker || !@($tracker->data->no_known_allergies_of_any_type)): ?>
+<?php if (count($points)): ?>
+    <p class="mt-2 mb-1 text-secondary font-weight-bold">Allergies</p>
+    <table class="table table-bordered table-xs table-cage mb-0">
+    <?php $j = 0; foreach ($points as $point): $j++; ?>
+        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
+        <?php $rel = $point->relevanceToNote($note); ?>
+        <?php $plan = $point->lastChildPlan; ?>
+        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
+        <?php $numVisible++; ?>
+        <tr>
+            <td class="width-30px pr-2">
+                @if($rel)
+                    <?php $numRelevant++; ?>
+                    {{ $j }}.
+                @else
+                    {{ $j }}.
+                @endif
+            </td>
+            <td class="px-2 width-300px">
+                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($point->data->name) ? @($point->data->name) : '-' ?></b>
+                </div>
+            </td>
+            <td class="px-2 width-300px">
+                <div>
+                    <?php if(!!$plan): ?>
+                        <div class="pl-3 mt-1 d-flex align-items-baseline">
+                            <span>{!! $plan->data->value !!}</span>
+                        </div>
+                    <?php elseif(false && $rel): ?>
+                        <div class="relevant-without-plan text-warning-mellow text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Plan missing</div>
+                    <?php endif; ?>
+                </div>
+                <div class="d-flex align-items-baseline">
+                    <?php if ($point->is_removed): ?>
+                        @if($point->removal_reason_category === 'DURING_VISIT')
+                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
+                        @elseif($point->removal_reason_category === 'ON_INTAKE')
+                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                        @endif
+                    <?php elseif ($point->added_in_note_id === $note->id): ?>
+                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="ml-2 text-sm text-success">* Diagnosed during visit</span>
+                        <?php else: ?>
+                            <span class="ml-2 text-sm text-info">* Added on intake</span>
+                        <?php endif;?>
+                    <?php endif; ?>
+                </div>
+            </td>
+            <td></td>
+        </tr>
+    <?php endforeach; ?>
+    </table>
+<?php endif; ?>
+<?php endif; ?>

+ 71 - 0
resources/views/app/patient/segment-templates/plan_free_text_v2/care_team.blade.php

@@ -0,0 +1,71 @@
+<?php
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+
+$points = Point::getPlanPointsOfCategory($patient, 'CARE_TEAM_MEMBER', $note);
+$numRelevant = 0;
+$numVisible = 0;
+$plural = 'Care team members';
+?>
+
+<?php if (count($points)): ?>
+    <p class="mt-2 mb-1 text-secondary font-weight-bold">Care Team</p>
+    <table class="table table-bordered table-xs table-cage mb-0">
+    <?php $j = 0; foreach ($points as $point): $j++; ?>
+        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
+        <?php $rel = $point->relevanceToNote($note); ?>
+        <?php $plan = $point->lastChildPlan; ?>
+        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
+        <?php $numVisible++; ?>
+        <tr>
+            <td class="width-30px pr-2">
+                @if($rel)
+                    <?php $numRelevant++; ?>
+                    {{ $j }}.
+                @else
+                    {{ $j }}.
+                @endif
+            </td>
+            <td class="px-2 width-300px">
+                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($point->data->name) ? @($point->data->name) : '-' ?></b>
+                    <?= !!@($point->data->specialty) ? '/&nbsp;' . @($point->data->specialty) . '' : '' ?>
+                    <?= !!@($point->data->organization) ? '/&nbsp;' . @($point->data->organization) . '' : '' ?><br>
+                    <?= !!@($point->data->phone) ? 'Ph: ' . @($point->data->phone) . '' : '' ?>
+                    <?= !!@($point->data->fax) ? '&nbsp;/&nbsp;Fax: ' . @($point->data->fax) . '<br>' : '' ?>
+                    <?= !!@($point->data->date) ? '&nbsp;/&nbsp;Date: ' . @($point->data->date) : '' ?>
+                </div>
+            </td>
+            <td class="px-2 width-300px">
+                <div class="pl-3">
+                    <?php if(!!$plan): ?>
+                        <div class="mt-1 d-flex align-items-baseline">
+                            <span>{!! $plan->data->value !!}</span>
+                        </div>
+                    <?php elseif(false && $rel): ?>
+                        <div class="relevant-without-plan text-warning-mellow text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Plan missing</div>
+                    <?php endif; ?>
+                </div>
+                <div class="pl-3 d-flex align-items-baseline">
+                    <?php if ($point->is_removed): ?>
+                        @if($point->removal_reason_category === 'DURING_VISIT')
+                            <span class="mt-1 text-sm text-secondary">Removed during visit</span>
+                        @elseif($point->removal_reason_category === 'ON_INTAKE')
+                            <span class="mt-1 text-sm text-secondary">Removed on intake</span>
+                        @endif
+                    <?php elseif ($point->added_in_note_id === $note->id): ?>
+                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="mt-1 text-sm text-success">* Added during visit</span>
+                        <?php else: ?>
+                            <span class="mt-1 text-sm text-info">* Added on intake</span>
+                        <?php endif;?>
+                    <?php endif; ?>
+                </div>
+            </td>
+            <td></td>
+        </tr>
+    <?php endforeach; ?>
+    </table>
+<?php endif; ?>

+ 4 - 0
resources/views/app/patient/segment-templates/plan_free_text_v2/edit.blade.php

@@ -0,0 +1,4 @@
+<?php
+$category = 'PLAN_FREE_TEXT';
+$endPoint = 'upsertNoteSingleton';
+include resource_path('views/app/patient/segment-templates/_simple_text_segment/edit.php');

+ 66 - 0
resources/views/app/patient/segment-templates/plan_free_text_v2/goals.blade.php

@@ -0,0 +1,66 @@
+<?php
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+
+$points = Point::getPlanPointsOfCategory($patient, 'GOAL', $note);
+$numRelevant = 0;
+$numVisible = 0;
+$plural = 'Goals';
+?>
+
+<?php if (count($points)): ?>
+    <p class="mt-2 mb-1 text-secondary font-weight-bold">Goals</p>
+    <table class="table table-bordered table-xs table-cage mb-0">
+    <?php $j = 0; foreach ($points as $point): $j++; ?>
+        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
+        <?php $rel = $point->relevanceToNote($note); ?>
+        <?php $plan = $point->lastChildPlan; ?>
+        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
+        <?php $numVisible++; ?>
+        <tr>
+            <td class="width-30px pr-2">
+                @if($rel)
+                    <?php $numRelevant++; ?>
+                    {{ $j }}.
+                @else
+                    {{ $j }}.
+                @endif
+            </td>
+            <td class="px-2 width-300px">
+                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($point->data->goal) ? @($point->data->goal) : '-' ?></b>
+                </div>
+            </td>
+            <td class="px-2 width-300px">
+                <div>
+                    <?php if(!!$plan): ?>
+                        <div class="pl-3 mt-1 d-flex align-items-baseline">
+                            <span>{!! $plan->data->value !!}</span>
+                        </div>
+                    <?php elseif(false && $rel): ?>
+                        <div class="relevant-without-plan text-warning-mellow text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Plan missing</div>
+                    <?php endif; ?>
+                </div>
+                <div class="d-flex align-items-baseline">
+                    <?php if ($point->is_removed): ?>
+                        @if($point->removal_reason_category === 'DURING_VISIT')
+                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
+                        @elseif($point->removal_reason_category === 'ON_INTAKE')
+                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                        @endif
+                    <?php elseif ($point->added_in_note_id === $note->id): ?>
+                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="ml-2 text-sm text-success">* Prescribed during visit</span>
+                        <?php else: ?>
+                            <span class="ml-2 text-sm text-info">* Added on intake</span>
+                        <?php endif;?>
+                    <?php endif; ?>
+                </div>
+            </td>
+            <td></td>
+        </tr>
+    <?php endforeach; ?>
+    </table>
+<?php endif; ?>

+ 69 - 0
resources/views/app/patient/segment-templates/plan_free_text_v2/medications.blade.php

@@ -0,0 +1,69 @@
+<?php
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+
+$points = Point::getPlanPointsOfCategory($patient, 'MEDICATION', $note);
+$tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
+$numRelevant = 0;
+$numVisible = 0;
+$plural = 'Medications';
+?>
+
+<?php if(!$tracker || !@($tracker->data->no_known_medications)): ?>
+<?php if (count($points)): ?>
+    <p class="mt-2 mb-1 text-secondary font-weight-bold">Medications</p>
+    <table class="table table-bordered table-xs table-cage mb-0">
+        <?php $j = 0; foreach ($points as $point): $j++; ?>
+        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
+        <?php $rel = $point->relevanceToNote($note); ?>
+        <?php $plan = $point->lastChildPlan; ?>
+        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
+        <?php $numVisible++; ?>
+        <tr>
+            <td class="width-30px pr-2">
+                @if($rel)
+                    <?php $numRelevant++; ?>
+                    {{ $j }}.
+                @else
+                    {{ $j }}.
+                @endif
+            </td>
+            <td class="px-2 width-300px">
+                <div class="font-weight-bold <?= $point->is_removed ? 'strike-through' : '' ?>">
+                    <?= !!@($point->data->name) ? @($point->data->name) : '-' ?>
+                </div>
+            </td>
+            <td class="px-2 width-300px">
+                <div>
+                    <?php if(!!$plan): ?>
+                    <div class="pl-3 mt-1 d-flex align-items-baseline">
+                        <span>{!! $plan->data->value !!}</span>
+                    </div>
+                    <?php elseif(false && $rel): ?>
+                    <div class="relevant-without-plan text-warning-mellow text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Plan missing</div>
+                    <?php endif; ?>
+                </div>
+                <div class="d-flex align-items-baseline">                
+                    <?php if ($point->is_removed): ?>
+                        @if($point->removal_reason_category === 'DURING_VISIT')
+                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
+                        @elseif($point->removal_reason_category === 'ON_INTAKE')
+                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                        @endif
+                    <?php elseif ($point->added_in_note_id === $note->id): ?>
+                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="ml-2 text-sm text-success">* Prescribed during visit</span>
+                        <?php else: ?>
+                            <span class="ml-2 text-sm text-info">* Added on intake</span>
+                        <?php endif;?>
+                    <?php endif; ?>
+                </div>
+            </td>
+            <td></td>
+        </tr>
+    <?php endforeach; ?>
+    </table>
+<?php endif; ?>
+<?php endif; ?>

+ 67 - 0
resources/views/app/patient/segment-templates/plan_free_text_v2/problems.blade.php

@@ -0,0 +1,67 @@
+<?php
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+
+$points = Point::getPlanPointsOfCategory($patient, 'PROBLEM', $note);
+$numRelevant = 0;
+$numVisible = 0;
+$plural = 'Problems';
+?>
+
+<?php if (count($points)): ?>
+    <p class="mt-2 mb-1 text-secondary font-weight-bold">Problems</p>
+    <table class="table table-bordered table-xs table-cage mb-0">
+    <?php $j = 0; foreach ($points as $point): $j++; ?>
+        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
+        <?php $rel = $point->relevanceToNote($note); ?>
+        <?php $plan = $point->lastChildPlan; ?>
+        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
+        <?php $numVisible++; ?>
+        <tr>
+            <td class="width-30px pr-2">
+                @if($rel)
+                    <?php $numRelevant++; ?>
+                    {{ $j }}.
+                @else
+                    {{ $j }}.
+                @endif
+            </td>
+            <td class="px-2 width-300px">
+                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
+                    <b><?= !!@($point->data->name) ? @($point->data->name) : '-' ?></b>
+                </div>
+            </td>
+            <td class="px-2 width-300px">
+                <div>
+                    <?php if(!!$plan): ?>
+                        <div class="pl-3 mt-1 d-flex align-items-baseline">
+                            <span>{!! $plan->data->value !!}</span>
+                        </div>
+                    <?php elseif(false && $rel): ?>
+                        <div class="relevant-without-plan text-warning-mellow text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Plan missing</div>
+                    <?php endif; ?>
+                </div>
+                <div class="d-flex align-items-baseline">
+                    <?php if ($point->is_removed): ?>
+                        @if($point->removal_reason_category === 'DURING_VISIT')
+                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
+                        @elseif($point->removal_reason_category === 'ON_INTAKE')
+                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                        @endif
+                    <?php elseif ($point->added_in_note_id === $note->id): ?>
+                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="ml-2 text-sm text-success">* Diagnosed during visit</span>
+                        <?php else: ?>
+                            <span class="ml-2 text-sm text-info">* Added on intake</span>
+                        <?php endif;?>
+                    <?php endif; ?>
+                </div>
+            </td>
+            <td></td>
+        </tr>
+    <?php endforeach; ?>
+    </table>
+<?php endif; ?>
+