Vijayakrishnan 3 anos atrás
pai
commit
ba06226df5
1 arquivos alterados com 25 adições e 21 exclusões
  1. 25 21
      resources/views/app/patient/prescriptions/list.blade.php

+ 25 - 21
resources/views/app/patient/prescriptions/list.blade.php

@@ -1,25 +1,29 @@
 <div id="prescriptions-{{$patient->id}}" v-cloak>
-    <div class="d-flex align-items-center mb-3">
+    <div class="d-flex align-items-baseline mb-3">
         <div class="font-weight-bold text-secondary font-size-14 m-0">ERx &amp; Orders</div>
-        @if(!request()->input('erx_category') || request()->input('erx_category') === 'DRUG')
-            <span class="mx-2 text-secondary on-hover-opaque">|</span>
-            <a href="#" v-on:click.prevent="newERx('DRUG')">+ Drug</a>
-        @endif
-        @if(!request()->input('erx_category') || request()->input('erx_category') === 'LAB')
-            <span class="mx-2 text-secondary on-hover-opaque">|</span>
-            <a href="#" v-on:click.prevent="newERx('LAB')">+ Lab</a>
-        @endif
-        @if(!request()->input('erx_category') || request()->input('erx_category') === 'IMAGING')
-            <span class="mx-2 text-secondary on-hover-opaque">|</span>
-            <a href="#" v-on:click.prevent="newERx('IMAGING')">+ Imaging</a>
-        @endif
-        @if(!request()->input('erx_category') || request()->input('erx_category') === 'REFERRAL')
-            <span class="mx-2 text-secondary on-hover-opaque">|</span>
-            <a href="#" v-on:click.prevent="newERx('REFERRAL')">+ Referral</a>
-        @endif
-        @if(!request()->input('erx_category') || request()->input('erx_category') === 'OTHER')
-            <span class="mx-2 text-secondary on-hover-opaque">|</span>
-            <a href="#" v-on:click.prevent="newERx('OTHER')">+ Other</a>
+        @if($patient->mcp)
+            @if(!request()->input('erx_category') || request()->input('erx_category') === 'DRUG')
+                <span class="mx-2 text-secondary on-hover-opaque">|</span>
+                <a href="#" v-on:click.prevent="newERx('DRUG')">+ Drug</a>
+            @endif
+            @if(!request()->input('erx_category') || request()->input('erx_category') === 'LAB')
+                <span class="mx-2 text-secondary on-hover-opaque">|</span>
+                <a href="#" v-on:click.prevent="newERx('LAB')">+ Lab</a>
+            @endif
+            @if(!request()->input('erx_category') || request()->input('erx_category') === 'IMAGING')
+                <span class="mx-2 text-secondary on-hover-opaque">|</span>
+                <a href="#" v-on:click.prevent="newERx('IMAGING')">+ Imaging</a>
+            @endif
+            @if(!request()->input('erx_category') || request()->input('erx_category') === 'REFERRAL')
+                <span class="mx-2 text-secondary on-hover-opaque">|</span>
+                <a href="#" v-on:click.prevent="newERx('REFERRAL')">+ Referral</a>
+            @endif
+            @if(!request()->input('erx_category') || request()->input('erx_category') === 'OTHER')
+                <span class="mx-2 text-secondary on-hover-opaque">|</span>
+                <a href="#" v-on:click.prevent="newERx('OTHER')">+ Other</a>
+            @endif
+        @else
+            <span class="ml-3 text-warning-mellow">MCP not set on the patient</span>
         @endif
     </div>
     <div class="d-flex align-items-start bg-white">
@@ -710,7 +714,7 @@ GROUP BY erx_category");
                             let payload = {
                                 noteUid: '{{ @$note ? $note->uid : '' }}',
                                 clientUid: '{{$patient->uid}}',
-                                hcpProUid: '{{$patient->mcp->uid}}',
+                                hcpProUid: '{{$patient->mcp ? $patient->mcp->uid : ''}}',
                                 erxCategory: _type
                             };
                             $.post('/api/erx/create', payload, _data => {