Browse Source

Add method & location to main patient header add-note

Vijayakrishnan 4 năm trước cách đây
mục cha
commit
db54dc22b4
1 tập tin đã thay đổi với 46 bổ sung3 xóa
  1. 46 3
      resources/views/layouts/patient.blade.php

+ 46 - 3
resources/views/layouts/patient.blade.php

@@ -231,7 +231,7 @@
                         </div>
                     </div>
                 @endif
-                <div class="card mt-3">
+                <div class="card mt-3" id="patient-header">
                     <div class="card-header py-1 hide-inside-ticket-popup">
                         <?php
                         $thumbnail = $patient->profile_picture_base64;
@@ -667,8 +667,7 @@
                                                 <input type="hidden" name="effectiveTime" value="{{date("h:i")}}">
                                                 <input type="hidden" name="title" id="note-create-title" value="">
                                                 <div class="form-group mb-2">
-                                                    <label for="" class="text-secondary text-sm mb-1">Note Template
-                                                        *</label>
+                                                    <label for="" class="text-secondary text-sm mb-1">Note Template *</label>
                                                     <select name="noteTemplateUid" class="form-control form-control-sm"
                                                             onchange="$('#note-create-title').val($(this).find('option:selected').text())"
                                                             required>
@@ -679,6 +678,24 @@
                                                         @endforeach
                                                     </select>
                                                 </div>
+                                                <div class="mb-2">
+                                                    <label for="" class="text-secondary text-sm mb-1">Method *</label>
+                                                    <select name="method" class="form-control form-control-sm note-method-select" required>
+                                                        <option value="AUDIO">Audio</option>
+                                                        <option value="VIDEO">Video</option>
+                                                        <option value="IN_CLINIC">In-Clinic</option>
+                                                        <option value="HOUSE_CALL">House Call</option>
+                                                    </select>
+                                                </div>
+                                                <div class="form-group if-in-clinic">
+                                                    <label for="" class="text-secondary text-sm mb-1">Location</label>
+                                                    <select name="hcpCompanyLocationUid" class="form-control">
+                                                        <option value="-- select --"></option>
+                                                        @foreach($pro->companyLocations() as $location)
+                                                            <option value="{{$location->uid}}">{{$location->line1}} {{$location->city}}</option>
+                                                        @endforeach
+                                                    </select>
+                                                </div>
                                                 <div class="form-group m-0">
                                                     <button submit class="btn btn-primary btn-sm">submit</button>
                                                 </div>
@@ -906,4 +923,30 @@
             </main>
         </div>
     </div>
+    <script>
+        (function() {
+            function init() {
+                $('.note-method-select').change(function() {
+                    let form = $(this).closest('form');
+                    if(this.value === 'IN_CLINIC') {
+                        form.find('.if-in-clinic').show();
+                    }
+                    else {
+                        form.find('.if-in-clinic').hide();
+                    }
+                });
+
+                $('.note-method-select').each(function() {
+                    let form = $(this).closest('form');
+                    if(this.value === 'IN_CLINIC') {
+                        form.find('.if-in-clinic').show();
+                    }
+                    else {
+                        form.find('.if-in-clinic').hide();
+                    }
+                });
+            }
+            addMCInitializer('patient-add-note-popup', init, '#patient-header')
+        }).call(window);
+    </script>
 @endsection