29 lines
737 B
PHP
29 lines
737 B
PHP
<?php
|
|
|
|
namespace App\Infrastructure\Reports\Services;
|
|
|
|
use App\Models\ObservationPatient;
|
|
|
|
/**
|
|
* Управляет пациентами, находящимися на контроле в отчётном интерфейсе.
|
|
*/
|
|
class ObservationPatientManagementService
|
|
{
|
|
public function removeObservationPatient(string $patientId): void
|
|
{
|
|
[$sourceType, $id] = explode(':', $patientId) + [null, null];
|
|
|
|
if ($sourceType === 'manual') {
|
|
ObservationPatient::query()
|
|
->where('rf_department_patient_id', $id)
|
|
->delete();
|
|
|
|
return;
|
|
}
|
|
|
|
ObservationPatient::query()
|
|
->where('rf_medicalhistory_id', $id)
|
|
->delete();
|
|
}
|
|
}
|