* добавлены операции и услуги операций

* добавлена выборка и подсчет по датам для роли зав.
* переключатель ролей
* выбор отделений для роли зав.
This commit is contained in:
brusnitsyn
2026-01-22 17:58:27 +09:00
parent 8a0fdf9470
commit cb43c74a72
28 changed files with 961 additions and 143 deletions

View File

@@ -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'),