Много всего

This commit is contained in:
brusnitsyn
2025-12-12 17:10:05 +09:00
parent 54f36e91fa
commit 98e9f8b52e
25 changed files with 1118 additions and 145 deletions

View File

@@ -18,7 +18,7 @@ class ArchiveHistoryResource extends JsonResource
return [
'id' => $this->id,
'issue_at' => Carbon::parse($this->issue_at)->format('d.m.Y'),
'return_at' => Carbon::parse($this->return_at)->format('d.m.Y'),
'return_at' => $this->return_at ? Carbon::parse($this->return_at)->format('d.m.Y') : null,
'comment' => $this->comment,
'org_id' => $this->org_id,
'org' => $this->org->name,

View File

@@ -18,7 +18,9 @@ class ArchiveInfoResource extends JsonResource
'id' => $this->id,
'num' => $this->num,
'post_in' => $this->post_in,
'status' => $this->status
'status' => $this->status,
'historyable_id' => $this->historyable_id,
'historyable_type' => $this->historyable_type,
];
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Http\Resources\Mis;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Carbon;
class SttMedicalHistoryResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->MedicalHistoryID,
'fullname' => $this->getFullNameAttribute(),
'daterecipient' => Carbon::parse($this->DateRecipient)->format('d.m.Y'),
'dateextract' => Carbon::parse($this->DateExtract)->format('d.m.Y'),
'card_num' => $this->archiveInfo->num ?? null,
'status' => $this->archiveInfo->status ?? null,
'datearhiv' => $this->archiveInfo?->post_at ? Carbon::parse($this->archiveInfo->post_at)->format('d.m.Y') : null,
'medcardnum' => $this->MedCardNum,
'dr' => Carbon::parse($this->BD)->format('d.m.Y'),
'can_be_issue' => $this->canBeIssued()
];
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PatientInfoResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id ?? $this->MedicalHistoryID,
'medcardnum' => $this->medcardnum ?? $this->MedCardNum,
'family' => $this->family ?? $this->FAMILY,
'name' => $this->name ?? $this->Name,
'ot' => $this->ot ?? $this->OT,
];
}
}

View File

@@ -22,11 +22,10 @@ class SttMedicalHistoryResource extends JsonResource
'dateextract' => Carbon::parse($this->dateextract)->format('d.m.Y'),
'card_num' => $this->archiveInfo->num ?? null,
'status' => $this->archiveInfo->status ?? null,
'datearhiv' => Carbon::parse($this->datearhiv)->format('d.m.Y'),
'statgod' => $this->statgod,
'enp' => $this->enp,
'datearhiv' => $this->archiveInfo?->post_at ? Carbon::parse($this->archiveInfo->post_at)->format('d.m.Y') : null,
'medcardnum' => $this->medcardnum,
'dr' => Carbon::parse($this->dr)->format('d.m.Y'),
'can_be_issue' => $this->canBeIssued()
];
}
}