Forráskód Böngészése

Notes resolution center updates

Vijayakrishnan 3 éve
szülő
commit
15374437a5

+ 14 - 0
resources/views/app/patient/note/note-segment-list-resolve.blade.php

@@ -0,0 +1,14 @@
+<div class="segments-list d-flex align-items-stretch" id="note-segments-list">
+
+	@if(count($note->segmentsLeft))
+		<div class="flex-grow-1">
+			@include('app.patient.note.note-segment-list-single-col', ['segments' => $note->segmentsLeft])
+		</div>
+	@endif
+	@if(count($note->segmentsRight))
+		<div class="min-width-50 width-50 border-left">
+			@include('app.patient.note.note-segment-list-single-col', ['segments' => $note->segmentsRight])
+		</div>
+	@endif
+</div>
+

+ 33 - 0
resources/views/app/patient/note/note-segment-list-single-col.blade.php

@@ -0,0 +1,33 @@
+<?php
+$previousHeading = null;
+$previousSubHeading = null;
+?>
+@foreach($segments as $segment)
+    @if($segment->segmentTemplate->internal_name !== 'medrisk_vigilence')
+        <?php
+        if ($segment->heading !== $previousHeading) {
+        if (!empty($previousHeading)) {
+            echo '</div></div>'; // <!-- end the previous parent section -->
+        }
+        if (!empty($segment->heading)) {
+
+        ?>
+        <div class="note-content-node note-content-heading">
+            <div class="py-2 px-3 border-bottom font-size-16 font-weight-bold bg-light text-secondary {{ $previousHeading ? 'mt-4 border-top' : '' }}">
+                {{ $segment->heading }}
+            </div>
+            <div class="note-content-children ml-5 border-left">
+                <!-- open new node -->
+        <?php
+        }
+        $previousHeading = $segment->heading;
+        }
+        ?>
+        @include('app.patient.note.segment-resolve')
+    @endif
+@endforeach
+<?php
+if (!empty($previousHeading)) {
+    echo '</div></div>'; // <!-- close any open parent section -->
+}
+?>

+ 118 - 30
resources/views/app/patient/note/resolve.blade.php

@@ -18,25 +18,25 @@
         }
     @endphp
 
-    <div class="popup-content-container">
+    <div class="popup-content-container pt-2" id="note-resolve-{{$note->uid}}">
 
         <div class="d-flex align-items-center mb-2 mx-3">
 
 		<div moe>
-    <a href="" start show class="">Memo to Shawn: </a> <b>{{ @$parsedDetailJson->memo_to_shawn }}</b> &nbsp;
+            <a href="" start show class="">Memo to Shawn: </a> <b>{{ @$parsedDetailJson->memo_to_shawn }}</b> &nbsp;
 
-    <form url="/api/note/upsertDetailJsonKeyVal" class="mcp-theme-1">
-        <input type="hidden" name="uid" value="{{$note->uid}}" class="form-control input-sm" />
-        <input type="hidden" name="key" value="memo_to_shawn" class="form-control input-sm" />
-        <div class="form-group">
-            <textarea name="val" class="form-control" >{{ @$parsedDetailJson->memo_to_shawn }}</textarea>
-        </div>
-        <div class="form-group text-nowrap mb-0">
-            <button class="btn btn-sm btn-primary" submit>Submit</button>
-            <button class="btn btn-sm btn-default border" close>Close</button>
+            <form url="/api/note/upsertDetailJsonKeyVal" class="mcp-theme-1">
+                <input type="hidden" name="uid" value="{{$note->uid}}" class="form-control input-sm" />
+                <input type="hidden" name="key" value="memo_to_shawn" class="form-control input-sm" />
+                <div class="form-group">
+                    <textarea name="val" class="form-control" >{{ @$parsedDetailJson->memo_to_shawn }}</textarea>
+                </div>
+                <div class="form-group text-nowrap mb-0">
+                    <button class="btn btn-sm btn-primary" submit>Submit</button>
+                    <button class="btn btn-sm btn-default border" close>Close</button>
+                </div>
+            </form>
         </div>
-    </form>
-</div>
 
             @if(@$parsedDetailJson->farah_decision)
                 <span class="mr-2">Farah:</span>
@@ -126,27 +126,26 @@
             @endif
         </div>
 
-        <div class="mx-3 border pb-3 mb-3 overflow-auto" style="max-height: calc(100vh - 220px);">
-            <div id="note-single-header" class="pb-3 d-flex align-items-start note_template_{{$note->visitTemplate ? $note->visitTemplate->internal_name : ''}}">
+        <div class="mx-3 border mb-3">
+            <div id="note-single-header" class="d-flex align-items-start note_template_{{$note->visitTemplate ? $note->visitTemplate->internal_name : ''}}">
 
-                <div class="p-2">
-                    <div class="mb-2 d-flex align-items-baseline">
-                        <div class="mr-2 font-weight-bold text-secondary">Name:</div>
-                        <div>{{$patient->displayName()}}</div>
+                <div class="p-2 d-flex align-items-baseline border-bottom w-100">
+                    <div class="d-inline-flex mr-4 align-items-baseline">
+                        <div class="font-weight-bold font-size-14">{{$patient->displayName()}}</div>
                     </div>
-                    <div class="mb-2 d-flex align-items-baseline">
-                        <div class="mr-2 font-weight-bold text-secondary">DOB:</div>
+                    <div class="d-inline-flex mr-4 align-items-baseline">
+                        <div class="mr-1 text-secondary">DOB:</div>
                         <div>{{$patient->dob}}</div>
                     </div>
-                    <div class="mb-2 d-flex align-items-baseline">
-                        <div class="mr-2 font-weight-bold text-secondary">Visit Date:</div>
+                    <div class="d-inline-flex mr-4 align-items-baseline">
+                        <div class="mr-1 text-secondary">Visit Date:</div>
                         <div>{{friendly_date($note->effective_dateest)}}</div>
                     </div>
-                    <div class="mb-2 d-flex align-items-baseline">
-                        <div class="mr-2 font-weight-bold text-secondary">Signed By:</div>
+                    <div class="d-inline-flex align-items-baseline">
+                        <div class="mr-1 text-secondary">Signed By:</div>
                         <div class="mr-2">{{$note->hcpPro->displayName()}}</div>
                         <div class="mr-2">on</div>
-                        <div class="mr-2">{{$note->signed_by_hcp_at}}</div>
+                        <div class="mr-2 text-info">{{friendlier_date_time($note->signed_by_hcp_at)}}</div>
                     </div>
                 </div>
 
@@ -154,13 +153,102 @@
 
             <div class="card mb-0 {{ $note->is_cancelled ? 'cancelled-item' : '' }} border-0 rounded-0">
 
-                <div class="card-body p-0">
-                    <div class="note_template_{{$note->visitTemplate ? $note->visitTemplate->internal_name : ''}}">
-                        @include('app.patient.note.note-segment-list-print')
+                <div class="card-body d-flex align-items-start p-0">
+                    <div class="flex-grow-1 overflow-auto" style="max-height: calc(100vh - 260px);">
+                        <div class="note_template_{{$note->visitTemplate ? $note->visitTemplate->internal_name : ''}}">
+                            @include('app.patient.note.note-segment-list-resolve')
+                        </div>
+                    </div>
+                    <div class="overflow-auto min-width-200px width-200px" style="max-height: calc(100vh - 260px);">
+                        @include('app.patient.note.rhs-sidebar')
                     </div>
                 </div>
             </div>
         </div>
     </div>
-
+    <script>
+        (function() {
+            function __initRTEs(_collection) {
+                _collection.each(function() {
+
+                    let noteRTE = $(this);
+
+                    $(this).wrap(
+                        $('<div class="rte-holder"/>')
+                            .attr('data-shortcuts', '')
+                    );
+
+                    // give a unique id to this editor instance
+                    var editorID = Math.ceil(Math.random() * 99999),
+                        fieldName = $(this).attr('data-field-name') ? $(this).attr('data-field-name') : 'free_text';
+
+                    var el = this;
+                    var existingContent = $(el).html();
+                    var quill = new Quill(el, {
+                        theme: 'snow',
+                        modules: {
+                            toolbar: false,
+                            keyboard: {
+                                bindings: {
+                                    'tab': {
+                                        key: 9,
+                                        handler: function(range, context) {
+                                            return true;
+                                        }
+                                    }
+                                }
+                            }
+                        },
+                        /*formats: [
+                            'bold',
+                            'italic',
+                            'link',
+                            'size',
+                            'strike',
+                            'underline',
+                            'blockquote',
+                            'header',
+                            'indent',
+                            'list',
+                            'align',
+                        ]*/
+                    });
+
+                    var toolbar = $(quill.container).prev('.ql-toolbar');
+
+                    quill.root.innerHTML = existingContent;
+
+                    $(quill.container)
+                        .find('.ql-editor[contenteditable]')
+                        .attr('data-field', fieldName)
+                        .attr('data-editor-id', editorID)
+                        .attr('with-shortcuts', 1);
+
+                    $(el).data('quillInstance', quill);
+
+                });
+            }
+            function init() {
+                let parentSegment = $('#note-resolve-{{$note->uid}}');
+                // __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
+
+                parentSegment.find('.btn-apply-override')
+                    .off('click.apply-override')
+                    .on('click.apply-override', function() {
+                        let html = $.trim($(this).closest('.rhs-edit').find('[contenteditable]').first().html());
+                        $.post('/api/segment/proposeSegmentSummarySuggestion', {
+                            uid: $(this).attr('data-segment-uid'),
+                            proposedSuggestedSummaryHtml: html,
+                            autoAccept: 1
+                        }, _data => {
+                            if(!hasResponseError(_data)) {
+                                toastr.success('Updated');
+                                $(this).closest('.overridable').find('.lhs-read').first().html(html);
+                            }
+                        }, 'json');
+                    });
+            }
+            addMCInitializer('note-resolve-{{$note->uid}}', init, '#note-resolve-{{$note->uid}}');
+        }).call(window);
+    </script>
 @endsection

+ 95 - 0
resources/views/app/patient/note/segment-resolve.blade.php

@@ -0,0 +1,95 @@
+<?php $iName = $segment->segmentTemplate->internal_name; ?>
+<?php $isLSSegment = strpos($iName, 'lifestyle_') === 0; ?>
+
+<div class="border-bottom note-section visit-segment {{$note->is_signed_by_hcp ? '' : 'edit-trigger'}} {{strpos($iName, 'lifestyle_') === 0 && $iName !== 'lifestyle_general' ? 'zero-height' : ''}}"
+     data-segment-uid="{{ $segment->uid }}"
+     data-segment-template-uid="{{ $segment->segmentTemplate->uid }}"
+     data-segment-template-name="{{ $segment->segmentTemplate->internal_name }}">
+
+    <div class="d-flex align-items-baseline bg-light text-secondary p-2" style="border-bottom: 1px solid #dee2e6;">
+
+    <!-- title -->
+
+        <span class="font-weight-bold d-flex align-items-center {{$isLSSegment || $iName === 'medrisk_vigilence' ? '' : 'xxxmb-2'}}" style="">
+            <span style="color: black; text-decoration: underline; font-size: 13px;">
+                {{$segment->display_title}}
+            </span>
+        </span>
+
+        @if($isLSSegment)
+            @if($iName === 'lifestyle_general')
+                <a href="#" class="ls-segment-trigger ml-2" data-target="lifestyle_general">General</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_nutrition">Nutrition</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_physical_activity">Physical Act.</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_sleep">Sleep</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_social">Social Relns.</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_substances">Subst. Use</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_stress">Stress</a>
+            @else
+                <span class="text-info ml-auto font-weight-normal">(click to view)</span>
+            @endif
+        @endif
+
+    </div>
+
+    <?php
+    $rhsEdit = (in_array($segment->segmentTemplate->internal_name, [
+            'informed_consent',
+            'omega_informed_consent',
+            'chief_complaint',
+            'omega_cc',
+            'ros',
+            'omega_ros',
+            'subjective_general',
+            'omega_subjective_free_text',
+            'objective_free_text',
+            'omega_objective_free_text',
+            'assessment_free_text',
+            'omega_assessment_free_text',
+            'plan_free_text',
+            'omega_plan_free_text',
+        ]) === TRUE);
+    ?>
+
+    @if(!$isLSSegment)
+        <?php
+            $html = '';
+            $recalculated = ''; // $segment->getRecalculatedHtml($performer, $performer->session_key, true)['summaryHtml'];
+            if($note->is_signed_by_hcp && $segment->accepted_suggestion_summary_html) {
+                $html = $segment->accepted_suggestion_summary_html;
+            }
+            else {
+                $html = $segment->summary_html;
+            }
+        ?>
+        @if(!$rhsEdit)
+            <div class="inset-comment summary-container p-2">
+                {!! $html !!}
+            </div>
+        @else
+            <div class="d-flex align-items-stretch overridable">
+                <div class="min-width-50">
+                    <label class="font-weight-bold text-sm py-1 mb-0 ml-2">Current:</label>
+                    <div class="inset-comment summary-container border-top p-2 lhs-read">
+                        {!! $html !!}
+                    </div>
+                </div>
+                <div class="min-width-50 rhs-edit">
+                    <label class="font-weight-bold text-sm py-1 mb-0 ml-2">Override:</label>
+                    <div contenteditable class="border border-info p-2">{!! trim($recalculated) !!}</div>
+                    <div class="my-1">
+                        <a href="#" class="btn-apply-override" data-segment-uid="{{$segment->uid}}">Apply</a>
+                    </div>
+                </div>
+            </div>
+        @endif
+    @endif
+
+</div>
+

+ 17 - 13
resources/views/app/practice-management/notes-resolution-center.blade.php

@@ -82,17 +82,20 @@
                     <td class="text-nowrap">{{friendly_date($row->effective_dateest)}}</td>
                     <td class="text-nowrap">{{ $row->minutes }}</td>
                     <td class="text-nowrap">
-			<div class="">
-			@if($row->icd1) <div>{{$row->icd1}} {{$row->icd1description}}</div>@endif
-			@if($row->icd2) <div>{{$row->icd2}} {{$row->icd2description}}</div>@endif
-			@if($row->icd3) <div>{{$row->icd3}} {{$row->icd3description}}</div>@endif
-			@if($row->icd4) <div>{{$row->icd4}} {{$row->icd4description}}</div>@endif
-			@if($row->icd_memo) <div>{{$row->icd_memo}}</div>@endif
-			</div>
-		    </td>
+                        <div class="">
+                        @if($row->icd1) <div>{{$row->icd1}} {{$row->icd1description}}</div>@endif
+                        @if($row->icd2) <div>{{$row->icd2}} {{$row->icd2description}}</div>@endif
+                        @if($row->icd3) <div>{{$row->icd3}} {{$row->icd3description}}</div>@endif
+                        @if($row->icd4) <div>{{$row->icd4}} {{$row->icd4description}}</div>@endif
+                        @if($row->icd_memo) <div>{{$row->icd_memo}}</div>@endif
+                        </div>
+                    </td>
                     <td class="text-nowrap">
-                        <a open-in-stag-popup update-parent title="Note: {{$row->client_name}}  -  {{friendly_date($row->effective_dateest)}}" href="/resolve-note/{{$row->client_uid}}/{{$row->uid}}">View</a>&nbsp;
-			<a href="/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on" target="popup" onclick="window.open("/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on",'popup','width=600,height=600,scrollbars=no,resizable=no'); return false;"><i class="fa fa-arrow-right"></i></a>
+                        <a open-in-stag-popup popup-style="medium-large" update-parent
+                           mc-initer="note-resolve-{{$row->uid}}"
+                           title="Note: {{$row->client_name}}  -  {{friendly_date($row->effective_dateest)}}"
+                           href="/resolve-note/{{$row->client_uid}}/{{$row->uid}}">View</a>&nbsp;
+			            <a href="/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on" target="popup" onclick="window.open("/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on",'popup','width=600,height=600,scrollbars=no,resizable=no'); return false;"><i class="fa fa-arrow-right"></i></a>
                     </td>
                     <td class="font-weight-bold text-success">{!! @$parsedDetailJson->farah_decision && @$parsedDetailJson->farah_decision === 'green' ? '<i class="fa fa-check"></i> Yes' : '' !!}</td>
                     <td class="font-weight-bold text-warning-dark">{!! @$parsedDetailJson->farah_decision && @$parsedDetailJson->farah_decision === 'red' ? '<i class="fa fa-exclamation-triangle"></i> Yes' : '' !!}</td>
@@ -102,13 +105,14 @@
                     <td class="font-weight-bold text-success">{{ $row->is_claim_closed }}</td>
                     <td class="font-weight-bold text-success">{!! @$parsedDetailJson->kyle_billed && @$parsedDetailJson->kyle_billed === 'yes' ? '<i class="fa fa-check"></i> Yes' : '' !!}</td>
                     <td class="d-none">
-		
-			<a href="/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on" target="popup" 
+		            {{--
+			<a href="/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on" target="popup"
 				onclick="window.open("/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on",'popup','width=600,height=600,scrollbars=no,resizable=no'); return false;"></a>
 
-                        <a open-in-stag-popup update-parent title="Note: {{$row->client_name}}  -  {{friendly_date($row->effective_dateest)}} - SUGGESTION MODE" 
+                        <a open-in-stag-popup update-parent title="Note: {{$row->client_name}}  -  {{friendly_date($row->effective_dateest)}} - SUGGESTION MODE"
 				href="/patients/view/{{ $row->client_uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">Go to note</a>
                     </td>
+                    --}}
                 </tr>
             @endforeach
             </tbody>