updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
@@ -1,29 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class AccountsReceivableClearanceSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$debtors = \Streamline\Models\Debtor::all();
foreach ($debtors as $debtor){
clearDebt($debtor->id);
}
$debt_plans = \Streamline\Models\DebtPlan::all();
foreach ($debt_plans as $debt_plan){
clearDebtPlan($debt_plan->id);
}
$paid_invoices = \Streamline\Models\InvoicePayment::all();
foreach ($paid_invoices as $invoice) {
clearInvoice($invoice->invoice_number);
}
}
}
@@ -1,22 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class DataCorrectionBillDateSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$all_bills = \Streamline\Models\HospitalBill::all();
foreach ($all_bills as $bill){
\Streamline\Models\HospitalBill::where('id', $bill->id)->update([
'bill_date' => \Carbon\Carbon::parse($bill->bill_date)->toDateString(),
'bill_due_date' => \Carbon\Carbon::parse($bill->bill_due_date)->toDateString(),
]);
}
}
}
@@ -1,61 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Streamline\Models\Debtor;
use Streamline\Models\DebtPlan;
use Streamline\Models\SundryDeposit;
use Streamline\Models\TreatmentDeposits;
class DataCorrectionCheckForCompleteOnDeposits extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$sundry_deposits = \Streamline\Models\SundryDeposit::all();
$treatment_deposits = \Streamline\Models\TreatmentDeposits::all();
$invoices = \Streamline\Models\PatientCategoryInvoice::all();
$treatments = $sundries = $debts = $debt_plans = $invoices = [];
foreach ($treatment_deposits as $deposit){
if ($deposit->patient_amount_paid != array_sum(explode(',', $deposit->treatment_subtotals))){
$balance = array_sum(explode(',', $deposit->treatment_subtotals)) - $deposit->patient_amount_paid ;
$treatments[] = $deposit;
$debts[] = Debtor::where('patient_id', $deposit->patient_id)->where('episode_id', $deposit->episode_id)->where('balance', $balance)->get()->first();
$debt_plans[] = DebtPlan::where('patient_id', $deposit->patient_id)->where('episode_id', $deposit->episode_id)->where('staff_guarantor_to_pay', $balance)->get()->first();
TreatmentDeposits::where('id', $deposit->id)->update(['payment_complete'=>0]);
}else{
TreatmentDeposits::where('id', $deposit->id)->update(['payment_complete'=>1]);
}
}
foreach ($sundry_deposits as $deposit){
if ($deposit->patient_amount_paid != array_sum(explode(',', $deposit->sundry_subtotals))){
$balance = array_sum(explode(',', $deposit->sundry_subtotals)) - $deposit->patient_amount_paid ;
$sundries[] = $deposit;
$debts[] = Debtor::where('patient_id', $deposit->patient_id)->where('episode_id', $deposit->episode_id)->where('balance', $balance)->get()->first();
$debt_plans[] = DebtPlan::where('patient_id', $deposit->patient_id)->where('episode_id', $deposit->episode_id)->where('staff_guarantor_to_pay', $balance)->get()->first();
SundryDeposit::where('id', $deposit->id)->update(['payment_complete'=>0]);
}else{
SundryDeposit::where('id', $deposit->id)->update(['payment_complete'=>1]);
}
}
foreach ($invoices as $invoice){
if($invoice->tag_id == 5 || $invoice->tag_id == 3 || $invoice->tag_id == 1){
if ($deposit->patient_amount_paid != array_sum(explode(',', $deposit->items_amounts))){
$balance = array_sum(explode(',', $deposit->items_amounts)) - $deposit->amount_paid_off ;
$invoice[] = $invoice;
\Streamline\Models\PatientCategoryInvoice::where('id', $invoice->id)->update(['payment_complete'=>0]);
}else{
\Streamline\Models\PatientCategoryInvoice::where('id', $invoice->id)->update(['payment_complete'=>1]);
}
}
}
}
}
@@ -1,42 +0,0 @@
<?php
namespace Database\Seeders;
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Streamline\Models\Banking;
use Streamline\Models\CashierIncome;
class DataCorrectionCopyCashierIncomeRecordToBanking extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$cashier_incomes = CashierIncome::all();
foreach ($cashier_incomes as $income){
$exists = Banking::where('trans_id', $income->receipt_number)->get()->toArray();
if (empty($exists)){
$current_bank_balance = Banking::where('bank', 10)->latest('trans_date')->first();
$balance_after_addition = (!is_null($current_bank_balance)) ? (int)$current_bank_balance->account_balance + (int)$income->amount : 0;
$bank_record = new Banking;
$bank_record->trans_type = 'DEPOSIT';
$bank_record->trans_date = Carbon::parse($income->created_at)->toDateString();
$bank_record->bank = 10;
$bank_record->other_accounts = 'sales and payments';
$bank_record->account_balance = $balance_after_addition;
$bank_record->credit = $income->amount;
$bank_record->debit = 0;
$bank_record->memo = 'deposit to un-deposited funds.';
$bank_record->trans_id = $income->receipt_number;
$bank_record->created_by = $income->brought_by;
$bank_record->save();
}
}
}
}
@@ -1,30 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class DataCorrectionDebtorPaymentSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$payments = \Streamline\Models\DebtorPayment::all();
foreach ($payments as $payment){
if($payment->amount_paid_history == null){
$amount_paid_history = serialize(array($payment->amount_paid));
\Streamline\Models\DebtorPayment::where('id', $payment->id)->update(['amount_paid_history'=>$amount_paid_history]);
}
if($payment->receipt_history == null){
$receipt_history = serialize(array($payment->receipt_no));
\Streamline\Models\DebtorPayment::where('id', $payment->id)->update(['receipt_history'=>$receipt_history]);
}
if($payment->balance_history == null){
$balance_history = serialize(array(0));
\Streamline\Models\DebtorPayment::where('id', $payment->id)->update(['balance_history'=>$balance_history]);
}
}
}
}
@@ -1,67 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class DataCorrectionHospitalBillPayableAccountSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$bills = \Streamline\Models\HospitalBill::all();
foreach ($bills as $bill){
$payable_account_array = []; $item_amount_paid = []; $item_balance_remaining = []; $deductions = [];
$items_array = explode(',', $bill->item_ids);
$items_subtotal_array = explode(',', $bill->item_subtotals);
$bill_balance = $bill->balance;
$bill_total = $bill->total_amount;
$bill_amount_paid = (is_null($bill_balance) ? 0 : (int)$bill_total - (int)$bill_balance);
for($x = 0; $x < count($items_array); $x++){
$new_amount = $bill_amount_paid - array_sum($deductions);
$payable_account = get_name($items_array[$x], 'id', 'payable_account','payment_items');
$payable_account_array[] = ($bill->bill_type == 'GEN') ? $payable_account : 14;
if(is_null($bill_balance)){
$item_amount_paid[] = 0;
$item_balance_remaining[] = $items_subtotal_array[$x];
}else if($bill_balance == 0){
$item_amount_paid[] = $items_subtotal_array[$x];
$item_balance_remaining[] = 0;
}
else{
if($items_subtotal_array[$x] <= $new_amount){
$item_amount_paid[] = $items_subtotal_array[$x];
$item_balance_remaining[] = 0;
$deductions[] = $items_subtotal_array[$x];
}else{
$item_amount_paid[] = $new_amount;
$item_balance_remaining[] = (int)$items_subtotal_array[$x] - (int)$new_amount;
$deductions[] = $new_amount;
}
}
}
\Streamline\Models\HospitalBill::where('id', $bill->id)->update([
'payable_account' => implode(',', $payable_account_array),
'item_amount_paid' => implode(',', $item_amount_paid),
'item_balance_remaining' => implode(',', $item_balance_remaining)
]);
}
}
}
@@ -1,40 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class DataCorrectionIncomeAccountAmounts extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$service_payments = \Streamline\Models\ServiceDeposit::all();
$investigation_payments = \Streamline\Models\InvestigationDeposit::all();
$procedure_payments = \Streamline\Models\ProcedureDeposit::all();
$sundry_payments = \Streamline\Models\SundryDeposit::all();
$treatment_payments = \Streamline\Models\TreatmentDeposits::all();
foreach ($service_payments as $payment){
split_service_payment($payment->id);
}
foreach ($investigation_payments as $payment){
split_investigation_payment($payment->id);
}
foreach ($procedure_payments as $payment){
split_procedure_payment($payment->id);
}
foreach ($sundry_payments as $payment){
split_sundry_payment($payment->id);
}
foreach ($treatment_payments as $payment){
split_treatment_payment($payment->id);
}
}
}
@@ -1,65 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class DataCorrectionIncomeAccountStrings extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$service_payments = \Streamline\Models\ServiceDeposit::all();
$investigation_payments = \Streamline\Models\InvestigationDeposit::all();
$procedure_payments = \Streamline\Models\ProcedureDeposit::all();
$sundry_payments = \Streamline\Models\SundryDeposit::all();
$treatment_payments = \Streamline\Models\TreatmentDeposits::all();
foreach ($service_payments as $payment){
$income_account_array = [];
$item_array = explode(',', $payment->items_ids);
for ($x = 0; $x < count($item_array); $x ++){
$income_account_array[] = get_name($item_array[$x], 'id', 'account_id', 'services');
}
\Streamline\Models\ServiceDeposit::where('id', $payment->id)->update(['current_chart_of_accounts'=> implode(',',$income_account_array)]);
}
foreach ($investigation_payments as $payment){
$income_account_array = [];
$item_array = explode(',', $payment->investigation_items);
for ($x = 0; $x < count($item_array); $x ++){
$income_account_array[] = get_name($item_array[$x], 'id', 'account_id', 'investigations');
}
\Streamline\Models\InvestigationDeposit::where('id', $payment->id)->update(['current_chart_of_accounts'=> implode(',',$income_account_array)]);
}
foreach ($procedure_payments as $payment){
$income_account_array = [];
$item_array = explode(',', $payment->procedure_items);
for ($x = 0; $x < count($item_array); $x ++){
$income_account_array[] = get_name($item_array[$x], 'id', 'account_id', 'procedures');
}
\Streamline\Models\ProcedureDeposit::where('id', $payment->id)->update(['current_chart_of_accounts'=> implode(',',$income_account_array)]);
}
foreach ($treatment_payments as $payment){
$income_account_array = [];
$item_array = explode(',', $payment->treatment_items);
for ($x = 0; $x < count($item_array); $x ++){
$income_account_array[] = get_name($item_array[$x], 'id', 'account_id', 'drugs');
}
\Streamline\Models\TreatmentDeposits::where('id', $payment->id)->update(['current_chart_of_accounts'=> implode(',',$income_account_array)]);
}
foreach ($sundry_payments as $payment){
$income_account_array = [];
$item_array = explode(',', $payment->sundry_items);
for ($x = 0; $x < count($item_array); $x ++){
$income_account_array[] = get_name($item_array[$x], 'id', 'account_id', 'sundries');
}
\Streamline\Models\SundryDeposit::where('id', $payment->id)->update(['current_chart_of_accounts'=> implode(',',$income_account_array)]);
}
}
}
@@ -1,51 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class DataCorrectionInventoryAndCostOfGoodsAccountSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$drugs = \Streamline\Models\Drug::all();
$sundries = \Streamline\Models\Sundry::all();
$sundry_deposits = \Streamline\Models\SundryDeposit::all();
$treatment_deposits = \Streamline\Models\TreatmentDeposits::all();
$drugs_cost_of_good_account_id = \Streamline\Models\ChartOfAccount::where('id', 17)->pluck('id')->first();
$sundries_cost_of_good_account_id = \Streamline\Models\ChartOfAccount::where('id', 5)->pluck('id')->first();
$drugs_inventory_asset_account_id = \Streamline\Models\ChartOfAccount::where('id', 18)->pluck('id')->first();
$sundries_inventory_asset_account_id = \Streamline\Models\ChartOfAccount::where('id', 24)->pluck('id')->first();
foreach ($drugs as $drug) {
\Streamline\Models\Drug::where('id', $drug->id)->update([
'cost_of_goods_account' => $drugs_cost_of_good_account_id,
'inventory_account' => $drugs_inventory_asset_account_id
]);
}
foreach ($sundries as $sundry) {
\Streamline\Models\Sundry::where('id', $sundry->id)->update([
'cost_of_goods_account' => $sundries_cost_of_good_account_id,
'inventory_account' => $sundries_inventory_asset_account_id
]);
}
foreach ($treatment_deposits as $treatment) {
\Streamline\Models\TreatmentDeposits::where('id', $treatment->id)->update([
'cost_of_goods_account' => $drugs_cost_of_good_account_id,
'inventory_account' => $drugs_inventory_asset_account_id
]);
}
foreach ($sundry_deposits as $sundry) {
\Streamline\Models\TreatmentDeposits::where('id', $treatment->id)->update([
'cost_of_goods_account' => $sundries_cost_of_good_account_id,
'inventory_account' => $sundries_inventory_asset_account_id
]);
}
}
}
@@ -31,9 +31,7 @@ use Database\Seeders\DebtPlanArrangementsTableSeeder;
use Database\Seeders\DefaultBedCategoryIncomeAccount;
use Database\Seeders\DentalsTableSeeder;
use Database\Seeders\DiagnosesTableSeeder;
use Database\Seeders\DiscountCategoriesTableSeeder;
use Database\Seeders\DistrictsTableSeeder;
use Database\Seeders\DonorsTableSeeder;
use Database\Seeders\DosageFrequenciesClassTableSeeder;
use Database\Seeders\DrugCategoriesTableSeeder;
use Database\Seeders\DrugFormsTableSeeder;
@@ -41,13 +39,9 @@ use Database\Seeders\DrugUnitsTableSeeder;
use Database\Seeders\FamilyPlanningMethodsTableSeeder;
use Database\Seeders\FamilyRelationshipsTableSeeder;
use Database\Seeders\FinancePointTagTableSeeder;
use Database\Seeders\GeneralSettingsSeeder;
use Database\Seeders\HeadsofFamilyTableSeeder;
use Database\Seeders\HeartRegularitiesTableSeeder;
use Database\Seeders\HmisCategoriesTableSeeder;
use Database\Seeders\HmisInvestigationCategoriesInpatientTableSeeder;
use Database\Seeders\InsuranceGroupsTableSeeder;
use Database\Seeders\InsuranceMembersTableSeeder;
use Database\Seeders\InvestigationCategoriesTableSeeder;
use Database\Seeders\InvestigationSuperCategoriesSeeder;
use Database\Seeders\IvFluidsTableSeeder;
@@ -68,13 +62,11 @@ use Database\Seeders\OutcomesTableSeeder;
use Database\Seeders\ParishesSeeder;
use Database\Seeders\PasswordExpirationForExistingUsersSeeder;
use Database\Seeders\PatientCategorySeeder;
use Database\Seeders\PatientDiscountsTableSeeder;
use Database\Seeders\PatientsTableSeeder;
use Database\Seeders\PaymentItemsTableSeeder;
use Database\Seeders\PayrollDefaultsSeeder;
use Database\Seeders\PermissionsCategoryTableSeeder;
use Database\Seeders\PermissionTableSeeder;
use Database\Seeders\PremiumsTableSeeder;
use Database\Seeders\ProcedureCategoriesTableSeeder;
use Database\Seeders\QuotationTypesTableSeeder;
use Database\Seeders\RadiologiesTableSeeder;
@@ -197,8 +189,7 @@ class DatabaseSeeder extends Seeder {
$this->call(NutritionTableSeeder::class);
$this->call(ArvAdherenceReasonTableSeeder::class);
$this->call(TheatreLocationsTableSeeder::class);
$this->call(CountriesTableSeeder::class);
$this->call(GeneralSettingsSeeder::class);
$this->call(CountriesTableSeeder::class);
$this->call(LaboratorySpecimenTableSeeder::class);
$this->call(InvestigationSuperCategoriesSeeder::class);
$this->call(SpecializedInvestigationVariablesSeeder::class);
@@ -1,120 +0,0 @@
<?php
use Illuminate\Database\Seeder;
use Streamline\Models\Debtor;
use Streamline\Models\DebtPlan;
use Streamline\Models\InsuranceExpenditure;
class DebtTablesAccountSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
$debtors = \Streamline\Models\Debtor::all();
$debt_plans = \Streamline\Models\DebtPlan::all();
$insurance_expenditures = \Streamline\Models\InsuranceExpenditure::all();
$inventory_account_id = \Streamline\Models\ChartOfAccount::where('type', 10)->pluck('id')->first();
$cost_of_good_account_id = \Streamline\Models\ChartOfAccount::where('type', 7)->pluck('id')->first();
foreach ($debtors as $invoice){
//Consultations / Services
if($invoice->tag_id == 6 || $invoice->tag_id == 8 || $invoice->tag_id == 7 || $invoice->tag_id == 10){
Debtor::where('id', $invoice->id)->update(['income_account'=> 7]);
}
//Drugs / Treatments
elseif ($invoice->tag_id == 3 || $invoice->tag_id == 1){
Debtor::where('id', $invoice->id)->update([
'income_account'=> 4,
'inventory_account'=> $inventory_account_id,
'cost_of_goods_account'=> $cost_of_good_account_id
]);
}
//Sundries
elseif ($invoice->tag_id == 5 ){
Debtor::where('id', $invoice->id)->update([
'income_account'=> 4,
'inventory_account'=> $inventory_account_id,
'cost_of_goods_account'=> $cost_of_good_account_id
]);
}
//Investigations
elseif ($invoice->tag_id == 2 ){
Debtor::where('id', $invoice->id)->update(['income_account'=> 11]);
}
//Procedures
elseif ($invoice->tag_id == 4 ){
Debtor::where('id', $invoice->id)->update(['income_account'=> 8]);
}
}
foreach ($debt_plans as $invoice){
//Consultations / Services
if($invoice->tag_id == 6 || $invoice->tag_id == 8 || $invoice->tag_id == 7 || $invoice->tag_id == 10){
DebtPlan::where('id', $invoice->id)->update(['income_account'=> 7]);
}
//Drugs / Treatments
elseif ($invoice->tag_id == 3 || $invoice->tag_id == 1){
DebtPlan::where('id', $invoice->id)->update([
'income_account'=> 4,
'inventory_account'=> $inventory_account_id,
'cost_of_goods_account'=> $cost_of_good_account_id
]);
}
//Sundries
elseif ($invoice->tag_id == 5 ){
DebtPlan::where('id', $invoice->id)->update([
'income_account'=> 4,
'inventory_account'=> $inventory_account_id,
'cost_of_goods_account'=> $cost_of_good_account_id
]);
}
//Investigations
elseif ($invoice->tag_id == 2 ){
DebtPlan::where('id', $invoice->id)->update(['income_account'=> 11]);
}
//Procedures
elseif ($invoice->tag_id == 4 ){
DebtPlan::where('id', $invoice->id)->update(['income_account'=> 8]);
}
}
foreach ($insurance_expenditures as $invoice){
//Consultations / Services
if($invoice->tag_id == 6 || $invoice->tag_id == 8 || $invoice->tag_id == 7 || $invoice->tag_id == 10){
InsuranceExpenditure::where('id', $invoice->id)->update(['income_account'=> 7]);
}
//Drugs / Treatments
elseif ($invoice->tag_id == 3 || $invoice->tag_id == 1){
InsuranceExpenditure::where('id', $invoice->id)->update([
'income_account'=> 4,
'inventory_account'=> $inventory_account_id,
'cost_of_goods_account'=> $cost_of_good_account_id
]);
}
//Sundries
elseif ($invoice->tag_id == 5 ){
InsuranceExpenditure::where('id', $invoice->id)->update([
'income_account'=> 12,
'inventory_account'=> $inventory_account_id,
'cost_of_goods_account'=> $cost_of_good_account_id
]);
}
//Investigations
elseif ($invoice->tag_id == 2 ){
InsuranceExpenditure::where('id', $invoice->id)->update(['income_account'=> 11]);
}
//Procedures
elseif ($invoice->tag_id == 4 ){
InsuranceExpenditure::where('id', $invoice->id)->update(['income_account'=> 8]);
}
}
}
}
@@ -1,32 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Streamline\Models\DiscountCategories;
class DiscountCategoriesTableSeeder extends Seeder {
/**
* Run the database seeders.
*
* @return void
*/
public function run(){
DiscountCategories::firstOrCreate(['id' => '1', 'name' => 'Test Fixed Figure', 'discount_type' => '1', 'donor_id' => '1', 'patient_category' => '1', 'donor_amount' => 20000, 'patient_amount' => 10000, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '2', 'name' => 'Test Patient Ceiling', 'discount_type' => '2', 'donor_id' => '1', 'patient_category' => '1', 'donor_amount' => 0, 'patient_amount' => 10000, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '3', 'name' => 'Test Patient TopUp', 'discount_type' => '3', 'donor_id' => '1', 'patient_category' => '1', 'donor_amount' => 20000, 'patient_amount' => 0, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '4', 'name' => 'Test Fixed Figure', 'discount_type' => '1', 'donor_id' => '1', 'patient_category' => '2', 'donor_amount' => 20000, 'patient_amount' => 10000, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '5', 'name' => 'Test Patient Ceiling', 'discount_type' => '2', 'donor_id' => '1', 'patient_category' => '2', 'donor_amount' => 0, 'patient_amount' => 10000, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '6', 'name' => 'Test Patient TopUp', 'discount_type' => '3', 'donor_id' => '1', 'patient_category' => '2', 'donor_amount' => 20000, 'patient_amount' => 0, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '7', 'name' => 'Test Fixed Figure', 'discount_type' => '1', 'donor_id' => '1', 'patient_category' => '3', 'donor_amount' => 20000, 'patient_amount' => 10000, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '8', 'name' => 'Test Patient Ceiling', 'discount_type' => '2', 'donor_id' => '1', 'patient_category' => '3', 'donor_amount' => 0, 'patient_amount' => 10000, 'created_by' => 1, 'updated_by' => 1]);
DiscountCategories::firstOrCreate(['id' => '9', 'name' => 'Test Patient TopUp', 'discount_type' => '3', 'donor_id' => '1', 'patient_category' => '3', 'donor_amount' => 20000, 'patient_amount' => 0, 'created_by' => 1, 'updated_by' => 1]);
}
}
@@ -1,16 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class DonorsTableSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run(){
\Streamline\Models\Donors::firstOrCreate(['id' => '1', 'name' => 'Donor 1', 'created_at' => '1', 'updated_by' => '1']);
}
}
@@ -1,22 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Streamline\Models\GeneralSettings;
class GeneralSettingsSeeder extends Seeder {
/**
* Run the database seeders.
*
* @return void
*/
public function run() {
GeneralSettings::firstOrCreate([
'ward_prescription_model' => '1',
'donor_feature' => '0',
'currency_code' => 'Ugx',
]);
}
}
@@ -1,17 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class HeadsofFamilyTableSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
\Streamline\Models\HeadOfFamily::firstOrCreate(['id' => '1','name' => 'Test Insurance Active','photo' => null,'group_id' => '1','patient_id' => '3','created_by' => '1','updated_by' => '1']);
}
}
@@ -18,21 +18,9 @@ class HmisCategoriesTableSeeder extends Seeder {
//title mapped to number
// ['id' => '1','name' => 'Epidemic-Prone Diseases', 'number' => '1.3.1', 'type' => '1', 'section_number' => null],
['id' => '2','name' => 'Other Infectious/Communicable Diseases', 'number' => '1.3.2','type' => '1', 'section_number' => null],
// ['id' => '3','name' => 'Neonatal Diseases', 'number' => '1.3.3', 'type' => '1', 'section_number' => null],
['id' => '4','name' => 'None Communicable Diseases/Conditions', 'number' => '1.3.4', 'type' => '1', 'section_number' => null],
// ['id' => '5','name' => 'Oral Diseases', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '6','name' => 'ENT Conditions', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '7','name' => 'Eye Conditions', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '8','name' => 'Mental Health', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '9','name' => 'Chronic Respiratory Diseases', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '10','name' => 'Cancers', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '11','name' => 'Cardiovascular Diseases', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '12','name' => 'Endocrine and Metabolic Disorders', 'number' => '', 'type' => '1', 'section_number' => null],
['id' => '13','name' => 'Malnutrition', 'number' => '', 'type' => '1', 'section_number' => null],
// ['id' => '14','name' => 'Injuries', 'number' => '', 'type' => '1', 'section_number' => null],
['id' => '15','name' => 'Minor Operations in OPD', 'number' => '1.3.5', 'type' => '1', 'section_number' => null],
// ['id' => '16','name' => 'Neglected Tropical Diseases (NTDs)', 'number' => '1.3.6', 'type' => '1', 'section_number' => null],
// ['id' => '17','name' => 'Maternal Conditions', 'number' => '1.3.7', 'type' => '1', 'section_number' => null],
['id' => '18','name' => 'Other OPD Conditions', 'number' => '1.3.8', 'type' => '1', 'section_number' => null],
['id' => '10046','name' => 'Obstetrics/Gynaecology', 'number' => '3.1', 'type' => '1', 'section_number' => '3'],
['id' => '10047','name' => 'Cardiothoracic Surgery', 'number' => '3.2', 'type' => '1', 'section_number' => '3'],
@@ -113,14 +101,17 @@ class HmisCategoriesTableSeeder extends Seeder {
foreach ($titles as $title) {
// Prevent re-seeding the same data
HmisCategory::firstOrCreate([
'id' => $title['id'],
'number' => $title['number'],
'title' => $title['name'],
'type' => $title['type'],
'section_number' => $title['section_number'],
'created_by' => 1
]);
HmisCategory::updateOrCreate(
['id' => $title['id']],
[
'number' => $title['number'],
'title' => $title['name'],
'type' => $title['type'],
'editable' => '0',
'section_number' => $title['section_number'],
'created_by' => 1
]
);
}
}
@@ -692,6 +692,7 @@ class HmisCategoryOptionsSeeder extends Seeder
['id' => '678','name' => 'Alcohol use ', 'number' => 'RB01','hmis_category_id' => '10118'],
['id' => '679','name' => 'Tobacco use', 'number' => 'RB02','hmis_category_id' => '10118'],
['id' => '680','name' => 'Tobacco exposure', 'number' => 'RB03','hmis_category_id' => '10118'],
['id' => '681','name' => 'All Others', 'number' => 'LD10','hmis_category_id' => '10090'],
);
foreach ($hmis_category_options as $hmis_category_option) {
@@ -702,6 +703,7 @@ class HmisCategoryOptionsSeeder extends Seeder
'name' => $hmis_category_option['name'],
'number' => $hmis_category_option['number'],
'hmis_category_id' => $hmis_category_option['hmis_category_id'],
'editable' => '0',
'parent_option' => $hmis_category_option['parent_option'] ?? null,
'created_by' => 1
]);
@@ -1,15 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class InsuranceGroupsTableSeeder extends Seeder {
/**
* Run the database seeders.
*
* @return void
*/
public function run(){
\Streamline\Models\InsuranceGroup::firstOrCreate(['id' => '1','name' => 'Group 1','contact_name' => 'Contact 1','contact_number' => '0777777777','insurance_start_date' => null,'created_by' => '1','updated_by' => '1']);
}
}
@@ -1,17 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class InsuranceMembersTableSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
\Streamline\Models\InsuranceMember::firstOrCreate(['id' => '1','photo' => null,'relationship_to_head' => '1','group_id' => '1','family_id' => '1','is_family_head' => '1','patient_id' => '3','created_by' => '1','updated_by' => '1']);
}
}
@@ -55,7 +55,7 @@ class ObservationsTableSeeder extends Seeder
Observation::firstOrCreate([
'system_name' => $observation['system_name'],
'name' => $observation['name'],
'slug' => str_replace(' ', '_', $observation['name']),
'slug' => strtolower(str_replace(' ', '_', $observation['name'])),
'measurement' => $observation['measurement'],
'lower_limit' => $observation['lower_limit'],
'upper_limit' => $observation['upper_limit'],
@@ -1,16 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class PatientDiscountsTableSeeder extends Seeder {
/**
* Run the database seeders.
*
* @return void
*/
public function run() {
\Streamline\Models\PatientDiscount::firstOrCreate(['id' => '1', 'patient_category' => '1', 'discount' => '0', 'pay_later' => '0', 'created_at' => '1']);
\Streamline\Models\PatientDiscount::firstOrCreate(['id' => '2', 'patient_category' => '2', 'discount' => '0', 'pay_later' => '1', 'created_at' => '1']);
}
}
@@ -269,7 +269,7 @@ class PermissionTableSeeder extends Seeder
array('name' => 'hmis-ward-create', 'permission_category_id' => '23', 'description' => 'Create Hmis ward', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'hmis-ward-edit', 'permission_category_id' => '23', 'description' => 'Edit Hmis ward', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'hmis-ward-delete', 'permission_category_id' => '23', 'description' => 'Deactivate and reactivate Hmis wards', 'guard_name' => 'web', 'crud' => 'delete', 'long_description' => ''),
array('name' => 'clinic-create', 'permission_category_id' => '12', 'description' => 'Create clinic', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'clinic-edit', 'permission_category_id' => '12', 'description' => 'Edit clinic', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'clinic-delete', 'permission_category_id' => '12', 'description' => 'Deactivate and reactivate clinics', 'guard_name' => 'web', 'crud' => 'delete', 'long_description' => ''),
@@ -569,6 +569,8 @@ class PermissionTableSeeder extends Seeder
array('name' => 'view-inpatient-sheet', 'permission_category_id' => '4', 'description' => 'View patient\'s inpatient sheet', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => ''),
array('name' => 'view-inpatient-billing', 'permission_category_id' => '4', 'description' => 'View patient\'s inpatient billing', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => ''),
array('name' => 'view-maternity-admission', 'permission_category_id' => '4', 'description' => 'View patient\'s maternity admission', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => ''),
array('name' => 'edit-maternity-admission', 'permission_category_id' => '4', 'description' => 'Edit patient\'s maternity admission', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => ''),
array('name' => 'print-maternity-admission', 'permission_category_id' => '4', 'description' => 'Print patient\'s maternity admission', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => ''),
array('name' => 'view-delivery-record', 'permission_category_id' => '4', 'description' => 'View patient\'s delivery record', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => ''),
array('name' => 'add-family-account-credit-limit', 'permission_category_id' => '7', 'description' => 'Add family account credit limit', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'view-pharmacy-overview', 'permission_category_id' => '4', 'description' => 'View Pharmacy Overview Graph', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
@@ -630,7 +632,12 @@ class PermissionTableSeeder extends Seeder
array('name' => 'create-consultation-with-notes', 'permission_category_id' => '4', 'description' => 'Create Consultation with notes', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Create Consultation with notes'),
array('name' => 'perform-triage-without-etat', 'permission_category_id' => '4', 'description' => 'Perform Triage Without ETAT', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Perform Triage Without ETAT'),
array('name' => 'delete-doctor-ward-notes-from-inpatient-sheet', 'permission_category_id' => '4', 'description' => 'Delete doctor ward notes from inpatient', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Delete ward progress notes that were added by the doctor'),
array('name' => 'edit-inpatient-detailed-notes', 'permission_category_id' => '4', 'description' => 'Edit inpatient detailed notes', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit inpatient detailed notes'),
array('name' => 'delete-inpatient-detailed-notes', 'permission_category_id' => '4', 'description' => 'Delete inpatient detailed notes', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Delete inpatient detailed notes'),
array('name' => 'delete-nurse-ward-notes-from-inpatient-sheet', 'permission_category_id' => '4', 'description' => 'Delete nurse ward notes from inpatient', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Delete ward progress notes that were added by the nurse'),
array('name' => 'edit-nurse-ward-notes-from-inpatient-sheet', 'permission_category_id' => '4', 'description' => 'Edit nurse ward notes from inpatient', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit ward progress notes that were added by the nurse'),
array('name' => 'edit-doctor-ward-notes-from-inpatient-sheet', 'permission_category_id' => '4', 'description' => 'Edit doctor ward notes from inpatient', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit doctor progress notes that were added by the doctor'),
array('name' => 'view-theatre-notes-from-the-inpatient-sheet', 'permission_category_id' => '4', 'description' => 'View theatre notes from the inpatient sheet', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'View theatre notes from the inpatient sheet'),
array('name' => 'view-investigation-staff-overview', 'permission_category_id' => '4', 'description' => 'View Staff Performance By Investigations', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => 'View how many staff performed investigations and which investigations they performed'),
array('name' => 'view-performed-services-report', 'permission_category_id' => '21', 'description' => 'View Performed Services Report', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
@@ -788,6 +795,66 @@ class PermissionTableSeeder extends Seeder
array('name' => 'drugs-stock-reconciliation', 'permission_category_id' => '15', 'description' => 'Drugs stock reconciliation', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'view-package-units', 'permission_category_id' => '15', 'description' => 'Manage Package Units', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'view-eye-clinic-report', 'permission_category_id' => '5', 'description' => 'View eye clinic reports', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'add-batch-during-lab-stock-reconciliation', 'permission_category_id' => '15', 'description' => 'add item batch during lab stock reconciliation', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'radiologies-items-stock-reconciliation', 'permission_category_id' => '15', 'description' => 'Radiologies stock reconciliation', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'lab-items-stock-reconciliation', 'permission_category_id' => '15', 'description' => 'Labs stock reconciliation', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'view-labs-stock-reconciliation-report', 'permission_category_id' => '15', 'description' => 'View Labs stock reconciliation report', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'view-radiologies-stock-reconciliation-report', 'permission_category_id' => '15', 'description' => 'View Radiologies stock reconciliation report', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'edit-radiologies-stock-sheet', 'permission_category_id' => '10', 'description' => 'Edit Imaging stock sheet', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'edit-labs-stock-sheet', 'permission_category_id' => '10', 'description' => 'Edit Labs stock sheet', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'labs-create', 'permission_category_id' => '10', 'description' => 'Create Lab Items', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'labs-bulk-create', 'permission_category_id' => '10', 'description' => 'Create Multiple Lab Items', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'labs-bulk-edit', 'permission_category_id' => '10', 'description' => 'Edit Multiple Lab Items', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'labs-edit', 'permission_category_id' => '10', 'description' => 'Edit a Lab Item', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'labs-delete', 'permission_category_id' => '10', 'description' => 'Delete a Lab Item', 'guard_name' => 'web', 'crud' => 'list', 'long_description' => ''),
array('name' => 'labs-usage-listing', 'permission_category_id' => '10', 'description' => 'List all Labs that have been used', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'labs-report-usage', 'permission_category_id' => '10', 'description' => 'A report showing usage of Lab Items', 'guard_name' => 'web', 'crud' => 'list', 'long_description' => ''),
array('name' => 'requisition-for-labs', 'permission_category_id' => '10', 'description' => 'Make Requisitions for Lab Items', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'labs-stock-sheet', 'permission_category_id' => '10', 'description' => 'View and Edit Lab stock sheet', 'guard_name' => 'web', 'crud' => 'list', 'long_description' => ''),
array('name' => 'labs-bulk-delete', 'permission_category_id' => '10', 'description' => 'Delete Multiple Lab Items', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'print-patient-cards', 'permission_category_id' => '4', 'description' => 'Print Patient Cards', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'view-patient-cards', 'permission_category_id' => '4', 'description' => 'View Patient Cards', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'radiologies-create', 'permission_category_id' => '10', 'description' => 'Create Radiology Items', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'radiologies-edit', 'permission_category_id' => '10', 'description' => 'Edit a Radiology Item', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'radiologies-delete', 'permission_category_id' => '10', 'description' => 'Delete a Radiology Item', 'guard_name' => 'web', 'crud' => 'list', 'long_description' => ''),
array('name' => 'radiologies-usage-listing', 'permission_category_id' => '10', 'description' => 'List all Radiology that have been used', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'radiologies-report-usage', 'permission_category_id' => '10', 'description' => 'A report showing usage of Radiology Items', 'guard_name' => 'web', 'crud' => 'list', 'long_description' => ''),
array('name' => 'requisition-for-radiologies', 'permission_category_id' => '10', 'description' => 'Make Requisitions for Radiology Items', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'radiologies-stock-sheet', 'permission_category_id' => '10', 'description' => 'View Radiology stock sheet', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'requisition-for-radiology-sundries', 'permission_category_id' => '15', 'description' => 'Make Requisitions for Imaging Sundries', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'view-radiology-sundries-stock-sheet', 'permission_category_id' => '15', 'description' => 'View Imaging Sundries stock sheet', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => ''),
array('name' => 'edit-quantity-to-issue', 'permission_category_id' => '15', 'description' => 'Edit Quantity on Stores Issue Out ', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'add-new-batch-to-issue-out', 'permission_category_id' => '15', 'description' => 'Add Batch on Stores Issue Out ', 'guard_name' => 'web', 'crud' => 'add', 'long_description' => ''),
array('name' => 'view-electronic-stock-card', 'permission_category_id' => '15', 'description' => 'View Item Inventory Report', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => 'View Item Inventory Report'),
array('name' => 'view-details-electronic-stock-card', 'permission_category_id' => '15', 'description' => 'View Details Item Inventory Report', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => 'View Details Item Inventory Report'),
array('name' => 'view-details-received-drill-down', 'permission_category_id' => '15', 'description' => 'View Received Stock drill down details', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => 'View Received Stock drill down details'),
array('name' => 'view-details-issued-drill-down', 'permission_category_id' => '15', 'description' => 'View Issued Stock drill down details', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => 'View Issued Stock drill down details'),
array('name' => 'view-details-adjusted-stock', 'permission_category_id' => '15', 'description' => 'View Adjusted Stock drill down details', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => 'View Adjusted Stock drill down details'),
array('name' => 'sundry-form-create', 'permission_category_id' => '12', 'description' => 'Add Sundry Form ', 'guard_name' => 'web', 'crud' => 'add', 'long_description' => ''),
array('name' => 'sundry-form-list', 'permission_category_id' => '12', 'description' => 'View Sundry Forms ', 'guard_name' => 'web', 'crud' => 'read', 'long_description' => ''),
array('name' => 'sundry-form-delete', 'permission_category_id' => '12', 'description' => 'Deactivate and reactivate Sundry Form ', 'guard_name' => 'web', 'crud' => 'delete', 'long_description' => ''),
array('name' => 'sundry-form-edit', 'permission_category_id' => '12', 'description' => 'Edit Sundry Form ', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'edit-unit-cost-during-pharmacy-drugs-stock-reconciliation','permission_category_id' => '13', 'description' => 'Edit unit cost on pharmacy drugs reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on pharmacy drugs reconciliation'),
array('name' => 'edit-unit-cost-during-pharmacy-sundries-stock-reconciliation','permission_category_id' => '13', 'description' => 'Edit unit cost on pharmacy sundries reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on pharmacy sundries reconciliation'),
array('name' => 'edit-unit-cost-during-stores-drugs-stock-reconciliation','permission_category_id' => '15', 'description' => 'Edit unit cost on stores drugs reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on stores drugs reconciliation'),
array('name' => 'edit-unit-cost-during-stores-sundries-stock-reconciliation','permission_category_id' => '15', 'description' => 'Edit unit cost on stores sundries reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on stores sundries reconciliation'),
array('name' => 'edit-unit-cost-during-stores-labs-stock-reconciliation','permission_category_id' => '15', 'description' => 'Edit unit cost on stores labs reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on stores labs reconciliation'),
array('name' => 'edit-unit-cost-during-stores-radiologies-stock-reconciliation','permission_category_id' => '15', 'description' => 'Edit unit cost on stores radiologies reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on stores radiologies reconciliation'),
array('name' => 'edit-unit-cost-during-stores-general-stock-reconciliation','permission_category_id' => '15', 'description' => 'Edit unit cost on stores general items reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on stores general items reconciliation'),
array('name' => 'cancel-ward-chart-dispensing', 'permission_category_id' => '13', 'description' => 'Cancel ward chart request', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Cancel ward chart request'),
array('name' => 'renew-patient-dependants-subscription', 'permission_category_id' => '8', 'description' => 'Renew patient dependants subscription', 'guard_name' => 'web', 'crud' => 'view', 'long_description' => 'User to be able to activate renewal of subscriptions for patient dependants'),
array('name' => 'prescribe-cancer-protocol', 'permission_category_id' => '4', 'description' => 'Prescribe cancer protocols', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Prescribe cancer protocols'),
array('name' => 'labour-ward-admission', 'permission_category_id' => '4', 'description' => 'Labour Ward Admission', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'safe-delivery', 'permission_category_id' => '4', 'description' => 'Safe Delivery', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'partogram', 'permission_category_id' => '4', 'description' => 'Partogram', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'labour-ward-overview', 'permission_category_id' => '4', 'description' => 'Labour Ward Overview', 'guard_name' => 'web', 'crud' => 'create', 'long_description' => ''),
array('name' => 'edit-consultation-note', 'permission_category_id' => '4', 'description' => 'Edit Consultation Note', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'delete-consultation-note', 'permission_category_id' => '4', 'description' => 'Delete Consultation Note', 'guard_name' => 'web', 'crud' => 'edit', 'long_description' => ''),
array('name' => 'pharmacy-optical-stock-sheet','permission_category_id' => '13', 'description' => 'View Pharmacy Opticals Stock Sheet', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'View Pharmacy Opticals Stock Sheet'),
array('name' => 'edit-unit-cost-during-pharmacy-opticals-stock-reconciliation','permission_category_id' => '13', 'description' => 'Edit unit cost on pharmacy opticals reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on pharmacy opticals reconciliation'),
array('name' => 'edit-unit-cost-during-stores-opticals-stock-reconciliation','permission_category_id' => '15', 'description' => 'Edit unit cost on stores opticals reconciliation', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit unit cost on stores opticals reconciliation'),
array('name' => 'edit-bill-per-package-unit','permission_category_id' => '15', 'description' => 'Edit Bill per package unit on receiving items', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit Bill per package unit when receiving items'),
array('name' => 'edit-quatity-per-package-unit','permission_category_id' => '15', 'description' => 'Edit Quantity per package unit on receiving items', 'guard_name' => 'web', 'crud' => 'other', 'long_description' => 'Edit Quantity per package unit on receiving items'),
);
foreach ($permissions as $permission) {
@@ -1,109 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Streamline\Models\AccountType;
use Illuminate\Support\Facades\DB;
class PlatinumAccountTypesUpdateSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run()
{
AccountType::firstOrCreate([
'id' => 11,
'name' => 'Non-Current Liabilities',
'description' => '',
'created_by' => 1,
'updated_by' => 1
]);
// Update account names
$oldTypes = AccountType::all();
foreach ($oldTypes as $type) {
if ($type->name == 'Liabilities') {
DB::table('account_types')->where('id', $type->id)->update([
'name' => 'Current Liabilities',
'updated_by' => 1
]);
}
if ($type->name == 'Fixed Asset') {
DB::table('account_types')->where('id', $type->id)->update([
'name' => 'Non-Current Assets',
'updated_by' => 1
]);
}
if ($type->name == 'Current Asset') {
DB::table('account_types')->where('id', $type->id)->update([
'name' => 'Current Assets',
'updated_by' => 1
]);
}
if ($type->name == 'Other current assets') {
// Old id was 18
DB::table('account_types')->where('id', $type->id)->update([
'id' => 12,
'name' => 'Other Current Assets',
'updated_by' => 1
]);
// Update Chart of Accounts tables with type 18 to 12
DB::table('chart_of_accounts')->where('type', $type->id)->update([
'type' => 12,
'updated_by' => 1
]);
}
if ($type->name == 'Other current liabilities') {
DB::table('account_types')->where('id', $type->id)->update([
'name' => 'Other Current Liabilities',
'updated_by' => 1
]);
}
if ($type->id == 19) {
DB::table('account_types')->where('id', $type->id)->update([
'id' => 15,
'updated_by' => 1
]);
// Update Chart of Accounts tables with type 19 to 15
DB::table('chart_of_accounts')->where('type', $type->id)->update([
'type' => 15,
'updated_by' => 1
]);
}
if ($type->id == 20) {
DB::table('account_types')->where('id', $type->id)->update([
'id' => 16,
'updated_by' => 1
]);
// Update Chart of Accounts tables with type 20 to 16
DB::table('chart_of_accounts')->where('type', $type->id)->update([
'type' => 16,
'updated_by' => 1
]);
}
if ($type->name == 'Long term liabilities') {
// Old id was 14
DB::table('account_types')->where('id', $type->id)->delete();
// Update Chart of Accounts tables with type 14 to 11 (Non-Current Liabilities)
DB::table('chart_of_accounts')->where('type', $type->id)->update([
'type' => 11,
'updated_by' => 1
]);
}
}
}
}
@@ -1,16 +0,0 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
class PremiumsTableSeeder extends Seeder
{
/**
* Run the database seeders.
*
* @return void
*/
public function run(){
\Streamline\Models\InsurancePremiums::firstOrCreate(['id' => '1','group_id' => '1','amount' => '20000','start_date' => '2019-02-01','end_date' => '2020-05-31','payment_date' => '2019-02-11','family_heads' => '1','family_amount' => '20000','receipt_number' => '0001','created_by' => '1']);
}
}
@@ -0,0 +1,32 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Streamline\Models\ReconilicationReason;
class ReconcileReasonSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
//
$reasons = [
"Item Expiry",
"Obsolete Items",
"Damaged Items",
"Miscalculation",
"Error in data entry",
"Theft",
"Other",
];
foreach ($reasons as $reason) {
ReconilicationReason::firstOrCreate([
'name' => $reason,
]);
}
}
}
@@ -4,7 +4,6 @@ namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
use Streamline\Enums\Roles;
class RolesTableSeeder extends Seeder {
@@ -16,10 +15,10 @@ class RolesTableSeeder extends Seeder {
public function run() {
$roles = [
Roles::ADMIN->value, 'Cashier', 'Data Entrants', Roles::DOCTOR->value, 'Finance Manager', 'Hospital Administrator', 'Human Resource Manager', 'IT Coordinator',
'Admin', 'Cashier', 'Data Entrants', 'Doctors', 'Finance Manager', 'Hospital Administrator', 'Human Resource Manager', 'IT Coordinator',
'Lab Assistant', 'Lab Clerk', 'Lab Technician', 'Medical Director', 'Midwives', 'Non-clinical users', 'Nursing', 'Nursing - Senior Ward Staff',
'Records Assistant', 'Insurance Manager', 'Patient Receiption Clerks', 'Pharmacy Nurses - Junior', 'Pharmacy Technicians - Senior',
'Enrolled Nurse', 'Specialist Nurses', 'Stores', 'Triage Nurses', Roles::SUPER_ADMIN->value
'Enrolled Nurse', 'Specialist Nurses', 'Stores', 'Triage Nurses', 'Super Admin'
];
@@ -31,17 +30,17 @@ class RolesTableSeeder extends Seeder {
* Assign ADMIN role all permissions
*/
$adminRole = Role::firstOrCreate(['name' => Roles::ADMIN->value]);
$adminRole = Role::firstOrCreate(['name' => 'Admin']);
$adminRole->givePermissionTo(Permission::all());
$superAdminRole = Role::firstOrCreate(['name' => Roles::SUPER_ADMIN->value]);
$superAdminRole = Role::firstOrCreate(['name' => 'Super Admin']);
$superAdminRole->givePermissionTo(Permission::all());
$dataEntrant = Role::firstOrCreate(['name' => 'Data Entrants']);
$dataEntrant->givePermissionTo(Permission::where(['permission_category_id' => 1])->where(['permission_category_id' => 4])->get());
$dataEntrant->givePermissionTo(Permission::where(['permission_category_id' => 4])->get());
$doctors = Role::firstOrCreate(['name' => Roles::DOCTOR->value]);
$doctors = Role::firstOrCreate(['name' => 'Doctors']);
$doctors->givePermissionTo(Permission::where(['permission_category_id' => 1])->get());
$doctors->givePermissionTo(Permission::where(['permission_category_id' => 4])->get());
$doctors->givePermissionTo(Permission::where(['permission_category_id' => 2])->get());
@@ -2,7 +2,6 @@
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Streamline\Enums\Roles;
use Streamline\Models\User;
use Illuminate\Support\Facades\Hash;
@@ -18,7 +17,7 @@ class UsersTableSeeder extends Seeder {
/*
* Creating the user
*/
$user = User::firstOrCreate([
$user = User::firstOrCreate([
'first_name' => 'Demo',
'last_name' => 'User Admin',
'username' => 'sysadmin',
@@ -34,7 +33,7 @@ class UsersTableSeeder extends Seeder {
/*
* Assigning this user the admin role
*/
$user->assignRole(Roles::ADMIN->value);
$user->assignRole(Roles::SUPER_ADMIN->value);
$user->assignRole('Admin');
$user->assignRole('Super Admin');
}
}
File diff suppressed because it is too large Load Diff