Samson Mutunga 3 jaren geleden
bovenliggende
commit
78620d7542

+ 2 - 1
config/app.php

@@ -262,7 +262,8 @@ return [
         'objective_free_text',
         'plan_free_text',
         'assessment_free_text',
-        'disclaimers'
+        'disclaimers',
+        'masks_and_respirators'
     ],
 
     'note_rhs_segments' => [

+ 157 - 0
resources/views/app/patient/segment-templates/masks_and_respirators/edit.blade.php

@@ -0,0 +1,157 @@
+<?php
+
+use App\Models\Point;
+
+$segmentSections = [
+	[
+		'heading' => 'Key Messages',
+		'points' => [
+			[
+				'key' => 'any_mask_better_than_no_mask',
+				'text' => 'Masking is a critical public health tool for preventing spread of COVID-19, and it is important to remember that any mask is better than no mask.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'masks_effective_at_reducing_virus',
+				'text' => 'Masks and respirators are effective at reducing transmission of SARS-CoV-2, the virus that causes COVID-19, when worn consistently and correctly.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'wear_the_best_mask_you_can',
+				'text' => "The key is: what will you wear that's most protective, but also wear consistently.",
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'more_protective_may_be_uncomfortable',
+				'text' => 'Some masks and respirators offer higher levels of protection than others, and some may be harder to tolerate or wear consistently than others.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'importance_with_risk_and_age',
+				'text' => 'This becomes more important if you are over 65 or have any medical conditions like HBP or DM that increase risk of COVID severity.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'what_are_you_currently_wearing',
+				'text' => 'What are you currently wearing / how often / how often replaced?',
+				'type' => 'textarea'
+			],
+			[
+				'key' => 'what_is_the_best_mask_you_will_wear_consistently',
+				'text' => 'What is the most most protective mask that you will wear consistently?',
+				'type' => 'text'
+			]
+		]
+	],
+	[
+		'heading' => 'Follow-Up',
+		'points' => [
+			[
+				'key' => 'n95_recommended',
+				'text' => 'N95 recommended.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'ensure_tight_fit',
+				'text' => 'Check for gaps by cupping your hands around the outside edges of the mask.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'check_airflow',
+				'text' => 'Make sure no air is flowing from the area near your eyes or from the sides of the mask.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'warm_air_check',
+				'text' => 'If the mask has a good fit, you will feel warm air come through the front of the mask and may be able to see the mask material move in and out with each breath.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'send_n95',
+				'text' => 'Send N95 samples if appropriate.',
+				'type' => 'readonly'
+			]
+		]
+	]
+];
+
+$category = 'MASKS_AND_RESPIRATORS';
+$endPoint = 'upsertNoteSingleton';
+
+$point = Point::where('added_in_segment_id', $segment->id)->where('category', $category)->orderBy('id', 'DESC')->first();
+
+$contentData = [];
+
+foreach($segmentSections as $segmentSection){
+	foreach($segmentSection['points'] as $sectionPoint){
+		if($sectionPoint['type'] == 'text'){
+			$contentData[$sectionPoint['key']] = '';
+		}elseif($sectionPoint['type'] == 'textarea'){
+			$contentData[$sectionPoint['key']] = '';
+		}elseif($sectionPoint['type'] == 'checkbox'){
+			$contentData[$sectionPoint['key']] = null;
+		}else{
+			$contentData[$sectionPoint['key']] = '';
+		}
+	}
+}
+
+
+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="uid" value="<?= @$point->uid ?>">
+		<input type="hidden" name="noteUid" value="<?= @$note->uid ?>">
+		<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($segmentSections as $section)
+		<div class="mb-2">
+			<h6><b><u>{{ $section['heading'] }}</u></b></h6>
+			@foreach($section['points'] as $point)
+			@if($point['type'] == 'text')
+			<div class="mb-2">
+				<label>{{ $point['text'] }}</label>
+				<input name="{{ $point['key'] }}" data-name="{{ $point['key'] }}" class="form-control" value="{{ @$contentData[$point['key']] }}" />
+			</div>
+			@elseif($point['type'] == 'textarea')
+			<div class="mb-2">
+				<label>{{ $point['text'] }}</label>
+				<textarea name="{{ $point['key'] }}" data-name="{{ $point['key'] }}" rows="2" class="form-control"><?= nl2br(@$contentData[$point['key']]) ?></textarea>
+			</div>
+			@elseif($point['type'] == 'checkbox')
+			<div class="">
+				<label class="d-flex align-items-baseline mb-2">
+					<div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+						<input type="checkbox" name="{{ $point['key'] }}" data-name="{{ $point['key'] }}" {{@($contentData[$point['key']] ? 'checked' : '')}}>
+					</div>
+					<span>{{ $point['text'] }}</span>
+				</label>
+			</div>
+			@else
+			<div class="mb-2">
+				<label><b>*</b> {{ $point['text'] }}</label>
+			</div>
+			@endif
+			@endforeach
+		</div>
+		<hr class="my-3">
+		@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>

+ 150 - 0
resources/views/app/patient/segment-templates/masks_and_respirators/summary.blade.php

@@ -0,0 +1,150 @@
+<?php
+
+use App\Models\Point;
+$segmentSections = [
+	[
+		'heading' => 'Key Messages',
+		'points' => [
+			[
+				'key' => 'any_mask_better_than_no_mask',
+				'text' => 'Masking is a critical public health tool for preventing spread of COVID-19, and it is important to remember that any mask is better than no mask.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'masks_effective_at_reducing_virus',
+				'text' => 'Masks and respirators are effective at reducing transmission of SARS-CoV-2, the virus that causes COVID-19, when worn consistently and correctly.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'wear_the_best_mask_you_can',
+				'text' => "The key is: what will you wear that's most protective, but also wear consistently.",
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'more_protective_may_be_uncomfortable',
+				'text' => 'Some masks and respirators offer higher levels of protection than others, and some may be harder to tolerate or wear consistently than others.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'importance_with_risk_and_age',
+				'text' => 'This becomes more important if you are over 65 or have any medical conditions like HBP or DM that increase risk of COVID severity.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'what_are_you_currently_wearing',
+				'text' => 'What are you currently wearing / how often / how often replaced?',
+				'type' => 'textarea'
+			],
+			[
+				'key' => 'what_is_the_best_mask_you_will_wear_consistently',
+				'text' => 'What is the most most protective mask that you will wear consistently?',
+				'type' => 'text'
+			]
+		]
+	],
+	[
+		'heading' => 'Follow-Up',
+		'points' => [
+			[
+				'key' => 'n95_recommended',
+				'text' => 'N95 recommended.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'ensure_tight_fit',
+				'text' => 'Check for gaps by cupping your hands around the outside edges of the mask.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'check_airflow',
+				'text' => 'Make sure no air is flowing from the area near your eyes or from the sides of the mask.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'warm_air_check',
+				'text' => 'If the mask has a good fit, you will feel warm air come through the front of the mask and may be able to see the mask material move in and out with each breath.',
+				'type' => 'checkbox'
+			],
+			[
+				'key' => 'send_n95',
+				'text' => 'Send N95 samples if appropriate.',
+				'type' => 'readonly'
+			]
+		]
+	]
+];
+
+$category = 'MASKS_AND_RESPIRATORS';
+$endPoint = 'upsertNoteSingleton';
+
+$point = Point::where('added_in_segment_id', $segment->id)->where('category', $category)->orderBy('id', 'DESC')->first();
+
+
+$contentData = [];
+
+foreach($segmentSections as $segmentSection){
+	foreach($segmentSection['points'] as $sectionPoint){
+		if($sectionPoint['type'] == 'text'){
+			$contentData[$sectionPoint['key']] = '';
+		}elseif($sectionPoint['type'] == 'textarea'){
+			$contentData[$sectionPoint['key']] = '';
+		}elseif($sectionPoint['type'] == 'checkbox'){
+			$contentData[$sectionPoint['key']] = null;
+		}else{
+			$contentData[$sectionPoint['key']] = '';
+		}
+	}
+}
+
+
+if (!!@$point->data) {
+    $contentData = json_decode($point->data, true);
+}
+?>
+
+
+<div class="events-none form-read-mode">
+    <div class="">
+        <label><b>{{ $patient->displayName() }}</b> is a <b>{{$patient->age_in_years }} y.o.</b>
+            @if($patient->sex == 'M')
+            <b>M</b>
+            @elseif($patient->sex == 'F')
+            <b>F</b>
+            @endif
+            presenting for follow-up regarding CDC COVID-19 guidelines & ongoing medical care.</label>
+    </div>
+    <hr class="my-2">
+    @foreach($segmentSections as $section)
+    <div class="mb-2">
+        <h6><b>{{ $section['heading'] }}</b></h6>
+        <ul>
+            @foreach($section['points'] as $point)
+            @if($point['type'] == 'text')
+            @if(@$contentData[$point['key']])
+            <li>{{ $point['text'] }}</li>
+            @endif
+
+            @elseif($point['type'] == 'textarea')
+            @if(@$contentData[$point['key']])
+            <li>
+                <label>{{ $point['text'] }}:</label>
+                <span><?= nl2br($contentData[$point['key']]) ?></span>
+            </li>
+            @endif
+            @elseif($point['type'] == 'checkbox')
+            @if(@$contentData[$point['key']])
+            <li>{{ $point['text'] }}</li>
+            @endif
+            @else
+            <div class="mb-2">
+                <li>{{ $point['text'] }}</li>
+            </div>
+            @endif
+            @endforeach
+        </ul>
+    </div>
+    <hr class="my-3">
+    @endforeach
+
+
+</div>