Browse Source

added note resolution center link

= 2 years ago
parent
commit
2919a599c6

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

@@ -444,6 +444,9 @@ use App\Models\Handout;
 
             <div class="px-2 border-left screen-only">
                 <a href="{{route('print-note', ['patient' => $patient, 'note' => $note])}}" native target="_blank" class=""><i class="fa fa-print"></i></a>
+                @if($performer->pro->is_admin)
+                    <a href="{{'/practice-management/notes-resolution-center-v2?uid='.$note->uid}}" target="_blank">NRC</a>
+                @endif
             </div>
 
             @if($pro->pro_type === 'ADMIN' || $pro->is_enrolled_as_mcp)

+ 41 - 3
resources/views/layouts/print-note.blade.php

@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="en">
+<html lang="en" note-uid="{{$note->uid}}" >
 <head>
     <meta charset="UTF-8">
     <meta name="viewport"
@@ -56,6 +56,14 @@
         .page-number:before {
             content: counter(pages);
         }
+
+        @media print
+        {
+            .no-print, .no-print *
+            {
+                display: none !important;
+            }
+        }
     </style>
 </head>
 <body>
@@ -222,9 +230,39 @@
             </table>
         @endif
     </div>
-
+    <div class="no00-print" style="padding-top: 1rem; text-align: center"><a id="save_btn" href="#">Save</a></div>
     <div style="padding-top: 2rem; text-align: center">********</div>
-
 </div>
+<script>
+    $(document).ready(function(){
+        let saveBtn = document.querySelector('#save_btn');
+        let content = document.querySelector('html');
+        let contentHTML = content.outerHTML;
+        let noteUid = content.getAttribute('note-uid');
+        setInterval(function(){
+            try {
+                submitToBackend(noteUid, contentHTML);
+            }catch(e){
+                console.log(e)
+            }
+        }, 10000);
+        saveBtn.addEventListener('click', () => {
+
+            submitToBackend(noteUid, contentHTML)
+            //send this to java
+            //create note_print record with versioned history
+            //on note show a list of note prints to admins
+            //allow opening a note print on its own tab with note print id means update existing
+            //auto save as you edit to local storage. flush local storage when you hit save
+        });
+    })
+
+    function submitToBackend(noteUid, content){
+        console.log("saving...")
+        console.log(noteUid);
+        console.log(content);
+    }
+
+</script>
 </body>
 </html>