Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Oct 3, 2024
1 parent 6ad20ad commit a2adec6
Show file tree
Hide file tree
Showing 178 changed files with 3,760 additions and 2,426 deletions.
2 changes: 1 addition & 1 deletion app/Enums/Report/Standard/Indicators/Child.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ protected function labelKeyPrefix(): ?string

public function class(): string
{
return "\\App\\Reports\\Standard\\Child\\{$this->value}";
return "\\App\\Reports\\Queries\\Child\\{$this->value}";
}
}
2 changes: 1 addition & 1 deletion app/Enums/Report/Standard/Indicators/Pregnant.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ protected function labelKeyPrefix(): ?string

public function class(): string
{
return "\\App\\Reports\\Standard\\Pregnant\\{$this->value}";
return "\\App\\Reports\\Queries\\Pregnant\\{$this->value}";
}
}
2 changes: 1 addition & 1 deletion app/Enums/Report/Standard/Indicators/RareDisease.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ protected function labelKeyPrefix(): ?string

public function class(): string
{
return "\\App\\Reports\\Standard\\RareDisease\\{$this->value}";
return "\\App\\Reports\\Queries\\RareDisease\\{$this->value}";
}
}
51 changes: 51 additions & 0 deletions app/Reports/Queries/Child/C01.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

namespace App\Reports\Queries\Child;

use App\Filament\Resources\BeneficiaryResource;
use App\Models\Beneficiary;
use App\Reports\Queries\ReportQuery;
use Illuminate\Database\Eloquent\Builder;

class C01 extends ReportQuery
{
/**
* Sum beneficiari with Nou-născut (0-27 de zile) (VCV_00).
*/
public static function query(): Builder
{
return Beneficiary::query()
->whereHasVulnerabilities(function (Builder $query) {
$query->whereJsonContains('properties', 'VCV_00');
});
}

public static function dateColumn(): string
{
return 'activity_log.created_at';
}

public static function columns(): array
{
return [
'id' => __('field.id'),
'first_name' => __('field.first_name'),
'last_name' => __('field.last_name'),
'cnp' => __('field.cnp'),
'gender' => __('field.gender'),
'date_of_birth' => __('field.age'),
'county' => __('field.county'),
'city' => __('field.city'),
'status' => __('field.status'),
];
}

public static function getRecordActions(array $params = []): array
{
return [
BeneficiaryResource::getUrl('view', $params, isAbsolute: false) => __('beneficiary.action.view_details'),
];
}
}
51 changes: 51 additions & 0 deletions app/Reports/Queries/Child/C02.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

declare(strict_types=1);

namespace App\Reports\Queries\Child;

use App\Filament\Resources\BeneficiaryResource;
use App\Models\Beneficiary;
use App\Reports\Queries\ReportQuery;
use Illuminate\Database\Eloquent\Builder;

class C02 extends ReportQuery
{
/**
* Sum beneficiari with Copil născut prematur (VSC_10).
*/
public static function query(): Builder
{
return Beneficiary::query()
->whereHasVulnerabilities(function (Builder $query) {
$query->whereJsonContains('properties', 'VSC_10');
});
}

public static function dateColumn(): string
{
return 'activity_log.created_at';
}

public static function columns(): array
{
return [
'id' => __('field.id'),
'first_name' => __('field.first_name'),
'last_name' => __('field.last_name'),
'cnp' => __('field.cnp'),
'gender' => __('field.gender'),
'date_of_birth' => __('field.age'),
'county' => __('field.county'),
'city' => __('field.city'),
'status' => __('field.status'),
];
}

public static function getRecordActions(array $params = []): array
{
return [
BeneficiaryResource::getUrl('view', $params, isAbsolute: false) => __('beneficiary.action.view_details'),
];
}
}
56 changes: 56 additions & 0 deletions app/Reports/Queries/Child/C04.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

namespace App\Reports\Queries\Child;

use App\Models\Beneficiary;
use App\Reports\Queries\ReportQuery;
use Illuminate\Database\Eloquent\Builder;
use App\Filament\Resources\BeneficiaryResource;

class C04 extends ReportQuery
{
/**
* Sum beneficiari with Boală infecţioasă (VSG_BI); Copil 0-1 ani (VCV_01) OR Copil 1-5 ani (VCV_02) OR Copil 5-14 ani (VCV_03).
*/
public static function query(): Builder
{
return Beneficiary::query()
->whereHasVulnerabilities(function (Builder $query) {
$query->whereJsonContains('properties', 'VSG_BI')
->where(function (Builder $query) {
$query->whereJsonContains('properties', 'VCV_01')
->orWhereJsonContains('properties', 'VCV_02')
->orWhereJsonContains('properties', 'VCV_03');
});
});
}

public static function dateColumn(): string
{
return 'activity_log.created_at';
}

public static function columns(): array
{
return [
'id' => __('field.id'),
'first_name' => __('field.first_name'),
'last_name' => __('field.last_name'),
'cnp' => __('field.cnp'),
'gender' => __('field.gender'),
'date_of_birth' => __('field.age'),
'county' => __('field.county'),
'city' => __('field.city'),
'status' => __('field.status'),
];
}

public static function getRecordActions(array $params = []): array
{
return [
BeneficiaryResource::getUrl('view', $params, isAbsolute: false) => __('beneficiary.action.view_details'),
];
}
}
56 changes: 56 additions & 0 deletions app/Reports/Queries/Child/C05.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

namespace App\Reports\Queries\Child;

use App\Models\Beneficiary;
use App\Reports\Queries\ReportQuery;
use Illuminate\Database\Eloquent\Builder;
use App\Filament\Resources\BeneficiaryResource;

class C05 extends ReportQuery
{
/**
* Sum beneficiari with Boală cronică (VSG_01); Copil 0-1 ani (VCV_01) OR Copil 1-5 ani (VCV_02) OR Copil 5-14 ani (VCV_03).
*/
public static function query(): Builder
{
return Beneficiary::query()
->whereHasVulnerabilities(function (Builder $query) {
$query->whereJsonContains('properties', 'VSG_01')
->where(function (Builder $query) {
$query->whereJsonContains('properties', 'VCV_01')
->orWhereJsonContains('properties', 'VCV_02')
->orWhereJsonContains('properties', 'VCV_03');
});
});
}

public static function dateColumn(): string
{
return 'activity_log.created_at';
}

public static function columns(): array
{
return [
'id' => __('field.id'),
'first_name' => __('field.first_name'),
'last_name' => __('field.last_name'),
'cnp' => __('field.cnp'),
'gender' => __('field.gender'),
'date_of_birth' => __('field.age'),
'county' => __('field.county'),
'city' => __('field.city'),
'status' => __('field.status'),
];
}

public static function getRecordActions(array $params = []): array
{
return [
BeneficiaryResource::getUrl('view', $params, isAbsolute: false) => __('beneficiary.action.view_details'),
];
}
}
56 changes: 56 additions & 0 deletions app/Reports/Queries/Child/C06.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

namespace App\Reports\Queries\Child;

use App\Models\Beneficiary;
use App\Reports\Queries\ReportQuery;
use Illuminate\Database\Eloquent\Builder;
use App\Filament\Resources\BeneficiaryResource;

class C06 extends ReportQuery
{
/**
* Sum beneficiari with Copil care nu primește vitamina D și Fier (VCS_03); Copil 0-1 ani (VCV_01) OR Copil 1-5 ani (VCV_02) OR Copil 5-14 ani (VCV_03).
*/
public static function query(): Builder
{
return Beneficiary::query()
->whereHasVulnerabilities(function (Builder $query) {
$query->whereJsonContains('properties', 'VCS_03')
->where(function (Builder $query) {
$query->whereJsonContains('properties', 'VCV_01')
->orWhereJsonContains('properties', 'VCV_02')
->orWhereJsonContains('properties', 'VCV_03');
});
});
}

public static function dateColumn(): string
{
return 'activity_log.created_at';
}

public static function columns(): array
{
return [
'id' => __('field.id'),
'first_name' => __('field.first_name'),
'last_name' => __('field.last_name'),
'cnp' => __('field.cnp'),
'gender' => __('field.gender'),
'date_of_birth' => __('field.age'),
'county' => __('field.county'),
'city' => __('field.city'),
'status' => __('field.status'),
];
}

public static function getRecordActions(array $params = []): array
{
return [
BeneficiaryResource::getUrl('view', $params, isAbsolute: false) => __('beneficiary.action.view_details'),
];
}
}
56 changes: 56 additions & 0 deletions app/Reports/Queries/Child/C07.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);

namespace App\Reports\Queries\Child;

use App\Filament\Resources\BeneficiaryResource;
use App\Models\Beneficiary;
use App\Reports\Queries\ReportQuery;
use Illuminate\Database\Eloquent\Builder;

class C07 extends ReportQuery
{
/**
* Sum beneficiari with Copil nevaccinat conform calendarului național (VSC_01); Copil 0-1 ani (VCV_01) OR Copil 1-5 ani (VCV_02) OR Copil 5-14 ani (VCV_03).
*/
public static function query(): Builder
{
return Beneficiary::query()
->whereHasVulnerabilities(function (Builder $query) {
$query->whereJsonContains('properties', 'VSC_01')
->where(function (Builder $query) {
$query->whereJsonContains('properties', 'VCV_01')
->orWhereJsonContains('properties', 'VCV_02')
->orWhereJsonContains('properties', 'VCV_03');
});
});
}

public static function dateColumn(): string
{
return 'activity_log.created_at';
}

public static function columns(): array
{
return [
'id' => __('field.id'),
'first_name' => __('field.first_name'),
'last_name' => __('field.last_name'),
'cnp' => __('field.cnp'),
'gender' => __('field.gender'),
'date_of_birth' => __('field.age'),
'county' => __('field.county'),
'city' => __('field.city'),
'status' => __('field.status'),
];
}

public static function getRecordActions(array $params = []): array
{
return [
BeneficiaryResource::getUrl('view', $params, isAbsolute: false) => __('beneficiary.action.view_details'),
];
}
}
Loading

0 comments on commit a2adec6

Please sign in to comment.