浏览代码

Refactor intake

Vijayakrishnan Krishnan 4 年之前
父节点
当前提交
d4cf0c7e5a
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      resources/views/app/patient/intake.blade.php

+ 8 - 3
resources/views/app/patient/intake.blade.php

@@ -1,12 +1,17 @@
 @extends ('layouts.patient')
 @extends ('layouts.patient')
 @section('inner-content')
 @section('inner-content')
-    <?
+    <?php
         $myName = '-';
         $myName = '-';
         if($patient->mcp) {
         if($patient->mcp) {
             $myName = implode(' ', array_filter([$patient->mcp->name_first, $patient->mcp->name_last]));
             $myName = implode(' ', array_filter([$patient->mcp->name_first, $patient->mcp->name_last]));
         }
         }
-    	$theirName = ($patient->name_prefix ?? ($patient->sex === 'M' ? 'Mr.' : 'Ms.'))
-    		.' '.($patient->name_last ?? $patient->name_first);
+        $theirName = [];
+        if(!empty($patient->name_prefix)) $theirName[] = $patient->name_prefix;
+        if(!empty($patient->sex)) {
+            $theirName[] = ($patient->sex === 'M' ? 'Mr.' : 'Ms.');
+        }
+        $theirName[] = $patient->name_last . ', ' . $patient->name_first;
+        $theirName = implode(" ", $theirName);
     ?>
     ?>
 
 
     <section class="intake primary-form">
     <section class="intake primary-form">