Перевод на DDD
This commit is contained in:
69
app/Domain/Patient/DTO/PatientData.php
Normal file
69
app/Domain/Patient/DTO/PatientData.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Patient\DTO;
|
||||
|
||||
class PatientData
|
||||
{
|
||||
public function __construct(
|
||||
public int $medicalHistoryId,
|
||||
public int $migrationPatientId,
|
||||
public int $extractMigrationPatientId,
|
||||
public int $diagnosisId,
|
||||
public int $attendingDoctorId,
|
||||
public int $bedActionId,
|
||||
public string $lastName,
|
||||
public string $firstName,
|
||||
public string $middleName,
|
||||
public string $birthDate,
|
||||
public string $recipientDate,
|
||||
public string $extractDate,
|
||||
public string $migrationIngoingDate,
|
||||
public string $migrationOutDate,
|
||||
public int $migrationBranchId,
|
||||
public string $departmentName,
|
||||
) { }
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'medicalHistoryId' => $this->medicalHistoryId,
|
||||
'migrationPatientId' => $this->migrationPatientId,
|
||||
'extractMigrationPatientId' => $this->extractMigrationPatientId,
|
||||
'diagnosisId' => $this->diagnosisId,
|
||||
'attendingDoctorId' => $this->attendingDoctorId,
|
||||
'bedActionId' => $this->bedActionId,
|
||||
'lastName' => $this->lastName,
|
||||
'firstName' => $this->firstName,
|
||||
'middleName' => $this->middleName,
|
||||
'birthDate' => $this->birthDate,
|
||||
'recipientDate' => $this->recipientDate,
|
||||
'extractDate' => $this->extractDate,
|
||||
'migrationIngoingDate' => $this->migrationIngoingDate,
|
||||
'migrationOutDate' => $this->migrationOutDate,
|
||||
'migrationBranchId' => $this->migrationBranchId,
|
||||
'departmentName' => $this->departmentName,
|
||||
];
|
||||
}
|
||||
|
||||
public static function fromMis(array $data): self
|
||||
{
|
||||
return new self(
|
||||
$data['rf_MedicalHistoryID'],
|
||||
$data['rf_MigrationPatientID'],
|
||||
$data['rf_ExtractMigrationPatientID'],
|
||||
$data['rf_DiagnosisID'],
|
||||
$data['rf_AttendingDoctorID'],
|
||||
$data['rf_BedActionID'],
|
||||
$data['FAMILY'],
|
||||
$data['Name'],
|
||||
$data['OT'],
|
||||
$data['BD'],
|
||||
$data['DateRecipient'],
|
||||
$data['DateExtract'],
|
||||
$data['DateIngoing'],
|
||||
$data['DateOut'],
|
||||
$data['rf_StationarBranchID'],
|
||||
$data['DepartmentNAME'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user