Ver Fonte

Fix update visit status modal

Vijayakrishnan Krishnan há 4 anos atrás
pai
commit
ef00a42c18
2 ficheiros alterados com 32 adições e 24 exclusões
  1. 19 15
      public/js/mc.js
  2. 13 9
      resources/views/layouts/patient.blade.php

+ 19 - 15
public/js/mc.js

@@ -300,24 +300,28 @@ function initCreateNote() {
     $(document)
         .off('click.create-note', '.create-auto-note-trigger')
         .on('click.create-note', '.create-auto-note-trigger', function() {
-            showMask();
-            var clientUid = $(this).attr('data-patient-uid');
-            $.post('/api/note/createUsingFreeTextHtml', {
-                clientUid: clientUid,
-                hcpProUid: $(this).attr('data-hcp-uid'),
-                effectiveDateEST: $(this).attr('data-effective-date'),
-            }, function(_data) {
-                hideMask();
-                if (!_data.success) {
-                    toastr.error(_data.message);
-                }
-                else {
-                    fastLoad('/patients/view/' + clientUid + '/notes/view/' + _data.data, true, false);
-                }
-            }, 'json');
+            createNewNote($(this).attr('data-patient-uid'), $(this).attr('data-hcp-uid'), $(this).attr('data-effective-date'));
         });
 }
 
+function createNewNote(_patientUid, _hcpUid, _date) {
+    hideMoeFormMask();
+    showMask();
+    $.post('/api/note/createUsingFreeTextHtml', {
+        clientUid: _patientUid,
+        hcpProUid: _hcpUid,
+        effectiveDateEST: _date,
+    }, function(_data) {
+        hideMask();
+        if (!_data.success) {
+            toastr.error(_data.message);
+        }
+        else {
+            fastLoad('/patients/view/' + _patientUid + '/notes/view/' + _data.data, true, false);
+        }
+    }, 'json');
+}
+
 function initQuillEdit(_selector = '.note-content[auto-edit]') {
 
     $(document)

+ 13 - 9
resources/views/layouts/patient.blade.php

@@ -251,25 +251,22 @@
                                                     </select>
                                                 </div>
                                                 <div class="mb-2">
-                                                    <input type="date" class="if-visit-done form-control form-control-sm" disabled name="mcpOnboardingVisitDate" max="{{ date('Y-m-d') }}">
+                                                    <input type="date" class="if-visit-done form-control form-control-sm" disabled
+                                                           name="mcpOnboardingVisitDate" value="{{ date('Y-m-d') }}" max="{{ date('Y-m-d') }}">
                                                 </div>
                                                 <div class="mb-2">
                                                     <select name="mcpOnboardingVisitNoteUid" disabled
                                                             class="form-control form-control-sm if-visit-done"
-                                                            onchange="toggleVisibilityAsNeeded(this, '', 'if-note-outside-system')">
+                                                            onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
                                                         <option value="">-- Visit Note --</option>
                                                         @foreach ($notes as $note)
-                                                            @if(!empty($note->title))
-                                                                <option value="{{$note->uid}}">{{$note->title}}</option>
+                                                            @if(!empty($note->title) && $note->client_id === $patient->id)
+                                                                <option value="{{$note->uid}}">{{$note->title}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
                                                             @endif
                                                         @endforeach
+                                                        <option value="-- create --">-- Create Note --</option>
                                                     </select>
                                                 </div>
-                                                <div class="mb-2 if-note-outside-system">
-                                                    <textarea class="form-control form-control-sm"
-                                                              name="reasonOnboardingVisitNoteOutsideSystem"
-                                                              placeholder="Visit note outside the system reason"></textarea>
-                                                </div>
                                                 <div>
                                                     <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
                                                     <button cancel class="btn btn-sm btn-default border">Cancel</button>
@@ -277,6 +274,13 @@
                                             </form>
                                         </div>
                                     </div>
+                                    @else
+                                        <div class="text-dark d-flex align-items-center">
+                                        <span class="mr-2 text-secondary">
+                                            <i class="fa fa-check text-sm"></i>
+                                            MCP Onboarding Visit Completed
+                                        </span>
+                                        </div>
                                     @endif
                                 </section>
                                 <section>