diff --git a/app/Filament/Resources/CatagraphyResource.php b/app/Filament/Resources/CatagraphyResource.php index 3c2d64b7..9a646554 100644 --- a/app/Filament/Resources/CatagraphyResource.php +++ b/app/Filament/Resources/CatagraphyResource.php @@ -229,10 +229,6 @@ public static function form(Form $form): Form ->multiple() ->searchable(), - Checkbox::make('is_vaccinated_on_schedule') - ->label($categories->get('VCC')) - ->columnSpanFull(), - Select::make('cat_ssa') ->label($categories->get('SSA')) ->placeholder(__('placeholder.select_many')) diff --git a/app/Filament/Resources/CatagraphyResource/Pages/ViewCatagraphy.php b/app/Filament/Resources/CatagraphyResource/Pages/ViewCatagraphy.php index f4830394..e454eccb 100644 --- a/app/Filament/Resources/CatagraphyResource/Pages/ViewCatagraphy.php +++ b/app/Filament/Resources/CatagraphyResource/Pages/ViewCatagraphy.php @@ -123,10 +123,6 @@ protected function form(Form $form): Form VulnerabilityChips::make('cat_ns') ->label($categories->get('NS')), - VulnerabilityChips::make('cat_vcc') - ->label($categories->get('VCC')) - ->columnSpanFull(), - VulnerabilityChips::make('cat_ssa') ->label($categories->get('SSA')), diff --git a/app/Models/Catagraphy.php b/app/Models/Catagraphy.php index 1fb56b0c..2505b674 100644 --- a/app/Models/Catagraphy.php +++ b/app/Models/Catagraphy.php @@ -46,7 +46,6 @@ class Catagraphy extends Model 'cat_ssa', 'cat_vif', 'is_social_case', - 'is_vaccinated_on_schedule', ]; protected $casts = [ @@ -69,7 +68,6 @@ class Catagraphy extends Model 'has_disabilities' => 'boolean', 'has_health_issues' => 'boolean', 'is_social_case' => 'boolean', - 'is_vaccinated_on_schedule' => 'boolean', ]; protected $with = [ @@ -184,18 +182,6 @@ public function catSoc(): Attribute return Attribute::make( get: fn () => match ($this->is_social_case) { true => 'VCS_01', - false => 'VCS_99', - default => null, - }, - )->shouldCache(); - } - - public function catVcc(): Attribute - { - return Attribute::make( - get: fn () => match ($this->is_vaccinated_on_schedule) { - true => 'VVC_01', - // false => 'VVC_99', default => null, }, )->shouldCache(); diff --git a/app/Reports/Queries/Child/C20.php b/app/Reports/Queries/Child/C20.php index 1962ab50..ae51b0e0 100644 --- a/app/Reports/Queries/Child/C20.php +++ b/app/Reports/Queries/Child/C20.php @@ -5,20 +5,25 @@ namespace App\Reports\Queries\Child; use App\Models\Beneficiary; +use App\Models\Catagraphy; use App\Reports\Queries\ReportQuery; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Query\Builder as QueryBuilder; class C20 extends ReportQuery { /** - * Sum beneficiari with Vaccinat conform calendarului (!= VVC_01); Copil 0-1 ani (VCV_01) OR Copil 1-5 ani (VCV_02) OR Copil 5-14 ani (VCV_03). + * Sum beneficiari with Vaccinat conform calendarului (VSC_97); 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->whereJsonDoesntContain('properties', 'VVC_01') - ->whereJsonOverlaps('properties', ['VCV_01', 'VCV_02', 'VCV_03']); + $query + ->whereJsonOverlaps('properties', ['VCV_01', 'VCV_02', 'VCV_03']) + ->whereHasCatagraphyRelation(Catagraphy::class, function (QueryBuilder $query) { + $query->whereJsonContains('properties->attributes->cat_ssa', 'VSC_97'); + }); }); } } diff --git a/database/data/240722-vulnerabilities.xlsx b/database/data/240722-vulnerabilities.xlsx index 9ce012be..daed36b0 100644 Binary files a/database/data/240722-vulnerabilities.xlsx and b/database/data/240722-vulnerabilities.xlsx differ diff --git a/database/factories/CatagraphyFactory.php b/database/factories/CatagraphyFactory.php index abf26ca0..a1e3f30e 100644 --- a/database/factories/CatagraphyFactory.php +++ b/database/factories/CatagraphyFactory.php @@ -38,7 +38,6 @@ public function definition() 'has_disabilities' => fake()->boolean(), 'has_health_issues' => fake()->boolean(), 'is_social_case' => fake()->boolean(), - 'is_vaccinated_on_schedule' => fake()->boolean(), 'cat_age' => fake()->randomElement($this->vulnerabilities->get('AGE')->keys()), 'cat_as' => fake()->randomElement($this->vulnerabilities->get('AS')->keys()), diff --git a/database/migrations/2024_09_30_152046_add_columns_to_catagraphies_table.php b/database/migrations/2024_09_30_152046_add_columns_to_catagraphies_table.php index aa05b154..b9406957 100644 --- a/database/migrations/2024_09_30_152046_add_columns_to_catagraphies_table.php +++ b/database/migrations/2024_09_30_152046_add_columns_to_catagraphies_table.php @@ -15,7 +15,6 @@ public function up(): void { Schema::table('catagraphies', function (Blueprint $table) { $table->boolean('is_social_case')->nullable()->after('evaluation_date'); - $table->boolean('is_vaccinated_on_schedule')->nullable()->after('cat_ns'); }); } };