Przeglądaj źródła

Pre-demo UI/logic updates

Vijayakrishnan Krishnan 4 lat temu
rodzic
commit
bcd4c8405d

+ 22 - 0
app/Models/Pro.php

@@ -44,4 +44,26 @@ class Pro extends Model
         $numRates = ProRate::where('is_active', true)->where('pro_id', $this->id)->count();
         return $numRates > 0;
     }
+
+    public function cmRates() {
+        return ProRate::where('is_active', true)
+            ->where('pro_id', $this->id)
+            ->where('code', 'LIKE', 'CM%')
+            ->get();
+    }
+
+    public function rmRates() {
+        return ProRate::where('is_active', true)
+            ->where('pro_id', $this->id)
+            ->where('code', 'LIKE', 'RM%')
+            ->get();
+    }
+
+    public function noteRates() {
+        return ProRate::where('is_active', true)
+            ->where('pro_id', $this->id)
+            ->where('code', 'NOT LIKE', 'CM%')
+            ->where('code', 'NOT LIKE', 'RM%')
+            ->get();
+    }
 }

+ 8 - 3
public/css/style.css

@@ -191,16 +191,21 @@ body>nav.navbar {
 .cancelled-item:not(.always-clickable) * {
     pointer-events: none;
 }
+.note-content {
+    max-height: 300px;
+    overflow-y: auto;
+}
 .note-content:not([auto-edit]) {
     padding: 1rem;
     padding-bottom: 0;
     cursor: pointer;
     position: relative;
 }
-.note-content:not(.cancelled):not([auto-edit]):not(.readonly):after {
-    content: 'Click to change';
-    display: inline;
+.note-content:not(.cancelled):not([auto-edit]):not(.readonly):before {
+    content: '(click to change)';
+    display: block;
     color: #535353;
+    padding-bottom: 0.3rem;
 }
 .mcp-theme-1 .ql-container, .mcp-theme-1 .ql-toolbar {
     border-left: 0;

+ 1 - 0
public/js/mc.js

@@ -215,6 +215,7 @@ function onFastLoaded(_data, _href, _history) {
             initQuillEdit();
             initFastLoad(targetParent);
             initPrimaryForm();
+            $(window).scrollTop(0);
         }, 50);
         if(typeof initializeCalendar !== 'undefined') {
             initializeCalendar();

+ 12 - 8
resources/views/app/patient/care-month/dashboard.blade.php

@@ -542,10 +542,12 @@
                                     <div class="mb-2">
                                         <select class="form-control" name="cmCode" value="">
                                             <option value="">-- Select CM Code --</option>
-                                            <option value="CM20">CM20</option>
-                                            <option value="CM30_HCP">CM30_HCP</option>
-                                            <option value="CM60">CM60</option>
-                                            <option value="CM90">CM90</option>
+                                            <?php $cmRates = $pro->cmRates(); ?>
+                                            @if($cmRates && count($cmRates))
+                                                @foreach($cmRates as $cmRate)
+                                                    <option value="{{ $cmRate->code }}">{{ $cmRate->code }}</option>
+                                                @endforeach
+                                            @endif
                                         </select>
                                     </div>
                                     <div class="mb-2">
@@ -727,10 +729,12 @@
                                     <div class="mb-2">
                                         <select class="form-control" name="rmCode" value="">
                                             <option value="">-- Select RM Code --</option>
-                                            <option value="RMB">RMB</option>
-                                            <option value="RM20">RM20</option>
-                                            <option value="RM30">RM30</option>
-                                            <option value="RM60">RM60</option>
+                                            <?php $rmRates = $pro->rmRates();?>
+                                            @if($rmRates && count($rmRates))
+                                                @foreach($rmRates as $rmRate)
+                                                    <option value="{{ $rmRate->code }}">{{ $rmRate->code }}</option>
+                                                @endforeach
+                                            @endif
                                         </select>
                                     </div>
                                     <div class="mb-2">

+ 1 - 1
resources/views/app/patient/intake.blade.php

@@ -323,7 +323,7 @@
                             else {
                                 toastr.success('Patient onboarding complete');
                                 hideMask();
-                                fastLoad('/patients/view/{{$patient->uid}}', true, false);
+                                fastLoad('/patients/view/{{$patient->uid}}/notes/view/' + noteUid, true, false);
                             }
                         }, 'json');
                         return false;

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

@@ -189,7 +189,15 @@
                                     <input type="date" name="effectiveDate" class="form-control form-control-sm" required>
                                 </div>
                                 <div class="mb-2">
-                                    <input type="text" name="code" placeholder="Code" class="form-control form-control-sm" required>
+                                    <select class="form-control" name="code" value="">
+                                        <option value="">-- Select Code --</option>
+                                        <?php $noteRates = $pro->noteRates(); ?>
+                                        @if($noteRates && count($noteRates))
+                                            @foreach($noteRates as $noteRate)
+                                                <option value="{{ $noteRate->code }}">{{ $noteRate->code }}</option>
+                                            @endforeach
+                                        @endif
+                                    </select>
                                 </div>
                                 <div class="mb-2">
                                     <input type="text" name="reason1" placeholder="Reason 1" class="form-control form-control-sm">
@@ -344,7 +352,15 @@
                                     <input type="date" name="effectiveDate" class="form-control form-control-sm" required>
                                 </div>
                                 <div class="mb-2">
-                                    <input type="text" name="code" placeholder="Code" class="form-control form-control-sm" required>
+                                    <select class="form-control" name="code" value="">
+                                        <option value="">-- Select Code --</option>
+                                        <?php $noteRates = $pro->noteRates(); ?>
+                                        @if($noteRates && count($noteRates))
+                                            @foreach($noteRates as $noteRate)
+                                                <option value="{{ $noteRate->code }}">{{ $noteRate->code }}</option>
+                                            @endforeach
+                                        @endif
+                                    </select>
                                 </div>
                                 <div class="mb-2">
                                     <input type="text" name="reason1" placeholder="Reason 1" class="form-control form-control-sm">