Форматирование

This commit is contained in:
brusnitsyn
2026-04-24 16:46:10 +09:00
parent fd0e6ee817
commit 63daa62888
87 changed files with 1380 additions and 791 deletions

View File

@@ -3,7 +3,6 @@
namespace App\Services;
use App\Models\MisMedicalHistory;
use App\Models\MisMigrationPatient;
class MisPatientService
{
@@ -24,7 +23,7 @@ class MisPatientService
*/
public function getInStationarPatients(string $status, $branchId, string|array $dateRange)
{
$emerSign = $status === 'plan' ? 1 : [2,4];
$emerSign = $status === 'plan' ? 1 : [2, 4];
$query = MisMedicalHistory::query();
$query->when(isset($branchId), function ($query) use ($branchId, $dateRange) {
$query->with(['migrations', 'surgicalOperations'])
@@ -50,11 +49,11 @@ class MisPatientService
$query = MisMedicalHistory::query();
$query->when(isset($branchId), function ($query) use ($branchId, $dateRange) {
$query->with('migrations')
->whereHas('migrations', function ($q) use ($branchId, $dateRange) {
$q->where('rf_StationarBranchID', $branchId)
->whereDate('DateRecipient', '<', $dateRange[1]);
});
})
->whereHas('migrations', function ($q) use ($branchId, $dateRange) {
$q->where('rf_StationarBranchID', $branchId)
->whereDate('DateRecipient', '<', $dateRange[1]);
});
})
->where('rf_EmerSignID', 1)
->where('MedicalHistoryID', '<>', 0);
@@ -73,7 +72,7 @@ class MisPatientService
$q->where('rf_StationarBranchID', $branchId)
->where('DateIngoing', '>', $dateRange[0])
->where('DateIngoing', '<=', $dateRange[1]);
// ->whereBetween('DateIngoing', $dateRange);
// ->whereBetween('DateIngoing', $dateRange);
});
})
->whereIn('rf_EmerSignID', [2, 4])
@@ -84,9 +83,9 @@ class MisPatientService
/**
* Получение запроса пациентов которые попали в отделение в определенную дату
* @param int $branchId Индентификатор ветки стационара
* @param array $dateRange Массив дат (0 - начальная дата, 1 - конечная дата)
* @return \Illuminate\Database\Eloquent\Builder
*
* @param int $branchId Индентификатор ветки стационара
* @param array $dateRange Массив дат (0 - начальная дата, 1 - конечная дата)
*/
public function getRecipientPatientsQuery(int $branchId, array $dateRange): \Illuminate\Database\Eloquent\Builder
{
@@ -96,7 +95,7 @@ class MisPatientService
$q->where('rf_StationarBranchID', $branchId)
->where('DateIngoing', '>=', $dateRange[0])
->where('DateIngoing', '<=', $dateRange[1]);
// ->whereBetween('DateIngoing', $dateRange);
// ->whereBetween('DateIngoing', $dateRange);
})->where('MedicalHistoryID', '<>', 0);
return $query;