Новые таблицы миса

This commit is contained in:
brusnitsyn
2026-01-16 17:30:41 +09:00
parent a649eaf7c5
commit 62d7e9efd4
11 changed files with 217 additions and 39 deletions

View File

@@ -19,6 +19,12 @@ class FormattedPatientResource extends JsonResource
return [
'id' => $this->MedicalHistoryID,
'num' => $this->num,
'mkb' => $this->whenLoaded('migrations', function () {
return [
'ds' => $this->migrations()->first()->diagnosis()->first()->mkb()->first()->DS ?? null,
'name' => $this->migrations()->first()->diagnosis()->first()->mkb()->first()->NAME ?? null,
];
}),
'fullname' => Str::ucwords(Str::lower("$this->FAMILY $this->Name $this->OT")),
'age' => Carbon::parse($this->BD)->diff(Carbon::now())->format('%y'),
'birth_date' => Carbon::parse($this->BD)->format('d.m.Y'),