mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 18:51:31 +00:00
Import latest app updates from streamline
An updated set of source files and initialization was provided by streamline to address issues observed during initial testing. These files have been updated in order to generate a new set of app images.
This commit is contained in:
+2
-2
@@ -33,8 +33,8 @@ class CreateResourcesTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('active')->nullable();
|
||||
$table->integer('created_by')->nullable();;
|
||||
$table->integer('updated_by')->nullable();;
|
||||
$table->integer('created_by')->nullable();
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
// for soft deletes to create deleted_at column
|
||||
|
||||
+1
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePermissionTables extends Migration {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ class CreateDiscountCategoriesTable extends Migration
|
||||
Schema::create('discount_categories', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('discount_type')->comment("1 = Fixed Figure","2 = Patient Ceiling","3 = Patient Top-up");
|
||||
$table->integer('discount_type')->comment("1 = Fixed Figure 2 = Patient Ceiling 3 = Patient Top-up");
|
||||
$table->integer('donor_id');
|
||||
$table->integer('patient_category');
|
||||
$table->integer('donor_amount');
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class CreateInvestigationsTable extends Migration {
|
||||
$table->string('stock_balance', 45)->nullable();
|
||||
$table->string('supplier', 45)->nullable();
|
||||
$table->string('amc', 45)->nullable();
|
||||
$table->boolean('available')->default();
|
||||
$table->boolean('available')->default(1);
|
||||
$table->integer('account_id')->default(0);
|
||||
$table->text('prompt')->nullable(); // Added during data migration
|
||||
$table->text('reference_text')->nullable(); // Added during migration
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ class CreateRadiologiesTable extends Migration
|
||||
$table->integer('non_insured_price')->nullable();
|
||||
$table->integer('insured_price')->nullable();
|
||||
$table->integer('store_stock')->default(0);
|
||||
$table->integer('pharmacy_stock')->default();
|
||||
$table->integer('pharmacy_stock')->default(0);
|
||||
$table->integer('reorder_level')->default(0);
|
||||
$table->string('description')->nullable();
|
||||
$table->date('expiry_date')->nullable();
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ class CreateHivCounsellingAndTestingsTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
|
||||
$table->string('counselling_date');
|
||||
$table->boolean('is_center_static')->nullable();
|
||||
$table->string('registration_number')->nullable();
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ class CreateHivPatientsTable extends Migration
|
||||
$table->increments('id');
|
||||
$table->integer('patient_id');
|
||||
$table->string('art_clinic_number');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ class CreateCountriesTable extends Migration {
|
||||
Schema::create('countries', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->smallInteger('created_by')->nullabl();
|
||||
$table->smallInteger('created_by')->nullable();
|
||||
$table->smallInteger('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
+3
-3
@@ -15,9 +15,9 @@ class AddHmisColumnsToInvestigationsTable extends Migration
|
||||
{
|
||||
Schema::table('investigations', function (Blueprint $table) {
|
||||
$table->string('hmis_no_outpatient')->nullable()->after('reference_link');
|
||||
$table->string('hmis_category')->nullable()->after('hmis_no_outpatient');;
|
||||
$table->string('hmis_no_inpatient')->nullable()->after('hmis_category');;
|
||||
$table->string('hmis_category_inpatient')->nullable()->after('hmis_no_inpatient');;
|
||||
$table->string('hmis_category')->nullable()->after('hmis_no_outpatient');
|
||||
$table->string('hmis_no_inpatient')->nullable()->after('hmis_category');
|
||||
$table->string('hmis_category_inpatient')->nullable()->after('hmis_no_inpatient');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+7
-5
@@ -13,11 +13,13 @@ class AddBatchNumberAndBatchQuotationIdAndBatchBalanceColumnsToDrugsTable extend
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('drugs', function (Blueprint $table) {
|
||||
$table->string('batch_number_in_use')->nullable()->after('markup_tag_id')->comment('This is the current batch that is being dispensed on');
|
||||
$table->integer('quotation_id_of_batch_in_use')->nullable()->after('batch_number_in_use')->comment('This is the id of the quotation associated to the batch currently in use');
|
||||
$table->integer('balance_of_batch_in_use')->default(0)->after('quotation_id_of_batch_in_use')->comment('This is the quantity left on the current batch in use');
|
||||
});
|
||||
if (!Schema::hasColumn('drugs', 'batch_number_in_use')) {
|
||||
Schema::table('drugs', function (Blueprint $table) {
|
||||
$table->string('batch_number_in_use')->nullable()->after('markup_tag_id')->comment('This is the current batch that is being dispensed on');
|
||||
$table->integer('quotation_id_of_batch_in_use')->nullable()->after('batch_number_in_use')->comment('This is the id of the quotation associated to the batch currently in use');
|
||||
$table->integer('balance_of_batch_in_use')->default(0)->after('quotation_id_of_batch_in_use')->comment('This is the quantity left on the current batch in use');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+7
-5
@@ -13,11 +13,13 @@ class AddBatchTrackingColumnsToSundriesTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('sundries', function (Blueprint $table) {
|
||||
$table->string('batch_number_in_use')->nullable()->after('markup_tag_id')->comment('This is the current batch that is being dispensed on');
|
||||
$table->integer('quotation_id_of_batch_in_use')->nullable()->after('batch_number_in_use')->comment('This is the id of the quotation associated to the batch currently in use');
|
||||
$table->integer('balance_of_batch_in_use')->default(0)->after('quotation_id_of_batch_in_use')->comment('This is the quantity left on the current batch in use');
|
||||
});
|
||||
if (!Schema::hasColumn('sundries', 'batch_number_in_use')) {
|
||||
Schema::table('sundries', function (Blueprint $table) {
|
||||
$table->string('batch_number_in_use')->nullable()->after('markup_tag_id')->comment('This is the current batch that is being dispensed on');
|
||||
$table->integer('quotation_id_of_batch_in_use')->nullable()->after('batch_number_in_use')->comment('This is the id of the quotation associated to the batch currently in use');
|
||||
$table->integer('balance_of_batch_in_use')->default(0)->after('quotation_id_of_batch_in_use')->comment('This is the quantity left on the current batch in use');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddReferralsColumnToPatientsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
if (!Schema::hasColumn('patients', 'referred_from')) {
|
||||
Schema::table('patients', function (Blueprint $table) {
|
||||
$table->string("referred_from")->after('children_id')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('patients', function (Blueprint $table) {
|
||||
$table->dropColumn('referred_from');
|
||||
});
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -25,6 +25,8 @@ class AddNewColumnLastSeen extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$table->dropColumn('last_seen');
|
||||
Schema::table('users', function(Blueprint $table){
|
||||
$table->dropColumn('last_seen');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -18,9 +18,11 @@ class ChangeDebtorPaymentDateFormats extends Migration {
|
||||
foreach ($debtor_payments as $payment) {
|
||||
$dates_array = unserialize($payment->date_paid_history);
|
||||
|
||||
for ($i = 0; $i < count($dates_array); $i++) {
|
||||
if (!date_create_from_format('d-m-Y', $dates_array[$i]) && date_create_from_format('Y-m-d', $dates_array[$i])) {
|
||||
$dates_array[$i] = date_create_from_format('Y-m-d', $dates_array[$i])->format('d-m-Y');
|
||||
if (is_array($dates_array)){
|
||||
for ($i = 0; $i < count($dates_array); $i++) {
|
||||
if (!date_create_from_format('d-m-Y', $dates_array[$i]) && date_create_from_format('Y-m-d', $dates_array[$i])) {
|
||||
$dates_array[$i] = date_create_from_format('Y-m-d', $dates_array[$i])->format('d-m-Y');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEyeModuleToGeneralSettings extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('eye_module_enabled');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('eye_module_enabled');
|
||||
});
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateDiagnosisCategoriesTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::create('diagnosis_categories', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->nullable();
|
||||
$table->integer('created_by')->nullable();
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::table('diagnoses', function (Blueprint $table) {
|
||||
$table->string('diagnosis_category')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::dropIfExists('diagnosis_categories');
|
||||
|
||||
Schema::table('diagnoses', function (Blueprint $table) {
|
||||
$table->dropColumn('diagnosis_category');
|
||||
});
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSlitLampTestAreasTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::create('slit_lamp_test_areas', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->integer('created_by')->nullable();
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::dropIfExists('slit_lamp_test_areas');
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSlitLampTestAreaValuesTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::create('slit_lamp_test_area_values', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('slit_lamp_test_area_id')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('brief')->nullable();
|
||||
$table->integer('created_by')->nullable();
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::dropIfExists('slit_lamp_test_area_values');
|
||||
}
|
||||
}
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddMissingEyeMigrations extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::dropIfExists('eye_clinic_base_exam_refraction');
|
||||
|
||||
Schema::create('eye_clinic_base_exam_refraction', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->text('neuro_oriented')->nullable();
|
||||
$table->text('neuro_mood')->nullable();
|
||||
$table->text('pupils_perrl')->nullable();
|
||||
$table->text('pupils_right_dark')->nullable();
|
||||
$table->text('pupils_right_light')->nullable();
|
||||
$table->text('pupils_right_shape')->nullable();
|
||||
$table->text('pupils_right_react')->nullable();
|
||||
$table->text('pupils_right_apd')->nullable();
|
||||
$table->text('pupils_left_dark')->nullable();
|
||||
$table->text('pupils_left_light')->nullable();
|
||||
$table->text('pupils_left_shape')->nullable();
|
||||
$table->text('pupils_left_react')->nullable();
|
||||
$table->text('pupils_left_apd')->nullable();
|
||||
$table->text('visual_acuity_method')->nullable();
|
||||
$table->text('visual_acuity_distance_sc_right')->nullable();
|
||||
$table->text('visual_acuity_distance_sc_right_scale')->nullable();
|
||||
$table->text('visual_acuity_distance_sc_left')->nullable();
|
||||
$table->text('visual_acuity_distance_sc_left_scale')->nullable();
|
||||
$table->text('visual_acuity_distance_cc_right')->nullable();
|
||||
$table->text('visual_acuity_distance_cc_right_scale')->nullable();
|
||||
$table->text('visual_acuity_distance_cc_left')->nullable();
|
||||
$table->text('visual_acuity_distance_cc_left_scale')->nullable();
|
||||
$table->text('visual_acuity_distance_ph_right')->nullable();
|
||||
$table->text('visual_acuity_distance_ph_right_scale')->nullable();
|
||||
$table->text('visual_acuity_distance_ph_left')->nullable();
|
||||
$table->text('visual_acuity_distance_ph_left_scale')->nullable();
|
||||
$table->text('visual_acuity_near_sc_right')->nullable();
|
||||
$table->text('visual_acuity_near_sc_right_scale')->nullable();
|
||||
$table->text('visual_acuity_near_sc_left')->nullable();
|
||||
$table->text('visual_acuity_near_sc_left_scale')->nullable();
|
||||
$table->text('visual_acuity_near_cc_right')->nullable();
|
||||
$table->text('visual_acuity_near_cc_right_scale')->nullable();
|
||||
$table->text('visual_acuity_near_cc_left')->nullable();
|
||||
$table->text('visual_acuity_near_cc_left_scale')->nullable();
|
||||
$table->text('manifest_retinoscope')->nullable();
|
||||
$table->text('manifest_autorefractor')->nullable();
|
||||
$table->text('manifest_auto_right_sphere')->nullable();
|
||||
$table->text('manifest_auto_right_cylinder')->nullable();
|
||||
$table->text('manifest_auto_right_axis')->nullable();
|
||||
$table->text('manifest_ret_right_dist_va')->nullable();
|
||||
$table->text('manifest_ret_right_add')->nullable();
|
||||
$table->text('manifest_ret_right_near_va')->nullable();
|
||||
$table->text('manifest_auto_left_sphere')->nullable();
|
||||
$table->text('manifest_auto_left_cylinder')->nullable();
|
||||
$table->text('manifest_auto_left_axis')->nullable();
|
||||
$table->text('manifest_ret_left_dist_va')->nullable();
|
||||
$table->text('manifest_ret_left_add')->nullable();
|
||||
$table->text('manifest_ret_left_near_va')->nullable();
|
||||
$table->text('keratometry_k1_left')->nullable();
|
||||
$table->text('keratometry_k1_right')->nullable();
|
||||
$table->text('keratometry_k2_left')->nullable();
|
||||
$table->text('keratometry_k2_right')->nullable();
|
||||
$table->text('keratometry_axis_left')->nullable();
|
||||
$table->text('keratometry_axis_right')->nullable();
|
||||
$table->text('subjective_left_sphere')->nullable();
|
||||
$table->text('subjective_right_sphere')->nullable();
|
||||
$table->text('subjective_left_cylinder')->nullable();
|
||||
$table->text('subjective_right_cylinder')->nullable();
|
||||
$table->text('subjective_left_axis')->nullable();
|
||||
$table->text('subjective_right_axis')->nullable();
|
||||
$table->text('added_values')->nullable();
|
||||
$table->text('best_left_vision')->nullable();
|
||||
$table->text('best_right_vision')->nullable();
|
||||
$table->text('manifest_ret_right_sphere')->nullable();
|
||||
$table->text('manifest_ret_right_cylinder')->nullable();
|
||||
$table->text('manifest_ret_right_axis')->nullable();
|
||||
$table->text('manifest_ret_left_sphere')->nullable();
|
||||
$table->text('manifest_ret_left_cylinder')->nullable();
|
||||
$table->text('manifest_ret_left_axis')->nullable();
|
||||
$table->string('pd_right_eye')->nullable();
|
||||
$table->string('pd_left_eye')->nullable();
|
||||
$table->longText('comment')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->text('created_by');
|
||||
$table->text('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::dropIfExists('eye_clinic_main_exam');
|
||||
|
||||
Schema::create('eye_clinic_main_exam', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->string('external_right')->nullable();
|
||||
$table->string('external_left')->nullable();
|
||||
$table->string('slit_ll_right')->nullable();
|
||||
$table->string('slit_ll_left')->nullable();
|
||||
$table->string('slit_cs_right')->nullable();
|
||||
$table->string('slit_cs_left')->nullable();
|
||||
$table->string('slit_cornea_right')->nullable();
|
||||
$table->string('slit_cornea_left')->nullable();
|
||||
$table->string('slit_ac_right')->nullable();
|
||||
$table->string('slit_ac_left')->nullable();
|
||||
$table->string('slit_iris_right')->nullable();
|
||||
$table->string('slit_iris_left')->nullable();
|
||||
$table->string('slit_lens_right')->nullable();
|
||||
$table->string('slit_lens_left')->nullable();
|
||||
$table->string('slit_vit_right')->nullable();
|
||||
$table->string('slit_vit_left')->nullable();
|
||||
$table->string('slit_retina_right')->nullable();
|
||||
$table->string('slit_retina_left')->nullable();
|
||||
$table->string('slit_optic_disc_right')->nullable();
|
||||
$table->string('slit_optic_disc_left')->nullable();
|
||||
$table->string('slit_ll_other_right')->nullable();
|
||||
$table->string('slit_ll_other_left')->nullable();
|
||||
$table->string('slit_cs_other_right')->nullable();
|
||||
$table->string('slit_cs_other_left')->nullable();
|
||||
$table->string('slit_cornea_other_right')->nullable();
|
||||
$table->string('slit_cornea_other_left')->nullable();
|
||||
$table->string('slit_ac_other_right')->nullable();
|
||||
$table->string('slit_ac_other_left')->nullable();
|
||||
$table->string('slit_iris_other_right')->nullable();
|
||||
$table->string('slit_iris_other_left')->nullable();
|
||||
$table->string('slit_lens_other_right')->nullable();
|
||||
$table->string('slit_lens_other_left')->nullable();
|
||||
$table->string('slit_vit_other_right')->nullable();
|
||||
$table->string('slit_vit_other_left')->nullable();
|
||||
$table->string('slit_retina_other_right')->nullable();
|
||||
$table->string('slit_retina_other_left')->nullable();
|
||||
$table->string('slit_optic_disc_other_right')->nullable();
|
||||
$table->string('slit_optic_disc_other_left')->nullable();
|
||||
$table->string('iop_left')->nullable();
|
||||
$table->string('iop_right')->nullable();
|
||||
$table->string('time')->nullable();
|
||||
$table->string('right_eye_diagnosis')->nullable();
|
||||
$table->string('left_eye_diagnosis')->nullable();
|
||||
$table->text('doctors_notes')->nullable();
|
||||
$table->text('advice')->nullable();
|
||||
$table->string('review_date')->nullable();
|
||||
$table->string('created_by');
|
||||
$table->string('updated_by')->nullable();
|
||||
$table->integer('outcome_id')->nullable();
|
||||
$table->integer('completed')->nullable();
|
||||
$table->integer('ward_id')->nullable();
|
||||
$table->string('admitted_on')->nullable();
|
||||
$table->string('followup_where')->nullable();
|
||||
$table->string('followup_when')->nullable();
|
||||
$table->string('referred_to')->nullable();
|
||||
$table->string('cdr_left')->nullable();
|
||||
$table->string('cdr_right')->nullable();
|
||||
$table->integer('consultation_done_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
//Schema::dropIfExists('eye_clinic_base_exam_refraction');
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddColumnsToEyeGlassesTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('eye_glasses', function (Blueprint $table) {
|
||||
$table->integer('cost_price');
|
||||
$table->text('price_list_category')->nullable();
|
||||
$table->text('price_list_price')->nullable();
|
||||
$table->integer('expenses_account_id');
|
||||
$table->integer('payables_account_id');
|
||||
$table->integer('supplier_id');
|
||||
$table->string('item_type')->nullable();
|
||||
$table->integer('store_stock');
|
||||
$table->integer('pharmacy_stock');
|
||||
$table->integer('reorder_level');
|
||||
$table->date('expiry_date')->nullable();
|
||||
$table->integer('form_id');
|
||||
$table->integer('unit_id');
|
||||
$table->integer('cost_of_goods_account');
|
||||
$table->integer('package_unit_id');
|
||||
$table->integer('does_package_unit_have_sub_packages');
|
||||
$table->integer('quantity_in_each_package_unit');
|
||||
$table->integer('quantity_in_each_sub_package');
|
||||
$table->integer('number_of_sub_packages_in_main_package_unit');
|
||||
$table->integer('inventory_account');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('eye_glasses', function (Blueprint $table) {
|
||||
$table->dropColumn('cost_price');
|
||||
$table->dropColumn('price_list_category');
|
||||
$table->dropColumn('price_list_price');
|
||||
$table->dropColumn('expenses_account_id');
|
||||
$table->dropColumn('payables_account_id');
|
||||
$table->dropColumn('supplier_id');
|
||||
$table->dropColumn('item_type');
|
||||
$table->dropColumn('store_stock');
|
||||
$table->dropColumn('pharmacy_stock');
|
||||
$table->dropColumn('reorder_level');
|
||||
$table->dropColumn('expiry_date');
|
||||
$table->dropColumn('form_id');
|
||||
$table->dropColumn('unit_id');
|
||||
$table->dropColumn('cost_of_goods_account');
|
||||
$table->dropColumn('package_unit_id');
|
||||
$table->dropColumn('does_package_unit_have_sub_packages');
|
||||
$table->dropColumn('quantity_in_each_package_unit');
|
||||
$table->dropColumn('quantity_in_each_sub_package');
|
||||
$table->dropColumn('number_of_sub_packages_in_main_package_unit');
|
||||
$table->dropColumn('inventory_account');
|
||||
});
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEyeColumnToOrderTables extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('treatments', function (Blueprint $table) {
|
||||
$table->string('eye')->nullable();
|
||||
});
|
||||
|
||||
Schema::table('ordered_procedures', function (Blueprint $table) {
|
||||
$table->string('eye')->nullable();
|
||||
});
|
||||
|
||||
Schema::table('ordered_investigations', function (Blueprint $table) {
|
||||
$table->string('eye')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('treatments', function (Blueprint $table) {
|
||||
$table->dropColumn('eye');
|
||||
});
|
||||
|
||||
Schema::table('ordered_procedures', function (Blueprint $table) {
|
||||
$table->dropColumn('eye');
|
||||
});
|
||||
|
||||
Schema::table('ordered_investigations', function (Blueprint $table) {
|
||||
$table->dropColumn('eye');
|
||||
});
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ConvertOrderedEyeIntsToStringColumns extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('ordered_eye_glasses', function (Blueprint $table) {
|
||||
$table->text('eye_glasses_id')->change();
|
||||
$table->text('quantity')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('ordered_eye_glasses', function (Blueprint $table) {
|
||||
$table->integer('eye_glasses_id')->change();
|
||||
$table->integer('quantity')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddPreviousIdColumnToPatientsTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('patients', function (Blueprint $table) {
|
||||
$table->string('previous_id')->after('id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('patients', function (Blueprint $table) {
|
||||
$table->dropColumn('previous_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -13,9 +13,11 @@ class AddGeneralCommentsToStockReconciliationsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('store_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->longText('general_comment')->nullable()->after('reconciliation_date');
|
||||
});
|
||||
if (!Schema::hasColumn('store_stock_reconciliations', 'general_comment')) {
|
||||
Schema::table('store_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->longText('general_comment')->nullable()->after('reconciliation_date');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddColumnsToEyeDepositsTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('eye_glasses_deposits', function (Blueprint $table) {
|
||||
$table->integer('refund_amount')->default(0)->after('patient_amount_paid');
|
||||
$table->integer('bank_id')->nullable();
|
||||
$table->integer('received')->nullable();
|
||||
$table->integer('deposited')->nullable();
|
||||
$table->integer('transferred')->nullable();
|
||||
$table->text('current_chart_of_accounts');
|
||||
$table->text('cost_price');
|
||||
$table->integer('cost_of_goods_account')->nullable();
|
||||
$table->integer('inventory_account')->nullable();
|
||||
$table->integer('payment_complete');
|
||||
$table->text('item_amount_paid');
|
||||
$table->text('item_balance_remaining');
|
||||
$table->text('order_ids');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('eye_glasses_deposits', function (Blueprint $table) {
|
||||
$table->dropColumn('refund_amount');
|
||||
$table->dropColumn('bank_id');
|
||||
$table->dropColumn('received');
|
||||
$table->dropColumn('deposited');
|
||||
$table->dropColumn('transferred');
|
||||
$table->dropColumn('current_chart_of_accounts');
|
||||
$table->dropColumn('cost_price');
|
||||
$table->dropColumn('cost_of_goods_account');
|
||||
$table->dropColumn('inventory_account');
|
||||
$table->dropColumn('payment_complete');
|
||||
$table->dropColumn('item_amount_paid');
|
||||
$table->dropColumn('item_balance_remaining');
|
||||
$table->dropColumn('order_ids');
|
||||
});
|
||||
}
|
||||
}
|
||||
+5
-3
@@ -13,9 +13,11 @@ class AddOpeningStockDateToDrugsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('drugs', function (Blueprint $table) {
|
||||
$table->date('opening_stock_date')->nullable()->after('opening_stock');
|
||||
});
|
||||
if (!Schema::hasColumn('drugs', 'opening_stock_date')) {
|
||||
Schema::table('drugs', function (Blueprint $table) {
|
||||
$table->date('opening_stock_date')->nullable()->after('opening_stock');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-3
@@ -13,9 +13,11 @@ class AddOpeningStockDateToSundriesTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('sundries', function (Blueprint $table) {
|
||||
$table->date('opening_stock_date')->nullable()->after('opening_stock');
|
||||
});
|
||||
if (!Schema::hasColumn('sundries', 'opening_stock_date')) {
|
||||
Schema::table('sundries', function (Blueprint $table) {
|
||||
$table->date('opening_stock_date')->nullable()->after('opening_stock');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-3
@@ -13,9 +13,11 @@ class AddGeneralCommentColumnToSundryStoreStockReconciliationsTable extends Migr
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('sundry_store_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->longText('general_comment')->nullable()->after('reconciliation_date');
|
||||
});
|
||||
if (!Schema::hasColumn('sundry_store_stock_reconciliations', 'general_comment')) {
|
||||
Schema::table('sundry_store_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->longText('general_comment')->nullable()->after('reconciliation_date');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+7
-5
@@ -13,11 +13,13 @@ class AddExpensesAndPayablesColumnsToLabsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('labs', function (Blueprint $table) {
|
||||
$table->integer('expenses_account_id')->nullable()->after('account_id');
|
||||
$table->integer('payables_account_id')->nullable()->after('expenses_account_id');
|
||||
$table->integer('cost_of_goods_account')->nullable()->after('payables_account_id');
|
||||
});
|
||||
if (!Schema::hasColumn('labs', 'cost_of_goods_account')) {
|
||||
Schema::table('labs', function (Blueprint $table) {
|
||||
$table->integer('expenses_account_id')->nullable()->after('account_id');
|
||||
$table->integer('payables_account_id')->nullable()->after('expenses_account_id');
|
||||
$table->integer('cost_of_goods_account')->nullable()->after('payables_account_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+213
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddMissingMigrationsForVine extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
if (!Schema::hasColumn('cashier_income', 'transferred')) {
|
||||
Schema::table('cashier_income', function (Blueprint $table) {
|
||||
$table->text('date_string')->change();
|
||||
$table->integer('transferred');
|
||||
});
|
||||
}
|
||||
|
||||
Schema::table('debt_plan', function (Blueprint $table) {
|
||||
$table->text('staff_guarantor')->change()->comment('csv of all guarantors');
|
||||
});
|
||||
|
||||
if (!Schema::hasColumn('drugs', 'reference_areas')) {
|
||||
Schema::table('drugs', function (Blueprint $table) {
|
||||
$table->text('reference_areas')->nullable();
|
||||
$table->text('reference_name')->nullable();
|
||||
$table->decimal('strength', 10, 2)->nullable()->default(0)->change();
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('drugs', 'opening_stock_date')) {
|
||||
Schema::table('drugs', function (Blueprint $table) {
|
||||
$table->date('opening_stock_date')->nullable()->after('reorder_level')->comment('This is the total stock that the hospital opened with');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('eye_glasses_deposits', 'item_amount_paid')) {
|
||||
Schema::table('eye_glasses_deposits', function (Blueprint $table) {
|
||||
$table->integer('bank_id');
|
||||
$table->integer('deposited');
|
||||
$table->integer('payment_complete');
|
||||
$table->text('transferred');
|
||||
$table->text('item_amount_paid');
|
||||
$table->text('item_balance_remaining');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('general_items', 'account_id')) {
|
||||
Schema::table('general_items', function (Blueprint $table) {
|
||||
$table->integer('account_id');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('general_settings', 'ward_prescription_model')) {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('ward_prescription_model');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('hospital_invoice_payments', 'amount_owed')) {
|
||||
Schema::table('hospital_invoice_payments', function (Blueprint $table) {
|
||||
$table->integer('amount_owed');
|
||||
$table->integer('received');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('insurance_expenditure', 'cost_price')) {
|
||||
Schema::table('insurance_expenditure', function (Blueprint $table) {
|
||||
$table->string('cost_price');
|
||||
$table->string('income_account');
|
||||
$table->string('inventory_account');
|
||||
$table->string('cost_of_goods_account');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('investigation_deposits', 'bank_id')) {
|
||||
Schema::table('investigation_deposits', function (Blueprint $table) {
|
||||
$table->integer('bank_id');
|
||||
$table->integer('deposited');
|
||||
$table->integer('transferred');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('investigations', 'urgent')) {
|
||||
Schema::table('investigations', function (Blueprint $table) {
|
||||
$table->string('urgent');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('labs', 'expenses_account_id')) {
|
||||
Schema::table('labs', function (Blueprint $table) {
|
||||
$table->integer('expenses_account_id');
|
||||
$table->integer('payables_account_id');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('maternity_progress', 'color')) {
|
||||
Schema::table('maternity_progress', function (Blueprint $table) {
|
||||
$table->string('color');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('patient_category_invoices', 'bank_id')) {
|
||||
Schema::table('patient_category_invoices', function (Blueprint $table) {
|
||||
$table->text('bank_id');
|
||||
$table->text('deposited');
|
||||
$table->text('transferred');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('patients', 'address_details')) {
|
||||
Schema::table('patients', function (Blueprint $table) {
|
||||
$table->text('hospital_contact_name');
|
||||
$table->text('address_details')->nullable();
|
||||
$table->integer('patient_account_balance')->default(0);
|
||||
$table->integer('patient_account_opening_balance')->nullable();
|
||||
$table->integer('patient_account_opening_account_id')->nullable();
|
||||
$table->date('patient_account_opening_date')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('procedure_deposits', 'bank_id')) {
|
||||
Schema::table('procedure_deposits', function (Blueprint $table) {
|
||||
$table->integer('bank_id');
|
||||
$table->integer('deposited');
|
||||
$table->integer('transferred');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('radiologies', 'payables_account_id')) {
|
||||
Schema::table('radiologies', function (Blueprint $table) {
|
||||
$table->integer('expenses_account_id');
|
||||
$table->integer('payables_account_id');
|
||||
});
|
||||
}
|
||||
|
||||
Schema::table('requisitions', function (Blueprint $table) {
|
||||
$table->text('cost_value')->change();
|
||||
});
|
||||
|
||||
if (!Schema::hasColumn('service_deposits', 'bank_id')) {
|
||||
Schema::table('service_deposits', function (Blueprint $table) {
|
||||
$table->integer('bank_id');
|
||||
$table->integer('deposited');
|
||||
$table->integer('transferred');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('sundries_deposits', 'bank_id')) {
|
||||
Schema::table('sundries_deposits', function (Blueprint $table) {
|
||||
$table->integer('bank_id');
|
||||
$table->integer('deposited');
|
||||
$table->integer('transferred');
|
||||
$table->integer('payment_complete');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('store_stock_reconciliations', 'general_comment')) {
|
||||
Schema::table('store_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->longText('general_comment');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('sundries', 'opening_stock_date')) {
|
||||
Schema::table('sundries', function (Blueprint $table) {
|
||||
$table->date('opening_stock_date');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('sundry_store_stock_reconciliations', 'general_comment')) {
|
||||
Schema::table('sundry_store_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->longText('general_comment');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('temporary_consultations', 'ward_id')) {
|
||||
Schema::table('temporary_consultations', function (Blueprint $table) {
|
||||
$table->integer('ward_id');
|
||||
$table->date('admitted_on');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('treatment_deposits', 'bank_id')) {
|
||||
Schema::table('treatment_deposits', function (Blueprint $table) {
|
||||
$table->integer('bank_id');
|
||||
$table->integer('deposited');
|
||||
$table->integer('transferred');
|
||||
$table->integer('payment_complete');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('ward_consultations_and_services', 'amount_paid')) {
|
||||
Schema::table('ward_consultations_and_services', function (Blueprint $table) {
|
||||
$table->integer('amount_paid');
|
||||
$table->string('receipt_number');
|
||||
$table->integer('balance');
|
||||
$table->integer('patient_category_to_pay');
|
||||
$table->integer('discount');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
//
|
||||
}
|
||||
}
|
||||
+6
-4
@@ -13,10 +13,12 @@ class AddOpeningStockTakePointsToSundriesTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('sundries', function (Blueprint $table) {
|
||||
$table->integer('store_opening_stock')->nullable()->after('opening_stock')->comment('This is the store stock that the hospital opened with');
|
||||
$table->integer('pharmacy_opening_stock')->nullable()->after('store_opening_stock')->comment('This is the pharmacy stock that the hospital opened with');
|
||||
});
|
||||
if (!Schema::hasColumn('sundries', 'store_opening_stock')) {
|
||||
Schema::table('sundries', function (Blueprint $table) {
|
||||
$table->integer('store_opening_stock')->nullable()->after('opening_stock')->comment('This is the store stock that the hospital opened with');
|
||||
$table->integer('pharmacy_opening_stock')->nullable()->after('store_opening_stock')->comment('This is the pharmacy stock that the hospital opened with');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEyeModuleClinicIdToGeneralSettingsTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('eye_module_clinic_id')->after('eye_module_enabled')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('eye_module_clinic_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDefaultClinicToGeneralSettingsTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('default_hospital_clinic')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('default_hospital_clinic');
|
||||
});
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOpticalStockReconciliationsTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::create('optical_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->longText('item_id')->nullable();
|
||||
$table->longText('system_stock')->nullable();
|
||||
$table->longText('physical_stock')->nullable();
|
||||
$table->longText('difference')->nullable();
|
||||
$table->longText('reason_for_difference')->nullable();
|
||||
$table->longText('mark_up')->nullable();
|
||||
$table->integer('affected_account_id')->nullable();
|
||||
$table->date('reconciliation_date')->nullable();
|
||||
$table->longText('general_comment')->nullable();
|
||||
$table->integer('type')->comment('0 is store and 1 is pharmacy');
|
||||
$table->integer('created_by')->nullable();
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::dropIfExists('optical_stock_reconciliations');
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -15,8 +15,8 @@ class CreateHmisWardsTable extends Migration
|
||||
{
|
||||
Schema::create('hmis_wards', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name', 255)->unique();
|
||||
$table->string('slug', 255)->unique();
|
||||
$table->string('name')->unique();
|
||||
$table->string('slug')->unique();
|
||||
$table->integer('created_by')->unsigned();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->integer('updated_by')->nullable()->unsigned();
|
||||
|
||||
+121
-85
@@ -73,26 +73,34 @@ class AddMissingAmountsToDepositTables extends Migration
|
||||
|
||||
foreach ($services_deposits as $deposit) {
|
||||
$amount_left = $deposit->patient_amount_paid;
|
||||
$amounts = explode(",", $deposit->items_amounts);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
if (is_integer($amount_left)) {
|
||||
$amounts = explode(",", $deposit->items_amounts);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
|
||||
if (!is_integer($amount)) {
|
||||
$amount = 0;
|
||||
}
|
||||
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ServiceDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
ServiceDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$procedure_deposits = DB::table('procedure_deposits')->whereNull('deleted_at')
|
||||
@@ -100,26 +108,33 @@ class AddMissingAmountsToDepositTables extends Migration
|
||||
|
||||
foreach ($procedure_deposits as $deposit) {
|
||||
$amount_left = $deposit->patient_amount_paid;
|
||||
$amounts = explode(",", $deposit->procedure_amounts);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
if (is_integer($amount_left)) {
|
||||
$amounts = explode(",", $deposit->procedure_amounts);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if (!is_integer($amount)) {
|
||||
$amount = 0;
|
||||
}
|
||||
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProcedureDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
ProcedureDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$sundries_deposits = DB::table('sundries_deposits')->whereNull('deleted_at')
|
||||
@@ -127,26 +142,33 @@ class AddMissingAmountsToDepositTables extends Migration
|
||||
|
||||
foreach ($sundries_deposits as $deposit) {
|
||||
$amount_left = $deposit->patient_amount_paid;
|
||||
$amounts = explode(",", $deposit->sundry_subtotals);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
if (is_integer($amount_left)) {
|
||||
$amounts = explode(",", $deposit->sundry_subtotals);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if (!is_integer($amount)) {
|
||||
$amount = 0;
|
||||
}
|
||||
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SundryDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
SundryDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$investigation_deposits = DB::table('investigation_deposits')->whereNull('deleted_at')
|
||||
@@ -154,26 +176,33 @@ class AddMissingAmountsToDepositTables extends Migration
|
||||
|
||||
foreach ($investigation_deposits as $deposit) {
|
||||
$amount_left = $deposit->patient_amount_paid;
|
||||
$amounts = explode(",", $deposit->investigation_amounts);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = intval($amount_left) - intval($amount);
|
||||
$amount_left -= intval($amount);
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
if (is_integer($amount_left)) {
|
||||
$amounts = explode(",", $deposit->investigation_amounts);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if (!is_integer($amount)) {
|
||||
$amount = 0;
|
||||
}
|
||||
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = intval($amount_left) - intval($amount);
|
||||
$amount_left -= intval($amount);
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InvestigationDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
InvestigationDeposit::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$treatment_deposits = DB::table('treatment_deposits')->whereNull('deleted_at')
|
||||
@@ -181,26 +210,33 @@ class AddMissingAmountsToDepositTables extends Migration
|
||||
|
||||
foreach ($treatment_deposits as $deposit) {
|
||||
$amount_left = $deposit->patient_amount_paid;
|
||||
$amounts = explode(",", $deposit->treatment_subtotals);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
if (is_integer($amount_left)) {
|
||||
$amounts = explode(",", $deposit->treatment_subtotals);
|
||||
$item_amount_paid = [];
|
||||
$item_balance_remaining = [];
|
||||
|
||||
foreach ($amounts as $amount) {
|
||||
if (!is_integer($amount)) {
|
||||
$amount = 0;
|
||||
}
|
||||
|
||||
if ($amount_left > $amount) {
|
||||
$item_amount_paid[] = $amount_left - $amount;
|
||||
$amount_left -= $amount;
|
||||
$item_balance_remaining[] = 0;
|
||||
} else {
|
||||
$item_amount_paid[] = $amount_left;
|
||||
$item_balance_remaining[] = $amount - $amount_left;
|
||||
$amount_left = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TreatmentDeposits::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
TreatmentDeposits::where('id', $deposit->id)->update([
|
||||
'item_amount_paid' => implode(',', $item_amount_paid),
|
||||
'item_balance_remaining' => implode(',', $item_balance_remaining)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ class ResetInpatientProcedures extends Migration {
|
||||
|
||||
// get chi price if available
|
||||
if (patient_insurance_status($info->patient_id) == 1) {
|
||||
$procedure_insurance_details = get_item_insurance_pricing($info->patient_id, $procedures[$x], 2, true);
|
||||
$procedure_insurance_details = get_item_insurance_pricing($info->patient_id, $procedures[$x], 2, true, 0);
|
||||
$ward_procedures_record->chi_price = $procedure_insurance_details[1];
|
||||
}
|
||||
|
||||
|
||||
+7
-5
@@ -13,9 +13,11 @@ class AddDeletedAtToEyeClinicMainExamTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('eye_clinic_main_exam', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
if (!Schema::hasColumn('eye_clinic_main_exam', 'deleted_at')) {
|
||||
Schema::table('eye_clinic_main_exam', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,8 +27,8 @@ class AddDeletedAtToEyeClinicMainExamTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('eye_clinic_main_exam', function (Blueprint $table) {
|
||||
/*Schema::table('eye_clinic_main_exam', function (Blueprint $table) {
|
||||
$table->dropSoftDeletes();
|
||||
});
|
||||
});*/
|
||||
}
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEyeToWardProceduresTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ward_procedures', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('eye')->nullable()->after('discount')->comment('2 -Both, 0 -Left, 1 -Right');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ward_procedures', function (Blueprint $table) {
|
||||
$table->dropColumn('eye');
|
||||
});
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEyeDiagnosesToInpatientInfoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasColumn('inpatient_info', 'right_eye_diagnosis')) {
|
||||
Schema::table('inpatient_info', function (Blueprint $table) {
|
||||
$table->string('right_eye_diagnosis')->nullable()->after('other_diagnoses');
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('inpatient_info', 'left_eye_diagnosis')) {
|
||||
Schema::table('inpatient_info', function (Blueprint $table) {
|
||||
$table->string('left_eye_diagnosis')->nullable()->after('right_eye_diagnosis');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('inpatient_info', function (Blueprint $table) {
|
||||
$table->dropColumn('right_eye_diagnosis');
|
||||
$table->dropColumn('left_eye_diagnosis');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddEyeToWardTreatmentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ward_treatments', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('eye')->nullable()->after('durations')->comment('2 -Both, 0 -Left, 1 -Right');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ward_treatments', function (Blueprint $table) {
|
||||
$table->dropColumn('eye');
|
||||
});
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->boolean('enable_hiv_screening_tool')->default(0);
|
||||
$table->boolean('enable_gbv_screening_tool')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('enable_hiv_screening_tool');
|
||||
$table->dropColumn('enable_gbv_screening_tool');
|
||||
});
|
||||
}
|
||||
};
|
||||
+27
-27
@@ -15,33 +15,33 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('triage_id');
|
||||
$table->unsignedBigInteger('patient_id');
|
||||
$table->boolean('mother_hiv_positive')->default(false);
|
||||
$table->boolean('has_been_sick_last_3_months')->default(false);
|
||||
$table->boolean('has_recurring_skin_problem')->default(false);
|
||||
$table->boolean('has_lost_weight_last_3_months')->default(false);
|
||||
$table->boolean('has_had_tb')->default(false);
|
||||
$table->boolean('is_growing_well')->default(false);
|
||||
$table->boolean('tested_for_hiv_in_past_12_months')->default(false);
|
||||
$table->boolean('had_tb_or_presumptive_tb')->default(false);
|
||||
$table->boolean('sti_symptoms_present')->default(false);
|
||||
$table->boolean('diagnosed_with_hepatitis_b_or_c')->default(false);
|
||||
$table->boolean('experienced_or_caused_sexual_violence')->default(false);
|
||||
$table->boolean('reactive_hiv_self_test_result')->default(false);
|
||||
$table->boolean('identified_through_index_client')->default(false);
|
||||
$table->boolean('exposed_to_hiv_positive_or_unknown_source')->default(false);
|
||||
$table->boolean('hiv_symptoms_without_recent_test')->default(false);
|
||||
$table->boolean('tested_for_hiv_last_3_months')->default(false);
|
||||
$table->boolean('tested_for_hiv_last_12_months')->default(false);
|
||||
$table->boolean('unprotected_sex_with_partner_of_unknown_hiv_status')->default(false);
|
||||
$table->boolean('unprotected_sex_with_hiv_positive_partner')->default(false);
|
||||
$table->boolean('shared_needles_or_piercing_objects')->default(false);
|
||||
$table->boolean('experienced_threats_in_past_12_months')->default(false);
|
||||
$table->boolean('prevented_from_accessing_healthcare_in_past_12_months')->default(false);
|
||||
$table->boolean('experienced_physical_violence_in_past_12_months')->default(false);
|
||||
$table->boolean('experienced_unwanted_touching_of_private_parts_in_past_12_months')->default(false);
|
||||
$table->boolean('experienced_forced_sex_in_past_12_months')->default(false);
|
||||
$table->boolean('experienced_condom_refusal_in_past_12_months')->default(false);
|
||||
|
||||
$table->boolean('mother_hiv_positive')->default(false)->nullable();
|
||||
$table->boolean('has_been_sick_last_3_months')->default(false)->nullable();
|
||||
$table->boolean('has_recurring_skin_problem')->default(false)->nullable();
|
||||
$table->boolean('has_lost_weight_last_3_months')->default(false)->nullable();
|
||||
$table->boolean('has_had_tb')->default(false)->nullable();
|
||||
$table->boolean('is_growing_well')->default(false)->nullable();
|
||||
$table->boolean('tested_for_hiv_in_past_12_months')->default(false)->nullable();
|
||||
$table->boolean('had_tb_or_presumptive_tb')->default(false)->nullable();
|
||||
$table->boolean('sti_symptoms_present')->default(false)->nullable();
|
||||
$table->boolean('diagnosed_with_hepatitis_b_or_c')->default(false)->nullable();
|
||||
$table->boolean('experienced_or_caused_sexual_violence')->default(false)->nullable();
|
||||
$table->boolean('reactive_hiv_self_test_result')->default(false)->nullable();
|
||||
$table->boolean('identified_through_index_client')->default(false)->nullable();
|
||||
$table->boolean('exposed_to_hiv_positive_or_unknown_source')->default(false)->nullable();
|
||||
$table->boolean('hiv_symptoms_without_recent_test')->default(false)->nullable();
|
||||
$table->boolean('tested_for_hiv_last_3_months')->default(false)->nullable();
|
||||
$table->boolean('tested_for_hiv_last_12_months')->default(false)->nullable();
|
||||
$table->boolean('unprotected_sex_with_partner_of_unknown_hiv_status')->default(false)->nullable();
|
||||
$table->boolean('unprotected_sex_with_hiv_positive_partner')->default(false)->nullable();
|
||||
$table->boolean('shared_needles_or_piercing_objects')->default(false)->nullable();
|
||||
$table->boolean('experienced_threats_in_past_12_months')->default(false)->nullable();
|
||||
$table->boolean('prevented_from_accessing_healthcare_in_past_12_months')->default(false)->nullable();
|
||||
$table->boolean('experienced_physical_violence_in_past_12_months')->default(false)->nullable();
|
||||
$table->boolean('experienced_unwanted_touching_of_private_parts_in_past_12_months')->default(false)->nullable();
|
||||
$table->boolean('experienced_forced_sex_in_past_12_months')->default(false)->nullable();
|
||||
$table->boolean('experienced_condom_refusal_in_past_12_months')->default(false)->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class EditEyeInWardTreatmentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ward_treatments', function (Blueprint $table) {
|
||||
$table->string('eye')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ward_treatments', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('eye')->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCardioEchoRangesToCardioEchoTemplateTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('cardio_echo_template', function (Blueprint $table) {
|
||||
$table->text('range')->nullable()->after('descriptions');
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('cardio_echo_template', function (Blueprint $table) {
|
||||
$table->dropColumn('range');
|
||||
$table->dropSoftDeletes();
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTypeToWardsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('wards', function (Blueprint $table) {
|
||||
$table->string('type')->nullable()->after('slug');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('wards', function (Blueprint $table) {
|
||||
$table->dropColumn('type');
|
||||
});
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddWardsToInsuranceBenefitsTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('insurance_benefits', function (Blueprint $table) {
|
||||
$table->string('wards')->after('ipd_percentage')->default("0")->comment('Wards to which this benefit applies');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('insurance_benefits', function (Blueprint $table) {
|
||||
$table->dropColumn('wards');
|
||||
});
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class MakeSmartTriageNullable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('smart_triage', function (Blueprint $table) {
|
||||
$table->string('age')->nullable()->change();
|
||||
$table->string('pulse_rate')->nullable()->change();
|
||||
$table->string('temperature')->nullable()->change();
|
||||
$table->string('muac')->nullable()->change();
|
||||
$table->string('transformed_oxygen_saturation')->nullable()->change();
|
||||
$table->string('parent_concern')->nullable()->change();
|
||||
$table->string('respiratory_distress')->nullable()->change();
|
||||
$table->string('oedema')->nullable()->change();
|
||||
$table->string('pallor')->nullable()->change();
|
||||
$table->string('linear_predictor')->nullable()->change();
|
||||
$table->string('risk_score')->nullable()->change();
|
||||
$table->string('auto_triage_grade')->nullable()->change();
|
||||
$table->string('selected_triage_grade')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
//
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddStockTypeToConsiderToGeneralSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('stock_levels_to_consider')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('stock_levels_to_consider');
|
||||
});
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWardStockReconciliationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('ward_stock_reconciliations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('item_type')->nullable();
|
||||
$table->integer('item_id')->nullable();
|
||||
$table->integer('physical_stock')->nullable();
|
||||
$table->integer('affected_account_id')->nullable();
|
||||
$table->tinyInteger('completion_status')->comment('1-complete, 0- not complete')->nullable();
|
||||
$table->integer('stock_count_identifier')->nullable();
|
||||
$table->string('general_comment')->nullable();
|
||||
$table->integer('created_by')->nullable();
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
// for soft deletes to create deleted_at column
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('ward_stock_reconciliations');
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTemplateUsedToCardioEchoResultsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('cardio_echo_results', function (Blueprint $table) {
|
||||
$table->integer('template_used')->after('descriptions_order')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('cardio_echo_results', function (Blueprint $table) {
|
||||
$table->dropColumn(['template_used']);
|
||||
});
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Streamline\Models\GeneralSettings;
|
||||
|
||||
class RemoveEyeClinicFromGeneralSettings extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
// get the current eye clinic id
|
||||
$general_settings = GeneralSettings::find(1);
|
||||
|
||||
if ($general_settings && !is_null($general_settings->eye_module_clinic_id) && $general_settings->eye_module_clinic_id != 0) {
|
||||
$clinic_id = $general_settings->eye_module_clinic_id;
|
||||
|
||||
\Illuminate\Support\Facades\DB::table('clinics')->where('id', $clinic_id)
|
||||
->update(['slug' => 'eye']);
|
||||
}
|
||||
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('eye_module_clinic_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('eye_module_clinic_id')->after('eye_module_enabled')->default(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ReaddGroupIdToInsuranceClaimsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
$claims = \Illuminate\Support\Facades\DB::table('insurance_claims')
|
||||
->leftJoin('insurance_members', 'insurance_members.patient_id', '=', 'insurance_claims.patient_id')
|
||||
->where('insurance_claims.group_id', 0)
|
||||
->get(['insurance_members.patient_id', 'insurance_members.group_id', 'insurance_claims.id']);
|
||||
|
||||
foreach ($claims as $claim) {
|
||||
\Illuminate\Support\Facades\DB::table('insurance_claims')->where('id', $claim->id)
|
||||
->update(['group_id' => $claim->group_id]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('insurance_claims', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddBillClosedColumnToInpatientBillingTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('inpatient_bills', function (Blueprint $table) {
|
||||
$table->integer('bill_closed')->default(0)->after('bill_authorized_at');
|
||||
$table->integer('bill_closed_by')->nullable()->after('bill_closed');
|
||||
$table->timestamp('bill_closed_at')->nullable()->after('bill_closed_by');
|
||||
});
|
||||
|
||||
$bills_to_close = \Illuminate\Support\Facades\DB::table('inpatient_bills')
|
||||
->join('inpatient_info', 'inpatient_info.id', '=', 'inpatient_bills.inpatient_info_id')
|
||||
->whereNull('inpatient_info.deleted_at')->whereNull('inpatient_bills.deleted_at')
|
||||
->whereIn('inpatient_info.outcome_id', [2,3,4,5,8])
|
||||
->update([
|
||||
'inpatient_bills.bill_closed' => 1,
|
||||
'inpatient_bills.bill_closed_by' => 0,
|
||||
'inpatient_bills.bill_closed_at' => \Carbon\Carbon::now()
|
||||
]);
|
||||
|
||||
$claims_to_close = \Illuminate\Support\Facades\DB::table('insurance_claims')
|
||||
->join('inpatient_bills', 'inpatient_bills.id', '=', 'insurance_claims.order_id')
|
||||
->whereNull('inpatient_bills.deleted_at')->whereNull('insurance_claims.deleted_at')
|
||||
->where('inpatient_outpatient', 1)->where('inpatient_bills.bill_closed', 1)
|
||||
->where('insurance_claims.claim_status', 1)
|
||||
->update(['insurance_claims.claim_status' => 2]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('inpatient_bills', function (Blueprint $table) {
|
||||
$table->dropColumn(['bill_closed', 'bill_closed_by', 'bill_closed_at']);
|
||||
});
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('gender_based_violences', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('triage_id');
|
||||
$table->unsignedBigInteger('patient_id');
|
||||
$table->boolean('child_feeling_unsafe')->default(false)->nullable(); // past_12_threatened_humiliated_caused_afraid
|
||||
$table->string('past_12_threatened_humiliated_caused_afraid_when')->default(false)->nullable();
|
||||
$table->string('past_12_threatened_humiliated_caused_afraid_by_whom')->default(false)->nullable();
|
||||
$table->boolean('past_12_prevented_coming_clinic_medication_treatment')->default(false)->nullable();
|
||||
$table->boolean('past_12_any_threatened_or_harmed')->default(false)->nullable();
|
||||
$table->boolean('past_12_any_touched_private_parts_not_want')->default(false)->nullable();
|
||||
$table->boolean('past_12_any_forced_sex')->default(false)->nullable();
|
||||
$table->boolean('past_12_any_refused_condom_when_wanted')->default(false)->nullable();
|
||||
$table->longText('others')->nullable();
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('gender_based_violences');
|
||||
}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('caesarian_sections', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('caesarian_sections');
|
||||
}
|
||||
};
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('uterus_operations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('uterus_operations');
|
||||
}
|
||||
};
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAdjudicationRequiredColumnToClaimsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('insurance_claims', function (Blueprint $table) {
|
||||
$table->integer('adjudication_required')->default(0)->comment("For inpatient claims, if 1 then adjudication is final step, 2 is when this step is complete and 0 is not required");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('insurance_claims', function (Blueprint $table) {
|
||||
$table->dropColumn(['adjudication_required']);
|
||||
});
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('obstetric_histories', function (Blueprint $table) {
|
||||
$table->string('abortion_outcome')->nullable()->after('outcome_name');
|
||||
$table->string('delivery_type')->nullable()->after('abortion_outcome');
|
||||
$table->string('classification')->nullable()->after('delivery_type');
|
||||
$table->string('puerperium')->nullable()->after('classification');
|
||||
$table->longText('children')->nullable()->after('puerperium');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('obstetric_histories', function (Blueprint $table) {
|
||||
$table->dropColumn('abortion_outcome');
|
||||
$table->dropColumn('delivery_type');
|
||||
$table->dropColumn('classification');
|
||||
$table->dropColumn('puerperium');
|
||||
$table->dropColumn('children');
|
||||
});
|
||||
}
|
||||
};
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ante_natal_clinic_registrations', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('woa_weeks')->nullable()->after('edd');
|
||||
$table->string('complications')->nullable()->after('woa_weeks');
|
||||
$table->string('other_complications')->nullable()->after('complications');
|
||||
$table->string('hospital_visits')->nullable()->after('other_complications');
|
||||
$table->longText('hospital_visit_reason')->nullable()->after('hospital_visits');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ante_natal_clinic_registrations', function (Blueprint $table) {
|
||||
$table->dropColumn('woa_weeks');
|
||||
$table->dropColumn('complications');
|
||||
$table->dropColumn('other_complications');
|
||||
$table->dropColumn('hospital_visits');
|
||||
$table->dropColumn('hospital_visit_reason');
|
||||
});
|
||||
}
|
||||
};
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('antenatal_mother_histories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->integer('registration_id');
|
||||
$table->unsignedTinyInteger('menses_length')->nullable();
|
||||
$table->unsignedTinyInteger('menses_amount')->nullable();
|
||||
$table->string('family_planning')->nullable();
|
||||
$table->string('date_discontinued')->nullable();
|
||||
$table->string('why_stop_family_planning')->nullable();
|
||||
$table->string('medical_presentations')->nullable();
|
||||
$table->string('any_medications')->nullable();
|
||||
$table->string('other_any_medications')->nullable();
|
||||
$table->string('surgical_history')->nullable();
|
||||
$table->text('surgical_history_operations')->nullable();
|
||||
$table->string('surgical_history_blood_transfusion')->nullable();
|
||||
$table->string('obs_gyn')->nullable();
|
||||
$table->string('caesarian_section')->nullable();
|
||||
$table->string('uterus_operations')->nullable();
|
||||
$table->string('family_history')->nullable();
|
||||
$table->string('sgbv')->nullable();
|
||||
$table->string('sgbv_risk')->nullable();
|
||||
$table->string('fractures')->nullable();
|
||||
$table->string('husband_health')->nullable();
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('antenatal_mother_histories');
|
||||
}
|
||||
};
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAttendanceFieldToConsultationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('consultations', function (Blueprint $table) {
|
||||
$table->enum('attendance', [1, 2])->nullable()->after('referral_notes')->comment('1 = New Attendance , 2 = Re-attendance');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('consultations', function (Blueprint $table) {
|
||||
$table->dropColumn('attendance');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAttendanceToGeneralSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->enum('consultation_attendance', [1, 0])->default(0)->after('add_lab_stamp_to_pdf_feature')->comment('1 = Yes , 0 = No');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('consultation_attendance');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ante_natal_clinic_followups', function (Blueprint $table) {
|
||||
$table->string('pp_brim')->nullable()->after('other_diagnoses');
|
||||
$table->string('other_physicals')->nullable()->after('pp_brim');
|
||||
$table->mediumText('physical_exam')->nullable()->after('other_physicals');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ante_natal_clinic_followups', function (Blueprint $table) {
|
||||
$table->dropColumn('pp_brim');
|
||||
$table->dropColumn('other_physicals');
|
||||
$table->dropColumn('physical_exam');
|
||||
});
|
||||
}
|
||||
};
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('anc_delivery_plans', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->integer('registration_id');
|
||||
$table->string('live_in_support')->nullable();
|
||||
$table->string('emergency_support')->nullable();
|
||||
$table->string('facility_stay')->nullable();
|
||||
$table->integer('transport_means')->nullable();
|
||||
$table->string('home_keeper')->nullable();
|
||||
$table->string('delivery_method')->nullable();
|
||||
$table->string('family_planning_method')->nullable();
|
||||
$table->string('health_screening')->nullable();
|
||||
$table->integer('disposal')->nullable();
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('anc_delivery_plans');
|
||||
}
|
||||
};
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePatientRegistrationFieldsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('patient_registration_fields', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name', 255)->unique();
|
||||
$table->enum('compulsory', [1, 0])->nullable()->comment('1 = Yes , 0 = No');
|
||||
$table->string('options', 255)->nullable();
|
||||
$table->integer('created_by')->unsigned();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->integer('updated_by')->nullable()->unsigned();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('patient_registration_fields');
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddInvestigationColumnsToGeneralSettingsTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('allow_lab_number_editing')->default(0);
|
||||
$table->integer('allow_editing_name_of_lab_doctor')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn(['allow_lab_number_editing', 'allow_editing_name_of_lab_doctor']);
|
||||
});
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddLabNumberToOrderedInvestigations extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
if (!Schema::hasColumn('ordered_investigations', 'lab_number')) {
|
||||
Schema::table('ordered_investigations', function (Blueprint $table) {
|
||||
$table->string('lab_number')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
if (!Schema::hasColumn('ordered_investigations', 'ordered_by')) {
|
||||
Schema::table('ordered_investigations', function (Blueprint $table) {
|
||||
$table->string('ordered_by')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ordered_investigations', function (Blueprint $table) {
|
||||
$table->dropColumn('lab_number');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddRegistrationFieldToPatientsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('patients', function (Blueprint $table) {
|
||||
$table->text('registration_fields')->nullable()->after('address_details');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('patients', function (Blueprint $table) {
|
||||
$table->dropColumn('registration_fields');
|
||||
});
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddInvestigationFieldsToPatientDocumentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('patient_documents', function (Blueprint $table) {
|
||||
$table->integer('investigation_id')->nullable()->unsigned()->after('episode_id');
|
||||
$table->integer('investigation_result_id')->nullable()->unsigned()->after('investigation_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('patient_documents', function (Blueprint $table) {
|
||||
$table->dropColumn('investigation_id');
|
||||
$table->dropColumn('investigation_result_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('drug_routes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->integer('available')->default(1);
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('drug_routes');
|
||||
}
|
||||
};
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void {
|
||||
Schema::create('cancer_protocols', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->integer('protocol_billing_type');
|
||||
$table->integer('protocol_cost')->default(0)->nullable();
|
||||
$table->string('pre_chemo_comments');
|
||||
$table->longText('pre_chemo_drugs');
|
||||
$table->string('chemo_comments');
|
||||
$table->longText('chemo_drugs');
|
||||
$table->string('post_chemo_comments');
|
||||
$table->longText('post_chemo_drugs');
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void {
|
||||
Schema::dropIfExists('cancer_protocols');
|
||||
}
|
||||
};
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Streamline\Models\WardItemRequest;
|
||||
|
||||
class AddItemIdsIssuedOutColumnToWardItemRequestsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ward_item_requests', function (Blueprint $table) {
|
||||
$table->text('item_ids_issued_out')->nullable()->after('balance_returned');
|
||||
});
|
||||
|
||||
//handle existing data
|
||||
$ward_item_requests = WardItemRequest::all();
|
||||
if (count($ward_item_requests) > 0) {
|
||||
foreach ($ward_item_requests as $record) {
|
||||
if ($record->dispensation_status == 1) {
|
||||
$record->item_ids_issued_out = $record->item_ids;
|
||||
$record->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ward_item_requests', function (Blueprint $table) {
|
||||
$table->dropColumn('item_ids_issued_out');
|
||||
});
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Streamline\Models\Requisition;
|
||||
|
||||
class AddItemIdsIssuedOutColumnToRequisitionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('requisitions', function (Blueprint $table) {
|
||||
$table->text('item_ids_issued_out')->nullable()->after('issue_status');
|
||||
});
|
||||
|
||||
//handle existing data
|
||||
$requisitions = Requisition::all();
|
||||
if (count($requisitions) > 0) {
|
||||
foreach ($requisitions as $record) {
|
||||
if ($record->issue_status == 1) {
|
||||
$record->item_ids_issued_out = $record->drug_id;
|
||||
$record->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('requisitions', function (Blueprint $table) {
|
||||
$table->dropColumn('item_ids_issued_out');
|
||||
});
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
class AddHmisOutpatientOptionsToDiagnosesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('diagnoses', function (Blueprint $table) {
|
||||
$table->unsignedInteger('outpatient_hmis_category')->nullable()->after('available');
|
||||
$table->unsignedInteger('outpatient_hmis_category_option')->nullable()->after('outpatient_hmis_category');
|
||||
$table->unsignedInteger('outpatient_dependent_option')->nullable()->after('outpatient_hmis_category_option');
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('diagnoses', function (Blueprint $table) {
|
||||
$table->dropColumn('outpatient_hmis_category');
|
||||
$table->dropColumn('outpatient_hmis_category_option');
|
||||
$table->dropColumn('outpatient_dependent_option');
|
||||
});
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddIncomeAccountToDebtPlanTable extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up() {
|
||||
$debt_plans = DB::table('debt_plan')->whereNull('income_account')
|
||||
->get(['id', 'tag_id']);
|
||||
|
||||
foreach ($debt_plans as $debt_plan) {
|
||||
$tag_id = $debt_plan->tag_id;
|
||||
|
||||
if ($tag_id == 6 || $tag_id == 8 || $tag_id == 7 || $tag_id == 10) {
|
||||
//Consultations / Services
|
||||
$income_account = 7;
|
||||
} elseif ($tag_id == 3 || $tag_id == 1) {
|
||||
//Drugs / Treatments
|
||||
$income_account = 4;
|
||||
} elseif ($tag_id == 5) {
|
||||
//Sundries
|
||||
$income_account = 12;
|
||||
} elseif ($tag_id == 2) {
|
||||
//Investigations
|
||||
$income_account = 11;
|
||||
} elseif ($tag_id == 4) {
|
||||
//Procedures
|
||||
$income_account = 8;
|
||||
} else {
|
||||
$income_account = NULL;
|
||||
}
|
||||
|
||||
DB::table('debt_plan')->where('id', $debt_plan->id)->update([
|
||||
"income_account" => $income_account
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down() {
|
||||
//
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddHmis002SlugToInvestigationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('investigations', function (Blueprint $table) {
|
||||
$table->unsignedSmallInteger('hmis_002_slug')->nullable()->after('lab_time');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('investigations', function (Blueprint $table) {
|
||||
$table->dropColumn('hmis_002_slug');
|
||||
});
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void {
|
||||
Schema::table('inpatient_info', function (Blueprint $table) {
|
||||
$table->longText('vitals')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void {
|
||||
Schema::table('inpatient_info', function (Blueprint $table) {
|
||||
$table->dropColumn(['vitals']);
|
||||
});
|
||||
}
|
||||
};
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddRestartLisPathToLabInstrumentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('lab_instruments', function (Blueprint $table) {
|
||||
$table->text('restart_lis_path')->nullable()->after('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('lab_instruments', function (Blueprint $table) {
|
||||
$table->dropColumn(['restart_lis_path']);
|
||||
});
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ChangeApprovalDateAndBillingDateToTimestampsOnQuotationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('quotations', function (Blueprint $table) {
|
||||
$table->dateTime('quotation_date')->change();
|
||||
$table->dateTime('billing_date')->change();
|
||||
$table->dateTime('approval_date')->change();
|
||||
$table->dateTime('receive_date')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('quotations', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ante_natal_clinic_registrations', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('ectopic_pregnancies')->nullable()->after('abortion');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ante_natal_clinic_registrations', function (Blueprint $table) {
|
||||
$table->dropColumn('ectopic_pregnancies');
|
||||
});
|
||||
}
|
||||
};
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('maternity_inpatients', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('ectopic_pregnancies')->nullable()->after('abortion');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('maternity_inpatients', function (Blueprint $table) {
|
||||
$table->dropColumn('ectopic_pregnancies');
|
||||
});
|
||||
}
|
||||
};
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Streamline\Models\Diagnosis;
|
||||
use Streamline\Models\HmisCategoryOptions;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class AddChangeIndexToHmisCategoriesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
// Schema::table('hmis_categories', function (Blueprint $table) {
|
||||
// $table->dropUnique('unique_title_number');
|
||||
// $table->unique(['title', 'number', 'type', 'section_number'], 'unique_category');
|
||||
// });
|
||||
// DB::beginTransaction();
|
||||
// // Call HMIS seeders
|
||||
// Artisan::call('db:seed', ['--class' => 'HmisCategoriesTableSeeder', '--force' => true ]);
|
||||
// Artisan::call('db:seed', ['--class' => 'HmisCategoryOptionsSeeder', '--force' => true ]);
|
||||
|
||||
// $options = HmisCategoryOptions::leftJoin('hmis_categories AS a','a.id', 'hmis_category_options.hmis_category_id')
|
||||
// ->select('a.id as outpatient_hmis_category','hmis_category_options.id','parent_option', 'hmis_category_options.number as number')
|
||||
// ->where([['a.type', 0], ['a.section_number',1]])->orWhereNotNull('parent_option')
|
||||
// ->get();
|
||||
// foreach ($options as $option) {
|
||||
// if(!empty($option->parent_option)) {
|
||||
// $outpatient_hmis_category = HmisCategoryOptions::find($option->parent_option);
|
||||
// Diagnosis::where('hmis_no_outpatient',$option->number)->update(['outpatient_hmis_category'=>$outpatient_hmis_category->hmis_category_id, 'outpatient_hmis_category_option'=>$option->parent_option, 'outpatient_dependent_option'=>$option->id]);
|
||||
// }
|
||||
// else Diagnosis::where('hmis_no_outpatient',$option->number)->update(['outpatient_hmis_category'=>$option->outpatient_hmis_category, 'outpatient_hmis_category_option'=>$option->id]);
|
||||
// }
|
||||
|
||||
// DB::commit();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('hmis_categories', function (Blueprint $table) {
|
||||
$table->unique(['title', 'number'],'unique_title_number');
|
||||
$table->dropUnique('unique_category');
|
||||
});
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('patient_inpatient_vitals', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->integer('inpatient_id');
|
||||
$table->text('vitals');
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('patient_inpatient_vitals');
|
||||
}
|
||||
};
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('ordered_cancer_protocols', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('protocol_id');
|
||||
$table->string('protocol_status')->default(0)->comment('0 ongoing, 1 stopped');
|
||||
$table->text('protocol_status_comment')->nullable();
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->integer('inpatient_id');
|
||||
$table->longText('pre_chemo_drugs');
|
||||
$table->integer('pre_chemo_status')->default(0)->comment('0 not started, 1 started, 2 complete');
|
||||
$table->longText('chemo_drugs');
|
||||
$table->integer('chemo_status')->default(0)->comment('0 not started, 1 started, 2 complete');
|
||||
$table->longText('post_chemo_drugs');
|
||||
$table->integer('post_chemo_status')->default(0)->comment('0 not started, 1 started, 2 complete');
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ordered_cancer_protocols');
|
||||
}
|
||||
};
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('obstetric_histories', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('stillbirth_type')->nullable()->after('delivery_type');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('obstetric_histories', function (Blueprint $table) {
|
||||
$table->dropColumn('stillbirth_type');
|
||||
});
|
||||
}
|
||||
};
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('incoming_ward_charts', function (Blueprint $table) {
|
||||
$table->string('has_cancer_protocol')->nullable()->comment('Integer that is a key for cancer_protocol_ward_charts table');
|
||||
});
|
||||
|
||||
Schema::create('cancer_protocol_ward_charts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->integer('ward_id');
|
||||
$table->string('height')->nullable();
|
||||
$table->string('weight')->nullable();
|
||||
$table->string('vitals_date_taken')->nullable();
|
||||
$table->text('request_comment')->nullable();
|
||||
$table->integer('protocol_id');
|
||||
$table->text('protocol_drug_id');
|
||||
$table->text('protocol_section');
|
||||
$table->text('protocol_drug_factor');
|
||||
$table->text('protocol_drug_factor_value');
|
||||
$table->text('protocol_drug_dose');
|
||||
$table->text('protocol_drug_dosage_label');
|
||||
$table->text('protocol_drug_unit_value');
|
||||
$table->text('protocol_dosage_to_dispense');
|
||||
$table->text('protocol_quantity_to_dispense');
|
||||
$table->longText('protocol_instruction');
|
||||
$table->integer('completion_status')->default(0);
|
||||
$table->integer('approved_by')->default(0);
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cancer_protocol_ward_charts');
|
||||
|
||||
Schema::table('incoming_ward_charts', function (Blueprint $table) {
|
||||
$table->dropColumn(['vitals']);
|
||||
});
|
||||
}
|
||||
};
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ChangeWardColumnsTypesForItemBatchWatcherTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('item_batch_watcher', function (Blueprint $table) {
|
||||
$table->text('ward_stock')->nullable()->change();
|
||||
$table->text('ward_id')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('item_batch_watcher', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddQuantityApprovedColumnToRequisitionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('requisitions', function (Blueprint $table) {
|
||||
$table->longText('quantity_approved')->nullable()->after('quantity_requested');
|
||||
$table->integer('approved_by')->nullable()->after('quantity_approved');
|
||||
$table->dateTime('approved_date')->nullable()->after('approved_by');
|
||||
$table->longText('issue_cost_value')->nullable()->after('cost_value');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('requisitions', function (Blueprint $table) {
|
||||
$table->dropColumn(['quantity_approved', 'approved_by', 'approved_date', 'issue_cost_value']);
|
||||
});
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Streamline\Models\Treatment;
|
||||
|
||||
class AddMonetaryColumnsToTreatmentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('treatments', function (Blueprint $table) {
|
||||
$table->text('amount_paid')->after('unit_selling_prices');
|
||||
$table->text('current_chart_of_account')->after('amount_paid');
|
||||
$table->text('unit_cost_price')->after('current_chart_of_account');
|
||||
$table->text('cost_of_goods_account')->after('unit_cost_price');
|
||||
$table->text('inventory_account')->after('cost_of_goods_account');
|
||||
});
|
||||
|
||||
// migrate for old values
|
||||
$treatments = Treatment::where('inpatient_bill_generated', 1)->get();
|
||||
|
||||
foreach ($treatments as $treatment) {
|
||||
$drug_ids = explode(",", $treatment->drugs);
|
||||
$unit_selling_prices = is_null($treatment->unit_selling_prices) ? array_fill(0, count($drug_ids), "") : explode(",", $treatment->unit_selling_prices);
|
||||
$date_of_interest = Carbon::parse($treatment->created_at)->toDateString();
|
||||
$current_chart_of_account = [];
|
||||
$cost_price = [];
|
||||
$inventory_account = [];
|
||||
$cost_of_goods_account = [];
|
||||
$amount_paid_array = [];
|
||||
|
||||
for ($i = 0; $i < count($drug_ids); $i++) {
|
||||
$drug_details = DB::table('drugs')->find($drug_ids[$i]);
|
||||
|
||||
if ($drug_details) {
|
||||
$drug_cost_price = $drug_details->cost_price;
|
||||
$drug_selling_price = $drug_details->non_insured_price;
|
||||
|
||||
$stock_watcher_record = DB::table('stock_watcher')->where('item_type', 1)
|
||||
->where('item_id', $drug_details->id)->first();
|
||||
|
||||
if ($stock_watcher_record) {
|
||||
$details_arr = json_decode($stock_watcher_record->details, true);
|
||||
|
||||
if (!isset($details_arr[$date_of_interest])) {
|
||||
// just get the dates into their own array
|
||||
$dates_array = array_keys($details_arr);
|
||||
|
||||
// search for the closest date to ours of interest and set that as our reference
|
||||
$closest_date = get_closest_element_in_array($dates_array, $date_of_interest);
|
||||
|
||||
if ($closest_date < $date_of_interest) {
|
||||
// we should only get dates less than that of interest since if it is greater calculations will be wrong
|
||||
$drug_cost_price = $details_arr[$closest_date]["buying_price"];
|
||||
$drug_selling_price = $details_arr[$closest_date]["selling_price"];
|
||||
} else {
|
||||
$drug_cost_price = 0;
|
||||
$drug_selling_price = 0;
|
||||
}
|
||||
} else {
|
||||
$drug_cost_price = $details_arr[$date_of_interest]["buying_price"];
|
||||
$drug_selling_price = $details_arr[$date_of_interest]["selling_price"];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($unit_selling_prices[$i])) {
|
||||
$unit_selling_prices[$i] = $drug_selling_price;
|
||||
}
|
||||
|
||||
$current_chart_of_account[] = $drug_details->account_id;
|
||||
$cost_price[] = $drug_cost_price;
|
||||
$inventory_account[] = $drug_details->inventory_account;
|
||||
$cost_of_goods_account[] = $drug_details->cost_of_goods_account;
|
||||
$amount_paid_array[] = $drug_selling_price;
|
||||
}
|
||||
}
|
||||
|
||||
$treatment->amount_paid = implode(",", $amount_paid_array);
|
||||
$treatment->unit_selling_prices = implode(",", $unit_selling_prices);
|
||||
$treatment->current_chart_of_account = implode(",", $current_chart_of_account);
|
||||
$treatment->unit_cost_price = implode(",", $cost_price);
|
||||
$treatment->cost_of_goods_account = implode(",", $cost_of_goods_account);
|
||||
$treatment->inventory_account = implode(",", $inventory_account);
|
||||
$treatment->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('treatments', function (Blueprint $table) {
|
||||
$table->dropColumn(['amount_paid', 'current_chart_of_account', 'unit_cost_price', 'cost_of_goods_account']);
|
||||
});
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('treatment_sheet_dispensations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('patient_id');
|
||||
$table->integer('episode_id');
|
||||
$table->integer('ward_treatment_id');
|
||||
$table->integer('order_number');
|
||||
$table->integer('drug_id');
|
||||
$table->integer('quantity_given');
|
||||
$table->string('given_by');
|
||||
$table->string('given_on');
|
||||
$table->integer('created_by');
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::table('ward_treatment_dispensations', function (Blueprint $table) {
|
||||
$table->decimal('quantity_given_treatment_sheet', 5, 2)->after('quantity_given')->comment('given from the treatment sheet');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('treatment_sheet_dispensations');
|
||||
|
||||
Schema::table('ward_treatment_dispensations', function (Blueprint $table) {
|
||||
$table->dropColumn(['quantity_given_treatment_sheet']);
|
||||
});
|
||||
}
|
||||
};
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddBankingIdRecordToFixedAssetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('fixed_assets', function (Blueprint $table) {
|
||||
$table->integer('banking_id')->after('bank_account_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('fixed_assets', function (Blueprint $table) {
|
||||
$table->dropColumn('banking_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddInpatientSheetExtrasToGeneralSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->integer('inpatient_sheet_extras')->default(1)->after('add_stamp_to_pdf_feature')->comment('0 - Extras disabled, 1 - Extras enabled');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('general_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('inpatient_sheet_extras');
|
||||
});
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Streamline\Models\HospitalBill;
|
||||
|
||||
class ChangeBillTypeForHospitalBills extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
HospitalBill::where('bill_type', 'GEN')
|
||||
->where('bill_memo', 'not like', '%UN-VERIFIED AUTO CREATED STRE@MLINE INVENTORY BILL%')
|
||||
->update(['bill_type' => 'PAY']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddAntimalarialToDrugCategoriesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('drug_categories', function (Blueprint $table) {
|
||||
$table->enum('anti_malarial', [1, 0])->nullable()->after('name')->comment('1 = Yes , 0 = No');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('drug_categories', function (Blueprint $table) {
|
||||
$table->dropColumn('anti_malarial');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddDrugStoppedColumnsToWardTreatmentsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('ward_treatments', function (Blueprint $table) {
|
||||
$table->text('stopped_drugs')->nullable()->after('instruction');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('ward_treatments', function (Blueprint $table) {
|
||||
$table->dropColumn('stopped_drugs');
|
||||
});
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddResearchIdToInsuranceMembersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('insurance_members', function (Blueprint $table) {
|
||||
$table->string('research_id')->nullable()->after('group_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('insurance_members', function (Blueprint $table) {
|
||||
$table->dropColumn('research_id');
|
||||
});
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('invoice_payment_records', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('invoice_number');
|
||||
$table->string('receipt_number');
|
||||
$table->integer('amount_paid');
|
||||
$table->date('date_paid');
|
||||
$table->integer('deducted')->nullable();
|
||||
$table->integer('received_id')->nullable();
|
||||
$table->integer('received_amount')->nullable();
|
||||
$table->integer('banked_id')->nullable();
|
||||
$table->integer('amount_written_off')->nullable();
|
||||
$table->integer('amount_written_off_by')->nullable();
|
||||
$table->date('amount_written_off_at')->nullable();
|
||||
$table->integer('created_by')->nullable();
|
||||
$table->integer('updated_by')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('invoice_payment_records');
|
||||
}
|
||||
};
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Streamline\Models\InvoicePaymentRecord;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$invoice_payments = DB::table('invoice_payments')
|
||||
->whereNull('deleted_at')->get();
|
||||
|
||||
foreach ($invoice_payments as $payment) {
|
||||
try {
|
||||
$receipt_number_arr = unserialize($payment->receipt_number);
|
||||
$amount_paid_history_arr = unserialize($payment->amount_paid_history);
|
||||
$date_paid_history_arr = unserialize($payment->date_paid_history);
|
||||
$staff_incharge_history_arr = unserialize($payment->staff_incharge_history);
|
||||
$received_id_history_arr = unserialize($payment->received_id_history);
|
||||
$received_amount_history_arr = unserialize($payment->received_amount_history);
|
||||
$banked_history_arr = unserialize($payment->banked_history);
|
||||
$receipt_number_arr = is_array($receipt_number_arr) ? array_values($receipt_number_arr) : [];
|
||||
$amount_paid_history_arr = is_array($amount_paid_history_arr) ? array_values($amount_paid_history_arr) : [];
|
||||
$date_paid_history_arr = is_array($date_paid_history_arr) ? array_values($date_paid_history_arr) : [];
|
||||
$staff_incharge_history_arr = is_array($staff_incharge_history_arr) ? array_values($staff_incharge_history_arr) : [];
|
||||
$received_id_history_arr = is_array($received_id_history_arr) ? array_values($received_id_history_arr) : [];
|
||||
$received_amount_history_arr = is_array($received_amount_history_arr) ? array_values($received_amount_history_arr) : [];
|
||||
$banked_history_arr = is_array($banked_history_arr) ? array_values($banked_history_arr) : [];
|
||||
|
||||
if (is_array($receipt_number_arr)) {
|
||||
for ($i = 0; $i < count($receipt_number_arr); $i++) {
|
||||
$record = new InvoicePaymentRecord();
|
||||
$record->invoice_number = $payment->invoice_number;
|
||||
$record->deducted = $payment->deducted;
|
||||
$record->receipt_number = $receipt_number_arr[$i];
|
||||
$record->amount_paid = $amount_paid_history_arr[$i] ?? 0;
|
||||
$record->date_paid = Carbon::parse(($date_paid_history_arr[$i] ?? date('Y-m-d')))->toDateString();
|
||||
$record->received_id = $received_id_history_arr[$i] ?? null;
|
||||
$record->received_amount = $received_amount_history_arr[$i] ?? null;
|
||||
$record->banked_id = $banked_history_arr[$i] ?? null;
|
||||
$record->created_by = $staff_incharge_history_arr[$i] ?? 1;
|
||||
$record->created_at = $payment->created_at;
|
||||
$record->save();
|
||||
}
|
||||
}
|
||||
|
||||
$amount_written_off_history_arr = json_decode($payment->amount_written_off_history);
|
||||
$amount_written_off_by_history_arr = json_decode($payment->amount_written_off_by_history);
|
||||
$amount_written_off_at_history_arr = json_decode($payment->amount_written_off_at_history);
|
||||
|
||||
if (is_array($amount_written_off_history_arr)) {
|
||||
for ($i = 0; $i < count($amount_written_off_history_arr); $i++) {
|
||||
$record = new InvoicePaymentRecord();
|
||||
$record->invoice_number = $payment->invoice_number;
|
||||
$record->deducted = $payment->deducted;
|
||||
$record->amount_written_off = $amount_written_off_history_arr[$i] ?? 0;
|
||||
$record->amount_written_off_at = Carbon::parse($amount_written_off_at_history_arr[$i])->toDateString();
|
||||
$record->created_by = $amount_written_off_by_history_arr[$i] ?? 1;
|
||||
$record->created_at = $payment->created_at;
|
||||
$record->save();
|
||||
}
|
||||
}
|
||||
} catch (QueryException | \Exception $e) {}
|
||||
}
|
||||
|
||||
Schema::table('invoice_payments', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'receipt_number', 'amount_paid_history', 'staff_incharge_history', 'date_paid_history',
|
||||
'received', 'deducted', 'received_id_history', 'received_amount_history','banked','banked_history',
|
||||
'amount_written_off', 'amount_written_off_history', 'amount_written_off_by_history', 'amount_written_off_at_history',
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user