瀏覽代碼

Note na bill: "Pending HCP Signing of Treatment Services"

Vijayakrishnan 3 年之前
父節點
當前提交
ca6a454d10
共有 2 個文件被更改,包括 19 次插入3 次删除
  1. 11 0
      app/Models/Note.php
  2. 8 3
      resources/views/app/generic-bills/add-bill-form/Note.blade.php

+ 11 - 0
app/Models/Note.php

@@ -115,4 +115,15 @@ class Note extends Model
     {
         return $this->hasOne(VisitTemplate::class, 'id', 'visit_template_id');
     }
+
+    public function hasTreatmentServicesBillByHCP()
+    {
+        $bills = Bill::where('note_id', $this->id)
+            ->where('bill_service_type', '<>', 'GENERIC')
+            ->where('code', 'Treatment Services')
+            ->where('is_cancelled', false)
+            ->count();
+        return !!$bills;
+    }
+
 }

+ 8 - 3
resources/views/app/generic-bills/add-bill-form/Note.blade.php

@@ -29,9 +29,14 @@
 
 <form url="/api/bill/createForGeneric">
     @if(hasActiveGenericBill($genericPro, @$patient, @$entityType, @$entityUid))
-        <div class="border rounded bg-aliceblue p-2 width-200px">
-            <i class="fa fa-exclamation-triangle text-warning-mellow mr-1"></i>
-            An uncancelled NA bill already exists for this note!
+        <div class="border rounded bg-aliceblue p-2 width-200px d-flex align-items-baseline">
+            <i class="fa fa-exclamation-triangle text-warning-mellow mr-2"></i>
+            <span>An uncancelled NA bill already exists for this note!</span>
+        </div>
+    @elseif($note && !$note->hasTreatmentServicesBillByHCP())
+        <div class="border rounded bg-aliceblue p-2 width-200px d-flex align-items-baseline">
+            <i class="fa fa-exclamation-triangle text-warning-mellow mr-2"></i>
+            <span>Pending HCP Signing of Treatment Services</span>
         </div>
     @else
         @include('app.generic-bills.add-bill-form._default-fields')