Skip to content

Commit

Permalink
Merge pull request #22 from palladiumkenya/main
Browse files Browse the repository at this point in the history
new instance configs and bug fixes
  • Loading branch information
Murithijoshua authored Nov 15, 2023
2 parents 82b490d + 8f16062 commit 2d12611
Show file tree
Hide file tree
Showing 50 changed files with 2,943 additions and 3,004 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/Test deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ jobs:
docker-compose exec -T php php artisan config:cache
docker-compose exec -T php php artisan view:cache
docker-compose exec -T php chmod -R 777 storage/
docker-compose exec -T php php artisan config:cache
docker-compose exec -T php php artisan config:clear
echo "done!"
47 changes: 24 additions & 23 deletions app/Http/Controllers/ClientListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Session;
use RealRashid\SweetAlert\Facades\Alert;


class ClientListController extends Controller
{
public function get_client_list()
Expand Down Expand Up @@ -642,28 +643,28 @@ public function client_extract()


if (Auth::user()->access_level == 'Facility') {
$client_extract = ClientReport::join('tbl_client', 'client_report.id', '=', 'tbl_client.id')
->select(
'tbl_client.enrollment_date',
'tbl_client.art_date',
'client_report.clinic_number',
'client_report.gender',
'client_report.group_name',
'client_report.marital',
'client_report.created_at',
'client_report.month_year',
'client_report.LANGUAGE',
'client_report.consented',
'client_report.txt_time',
'client_report.partner_name',
'client_report.county',
'client_report.sub_county',
'client_report.mfl_code',
'client_report.facility_name',
'client_report.consented',
'tbl_client.wellness_enable',
'tbl_client.upi_no'
)
$client_extract = ClientReport::select(
'tbl_client.enrollment_date',
'tbl_client.art_date',
'client_report.clinic_number',
'client_report.gender',
'client_report.group_name',
'client_report.marital',
'client_report.created_at',
'client_report.month_year',
'client_report.LANGUAGE',
'client_report.consented',
'client_report.txt_time',
'client_report.partner_name',
'client_report.county',
'client_report.sub_county',
'client_report.mfl_code',
'client_report.facility_name',
'client_report.consented',
'tbl_client.wellness_enable',
'tbl_client.upi_no'
)
->join('tbl_client', 'client_report.id', '=', 'tbl_client.id')
->where('client_report.mfl_code', Auth::user()->facility_id)
->get();
}
Expand Down Expand Up @@ -718,7 +719,7 @@ public function client_extract()
'tbl_client.upi_no'
)
->get();
$client_extract;

}

if (Auth::user()->access_level == 'Admin') {
Expand Down
392 changes: 250 additions & 142 deletions app/Http/Controllers/FacilityController.php

Large diffs are not rendered by default.

169 changes: 89 additions & 80 deletions app/Http/Controllers/FinalDashboardController.php

Large diffs are not rendered by default.

2,814 changes: 752 additions & 2,062 deletions app/Http/Controllers/NewDashboardController.php

Large diffs are not rendered by default.

777 changes: 513 additions & 264 deletions app/Http/Controllers/NewReportController.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions app/Http/Controllers/NishauriController.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function nishauri_uptake()
->groupBy('tbl_tx_cur.mfl_code')
->get();
$txcurr = $txcurr->sum('tx_cur');
$all_enrollment = DB::select("CALL sp_nishauri_uptake(?,?,?,?,?,?,?,?)", ["%", "%", "%", "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_enrollment = DB::select("CALL sp_nishauri_national_uptake(?,?,?,?,?,?,?,?)", ["%", "%", "%", "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_module = DB::select("CALL sp_nishauri_access_uptake(?,?,?,?,?,?)", ["%", "%", "%", "%", "1900-01-01", $currentDate]);

$data['txcurr'] = $txcurr;
Expand Down Expand Up @@ -251,7 +251,7 @@ public function nishauri_uptake()
->groupBy('tbl_tx_cur.mfl_code')
->get();
$txcurr = $txcurr->sum('tx_cur');
$all_enrollment = DB::select("CALL sp_nishauri_uptake(?,?,?,?,?,?,?,?)", [$partner, "%", "%", "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_enrollment = DB::select("CALL sp_nishauri_national_uptake(?,?,?,?,?,?,?,?)", [$partner, "%", "%", "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_module = DB::select("CALL sp_nishauri_access_uptake(?,?,?,?,?,?)", [$partner, "%", "%", "%", "1900-01-01", $currentDate]);

$data['txcurr'] = $txcurr;
Expand All @@ -273,7 +273,7 @@ public function nishauri_uptake()
->groupBy('tbl_tx_cur.mfl_code')
->get();
$txcurr = $txcurr->sum('tx_cur');
$all_enrollment = DB::select("CALL sp_nishauri_uptake(?,?,?,?,?,?,?,?)", ["%", $county, "%", "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_enrollment = DB::select("CALL sp_nishauri_national_uptake(?,?,?,?,?,?,?,?)", ["%", $county, "%", "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_module = DB::select("CALL sp_nishauri_access_uptake(?,?,?,?,?,?)", ["%", $county, "%", "%", "1900-01-01", $currentDate]);

$data['txcurr'] = $txcurr;
Expand All @@ -294,7 +294,7 @@ public function nishauri_uptake()
->groupBy('tbl_tx_cur.mfl_code')
->get();
$txcurr = $txcurr->sum('tx_cur');
$all_enrollment = DB::select("CALL sp_nishauri_uptake(?,?,?,?,?,?,?,?)", ["%", "%", $subcounty, "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_enrollment = DB::select("CALL sp_nishauri_national_uptake(?,?,?,?,?,?,?,?)", ["%", "%", $subcounty, "%", "1900-01-01", $currentDate, "1900-01-01", $currentDate]);
$all_module = DB::select("CALL sp_nishauri_access_uptake(?,?,?,?,?,?)", ["%", "%", $subcounty, "%", "1900-01-01", $currentDate]);

$data['txcurr'] = $txcurr;
Expand Down
24 changes: 15 additions & 9 deletions app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,28 @@ public function consented_report()
}

if (Auth::user()->access_level == 'Facility') {
$consented_clients = Client::join('tbl_groups', 'tbl_groups.id', 'tbl_client.group_id')
->select('tbl_client.clinic_number', 'tbl_client.file_no', 'tbl_client.f_name', 'tbl_client.m_name', 'tbl_client.l_name', 'tbl_client.phone_no', 'tbl_client.dob', 'tbl_client.client_status', 'tbl_groups.name', 'tbl_client.created_at', 'tbl_client.smsenable', 'tbl_client.enrollment_date', 'tbl_client.art_date', 'tbl_client.updated_at', 'tbl_client.status', 'tbl_client.consent_date')
->where('tbl_client.smsenable', '=', 'Yes')
->where('tbl_client.status', '=', 'Active')
$consented_clients = Client::leftJoin('tbl_groups', 'tbl_groups.id', 'tbl_client.group_id')
->leftJoin(DB::raw('(SELECT client_id, DATE(created_at) AS created_at
FROM tbl_appointment a1
WHERE a1.id = (SELECT MAX(a2.id) FROM tbl_appointment a2 WHERE a2.client_id = a1.client_id)
AND a1.consented = "YES") a'), 'tbl_client.id', '=', 'a.client_id')
->select('tbl_client.clinic_number', 'tbl_client.file_no', 'tbl_client.f_name', 'tbl_client.m_name', 'tbl_client.l_name', 'tbl_client.phone_no', 'tbl_client.dob', 'tbl_client.client_status', 'tbl_groups.name', 'tbl_client.created_at', DB::raw('CASE WHEN tbl_client.smsenable="Yes" THEN "Yes" WHEN a.client_id IS NOT NULL THEN
"Yes" ELSE "No" END as smsenable'), 'tbl_client.enrollment_date', 'tbl_client.art_date', 'tbl_client.updated_at', 'tbl_client.status', 'tbl_client.consent_date')
->whereNull('tbl_client.hei_no')
->where('tbl_client.mfl_code', Auth::user()->facility_id)
->paginate(1000);
->paginate(15000);
}

if (Auth::user()->access_level == 'Partner') {
$all_partners = Partner::where('status', '=', 'Active')
->pluck('name', 'id');
$consented_clients = Client::join('tbl_groups', 'tbl_groups.id', 'tbl_client.group_id')
->select('tbl_client.clinic_number', 'tbl_client.file_no', 'tbl_client.f_name', 'tbl_client.m_name', 'tbl_client.l_name', 'tbl_client.phone_no', 'tbl_client.dob', 'tbl_client.client_status', 'tbl_groups.name', 'tbl_client.created_at', 'tbl_client.smsenable', 'tbl_client.enrollment_date', 'tbl_client.art_date', 'tbl_client.updated_at', 'tbl_client.status', 'tbl_client.consent_date')
->where('tbl_client.smsenable', '=', 'Yes')
->where('tbl_client.status', '=', 'Active')
$consented_clients = Client::leftJoin('tbl_groups', 'tbl_groups.id', 'tbl_client.group_id')
->leftJoin(DB::raw('(SELECT client_id, DATE(created_at) AS created_at
FROM tbl_appointment a1
WHERE a1.id = (SELECT MAX(a2.id) FROM tbl_appointment a2 WHERE a2.client_id = a1.client_id)
AND a1.consented = "YES") a'), 'tbl_client.id', '=', 'a.client_id')
->select('tbl_client.clinic_number', 'tbl_client.file_no', 'tbl_client.f_name', 'tbl_client.m_name', 'tbl_client.l_name', 'tbl_client.phone_no', 'tbl_client.dob', 'tbl_client.client_status', 'tbl_groups.name', 'tbl_client.created_at', DB::raw('CASE WHEN tbl_client.smsenable="Yes" THEN "Yes" WHEN a.client_id IS NOT NULL THEN
"Yes" ELSE "No" END as smsenable'), 'tbl_client.enrollment_date', 'tbl_client.art_date', 'tbl_client.updated_at', 'tbl_client.status', 'tbl_client.consent_date')
->whereNull('tbl_client.hei_no')
->where('tbl_client.partner_id', Auth::user()->partner_id)
->paginate(1000);
Expand Down
16 changes: 16 additions & 0 deletions app/Models/ClientDashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Watson\Rememberable\Rememberable;

class ClientDashboard extends Model
{
use HasFactory;
use Rememberable;

public $table = 'etl_client_dashboard';
public $timestamps = false;
}
29 changes: 29 additions & 0 deletions config/UshauriDOD/database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

return [

'default' => env('DB_CONNECTION', 'mysql'),

'connections' => [

'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'dod_db_host'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'dod_db_name'),
'username' => env('DB_USERNAME', 'dod_db_user'),
'password' => env('DB_PASSWORD', 'dod_db_password'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'strict' => true,
'engine' => null,
],

// Other database connections...

],

// ...

];
29 changes: 29 additions & 0 deletions config/UshauriPublic/database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

return [

'default' => env('DB_CONNECTION', 'mysql'),

'connections' => [

'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'public_db_host'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'public_db_name'),
'username' => env('DB_USERNAME', 'public_db_user'),
'password' => env('DB_PASSWORD', 'public_db_password'),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'strict' => true,
'engine' => null,
],

// Other database connections...

],

// ...

];
15 changes: 15 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,19 @@

],

'config' => [
'app' => env('INSTANCE') . '/app.php',
'auth' => env('INSTANCE') . '/auth.php',
'broadcasting' => env('INSTANCE') . '/broadcasting.php',
'cache' => env('INSTANCE') . '/cache.php',
'database' => env('INSTANCE') . '/database.php',
'filesystems' => env('INSTANCE') . '/filesystems.php',
'mail' => env('INSTANCE') . '/mail.php',
'queue' => env('INSTANCE') . '/queue.php',
'services' => env('INSTANCE') . '/services.php',
'session' => env('INSTANCE') . '/session.php',
'view' => env('INSTANCE') . '/view.php',
],


];
Binary file added public/assets/images/DOD_Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions resources/views/appointments/appointments_list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
<thead>
<tr>
<th>No.</th>
@if (env('INSTANCE') === 'UshauriDOD')
<th>KDOD Number</th>
<th>Service No</th>
@else
<th>Clinic Number</th>
<th>Serial No</th>
@endif
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
Expand Down
9 changes: 7 additions & 2 deletions resources/views/appointments/future_appointments.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@
<thead>
<tr>
<th>No.</th>
@if (env('INSTANCE') === 'UshauriDOD')
<th>KDOD Number</th>
<th>Service No</th>
@else
<th>Clinic Number</th>
<th>UPI Number</th>
<th>Serial No</th>
@endif
<th>UPI Number</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Last Name</th>
Expand All @@ -43,8 +48,8 @@
<tr>
<td> {{ $loop->iteration }}</td>
<td> {{$result->clinic_number}}</td>
<td> {{$result->upi_no}}</td>
<td> {{$result->file_no}}</td>
<td> {{$result->upi_no}}</td>
<td> {{$result->f_name}}</td>
<td> {{$result->m_name}}</td>
<td> {{$result->l_name}}</td>
Expand Down
4 changes: 4 additions & 0 deletions resources/views/appointments/future_apps_edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
<thead>
<tr>
<th>No.</th>
@if (env('INSTANCE') === 'UshauriDOD')
<th>KDOD Number</th>
@else
<th>Clinic Number</th>
@endif
<th>UPI Number</th>
<th>Appointment Date</th>
<th>Appointment Type</th>
Expand Down
Loading

0 comments on commit 2d12611

Please sign in to comment.