Добавил ограничение по отказникам
This commit is contained in:
@@ -31,6 +31,7 @@ class SnapshotPatientSource
|
||||
?array $recipientReportIds = null
|
||||
): Collection {
|
||||
$snapshots = MedicalHistorySnapshot::query()
|
||||
->withoutDenials()
|
||||
->whereIn('rf_report_id', $reportIds)
|
||||
->where('patient_type', $type)
|
||||
->get()
|
||||
@@ -45,6 +46,7 @@ class SnapshotPatientSource
|
||||
if ($markRecipients) {
|
||||
$recipientReportIds ??= $reportIds;
|
||||
$recipientIds = MedicalHistorySnapshot::query()
|
||||
->withoutDenials()
|
||||
->whereIn('rf_report_id', $recipientReportIds)
|
||||
->where('patient_type', 'recipient')
|
||||
->get()
|
||||
@@ -91,6 +93,7 @@ class SnapshotPatientSource
|
||||
?array $recipientReportIds = null
|
||||
): Collection {
|
||||
$snapshots = MedicalHistorySnapshot::query()
|
||||
->withoutDenials()
|
||||
->whereIn('rf_report_id', $reportIds)
|
||||
->where('patient_type', 'current')
|
||||
->get();
|
||||
@@ -107,6 +110,7 @@ class SnapshotPatientSource
|
||||
|
||||
$recipientReportIds ??= $reportIds;
|
||||
$recipientIds = MedicalHistorySnapshot::query()
|
||||
->withoutDenials()
|
||||
->whereIn('rf_report_id', $recipientReportIds)
|
||||
->where('patient_type', 'recipient')
|
||||
->get()
|
||||
@@ -151,7 +155,7 @@ class SnapshotPatientSource
|
||||
|
||||
private function getCountFromSnapshots(string $type, array $reportIds): int
|
||||
{
|
||||
$query = MedicalHistorySnapshot::whereIn('rf_report_id', $reportIds);
|
||||
$query = MedicalHistorySnapshot::withoutDenials()->whereIn('rf_report_id', $reportIds);
|
||||
|
||||
if ($type === 'outcome') {
|
||||
$query->whereIn('patient_type', ['discharged', 'deceased']);
|
||||
|
||||
Reference in New Issue
Block a user