Форматирование
This commit is contained in:
@@ -28,6 +28,7 @@ class UnifiedPatientData
|
||||
public ?string $outcomeType = null,
|
||||
public ?string $outcomeDate = null,
|
||||
public ?string $comment = null,
|
||||
public ?bool $reanimationIsComplete = null,
|
||||
public bool $isRecipientToday = false,
|
||||
public bool $isManual = false,
|
||||
public bool $canManageManual = false,
|
||||
@@ -49,7 +50,7 @@ class UnifiedPatientData
|
||||
$migration = $patient->relationLoaded('migrations')
|
||||
? $patient->migrations->first()
|
||||
: null;
|
||||
if (!$migration && $patient->relationLoaded('latestMigration')) {
|
||||
if (! $migration && $patient->relationLoaded('latestMigration')) {
|
||||
$migration = $patient->latestMigration;
|
||||
}
|
||||
$diagnosisMkb = $outcomeMigration?->mainDiagnosis?->mkb ?? $migration?->mainDiagnosis?->mkb;
|
||||
@@ -79,11 +80,13 @@ class UnifiedPatientData
|
||||
outcomeType: $patient->outcome_type ?? $linkedManualPatient?->outcome_type,
|
||||
outcomeDate: $patient->outcome_date ?? $linkedManualPatient?->outcome_at?->toIso8601String(),
|
||||
comment: $comment,
|
||||
reanimationIsComplete: isset($patient->reanimation_is_complete) ? (bool) $patient->reanimation_is_complete : null,
|
||||
isRecipientToday: $isRecipientToday,
|
||||
isManual: (bool) $linkedManualPatient,
|
||||
canManageManual: (bool) $linkedManualPatient,
|
||||
);
|
||||
}
|
||||
|
||||
public static function fromMisMigrationPatient(
|
||||
MisMigrationPatient $migration,
|
||||
bool $isRecipientToday = false,
|
||||
@@ -123,6 +126,7 @@ class UnifiedPatientData
|
||||
outcomeType: $migration->outcome_type ?? $linkedManualPatient?->outcome_type,
|
||||
outcomeDate: $migration->outcome_date ?? $linkedManualPatient?->outcome_at?->toIso8601String(),
|
||||
comment: $comment,
|
||||
reanimationIsComplete: isset($medicalHistory->reanimation_is_complete) ? (bool) $medicalHistory->reanimation_is_complete : null,
|
||||
isRecipientToday: $isRecipientToday,
|
||||
isManual: (bool) $linkedManualPatient,
|
||||
canManageManual: (bool) $linkedManualPatient,
|
||||
@@ -154,6 +158,7 @@ class UnifiedPatientData
|
||||
outcomeType: $patient->outcome_type,
|
||||
outcomeDate: $patient->outcome_at?->toIso8601String(),
|
||||
comment: $comment,
|
||||
reanimationIsComplete: null,
|
||||
isRecipientToday: $isRecipientToday,
|
||||
isManual: true,
|
||||
canManageManual: true,
|
||||
@@ -164,12 +169,11 @@ class UnifiedPatientData
|
||||
MedicalHistorySnapshot $snapshot,
|
||||
bool $isRecipientToday = false,
|
||||
?array $operations = null
|
||||
): self
|
||||
{
|
||||
): self {
|
||||
$birthDate = self::normalizeDate($snapshot->birth_date);
|
||||
|
||||
// if ($snapshot->rf_medicalhistory_id === 334148)
|
||||
// dd($snapshot);
|
||||
// if ($snapshot->rf_medicalhistory_id === 334148)
|
||||
// dd($snapshot);
|
||||
|
||||
return new self(
|
||||
id: $snapshot->rf_department_patient_id ? "manual:{$snapshot->rf_department_patient_id}" : ($snapshot->patient_uid ?: "mis:{$snapshot->rf_medicalhistory_id}"),
|
||||
@@ -190,6 +194,7 @@ class UnifiedPatientData
|
||||
outcomeType: $snapshot->outcome_type,
|
||||
outcomeDate: self::normalizeDateTime($snapshot->outcome_at),
|
||||
comment: null,
|
||||
reanimationIsComplete: null,
|
||||
isRecipientToday: $isRecipientToday,
|
||||
isManual: (bool) $snapshot->is_manual,
|
||||
canManageManual: false,
|
||||
@@ -232,7 +237,7 @@ class UnifiedPatientData
|
||||
|
||||
private static function normalizeDateTime($value): ?string
|
||||
{
|
||||
if (!$value) {
|
||||
if (! $value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -245,7 +250,7 @@ class UnifiedPatientData
|
||||
|
||||
private static function normalizeDate($value): ?string
|
||||
{
|
||||
if (!$value) {
|
||||
if (! $value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user