Ver código fonte

SHx & SocHx change log

Vijayakrishnan 3 anos atrás
pai
commit
e760981fb3

+ 47 - 0
resources/views/app/patient/segment-templates/history_screenings/log.blade.php

@@ -0,0 +1,47 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+
+$point = Point::getOnlyTopLevelPointOfCategory($note, 'SCREENINGS_HISTORY', true);
+
+if($point) {
+    ?> <div class="popup-content-container px-3"> <?php
+    foreach ($point->childReviews as $childReview) {
+        $contentData = $parsed = false;
+        if ($childReview->data) {
+            $childReview->data = json_decode($childReview->data, true);
+            $contentData = $parsed = $childReview->data;
+
+            if($contentData && $contentData['count']) {
+                ?>
+                    <div class="mb-1 font-weight-bold">{{$childReview->creatorPro->displayName()}} - {{friendly_date($childReview->note->effective_dateest)}}</div>
+                    <div class="pl-3 bg-light border p-3 mb-3">
+                    <table class="table table-bordered table-sm mb-0 table-cage">
+                        <?php
+                        for ($i = 0; $i < $contentData['count']; $i++) {
+                        ?>
+                        <tr>
+                            <td class="width-300px">
+                                <?= isset($contentData['items'][$i]['screening']) ? $contentData['items'][$i]['screening'] : '--' ?>
+                            </td>
+                            <td class="width-300px pl-3">
+                                <?php if(isset($contentData['items'][$i]['comments']) && !empty($contentData['items'][$i]['comments'])): ?>
+                                <span class="ml-1 text-secondary">(<?= $contentData['items'][$i]['comments'] ?>)</span>
+                                <?php endif; ?>
+                            </td>
+                            <td></td>
+                        </tr>
+                        <?php
+                        }
+                        ?>
+                    </table>
+                <?php
+            }
+        }
+    }
+    ?> </div> <?php
+}

+ 89 - 0
resources/views/app/patient/segment-templates/history_social/log.blade.php

@@ -0,0 +1,89 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+
+$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"],
+    ]
+];
+
+$point = Point::getOnlyTopLevelPointOfCategory($note, 'SOCIAL_HISTORY', true);
+
+if($point) {
+    ?> <div class="popup-content-container px-3"> <?php
+    foreach ($point->childReviews as $childReview) {
+        $contentData = $parsed = false;
+        if ($childReview->data) {
+            $childReview->data = json_decode($childReview->data, true);
+            $contentData = $parsed = $childReview->data;
+            ?>
+            <div class="mb-1 font-weight-bold">{{$childReview->creatorPro->displayName()}} - {{friendly_date($childReview->note->effective_dateest)}}</div>
+            <div class="pl-3 bg-light border p-3 mb-3">
+            <?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 }
+        }
+    }
+    ?> </div> <?php
+}

+ 88 - 0
resources/views/app/patient/segment-templates/history_surgical/log.blade.php

@@ -0,0 +1,88 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+
+$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",]
+    ]
+];
+
+
+$point = Point::getOnlyTopLevelPointOfCategory($note, 'SURGICAL_HISTORY', true);
+
+if($point) {
+    ?> <div class="popup-content-container px-3"> <?php
+    foreach ($point->childReviews as $childReview) {
+        $contentData = $parsed = false;
+        if ($childReview->data) {
+            $childReview->data = json_decode($childReview->data, true);
+            $contentData = $parsed = $childReview->data;
+
+            ?>
+            <div class="mb-1 font-weight-bold">{{$childReview->creatorPro->displayName()}} - {{friendly_date($childReview->note->effective_dateest)}}</div>
+            <div class="pl-3 bg-light border p-3 mb-3">
+            <?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>
+                <!--Common
+                <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 }
+        }
+    }
+    ?> </div> <?php
+}