* добавлены операции и услуги операций
* добавлена выборка и подсчет по датам для роли зав. * переключатель ролей * выбор отделений для роли зав.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Resources\Mis;
|
||||
|
||||
use App\Models\MisSurgicalOperation;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Carbon;
|
||||
@@ -25,6 +26,15 @@ class FormattedPatientResource extends JsonResource
|
||||
'name' => $this->migrations()->first()->diagnosis()->first()?->mkb()->first()->NAME ?? null,
|
||||
];
|
||||
}),
|
||||
'operations' => $this->whenLoaded('surgicalOperations', function () {
|
||||
return $this->surgicalOperations()->where('rf_StationarBranchID', $this->misStationarBranchId)
|
||||
->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