Browse Source

EC-270 - all subj data in subj_system

Vijayakrishnan 3 years ago
parent
commit
fa3a75e000
18 changed files with 924 additions and 21 deletions
  1. 58 0
      resources/views/app/patient/module-specific-summary-renderers/allergy/subjective.blade.php
  2. 58 0
      resources/views/app/patient/module-specific-summary-renderers/care_team_member/subjective.blade.php
  3. 58 0
      resources/views/app/patient/module-specific-summary-renderers/goal/subjective.blade.php
  4. 114 0
      resources/views/app/patient/module-specific-summary-renderers/history_family/subjective.blade.php
  5. 112 0
      resources/views/app/patient/module-specific-summary-renderers/history_social/subjective.blade.php
  6. 109 0
      resources/views/app/patient/module-specific-summary-renderers/history_surgical/subjective.blade.php
  7. 58 0
      resources/views/app/patient/module-specific-summary-renderers/medication/subjective.blade.php
  8. 147 0
      resources/views/app/patient/module-specific-summary-renderers/past_medical_history/subjective.blade.php
  9. 58 0
      resources/views/app/patient/module-specific-summary-renderers/problem/subjective.blade.php
  10. 2 2
      resources/views/app/patient/note/segment-slim.blade.php
  11. 2 2
      resources/views/app/patient/note/segment_script.blade.php
  12. 2 2
      resources/views/app/patient/segment-templates/_custom_items/script.blade.php
  13. 6 3
      resources/views/app/patient/segment-templates/history_family/edit.blade.php
  14. 6 3
      resources/views/app/patient/segment-templates/history_social/edit.blade.php
  15. 6 3
      resources/views/app/patient/segment-templates/history_surgical/edit.blade.php
  16. 118 2
      resources/views/app/patient/segment-templates/omega_subjective_system/summary.blade.php
  17. 7 4
      resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php
  18. 3 0
      resources/views/app/patient/wizard-partials/common-script.blade.php

+ 58 - 0
resources/views/app/patient/module-specific-summary-renderers/allergy/subjective.blade.php

@@ -0,0 +1,58 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/allergies-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="allergies-center-{{$note->id}}"
+           title="Allergies Center"
+           popup-style="overflow-visible">
+            Allergies
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? ' text-info':'' }}">
+                        @if($rel)
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class=" <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            <?= !!@($point->data->name) ? @($point->data->name) : '-' ?>
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="d-flex align-items-baseline pl-2">
+                            <?php $review = $point->childReviewAddedInNote($note); ?>
+                            <?php if(!!$review): ?>
+                            <span class="pr-2">{!! $review->data->value !!}</span>
+                            <?php endif; ?>
+                            <span>
+                                <?php if ($point->is_removed): ?>
+                                @if($point->removal_reason_category === 'DURING_VISIT')
+                                    <span class="text-sm text-secondary">Removed during visit</span>
+                                @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                    <span class="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="text-sm text-success">* Diagnosed during visit</span>
+                                <?php else: ?>
+                                <span class="text-sm text-info">* Diagnosed on intake</span>
+                                <?php endif;?>
+                                <?php endif; ?>
+                            </span>
+                        </div>
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

+ 58 - 0
resources/views/app/patient/module-specific-summary-renderers/care_team_member/subjective.blade.php

@@ -0,0 +1,58 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/careteam-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="careteam-center-{{$note->id}}"
+           title="Care Team Center"
+           popup-style="overflow-visible">
+            Care Team
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? ' text-info':'' }}">
+                        @if($rel)
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class=" <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            <?= !!@($point->data->name) ? @($point->data->name) : '-' ?>
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="d-flex align-items-baseline pl-2">
+                            <?php $review = $point->childReviewAddedInNote($note); ?>
+                            <?php if(!!$review): ?>
+                            <span class="pr-2">{!! $review->data->value !!}</span>
+                            <?php endif; ?>
+                            <span>
+                                <?php if ($point->is_removed): ?>
+                                @if($point->removal_reason_category === 'DURING_VISIT')
+                                    <span class="text-sm text-secondary">Removed during visit</span>
+                                @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                    <span class="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="text-sm text-success">* Added during visit</span>
+                                <?php else: ?>
+                                <span class="text-sm text-info">* Added on intake</span>
+                                <?php endif;?>
+                                <?php endif; ?>
+                            </span>
+                        </div>
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

+ 58 - 0
resources/views/app/patient/module-specific-summary-renderers/goal/subjective.blade.php

@@ -0,0 +1,58 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/goals-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="goals-center-{{$note->id}}"
+           title="Goals Center"
+           popup-style="overflow-visible">
+            Goals
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? ' text-info':'' }}">
+                        @if($rel)
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class=" <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            <?= !!@($point->data->goal) ? @($point->data->goal) : '-' ?>
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="d-flex align-items-baseline pl-2">
+                            <?php $review = $point->childReviewAddedInNote($note); ?>
+                            <?php if(!!$review): ?>
+                            <span class="pr-2">{!! $review->data->value !!}</span>
+                            <?php endif; ?>
+                            <span>
+                                <?php if ($point->is_removed): ?>
+                                @if($point->removal_reason_category === 'DURING_VISIT')
+                                    <span class="text-sm text-secondary">Removed during visit</span>
+                                @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                    <span class="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="text-sm text-success">* Added during visit</span>
+                                <?php else: ?>
+                                <span class="text-sm text-info">* Added on intake</span>
+                                <?php endif;?>
+                                <?php endif; ?>
+                            </span>
+                        </div>
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

+ 114 - 0
resources/views/app/patient/module-specific-summary-renderers/history_family/subjective.blade.php

@@ -0,0 +1,114 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+use App\Models\Segment;
+/** @var Client $patient */
+/** @var Note $note */
+/** @var Segment $segment */
+
+?>
+
+@if($points && count($points))
+
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/note-segment-view-by-name/{{$note->uid}}/history_family/edit",
+           mc-initer="edit-univ_history_family-container-{{$note->id}}"
+           title="Family History"
+           popup-style="overflow-visible">
+            FHx
+        </a>
+        <div class="flex-grow-1">
+
+<?php
+
+$point = $points[0];
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+
+$contentData = $parsed = false;
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+}
+
+$labels = [
+    'general_no_health_concern' => 'No health concern',
+    'general_arthritis' => 'Arthritis',
+    'general_asthma' => 'Asthma',
+    'general_bleeding_disorder' => 'Bleeding disorder',
+    'general_cad_lt_age_55' => 'CAD &gt; age 55',
+    'general_copd' => 'COPD',
+    'general_diabetes' => 'Diabetes',
+    'general_heart_attack' => 'Heart attack',
+    'general_heart_disease' => 'Heart disease',
+    'general_high_cholesterol' => 'High cholesterol',
+    'general_hypertension' => 'Hypertension',
+    'general_mental_illness' => 'Mental illness',
+    'general_osteoporosis' => 'Osteoporosis',
+    'general_stroke' => 'Stroke',
+    'cancer_breast_ca' => 'Breast cancer',
+    'cancer_colon_ca' => 'Colon cancer',
+    'cancer_other_ca' => 'Other cancer',
+    'cancer_ovarian_ca' => 'Ovarian cancer',
+    'cancer_uterine_ca' => 'Uterine cancer',
+];
+
+if($contentData && !$contentData['unknown'] && !!$contentData['count']) {
+    for ($i = 0; $i < $contentData['count']; $i++) {
+?>
+<div class="<?= $i > 0 ? 'mt-2' : '' ?>">
+    <div class="">
+        <b><?= isset($contentData['items'][$i]['relationship']) ? $contentData['items'][$i]['relationship'] : '--' ?></b>
+        <?php if(isset($contentData['items'][$i]['status']) && !empty($contentData['items'][$i]['status'])): ?>
+        <span class="ml-1 text-secondary">(<?= $contentData['items'][$i]['status'] ?>)</span>
+        <?php endif; ?>
+    </div>
+    <div class="ml-3">
+        <?php
+        $positives = [];
+        $negatives = [];
+        foreach ($labels as $k => $v) {
+            if(isset($contentData['items'][$i][$k])) {
+                if(strtolower($contentData['items'][$i][$k]) === 'yes') {
+                    $positives[] = $v;
+                }
+                else {
+                    $negatives[] = $v;
+                }
+            }
+        }
+        ?>
+        @if(count($positives))
+            <div class="pt-1"><b>Positive for</b>: {!!  implode(', ', $positives) !!}</div>
+        @endif
+        @if(count($negatives))
+            <div class="pt-1"><b>Negative for</b>: {!!  implode(', ', $negatives) !!}</div>
+        @endif
+    </div>
+    <?php if(isset($contentData['items'][$i]['comments']) && !empty($contentData['items'][$i]['comments'])): ?>
+    <div class="ml-3 pt-1 client-rs-contents">
+        <b>Comments: </b><?= $contentData['items'][$i]['comments'] ?>
+    </div>
+    <?php endif; ?>
+</div>
+<?php
+    }
+}
+else {
+?>
+<div class="text-secondary">-</div>
+<?php
+}
+?>
+
+        </div>
+    </div>
+
+@endif

+ 112 - 0
resources/views/app/patient/module-specific-summary-renderers/history_social/subjective.blade.php

@@ -0,0 +1,112 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+use App\Models\Segment;
+/** @var Client $patient */
+/** @var Note $note */
+/** @var Segment $segment */
+
+?>
+
+@if($points && count($points))
+
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/note-segment-view-by-name/{{$note->uid}}/history_social/edit",
+           mc-initer="edit-univ_history_social-container-{{$note->id}}"
+           title="Social History"
+           popup-style="overflow-visible">
+            Soc Hx
+        </a>
+        <div class="flex-grow-1">
+
+<?php
+
+$point = $points[0];
+
+$fields = [
+    [
+        "Tobacco" => ["Current every day smoker", "Current some day smoker", "Former smoker", "Heavy tobacco smoker", "Light tobacco smoker", "Never smoker", "Smoker, current status unknown", "Unknown if ever smoked "],
+    ],
+    [
+        "Alcohol" => ["Do not drink", "Drink daily", "Frequently drink", "Hx of Alcoholism", "Occasional drink"],
+        "Drug Abuse" => ["IVDU", "Illicit drug use", "No illicit drug use"],
+    ],
+    [
+        "Cardiovascular" => ["Eat healthy meals", "Regular exercise", "Take daily aspirin"],
+        "Safety" => ["Household Smoke detector", "Keep Firearms in home", "Wear seatbelts"],
+    ],
+    [
+        "Sexual Activity" => ["Exposure to STI", "Homosexual encounters", "Not sexually active", "Safe sex practices", "Sexually active"],
+        "Birth Gender" => ["Male", "Female", "Undifferentiated"],
+    ]
+];
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+
+$contentData = $parsed = false;
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+
+    for ($i = 0; $i < count($fields); $i++):
+        foreach($fields[$i] as $head => $values):
+            for($k = 0; $k < count($values); $k++):
+                $fName = $head . '_' . sanitize_field_name($values[$k]);
+                if(@$contentData['common'][$fName]): ?>
+                    <div>
+                        <?= ucwords($head) ?>
+                        <i class="fa fa-arrow-right text-sm text-secondary"></i>
+                        <span class="font-weight-bold"><?= $values[$k] ?></span>
+                        <?php if(@$contentData['common'][$fName . '__comments']): ?>
+                            <span class="text-sm ml-1 text-secondary">(<?= $contentData['common'][$fName . '__comments'] ?>)</span>
+                        <?php endif; ?>
+                    </div>
+                <?php
+                endif;
+            endfor;
+        endforeach;
+    endfor;
+
+    // custom fields
+
+    if(isset($contentData['customFields']) && count($contentData['customFields'])):
+        ?> <div class=""> <?php
+        for ($i = 0; $i < count($contentData['customFields']); $i++):
+            $item = $contentData['customFields'][$i];
+            if($item['value']): ?>
+                <div>
+                    Custom
+                    <i class="fa fa-arrow-right text-sm text-secondary"></i>
+                    <span class="font-weight-bold"><?= $item['label'] ?></span>
+                    <?php if($item['comments']): ?>
+                        <span class="text-sm ml-1 text-secondary">(<?= $item['comments'] ?>)</span>
+                    <?php endif; ?>
+                </div>
+            <?php
+            endif;
+        endfor;
+        ?> </div> <?php
+    endif;
+
+    if(isset($contentData['comments']) && !empty(trim($contentData['comments']))) { ?>
+        <div class="mt-2 mb-1">
+            <b>Comments: </b><?= $contentData['comments'] ?>
+        </div>
+    <?php }
+}
+else {
+    echo '<span class="text-secondary">-</span>';
+}
+?>
+
+        </div>
+    </div>
+
+@endif

+ 109 - 0
resources/views/app/patient/module-specific-summary-renderers/history_surgical/subjective.blade.php

@@ -0,0 +1,109 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+use App\Models\Segment;
+/** @var Client $patient */
+/** @var Note $note */
+/** @var Segment $segment */
+
+?>
+
+@if($points && count($points))
+
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/note-segment-view-by-name/{{$note->uid}}/history_surgical/edit",
+           mc-initer="edit-univ_history_surgical-container-{{$note->id}}"
+           title="Surgical History"
+           popup-style="overflow-visible">
+            Surg Hx
+        </a>
+        <div class="flex-grow-1">
+
+<?php
+
+$point = $points[0];
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+
+$fields = [
+    [
+        "" => ["Aneurysm repair", "Appendectomy", "Back surgery", "Bariatric surgery/gastric bypass", "Bilateral tubal ligation", "Breast resection/mastectomy", "CABG", "Carotid endarterectomy/stent", "Carpal tunnel release surgery",]
+    ],
+    [
+        "" => ["Cataract/lens surgery", "Cesarean section", "Cholecystectomy/bile duct surgery", "Dilation and curettage", "Hemorrhoid surgery", "Hip arthroplasty", "Hip replacement", "Hysterectomy", "Inguinal hernia repair",]
+    ],
+    [
+        "" => ["Knee arthroplasty", "LASIK", "Laminectomy", "Nasal surgery", "PTCA/PCI", "Pacemaker/defibrillator", "Prostate surgery", "Prostatectomy", "Rotator cuff surgery",]
+    ],
+    [
+        "" => ["Sinus surgery", "Skin cancer excision", "Spinal fusion", "TAH-BSO", "TURP", "Tonsillectomy/Adenoidectomy", "Vasectomy",]
+    ]
+];
+
+$contentData = $parsed = false;
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+
+    for ($i = 0; $i < count($fields); $i++):
+        foreach($fields[$i] as $head => $values):
+            for($k = 0; $k < count($values); $k++):
+                $fName = $head . '_' . sanitize_field_name($values[$k]);
+                if(@$contentData['common'][$fName]): ?>
+                    <div>
+                        <!--Common
+                        <i class="fa fa-arrow-right text-sm text-secondary"></i>-->
+                        <span class=""><?= $values[$k] ?></span>
+                        <?php if(@$contentData['common'][$fName . '__comments']): ?>
+                            <span class="text-sm ml-1 text-secondary">(<?= $contentData['common'][$fName . '__comments'] ?>)</span>
+                        <?php endif; ?>
+                    </div>
+                <?php
+                endif;
+            endfor;
+        endforeach;
+    endfor;
+
+    // custom fields
+
+    if(isset($contentData['customFields']) && count($contentData['customFields'])):
+        ?> <div class=""> <?php
+        for ($i = 0; $i < count($contentData['customFields']); $i++):
+            $item = $contentData['customFields'][$i];
+            if($item['value']): ?>
+                <div>
+                    <!--Custom
+                    <i class="fa fa-arrow-right text-sm text-secondary"></i>-->
+                    <span class="font-weight-bold"><?= $item['label'] ?></span>
+                    <?php if($item['comments']): ?>
+                        <span class="text-sm ml-1 text-secondary">(<?= $item['comments'] ?>)</span>
+                    <?php endif; ?>
+                </div>
+            <?php
+            endif;
+        endfor;
+        ?> </div> <?php
+    endif;
+
+    if(isset($contentData['comments']) && !empty(trim($contentData['comments']))) { ?>
+        <div class="mt-2 mb-1">
+            <b>Comments: </b><?= $contentData['comments'] ?>
+        </div>
+    <?php }
+}
+else {
+    echo '<span class="text-secondary">-</span>';
+}
+?>
+
+        </div>
+    </div>
+
+@endif

+ 58 - 0
resources/views/app/patient/module-specific-summary-renderers/medication/subjective.blade.php

@@ -0,0 +1,58 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/medications-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="medications-center-{{$note->id}}"
+           title="Medications Center"
+           popup-style="overflow-visible">
+            Medications
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? ' text-info':'' }}">
+                        @if($rel)
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class=" <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            <?= !!@($point->data->name) ? @($point->data->name) : '-' ?>
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="d-flex align-items-baseline pl-2">
+                            <?php $review = $point->childReviewAddedInNote($note); ?>
+                            <?php if(!!$review): ?>
+                            <span class="pr-2">{!! $review->data->value !!}</span>
+                            <?php endif; ?>
+                            <span>
+                                <?php if ($point->is_removed): ?>
+                                @if($point->removal_reason_category === 'DURING_VISIT')
+                                    <span class="text-sm text-secondary">Removed during visit</span>
+                                @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                    <span class="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="text-sm text-success">* Prescribed during visit</span>
+                                <?php else: ?>
+                                <span class="text-sm text-info">* Prescribed on intake</span>
+                                <?php endif;?>
+                                <?php endif; ?>
+                            </span>
+                        </div>
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

+ 147 - 0
resources/views/app/patient/module-specific-summary-renderers/past_medical_history/subjective.blade.php

@@ -0,0 +1,147 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+use App\Models\Segment;
+/** @var Client $patient */
+/** @var Note $note */
+/** @var Segment $segment */
+
+?>
+
+@if($points && count($points))
+
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/note-segment-view-by-name/{{$note->uid}}/past_medical_history/edit",
+           mc-initer="edit-univ_history_past_medical-container-{{$note->id}}"
+           title="Past Medical History"
+           popup-style="overflow-visible">
+            PMHx
+        </a>
+        <div class="flex-grow-1">
+
+<?php
+
+$point = $points[0];
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+
+$fields = [
+    [
+        "Head" => ["Trauma"],
+        "Eyes" => ["Blindness", "Cataracts", "Glaucoma", "Wears glasses/contacts"],
+        "Ears" => ["Hearing aids"],
+        "Nose/Sinuses" => ["Allergic Rhinitis", "Sinus infections"],
+        "Mouth/Throat/Teeth" => ["Dentures"],
+        "Cardiovascular" => ["Aneurysm", "Angina", "DVT", "Dysrhythmia", "HTN", "Murmur", "Myocardial infarction", "Other heart disease"],
+    ],
+    [
+        "Respiratory" => ["Asthma", "Bronchitis", "COPD - Bronchitis/Emphysema", "Pleuritis", "Pneumonia"],
+        "Gastrointestinal" => ["Cirrhosis", "GERD", "Gallbladder disease", "Heartburn", "Hemorrhoids", "Hepatitis", "Hiatal hernia", "Jaundice", "Ulcer"],
+        "Genitourinary" => ["Hernia", "Incontinence", "Nephrolithiasis", "Other kidney disease", "STDs", "UTI(s)"],
+    ],
+    [
+        "Musculoskeletal" => ["Arthritis", "Gout", "M/S injury"],
+        "Skin" => ["Dermatitis", "Mole(s)", "Other skin condition(s)", "Psoriasis"],
+        "Neurological" => ["Epilepsy", "Seizures", "Severe headaches, migraines", "Stroke", "TIA"],
+        "Psychiatric" => ["Bipolar disorder", "Depression", "Hallucinations, delusions", "Suicidal ideation", "Suicide attempts"],
+    ],
+    [
+        "Endocrine" => ["Goiter", "Hyperlipidemia", "Hypothyroidism", "Thyroid disease", "Thyroiditis", "Type I DM", "Type II DM"],
+        "Heme/Onc" => ["Anemia", "Cancer"],
+        "Infectious" => ["HIV", "STDs", "Tuberculosis (dz)", "Tuberculosis (exposure)"],
+    ]
+];
+
+$contentData = [
+    "bloodType" => "",
+    "bloodRH" => "",
+    "common" => [],
+    "customFields" => [],
+    "comments" => "",
+];
+$isempty = false;
+
+$contentData = $parsed = false;
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+}
+
+if ($contentData) {
+
+    $blood = [];
+    if(isset($contentData['bloodType'])) {
+        $blood[] = $contentData['bloodType'];
+    }
+    if(isset($contentData['bloodRH'])) {
+        $blood[] = $contentData['bloodRH'];
+    }
+    $blood = implode(" ", $blood);
+    if(!empty(trim($blood))) { ?>
+        <div class="mb-2">
+            <div>Blood Type &amp; RH: <b><?= $blood ?></b></div>
+        </div>
+    <?php }
+
+    for ($i = 0; $i < count($fields); $i++):
+        foreach($fields[$i] as $head => $values):
+            for($k = 0; $k < count($values); $k++):
+                $fName = $head . '_' . sanitize_field_name($values[$k]);
+                if(@$contentData['common'][$fName]): ?>
+                    <div>
+                        <?= ucwords($head) ?>
+                        <i class="fa fa-arrow-right text-sm text-secondary"></i>
+                        <span class="font-weight-bold"><?= $values[$k] ?></span>
+                        <?php if(@$contentData['common'][$fName . '__comments']): ?>
+                            <span class="text-sm ml-1 text-secondary">(<?= $contentData['common'][$fName . '__comments'] ?>)</span>
+                        <?php endif; ?>
+                    </div>
+                <?php
+                endif;
+            endfor;
+        endforeach;
+    endfor;
+
+    // custom fields
+
+    if(isset($contentData['customFields']) && count($contentData['customFields'])):
+        ?> <div class=""> <?php
+        for ($i = 0; $i < count($contentData['customFields']); $i++):
+            $item = $contentData['customFields'][$i];
+            if($item['value']): ?>
+                <div>
+                    Custom
+                    <i class="fa fa-arrow-right text-sm text-secondary"></i>
+                    <span class="font-weight-bold"><?= $item['label'] ?></span>
+                    <?php if($item['comments']): ?>
+                        <span class="text-sm ml-1 text-secondary">(<?= $item['comments'] ?>)</span>
+                    <?php endif; ?>
+                </div>
+            <?php
+            endif;
+        endfor;
+        ?> </div> <?php
+    endif;
+
+    if(isset($contentData['comments']) && !empty(trim($contentData['comments']))) { ?>
+        <div class="mt-2 mb-1">
+            <b>Comments: </b><?= $contentData['comments'] ?>
+        </div>
+    <?php }
+
+} else {
+    echo '<div class="text-secondary">-</div>';
+}
+?>
+
+        </div>
+    </div>
+
+@endif

+ 58 - 0
resources/views/app/patient/module-specific-summary-renderers/problem/subjective.blade.php

@@ -0,0 +1,58 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px "
+           open-in-stag-popup
+           href="/problems-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="problems-center-{{$note->id}}"
+           title="Problems Center"
+           popup-style="overflow-visible">
+            Problems
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? ' text-info':'' }}">
+                        @if($rel)
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class=" <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            <?= !!@($point->data->name) ? @($point->data->name) : '-' ?>
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="d-flex align-items-baseline pl-2">
+                            <?php $review = $point->childReviewAddedInNote($note); ?>
+                            <?php if(!!$review): ?>
+                            <span class="pr-2">{!! $review->data->value !!}</span>
+                            <?php endif; ?>
+                            <span>
+                                <?php if ($point->is_removed): ?>
+                                @if($point->removal_reason_category === 'DURING_VISIT')
+                                    <span class="text-sm text-secondary">Removed during visit</span>
+                                @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                    <span class="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="text-sm text-success">* Diagnosed during visit</span>
+                                <?php else: ?>
+                                <span class="text-sm text-info">* Diagnosed on intake</span>
+                                <?php endif;?>
+                                <?php endif; ?>
+                            </span>
+                        </div>
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

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

@@ -59,12 +59,12 @@ $isOmegaSystemSegment = (strpos($iName, 'omega_') === 0 && substr($iName, -7) ==
         {{-- if segment has log feature, link --}}
         @if($pro->pro_type === 'ADMIN' && file_exists(resource_path("views/app/patient/segment-templates/{$segment->segmentTemplate->internal_name}/log.blade.php")))
             <a native="" target="_blank"
-               class="c-pointer ml-3 text-decoration-none"
+               class="c-pointer ml-2 text-decoration-none"
                open-in-stag-popup=""
                title="{{$segment->display_title}} - Change Log"
                popup-style="medium"
                href="/note-segment-view/{{$patient->uid}}/{{$note->uid}}/{{$segment->uid}}/<?= $segment->segmentTemplate->internal_name ?>/log">
-               <i class="fas fa-history font-size-16"></i>
+               <i class="fas fa-history"></i>
             </a>
         @endif
 

+ 2 - 2
resources/views/app/patient/note/segment_script.blade.php

@@ -365,8 +365,8 @@
                 debouncedSaver(this);
             });
 
-            $(document).off('save-trigger.auto-save-input', '.visit-segment.edit[data-segment-template-name] [visit-moe][no-auto-save] form input[type="hidden"]');
-            $(document).on('save-trigger.auto-save-input', '.visit-segment.edit[data-segment-template-name] [visit-moe][no-auto-save] form input[type="hidden"]', function () {
+            $(document).off('save-trigger.auto-save-input', '[visit-moe] form input[type="hidden"]');
+            $(document).on('save-trigger.auto-save-input', '[visit-moe] form input[type="hidden"]', function () {
                 debouncedSaver(this);
             });
         }

+ 2 - 2
resources/views/app/patient/segment-templates/_custom_items/script.blade.php

@@ -43,7 +43,7 @@ saveCustomItem: function(_label) {
                 uid: _data.data
             });
             Vue.nextTick(() => {
-                $('[data-segment-template-name="<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?>"]').find('[moe][initialized]').removeAttr('initialized');
+                $('[data-segment-template-name="<?= !!@$segment && @$segment->segmentTemplate && @$segment->segmentTemplate->internal_name ? $segment->segmentTemplate->internal_name : $segmentInternalName ?>"]').find('[moe][initialized]').removeAttr('initialized');
                 initMoes();
             });
         }
@@ -65,7 +65,7 @@ removeCustomItem: function(_item, _index) {
         if(!hasResponseError(_data)) {
             this.customFields.splice(_index, 1);
             Vue.nextTick(() => {
-                $('[data-segment-template-name="<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?>"]').find('textarea').first().trigger('input')
+                $('[data-segment-template-name="<?= !!@$segment && @$segment->segmentTemplate && @$segment->segmentTemplate->internal_name ? $segment->segmentTemplate->internal_name : $segmentInternalName ?>"]').find('textarea').first().trigger('input')
             });
         }
     });

+ 6 - 3
resources/views/app/patient/segment-templates/history_family/edit.blade.php

@@ -337,7 +337,7 @@ if(!$contentData) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
+        function init() {
 
             new Vue({
                 el: '#edit-univ_history_family-container',
@@ -350,7 +350,7 @@ if(!$contentData) {
                     $data: {
                         handler: function(val, oldVal) {
                             let parent = $('#edit-univ_history_family-container').closest('form');
-                            parent.find('[name="data"]').val(JSON.stringify(this.$data));
+                            parent.find('[name="data"]').val(JSON.stringify(this.$data)).trigger('save-trigger');
                         },
                         deep: true
                     }
@@ -420,7 +420,10 @@ if(!$contentData) {
                 }
             });
 
-        };
+        }
+
+        window.segmentInitializers.history_family = init;
+        addMCInitializer('edit-univ_history_family-container-{{$note->id}}', init, '#edit-univ_history_family-container');
 
     }).call(window);
 </script>

+ 6 - 3
resources/views/app/patient/segment-templates/history_social/edit.blade.php

@@ -156,7 +156,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
+        function init() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';
@@ -223,7 +223,7 @@ for ($i = 0; $i < count($fields); $i++) {
                     $data: {
                         handler: function(val, oldVal) {
                             let parent = $('#edit-univ_history_social-container').closest('form');
-                            parent.find('[name="data"]').val(JSON.stringify(this.$data));
+                            parent.find('[name="data"]').val(JSON.stringify(this.$data)).trigger('save-trigger');
                         },
                         deep: true
                     }
@@ -233,7 +233,10 @@ for ($i = 0; $i < count($fields); $i++) {
                 }
             });
 
-        };
+        }
+
+        window.segmentInitializers.history_social = init;
+        addMCInitializer('edit-univ_history_social-container-{{$note->id}}', init, '#edit-univ_history_social-container');
 
     }).call(window);
 </script>

+ 6 - 3
resources/views/app/patient/segment-templates/history_surgical/edit.blade.php

@@ -157,7 +157,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
+        function init() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';
@@ -224,7 +224,7 @@ for ($i = 0; $i < count($fields); $i++) {
                     $data: {
                         handler: function(val, oldVal) {
                             let parent = $('#edit-univ_history_surgical-container').closest('form');
-                            parent.find('[name="data"]').val(JSON.stringify(this.$data));
+                            parent.find('[name="data"]').val(JSON.stringify(this.$data)).trigger('save-trigger');
                         },
                         deep: true
                     }
@@ -234,7 +234,10 @@ for ($i = 0; $i < count($fields); $i++) {
                 }
             });
 
-        };
+        }
+
+        window.segmentInitializers.history_surgical = init;
+        addMCInitializer('edit-univ_history_surgical-container-{{$note->id}}', init, '#edit-univ_history_surgical-container');
 
     }).call(window);
 </script>

+ 118 - 2
resources/views/app/patient/segment-templates/omega_subjective_system/summary.blade.php

@@ -5,7 +5,123 @@ use App\Models\Point;
 /** @var \App\Models\Client $patient */
 /** @var \App\Models\Note $note */
 
-$points = Point::getIntakePointsWithChildReview($patient, $note);
+$wizardLinks = [
+    [
+        "name" => 'Allergies',
+        "href" => "/allergies-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "allergies-center-{$note->id}"
+    ],
+    [
+        "name" => 'Medications',
+        "href" => "/medications-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "medications-center-{$note->id}"
+    ],
+    [
+        "name" => 'Problems',
+        "href" => "/problems-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "problems-center-{$note->id}"
+    ],
+    [
+        "name" => 'Goals',
+        "href" => "/goals-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "goals-center-{$note->id}"
+    ],
+    [
+        "name" => 'Care Team',
+        "href" => "/careteam-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "careteam-center-{$note->id}"
+    ],
+    [
+        "name" => 'PMHx',
+        "title" => 'Past Medical History',
+        "href" => "/note-segment-view-by-name/{$note->uid}/past_medical_history/edit",
+        "initer" => "edit-univ_history_past_medical-container-{$note->id}"
+    ],
+    [
+        "name" => 'FHx',
+        "title" => 'Family History',
+        "href" => "/note-segment-view-by-name/{$note->uid}/history_family/edit",
+        "initer" => "edit-univ_history_family-container-{$note->id}"
+    ],
+    [
+        "name" => 'Soc Hx',
+        "title" => 'Social History',
+        "href" => "/note-segment-view-by-name/{$note->uid}/history_social/edit",
+        "initer" => "edit-univ_history_social-container-{$note->id}"
+    ],
+    [
+        "name" => 'Surg Hx',
+        "title" => 'Surgical History',
+        "href" => "/note-segment-view-by-name/{$note->uid}/history_surgical/edit",
+        "initer" => "edit-univ_history_surgical-container-{$note->id}"
+    ],
+];
+
+?>
+
+<div class="mb-2">
+    @foreach($wizardLinks as $link)
+        @if(@$link['name'])
+            <a href="{{$link['href']}}"
+               open-in-stag-popup
+               popup-style="overflow-visible {{@$link['style']}}"
+               title="{!! @$link['title'] ?: $link['name'] !!}"
+               mc-initer="{{ @$link['initer']  }}"
+               class="mr-2 d-inline-block text-nowrap">{!! $link['name'] !!}</a>
+        @endif
+    @endforeach
+</div>
+
+<?php
+
+$inPoints = Point::getIntakePointsWithChildReview($patient, $note);
+
+// allergies/meds/problems/goals/careteam
+$topLevelPointToRendererMap = [
+    'ALLERGY' => 'allergy',
+    'MEDICATION' => 'medication',
+    'PROBLEM' => 'problem',
+    'GOAL' => 'goal',
+    'CARE_TEAM_MEMBER' => 'care_team_member'
+];
+
+$pointMap = [];
+
+foreach($inPoints as $point){
+    if(!isset($topLevelPointToRendererMap[$point->category])) continue;
+    $renderer = $topLevelPointToRendererMap[$point->category];
+    if(!isset($pointMap[$renderer])) $pointMap[$renderer] = [];
+    $pointMap[$renderer][] = $point;
+}
+
+foreach ($pointMap as $renderer => $points) {
+?>
+@include('app.patient.module-specific-summary-renderers.' . $renderer . '.subjective', compact('points'))
+<?php
+}
+
+// history, ros
+$topLevelPointToRendererMap = [
+    'PAST_MEDICAL_HISTORY' => 'past_medical_history',
+    'FAMILY_HISTORY' => 'history_family',
+    'SOCIAL_HISTORY' => 'history_social',
+    'SURGICAL_HISTORY' => 'history_surgical',
+];
+
+$pointMap = [];
+
+foreach($inPoints as $point){
+    if(!isset($topLevelPointToRendererMap[$point->category])) continue;
+    $renderer = $topLevelPointToRendererMap[$point->category];
+    if(!isset($pointMap[$renderer])) $pointMap[$renderer] = [];
+    $pointMap[$renderer][] = $point;
+}
+
+foreach ($pointMap as $renderer => $points) {
+?>
+@include('app.patient.module-specific-summary-renderers.' . $renderer . '.subjective', compact('points'))
+<?php
+}
 
 $topLevelPointToRendererMap = [
     'HIGH_SUGAR_BEVERAGES' => 'nutrition',
@@ -36,7 +152,7 @@ $topLevelPointToRendererMap = [
 
 $pointMap = [];
 
-foreach($points as $point){
+foreach($inPoints as $point){
     if(!isset($topLevelPointToRendererMap[$point->category])) continue;
     $renderer = $topLevelPointToRendererMap[$point->category];
     if(!isset($pointMap[$renderer])) $pointMap[$renderer] = [];

+ 7 - 4
resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php

@@ -196,7 +196,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
+        function init() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';
@@ -263,7 +263,7 @@ for ($i = 0; $i < count($fields); $i++) {
                     $data: {
                         handler: function(val, oldVal) {
                             let parent = $('#edit-univ_history_past_medical-container').closest('form');
-                            parent.find('[name="data"]').val(JSON.stringify(this.$data));
+                            parent.find('[name="data"]').val(JSON.stringify(this.$data)).trigger('save-trigger');
                         },
                         deep: true
                     }
@@ -273,9 +273,12 @@ for ($i = 0; $i < count($fields); $i++) {
                 }
             });
 
-            window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {};
+            window.segmentInitializers.past_medical_history = function() {};
 
-        };
+        }
+
+        window.segmentInitializers.past_medical_history = init;
+        addMCInitializer('edit-univ_history_past_medical-container-{{$note->id}}', init, '#edit-univ_history_past_medical-container');
 
     }).call(window);
 </script>

+ 3 - 0
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -327,6 +327,7 @@ parentSegment.find('#frm-add-{{$label}}')
                 $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
+                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
                 if(typeof refreshRHSSidebar !== 'undefined') refreshRHSSidebar();
 
@@ -457,6 +458,7 @@ parentSegment.find('.frm-edit-{{$label}}')
                 $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
+                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
                 if(typeof refreshRHSSidebar !== 'undefined') refreshRHSSidebar();
             }
@@ -479,6 +481,7 @@ parentSegment.find('.frm-upsert-review-plan-{{$label}}')
                 $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
+                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
                 refreshDynamicStagPopup();
             }