Kaynağa Gözat

fixed cc summary

Josh 4 yıl önce
ebeveyn
işleme
f85bd3c161
1 değiştirilmiş dosya ile 12 ekleme ve 2 silme
  1. 12 2
      storage/sections/cc/default.php

+ 12 - 2
storage/sections/cc/default.php

@@ -12,9 +12,19 @@ $items = !$items ? [] : $items;
 foreach($items as $item):
     $value[] = $item['title'];
 endforeach;
-$summaryHtml = $patient->displayName() . ", {$patient->age_in_years} years old {$patient->sex} ";
+
+$summaryHtml = 'Patient ' . $patient->name_first .' '.$patient->name_last . " is a {$patient->age_in_years} year old {$patient->sex} ";
 if(count($value)) {
-    $summaryHtml .= "presenting with " . implode(", ", $value);
+    $summaryHtml .= "presenting with ";
+    if(count($value) == 1){
+        $summaryHtml .= implode(", ", $value);
+    }else{
+        $allButLast = array_slice($value, 0, count($value)-1);
+        $last =  array_slice($value, count($value)-1, 1)[0];
+        $summaryHtml .= implode(", ", $allButLast);
+        $summaryHtml .= ' and ' . $last;
+    }
+
 }
 $contentData = [
     'value' => $summaryHtml