Procházet zdrojové kódy

Note print starter

Vijayakrishnan před 3 roky
rodič
revize
ff90e39e6f

+ 4 - 0
app/Http/Controllers/NoteController.php

@@ -90,6 +90,10 @@ class NoteController extends Controller
             compact('patient', 'note', 'section', 'page'));
     }
 
+    public function print(Request $request, Client $patient, Note $note) {
+        return view("app.patient.note.print", compact('patient', 'note'));
+    }
+
     public function getHtmlForSegment($segmentUid, $sessionKey){
 
         $summaryHtml = '';

+ 4 - 4
resources/views/app/patient/note/dashboard.blade.php

@@ -378,12 +378,12 @@
                 </div>
             </div>
 
+            @if($note->is_signed_by_hcp)
             <div class="px-2 border-left screen-only">
-                <a href="#" onclick="window.print(); return false;">
-                    <i class="fa fa-print"></i>
-                    Print
-                </a>
+                <a href="{{route('print-note', ['patient' => $patient, 'note' => $note])}}" native target="_blank" class=""><i class="fa fa-print"></i> Print</a>
             </div>
+            @endif
+
             @if($pro->pro_type === 'ADMIN' || $pro->is_enrolled_as_mcp)
             <div class="px-2 border-left screen-only">
                 <a native target="_blank"

+ 36 - 0
resources/views/app/patient/note/note-segment-list-print.blade.php

@@ -0,0 +1,36 @@
+<div class="segments-list" id="note-segments-list">
+    <?php
+    $previousHeading = null;
+    $previousSubHeading = null;
+    ?>
+    @foreach($note->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-print')
+		@endif
+    @endforeach
+    <?php
+    if (!empty($previousHeading)) {
+        echo '</div></div>'; // <!-- close any open parent section -->
+    }
+    ?>
+</div>
+

+ 45 - 0
resources/views/app/patient/note/print.blade.php

@@ -0,0 +1,45 @@
+<?php
+/** @var App\Models\Note $note */
+/** @var App\Models\Pro $pro */
+/** @var App\Models\Section $section */
+/** @var $allSections */
+?>
+@extends ('layouts.print')
+
+@section('content')
+
+    <div id="note-single-header" class="pb-3 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>
+            <div class="mb-2 d-flex align-items-baseline">
+                <div class="mr-2 font-weight-bold 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>{{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="mr-2">{{$note->hcpPro->displayName()}}</div>
+                <div class="mr-2">on</div>
+                <div class="mr-2">{{$note->signed_by_hcp_at}}</div>
+            </div>
+        </div>
+
+    </div>
+
+    <div class="card mb-0 {{ $note->is_cancelled ? 'cancelled-item' : '' }} border-0 rounded-0">
+
+        <div class="card-body p-0">
+            <div class="note-container note_template_{{$note->visitTemplate ? $note->visitTemplate->internal_name : ''}}">
+                @include('app.patient.note.note-segment-list-print')
+            </div>
+        </div>
+    </div>
+
+@endsection

+ 50 - 0
resources/views/app/patient/note/segment-print.blade.php

@@ -0,0 +1,50 @@
+<?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 if(!$isLSSegment): ?>
+
+    <div class="inset-comment summary-container {{$iName === 'medrisk_vigilence' ? 'px-0' : 'p-2 pl-4'}}">
+        {!! $segment->summary_html !!}
+    </div>
+
+    <?php endif ?>
+
+</div>
+

+ 42 - 0
resources/views/layouts/print.blade.php

@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
+
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+
+    <title>{{ config('app.name') }}</title>
+
+    <!-- Fonts -->
+    <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
+
+    <!-- <link href="{{ asset('bootstrap-4.5.0/css/bootstrap.css') }}" rel="stylesheet"> -->
+    <link rel="stylesheet" href="/fontawesome-free-5.13.1-web/css/all.min.css">
+    <link href="{{ asset('/css/app.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link href="{{ asset('/css/style.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link href="{{ asset('/css/yemi.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link rel="stylesheet" href="{{ asset('/css/toastr.min.css') }}">
+    <link href="{{asset('/css/z.css')}}?v={{config('app.asset_version')}}" rel=stylesheet>
+    <!-- Styles -->
+
+
+    {{-- inline bootstrap datepicker --}}
+{{--    <link href='/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css' rel="stylesheet">
+    <script src='/bootstrap-datepicker/js/bootstrap-datepicker.min.js'></script>--}}
+
+    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
+
+    @yield('head')
+</head>
+
+<body>
+
+    <main role="main" class="stag-content px-0 mcp-theme-1">
+        @yield('content')
+
+    </main><!-- /.container -->
+
+    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.24/fc-3.3.2/fh-3.1.8/datatables.min.css"/>
+</body>
+
+</html>

+ 2 - 0
routes/web.php

@@ -648,6 +648,8 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('/search-payer/json', 'PayerController@searchPayerV2JSON')->name('searchPayerV2JSON');
     Route::get('/search-facility/json', 'HomeController@facilitySuggestJSON')->name('facilitySuggestJSON');
 
+    Route::get('print-note/{patient}/{note}', 'NoteController@print')->name('print-note');
+
 });
 
 Route::post("/process_form_submit", 'NoteController@processFormSubmit')->name('process_form_submit');