Bläddra i källkod

added how_to_smbp

= 3 år sedan
förälder
incheckning
c868a197f5

+ 2 - 1
config/app.php

@@ -277,7 +277,8 @@ return [
         'exercise',
         'behavior',
         'goals',
-        'care_team'
+        'care_team',
+        'how_to_smbp'
     ]
 
 ];

+ 92 - 0
resources/views/app/patient/segment-templates/how_to_smbp/edit.blade.php

@@ -0,0 +1,92 @@
+<?php
+
+use App\Models\Point;
+
+$category = 'HOW_TO_SMBP';
+$endPoint = 'upsertNoteSingleton';
+
+//$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+$point = Point::where('added_in_segment_id', $segment->id)->where('category', $category)->orderBy('id', 'DESC')->first();
+
+$bp_checkboxes = [
+    [
+        'section' => 'Prepare',
+        'items' => [
+            'Avoid caffeine, cigarettes and other stimulants 30 minutes before you measure your blood pressure.',
+            'Wait at least 30 minutes after a meal.',
+            'If you’re on blood pressure medication, measure your BP before you take your medication.',
+            'Empty your bladder beforehand.',
+            'Find a quiet space where you can sit comfortably without distraction.'
+        ],
+    ],
+    [
+        'section' => 'Position',
+        'items' => [
+            'Put cuff on bare arm, above elbow at mid-arm.',
+            'Position arm so cuff is at heart level.',
+            'Keep arm supported, palm up, with muscles relaxed.',
+            'Sit with legs uncrossed.',
+            'Keep feet flat on the floor.',
+            'Keep your back supported.'
+
+        ]
+    ],
+    [
+        'section' => 'Measure',
+        'items' => [
+            'Rest for five minutes while in position before starting.',
+            'Take two or three measurements, one minute apart.',
+            'Keep your body relaxed and in position during measurements.',
+            'Sit quietly with no distractions during measurements—avoid conversations, TV, phones and other devices.',
+            'Record your measurements when finished.'
+        ]
+    ]
+];
+	
+$contentData = [];
+
+foreach($bp_checkboxes as $x){
+    foreach($x['items'] as $item){
+        $contentData[$item] = null;
+    }
+}
+
+if (!!@$point->data) {
+    $contentData = json_decode($point->data, true);
+}
+
+?>
+
+<div visit-moe close-on-save close-on-cancel class="d-block p-3">
+    <form show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="category" value="<?= $category ?>">
+        <input type="hidden" name="data" value="{{json_encode($contentData)}}">
+
+        @foreach($bp_checkboxes as $cb)
+            <h2>{{$cb['section']}}</h2>
+            @foreach($cb['items'] as $item)
+            <div class="ml-3 mb-1">
+                <label class="mb-1 d-flex align-items-center">
+                    <input type="checkbox" data-name="{{$item}}" {{@($contentData[$item] ? 'checked' : '')}} class="mr-2">
+                    <span class="ml-2">{{$item}}</strong>.</span>
+                </label>
+            </div>
+            @endforeach
+            @if($cb['section'] != 'Measure')
+            <hr class="my-3">
+            @endif
+        @endforeach
+
+        <div class="pt-2">
+            <button submit class="btn btn-sm btn-primary mr-2"><i class="fa fa-save"></i></button>
+            <div class="d-inline-flex align-self-stretch align-items-center">
+                <span class="autosave-indicator saving text-sm text-secondary">Saving changes &hellip;</span>
+                <span class="autosave-indicator saved text-sm text-secondary">
+                    <i class="fa fa-check"></i>
+                    Saved
+                </span>
+            </div>
+        </div>
+    </form>
+</div>

+ 82 - 0
resources/views/app/patient/segment-templates/how_to_smbp/summary.blade.php

@@ -0,0 +1,82 @@
+<?php
+
+use App\Models\Point;
+
+$category = 'HOW_TO_SMBP';
+$endPoint = 'upsertNoteSingleton';
+
+//$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+$point = Point::where('added_in_segment_id', $segment->id)->where('category', $category)->orderBy('id', 'DESC')->first();
+
+
+$bp_checkboxes = [
+    [
+        'section' => 'Prepare',
+        'items' => [
+            'Avoid caffeine, cigarettes and other stimulants 30 minutes before you measure your blood pressure.',
+            'Wait at least 30 minutes after a meal.',
+            'If you’re on blood pressure medication, measure your BP before you take your medication.',
+            'Empty your bladder beforehand.',
+            'Find a quiet space where you can sit comfortably without distraction.'
+        ],
+    ],
+    [
+        'section' => 'Position',
+        'items' => [
+            'Put cuff on bare arm, above elbow at mid-arm.',
+            'Position arm so cuff is at heart level.',
+            'Keep arm supported, palm up, with muscles relaxed.',
+            'Sit with legs uncrossed.',
+            'Keep feet flat on the floor.',
+            'Keep your back supported.'
+
+        ]
+    ],
+    [
+        'section' => 'Measure',
+        'items' => [
+            'Rest for five minutes while in position before starting.',
+            'Take two or three measurements, one minute apart.',
+            'Keep your body relaxed and in position during measurements.',
+            'Sit quietly with no distractions during measurements—avoid conversations, TV, phones and other devices.',
+            'Record your measurements when finished.'
+        ]
+    ]
+];
+	
+$contentData = [];
+
+foreach($bp_checkboxes as $x){
+    foreach($x['items'] as $item){
+        $contentData[$item] = null;
+    }
+}
+
+if (!!@$point->data) {
+    $contentData = json_decode($point->data, true);
+}
+
+?>
+
+<div visit-moe close-on-save close-on-cancel class="d-block">
+    <form show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="category" value="<?= $category ?>">
+        <input type="hidden" name="data" value="{{json_encode($contentData)}}">
+
+        @foreach($bp_checkboxes as $cb)
+            <h2>{{$cb['section']}}</h2>
+            @foreach($cb['items'] as $item)
+            <div class="ml-1 mb-1">
+                <label class="mb-1 d-flex align-items-center">
+                    <input readonly type="checkbox" data-name="{{$item}}" {{@($contentData[$item] ? 'checked' : '')}} class="mr-2">
+                    <span class="ml-2">{{$item}}</strong>.</span>
+                </label>
+            </div>
+            @endforeach
+            @if($cb['section'] != 'Measure')
+            <hr class="my-3">
+            @endif
+        @endforeach
+    </form>
+</div>