* переписал функции прототипов в сервисы
* оптимизация доставки контента до клиента * переписал запросы выборок * убрал из подсчета переведенных * добавил сохранение метрикам для вывода в дашборд
This commit is contained in:
@@ -20,21 +20,12 @@ class FormattedPatientResource extends JsonResource
|
||||
return [
|
||||
'id' => $this->MedicalHistoryID,
|
||||
'num' => $this->num,
|
||||
'mkb' => $this->whenLoaded('migrations', function () {
|
||||
'mkb.ds' => $this->migrations->first()->diagnosis->first()?->mkb?->DS,
|
||||
'operations' => $this->surgicalOperations->map(function ($operation) {
|
||||
return [
|
||||
'ds' => $this->migrations()->first()->diagnosis()->first()?->mkb()->first()->DS ?? null,
|
||||
'name' => $this->migrations()->first()->diagnosis()->first()?->mkb()->first()->NAME ?? null,
|
||||
'code' => $operation->serviceMedical->ServiceMedicalCode
|
||||
];
|
||||
}),
|
||||
'operations' => $this->whenLoaded('surgicalOperations', function () {
|
||||
return $this->operationOnBranch($this->misStationarBranchId, $this->startDate, $this->endDate)
|
||||
->get()
|
||||
->map(function (MisSurgicalOperation $operation) {
|
||||
return [
|
||||
'code' => $operation->serviceMedical->ServiceMedicalCode ?? 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'),
|
||||
|
||||
Reference in New Issue
Block a user