Эх сурвалжийг харах

Merge branch 'master' of rav.triplestart.com:jmudaka/stagfe2

root 3 жил өмнө
parent
commit
6b3c076e97

+ 2 - 2
app/Http/Controllers/StatTreeController.php

@@ -279,7 +279,7 @@ class StatTreeController extends Controller
             $children = [];
 
             // clause text child
-            /*$children[] = [
+            $children[] = [
                 "text" => $clause->clause_text,
                 "icon" => "fa fa-laptop-code text-primary text-sm",
                 "state" => [
@@ -296,7 +296,7 @@ class StatTreeController extends Controller
                 "data" => [
                     "type" => "clause_text"
                 ]
-            ];*/
+            ];
 
             // clause arg children
             $argsSystem = [];

+ 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' => [

+ 3 - 0
public/css/style.css

@@ -204,6 +204,9 @@ body.stag_rhs_collapsed .app-right-panel {
 .mcp-theme-1 .overflow-overlay-on-hover:hover {
     overflow: overlay;
 }
+.mcp-theme-1 .overflow-x-scroll {
+    overflow-x: scroll !important;
+}
 .mcp-theme-1 .text-secondary-light {
     color: #c9ddef !important;
 }

+ 6 - 0
resources/views/app/patient/segment-templates/history_family/edit.blade.php

@@ -8,6 +8,10 @@ use App\Models\Note;
 
 if(!@$segment) $segment = null;
 
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'FAMILY_HISTORY', $sessionKey, true);
 
 $contentData = $parsed = false;
@@ -59,6 +63,8 @@ if(!$contentData) {
                     {{!$segment ? 'hook=onHxPopupClosure' : ''}}>
             @if(!!@$segment)
                 <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="segmentUid" value="<?= $note->coreSegment->uid ?>">
             @endif
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="noteUid" value="<?= $note->uid ?>">

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

@@ -6,6 +6,13 @@ use App\Models\Note;
 /** @var Client $patient */
 /** @var Note $note */
 
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'FAMILY_HISTORY', $sessionKey, true);
 
 $contentData = $parsed = false;

+ 4 - 0
resources/views/app/patient/segment-templates/history_screenings/edit.blade.php

@@ -6,6 +6,10 @@ use App\Models\Note;
 /** @var Client $patient */
 /** @var Note $note */
 
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'SCREENINGS_HISTORY', $sessionKey, true);
 
 $contentData = $parsed = false;

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

@@ -6,6 +6,13 @@ use App\Models\Note;
 /** @var Client $patient */
 /** @var Note $note */
 
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'SCREENINGS_HISTORY', $sessionKey, true);
 
 $contentData = $parsed = false;

+ 6 - 0
resources/views/app/patient/segment-templates/history_social/edit.blade.php

@@ -9,6 +9,10 @@ use App\Models\Note;
 
 if(!@$segment) $segment = null;
 
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $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 "],
@@ -67,6 +71,8 @@ for ($i = 0; $i < count($fields); $i++) {
                 {{!$segment ? 'hook=onHxPopupClosure' : ''}}>
             @if(!!@$segment)
                 <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="segmentUid" value="<?= $note->coreSegment->uid ?>">
             @endif
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="noteUid" value="<?= $note->uid ?>">

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

@@ -25,6 +25,13 @@ $fields = [
     ]
 ];
 
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'SOCIAL_HISTORY', $sessionKey, true);
 
 $contentData = $parsed = false;

+ 6 - 0
resources/views/app/patient/segment-templates/history_surgical/edit.blade.php

@@ -9,6 +9,10 @@ use App\Models\Note;
 
 if(!@$segment) $segment = null;
 
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $fields = [
     [
         "" => ["Aneurysm repair", "Appendectomy", "Back surgery", "Bariatric surgery/gastric bypass", "Bilateral tubal ligation", "Breast resection/mastectomy", "CABG", "Carotid endarterectomy/stent", "Carpal tunnel release surgery",]
@@ -64,6 +68,8 @@ for ($i = 0; $i < count($fields); $i++) {
                 {{!$segment ? 'hook=onHxPopupClosure' : ''}}>
             @if(!!@$segment)
                 <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="segmentUid" value="<?= $note->coreSegment->uid ?>">
             @endif
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="noteUid" value="<?= $note->uid ?>">

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

@@ -7,6 +7,13 @@ use App\Models\Note;
 /** @var Note $note */
 /** @var Segment $segment */
 
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $fields = [
     [
         "" => ["Aneurysm repair", "Appendectomy", "Back surgery", "Bariatric surgery/gastric bypass", "Bilateral tubal ligation", "Breast resection/mastectomy", "CABG", "Carotid endarterectomy/stent", "Carpal tunnel release surgery",]

+ 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>

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

@@ -0,0 +1,140 @@
+<?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">
+    @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>

+ 6 - 0
resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php

@@ -9,6 +9,10 @@ use App\Models\Note;
 
 if(!@$segment) $segment = null;
 
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $fields = [
     [
         "Head" => ["Trauma"],
@@ -78,6 +82,8 @@ for ($i = 0; $i < count($fields); $i++) {
                 {{!$segment ? 'hook=onHxPopupClosure' : ''}}>
             @if(!!@$segment)
                 <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="segmentUid" value="<?= $note->coreSegment->uid ?>">
             @endif
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="noteUid" value="<?= $note->uid ?>">

+ 8 - 0
resources/views/app/patient/segment-templates/past_medical_history/summary.blade.php

@@ -6,6 +6,10 @@ use App\Models\Note;
 /** @var Client $patient */
 /** @var Note $note */
 
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+
 $fields = [
     [
         "Head" => ["Trauma"],
@@ -42,6 +46,10 @@ $contentData = [
 ];
 $isempty = false;
 
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'PAST_MEDICAL_HISTORY', $sessionKey, true);
 
 $contentData = $parsed = false;

+ 14 - 6
resources/views/app/stat-tree/stat-trees/sub/edit.blade.php

@@ -134,8 +134,8 @@
                                 <a href="#" class="clause-expand-all ml-3" title="Expand All"><i class="fa fa-angle-double-down text-secondary"></i></a>
                                 <a href="#" class="clause-collapse-all ml-2" title="Collapse All"><i class="fa fa-angle-double-up text-secondary"></i></a>
                             </div>
-                            <div class="flex-grow-1 overflow-overlay-on-hover pl-1">
-                                <div class="overflow-auto clauses-view pb-5" id="clauses-view-{{$statTree->id}}"></div>
+                            <div class="flex-grow-1 overflow-auto overflow-x-scroll pl-1">
+                                <div class="clauses-view pb-5" id="clauses-view-{{$statTree->id}}"></div>
                             </div>
                         </div>
 
@@ -301,12 +301,12 @@
                                         @if(!$multiProView)
                                             <div class="stat-tree-view overflow-auto min-height-300px" id="stat-tree-edit-{{$statTree->id}}"></div>
                                         @else
-                                            <div class="d-flex align-items-start">
-                                                <div class="mv-tree overflow-auto">
+                                            <div class="d-flex align-items-start h-100">
+                                                <div class="mv-tree overflow-auto h-100 d-inline-flex flex-column">
                                                     <div class="multi-pro-view-stat-label">Stat</div>
-                                                    <div class="stat-tree-view overflow-auto" id="stat-tree-edit-{{$statTree->id}}"></div>
+                                                    <div class="stat-tree-view overflow-auto overflow-x-scroll flex-grow-1" id="stat-tree-edit-{{$statTree->id}}"></div>
                                                 </div>
-                                                <div class="overflow-auto mv-table">
+                                                <div class="overflow-auto overflow-x-scroll mv-table h-100">
                                                     <table class="table table-sm multi-pro-stats-table w-auto m-0">
                                                         <thead>
                                                         <tr>
@@ -1464,6 +1464,14 @@
                             }, 'json');
                             @endif
 
+                            @if($multiProView)
+                            $('.mv-tree .stat-tree-view')
+                                .off('scroll')
+                                .on('scroll', function() {
+                                     $('.mv-table').scrollTop($(this).scrollTop());
+                                });
+                            @endif
+
                             ClausesTree.load();
                             StatTree.load();
                             initMoes();

+ 1 - 1
resources/views/layouts/confirm-hours-of-availability-notification.blade.php

@@ -38,7 +38,7 @@
 		</div>
 		@else
 		<div>
-			<span>Hours of Availability last confirmed on <b><i class="fas fa-history"></i> {{ friendly_date($pro->hours_of_availability_confirmed_at) }}</b></span>
+			<span>Hours of Availability last confirmed on <b><i class="fas fa-history"></i> {{ friendly_date_time($pro->hours_of_availability_confirmed_at) }}</b></span>
 		</div>
 
 		<div>