Explorar o código

ROS change log

Vijayakrishnan %!s(int64=3) %!d(string=hai) anos
pai
achega
78458fe6f7
Modificáronse 1 ficheiros con 261 adicións e 0 borrados
  1. 261 0
      resources/views/app/patient/segment-templates/ros/log.blade.php

+ 261 - 0
resources/views/app/patient/segment-templates/ros/log.blade.php

@@ -0,0 +1,261 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+
+$fields = [
+    [
+        "Constitutional" => [
+            "Fatigue",
+            "Fever",
+            "Weight gain",
+            "Weight loss"],
+
+        "Eyes" => [
+            "Blurry vision",
+            "Double vision",
+            "Dry eyes",
+            "Floaters",
+            "Halos",
+            "Headache",
+            "Irritation",
+            "Loss of peripheral vision",
+            "Pain",
+            "Pinpoint pupils",
+            "Teary",
+            "Visual changes"],
+
+        "ENMT" => [
+            "Altered sense of smell",
+            "Dental caries",
+            "Dentures",
+            "Dizziness",
+            "Dry mouth",
+            "Ear pain/pressure",
+            "Hearing loss",
+            "Mouth pain",
+            "Nasal congestion",
+            "Neck pain/stiffness",
+            "Post nasal drainage",
+            "Sinus pain / pressure",
+            "Sore throat",
+            "Teeth missing",
+            "Tinnitus",
+            "Trouble swallowing"],
+        "Allergy / Immune" => [
+            "Congestion",
+            "Difficulty healing",
+            "Frequent infections",
+            "Headache",
+            "Hives",
+            "Itching",
+            "Running nose",
+            "Sneezing",
+            "Watery eyes"]
+    ],
+    [
+        "Cardiovascular" => [
+            "Chest pain / pressure at rest",
+            "Chest pain / pressure with excursion",
+            "Cold hands / feet",
+            "Dizziness",
+            "Exercise intolerance",
+            "Fainting",
+            "Feeling faint",
+            "Left arm pain",
+            "Light headed",
+            "Lower leg cramps",
+            "Muscle weakness",
+            "Palpitations",
+            "Shortness of breath",
+            "Sweating",
+            "Swelling"],
+
+        "Respiratory" => [
+            "Cough – dry",
+            "Cough – wet",
+            "Coughing up blood",
+            "Pain with breathing",
+            "Productive cough",
+            "Shortness of breath at rest",
+            "Shortness of breath on excursion",
+            "Wheezing"],
+
+        "Gastrointestinal" => [
+            "Abdominal pain",
+            "Constipation",
+            "Coughing up blood",
+            "Diarrhea",
+            "Difficulty swallowing",
+            "Fecal incontinence",
+            "Heartburn",
+            "Loose stool",
+            "Nausea",
+            "Painful swallowing",
+            "Rectal pain",
+            "Stool – black tarry",
+            "Stool – bloody"],
+    ],
+    [
+        "Genitourinary" => [
+            "Blood in urine",
+            "Discharge",
+            "Foley",
+            "Incontinence",
+            "Lesions",
+            "Sexual dysfunction",
+            "Tenderness",
+            "Urinary retention",
+            "Urination - frequent",
+            "Urination - painful",
+            "Urination wakes you up at night"],
+
+        "Musculoskeletal" => [
+            "Decreased range of motion",
+            "Fracture",
+            "Gait - unstable",
+            "Joint instability",
+            "Joint pain",
+            "Joint stiffness",
+            "Joint swelling",
+            "Muscle pain",
+            "Muscle weakness",
+            "Sprain"],
+
+        "Skin" => [
+            "Bruises",
+            "Color changes",
+            "Dry skin",
+            "Goosebumps",
+            "Itchy",
+            "IVDU marks",
+            "Lesions",
+            "Nodules",
+            "Rash",
+            "Scars",
+            "Swelling",
+            "Track marks",
+            "Ulcer",
+            "Wound"],
+
+    ],
+    [
+        "Neurological" => [
+            "Coordination problem",
+            "Dizziness",
+            "Double vision",
+            "Fainting",
+            "Head trauma",
+            "Headache",
+            "Imbalance",
+            "Muscle twitching",
+            "Numbness",
+            "Problems walking",
+            "Restlessness",
+            "Seizures",
+            "Speech disturbance",
+            "TBI",
+            "Tingling",
+            "Tinnitus",
+            "Tremor",
+            "Vertigo",
+            "Weakness"],
+
+        "Endocrine" => [
+            "Change in hair growth",
+            "Cold intolerance",
+            "Diabetes",
+            "Excessive hunger",
+            "Excessive thirst",
+            "Excessive urination",
+            "Exhausted",
+            "Goiter",
+            "Heat intolerance",
+            "Hot and cold flashes",
+            "Sleeplessness",
+            "Weight gain",
+            "Weight loss"],
+
+        "Lymphatic" => [
+            "Anemia",
+            "Bleeding tendency",
+            "Bruises",
+            "Lymph node pain enlargement",
+            "Pain",
+            "Swelling",
+            "Transfusions"],
+    ]
+];
+
+$point = Point::getOnlyTopLevelPointOfCategory($note, 'ROS', 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
+
+            if(!!@$contentData['declaration']) {
+                echo '<div class="mb-2">';
+                echo '<i class="fa fa-check"></i>&nbsp;';
+                echo "Except for the systems documented in the HPI or detailed below, all other systems were reviewed and negative.";
+                echo '</div>';
+            }
+
+            // group by "head" and separate fields with values
+            $grouped = [];
+            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]) {
+                            if(!isset($grouped[$head])) $grouped[$head] = [];
+                            $grouped[$head][] = [
+                                "label" => $values[$k],
+                                "value" => @$contentData['common'][$fName],
+                                "comments" => @$contentData['common'][$fName . '__comments']
+                            ];
+                        }
+                    }
+                }
+            }
+
+            $display = [];
+            foreach($grouped as $head => $items) {
+                $combined = [];
+                for ($i = 0; $i < count($items); $i++) {
+                    $combined[] = $items[$i]['label'] . ' (' . $items[$i]['value'] . ')' .
+                        (@$items[$i]['comments'] ? '<span class="text-secondary font-italic text-sm">&nbsp;' . @$items[$i]['comments'] . '</span>' : '');
+                }
+                $display[$head] = implode(' • ', $combined);
+            }
+
+            foreach($display as $head => $line) {
+            ?>
+            <div class="mb-2">
+                <span class="font-weight-bold mr-1">{{$head}}:</span>
+                <span class="">{!! $line !!}</span>
+            </div>
+            <?php
+            }
+            if(isset($contentData['comments']) && !empty(trim($contentData['comments']))) {
+            ?>
+                <div class="mt-2 mb-1">
+                    <b>Comments: </b><?= $contentData['comments'] ?>
+                </div>
+            <?php
+            }
+        }
+    }
+    ?> </div> <?php
+}