Browse Source

Include ROS (link and summary) in subj system

Vijayakrishnan 3 years ago
parent
commit
47d9b73bc2

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

@@ -0,0 +1,286 @@
+<?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}}/omega_ros/edit",
+           mc-initer="init-ros-{{$note->id}}"
+           title="Review Of Systems"
+           popup-style="overflow-visible">
+            ROS
+        </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;
+}
+
+$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"],
+    ]
+];
+
+if ($contentData) {
+
+if(!!@$contentData['declaration']) {
+    echo '<div class="mb-1">';
+    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="">
+    <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">
+        <b>Comments: </b><?= $contentData['comments'] ?>
+    </div>
+@endif
+<?php
+} else {
+    echo '<div class="text-secondary">-</div>';
+}
+
+?>
+
+        </div>
+    </div>
+
+@endif

+ 1 - 1
resources/views/app/patient/segment-templates/omega_ros/edit.blade.php

@@ -405,7 +405,7 @@ for ($i = 0; $i < count($fields); $i++) {
 
         }
 
-        // window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = initROS;
+        window.segmentInitializers.omega_ros = initROS;
 
         addMCInitializer('init-ros-{{$note->id}}', initROS, '#edit-ros-container');
 

+ 7 - 0
resources/views/app/patient/segment-templates/omega_subjective_system/summary.blade.php

@@ -55,6 +55,12 @@ $wizardLinks = [
         "href" => "/note-segment-view-by-name/{$note->uid}/history_surgical/edit",
         "initer" => "edit-univ_history_surgical-container-{$note->id}"
     ],
+    [
+        "name" => 'ROS',
+        "title" => 'Review Of Systems',
+        "href" => "/note-segment-view-by-name/{$note->uid}/omega_ros/edit",
+        "initer" => "init-ros-{$note->id}"
+    ],
 ];
 
 ?>
@@ -107,6 +113,7 @@ $topLevelPointToRendererMap = [
     'FAMILY_HISTORY' => 'history_family',
     'SOCIAL_HISTORY' => 'history_social',
     'SURGICAL_HISTORY' => 'history_surgical',
+    'ROS' => 'ros',
 ];
 
 $pointMap = [];