mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 03:31:31 +00:00
updated streamline-setup v2
This commit is contained in:
+65
@@ -0,0 +1,65 @@
|
||||
<?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)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user