Преглед изворни кода

DNA - show source in patients list

Vijayakrishnan пре 3 година
родитељ
комит
5bc87ae23f
2 измењених фајлова са 30 додато и 3 уклоњено
  1. 10 0
      app/Models/Client.php
  2. 20 3
      resources/views/app/patients.blade.php

+ 10 - 0
app/Models/Client.php

@@ -670,6 +670,16 @@ class Client extends Model
         return !!$count;
     }
 
+    public function systemSourcePro()
+    {
+        return $this->hasOne(Pro::class, 'id', 'system_source_pro_id');
+    }
+
+    public function systemSourceProTeam()
+    {
+        return $this->hasOne(ProTeam::class, 'id', 'system_source_pro_team_id');
+    }
+
     public function recentNotes($_pro = null) {
         $notes = Note::where('client_id', $this->id)->where('is_cancelled', false);
         if($_pro) {

+ 20 - 3
resources/views/app/patients.blade.php

@@ -62,16 +62,20 @@
                 <thead class="bg-light">
                 <tr>
                     @if($pro->pro_type === 'ADMIN')
-                    <th class="border-0"></th>
+                        <th class="border-0"></th>
                     @endif
                     <th class="px-3 border-0">Chart #</th>
                     <th class="border-0">Patient</th>
+                    @if($pro->isDefaultNA() || $pro->pro_type === 'ADMIN')
+                        <th class="border-0">Source</th>
+                    @endif
                     <th class="border-0 px-1">OB</th>
                     <th class="border-0">Signed<br>Notes</th>
                     <th class="border-0">CM<br>Setup</th>
                     <th class="border-0">Created At</th>
-		            <th class="border-0">Address</th>
-                    @if($showProgramsColumn)<th class="border-0">Program(s)</th>@endif
+                    <th class="border-0">Address</th>
+                    @if($showProgramsColumn)
+                        <th class="border-0">Program(s)</th>@endif
                     <th class="border-0">MCN</th>
                     <th class="border-0">PCP</th>
                     <th class="border-0"><span class="text-nowrap">Recent Notes</span><br>(overall)</th>
@@ -96,6 +100,19 @@
                             {{$patient->displayName()}}
                             <div>{{ friendly_date_time($patient->dob, false) }}{{ $patient->sex === 'M' ? ', Male' : ($patient->sex === ', F' ? 'Female' : '') }}</div>
                         </td>
+                        @if($pro->isDefaultNA() || $pro->pro_type === 'ADMIN')
+                            <td>
+                                @if($patient->has_system_source)
+                                    @if($patient->system_source_category === 'PRO_TEAM' && $patient->systemSourceProTeam)
+                                        <div class="text-nowrap">Via team profile</div>
+                                        <a native target="_blank" href="{{config('app.stagfe6_url')}}/{{$patient->systemSourceProTeam->slug}}">{{$patient->systemSourceProTeam->slug}}</a>
+                                    @elseif($patient->system_source_category === 'PRO' && $patient->systemSourcePro)
+                                        <div class="text-nowrap">Via pro profile</div>
+                                        <a native target="_blank" href="{{config('app.stagfe6_url')}}/{{$patient->systemSourcePro->slug}}">{{$patient->systemSourcePro->slug}}</a>
+                                    @endif
+                                @endif
+                            </td>
+                        @endif
                         <td class="px-1">
                             @if($patient->has_mcp_done_onboarding_visit !== 'YES')
                                 <span title="MCP Onboarding Visit Pending"><i class="fa fa-exclamation-triangle"></i></span>