mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 03:31: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:
@@ -59,7 +59,7 @@ use RegistersUsers;
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Streamline\Models\User
|
||||
* @return User
|
||||
*/
|
||||
protected function create(array $data) {
|
||||
return User::create([
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
namespace Streamline\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Streamline\Models\BloodDonation;
|
||||
use Streamline\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BloodDonationsController extends Controller {
|
||||
|
||||
@@ -76,7 +77,7 @@ class BloodDonationsController extends Controller {
|
||||
$new_blood_donation = new BloodDonation;
|
||||
$new_blood_donation->donor_id = $donor_id;
|
||||
$new_blood_donation->last_donation_date = $donation_date;
|
||||
$new_blood_donation->created_by = auth()->user()->id;
|
||||
$new_blood_donation->created_by = Auth::id();
|
||||
if ($new_blood_donation->save()) {
|
||||
flash('New blood donation has been succesfully recorded')->success();
|
||||
return redirect('blood_donations');
|
||||
|
||||
@@ -89,7 +89,7 @@ class DataExtractionController extends Controller {
|
||||
"inventory_account" => $inventory_account,
|
||||
"cost_of_goods_account" => $cost_of_goods_account,
|
||||
"has_price_list" => 0,
|
||||
"created_by" => auth()->user()->id,
|
||||
"created_by" => Auth::id(),
|
||||
"created_at" => date('Y-m-d H:i:s')
|
||||
]);
|
||||
|
||||
@@ -140,7 +140,7 @@ class DataExtractionController extends Controller {
|
||||
"inventory_account" => 0,
|
||||
"cost_of_goods_account" => 0,
|
||||
"has_price_list" => 1,
|
||||
"created_by" => auth()->user()->id,
|
||||
"created_by" => Auth::id(),
|
||||
"created_at" => date('Y-m-d H:i:s')
|
||||
]);
|
||||
|
||||
|
||||
@@ -3,22 +3,31 @@
|
||||
namespace Streamline\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Streamline\Models\Clinic;
|
||||
use Streamline\Models\GeneralSettings;
|
||||
use Streamline\Models\Services;
|
||||
use Streamline\Models\PermissionCategory;
|
||||
use Streamline\Models\StreamlineSetupStep;
|
||||
use Streamline\Models\User;
|
||||
|
||||
class GeneralSettingsController extends Controller {
|
||||
class GeneralSettingsController extends Controller
|
||||
{
|
||||
|
||||
public function edit_settings(){
|
||||
public function edit_settings()
|
||||
{
|
||||
$general_settings = GeneralSettings::find(1);
|
||||
$services = Services::pluck('name', 'id')->toArray();
|
||||
$services = ['' => '- select -'] + $services;
|
||||
|
||||
return view('general_settings.edit', compact('general_settings', 'services'));
|
||||
$clinics = Clinic::pluck('name', 'id')->toArray();
|
||||
$clinics = ['' => '- select -'] + $clinics;
|
||||
|
||||
return view('general_settings.edit', compact('general_settings', 'services', 'clinics'));
|
||||
}
|
||||
|
||||
public function save_settings(Request $request){
|
||||
public function save_settings(Request $request)
|
||||
{
|
||||
|
||||
$general_settings = GeneralSettings::find(1);
|
||||
$general_settings->donor_feature = $request->donor_feature;
|
||||
@@ -32,6 +41,8 @@ class GeneralSettingsController extends Controller {
|
||||
$general_settings->enable_sms = $request->enable_sms;
|
||||
$general_settings->incoming_prescription_confirmation_feature = $request->incoming_prescription_confirmation_feature;
|
||||
$general_settings->add_stamp_to_pdf_feature = $request->add_stamp_to_pdf_feature;
|
||||
$general_settings->consultation_attendance = $request->consultation_attendance;
|
||||
$general_settings->inpatient_sheet_extras= $request->inpatient_sheet_extras;
|
||||
$general_settings->add_lab_stamp_to_pdf_feature = $request->add_lab_stamp_to_pdf_feature;
|
||||
$general_settings->enable_dipensing_unpaid_prescription = $request->enable_dipensing_unpaid_prescription;
|
||||
$general_settings->item_batch_tracking = $request->item_batch_tracking;
|
||||
@@ -65,6 +76,7 @@ class GeneralSettingsController extends Controller {
|
||||
$general_settings->view_investigation_price_on_order = $request->view_investigation_price_on_order;
|
||||
$general_settings->view_sundry_price_on_order = $request->view_sundry_price_on_order;
|
||||
$general_settings->view_service_price_on_order = $request->view_service_price_on_order;
|
||||
$general_settings->eye_module_enabled = $request->eye_module_enabled;
|
||||
$general_settings->payments_from_banks_with_lesser_balance = $request->payments_from_banks_with_lesser_balance;
|
||||
$general_settings->system_language = $request->system_language;
|
||||
$general_settings->smart_triage_feature = $request->smart_triage_feature;
|
||||
@@ -72,23 +84,29 @@ class GeneralSettingsController extends Controller {
|
||||
$general_settings->allow_dispensing_out_of_stock_drugs = $request->allow_dispensing_out_of_stock_drugs;
|
||||
$general_settings->allow_issuing_out_of_stock_drugs = $request->allow_issuing_out_of_stock_drugs;
|
||||
$general_settings->smart_discharge_feature = $request->smart_discharge_feature;
|
||||
$general_settings->default_hospital_clinic = $request->default_hospital_clinic;
|
||||
$general_settings->enable_fingerprint = $request->enable_fingerprint;
|
||||
$general_settings->full_detail_receipt_print = $request->full_detail_receipt_print;
|
||||
$general_settings->inpatient_sheet_with_detailed_notes = $request->inpatient_sheet_with_detailed_notes;
|
||||
$general_settings->show_symptoms_on_consultation = $request->show_symptoms_on_consultation;
|
||||
$general_settings->select_clinic_order_type = $request->select_clinic_order_type;
|
||||
$general_settings->enable_hiv_and_gbv_screening_tool = $request->enable_hiv_and_gbv_screening_tool;
|
||||
$general_settings->enable_hiv_screening_tool = $request->enable_hiv_screening_tool;
|
||||
$general_settings->enable_gbv_screening_tool = $request->enable_gbv_screening_tool;
|
||||
$general_settings->stock_levels_to_consider = $request->stock_levels_to_consider;
|
||||
$general_settings->allow_lab_number_editing = $request->allow_lab_number_editing;
|
||||
$general_settings->allow_editing_name_of_lab_doctor = $request->allow_editing_name_of_lab_doctor;
|
||||
$general_settings->save();
|
||||
|
||||
flash("Settings have been updated")->success();
|
||||
|
||||
if (session()->has('streamline_setup')) {
|
||||
if (session()->has('streamline_setup')) {
|
||||
//update the streamline setup table with the new finished step
|
||||
$streamline_setup = new \Streamline\Models\StreamlineSetupStep;
|
||||
$streamline_setup = new StreamlineSetupStep;
|
||||
$streamline_setup->step = "general settings configuration";
|
||||
$streamline_setup->completion_status = 1;
|
||||
$streamline_setup->save();
|
||||
session()->forget('streamline_setup');
|
||||
session()->forget('streamline_setup');
|
||||
return redirect("home");
|
||||
}
|
||||
return redirect("general_settings/edit");
|
||||
@@ -105,9 +123,9 @@ class GeneralSettingsController extends Controller {
|
||||
{
|
||||
$activated_categories_array = $request->permission_category;
|
||||
$all_permission_categories = PermissionCategory::pluck('id')->toArray();
|
||||
|
||||
|
||||
//loop through the categories and activate only the checked ones
|
||||
for ($i=0; $i < count($all_permission_categories); $i++) {
|
||||
for ($i = 0; $i < count($all_permission_categories); $i++) {
|
||||
$category = PermissionCategory::find($all_permission_categories[$i]);
|
||||
if (in_array($all_permission_categories[$i], $activated_categories_array)) {
|
||||
$category->is_module_active = 1;
|
||||
@@ -116,21 +134,21 @@ class GeneralSettingsController extends Controller {
|
||||
}
|
||||
$category->update();
|
||||
}
|
||||
|
||||
|
||||
flash("Active modules have been activated")->success();
|
||||
return redirect("activate_streamline_modules");
|
||||
}
|
||||
|
||||
public function edit_personal_settings(Request $request)
|
||||
{
|
||||
$general_settings = User::find(auth()->user()->id);
|
||||
$general_settings = User::find(Auth::id());
|
||||
|
||||
return view('general_settings.personal_settings_edit', compact('general_settings'));
|
||||
}
|
||||
|
||||
public function save_personal_settings(Request $request)
|
||||
{
|
||||
$user = User::find(auth()->user()->id);
|
||||
$user = User::find(Auth::id());
|
||||
if ($user) {
|
||||
$user->system_language = $request->system_language;
|
||||
$user->update();
|
||||
@@ -139,7 +157,7 @@ class GeneralSettingsController extends Controller {
|
||||
return redirect('personal_settings/edit');
|
||||
}
|
||||
|
||||
flash('system could not update the settings')->success();
|
||||
flash('system could not update the settings')->success();
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
@@ -158,13 +176,10 @@ class GeneralSettingsController extends Controller {
|
||||
|
||||
flash('settings have been updated')->success();
|
||||
return redirect()->route('general_settings.active_users_limit_settings');
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
|
||||
flash('system could not update the settings')->error();
|
||||
flash('system could not update the settings')->error();
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
|
||||
namespace Streamline\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use flash;
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Streamline\Models\InsuranceMember;
|
||||
use Streamline\Models\MessageBoard;
|
||||
use Streamline\Models\HospitalInformation;
|
||||
use Streamline\Models\PatientEpisode;
|
||||
use Streamline\Models\Patient;
|
||||
use Streamline\Models\StreamlineSetupStep;
|
||||
use DB;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
@@ -26,7 +23,6 @@ class HomeController extends Controller
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index() {
|
||||
/*
|
||||
@@ -71,19 +67,19 @@ class HomeController extends Controller
|
||||
|
||||
public function quick_analysis_reports()
|
||||
{
|
||||
$insurance_members_array = \Streamline\Models\InsuranceMember::pluck('patient_id')->toArray();
|
||||
$insurance_members_array = InsuranceMember::pluck('patient_id')->toArray();
|
||||
|
||||
$patient_registered_per_month_under_insurance = \Streamline\Models\Patient::whereIn('id',$insurance_members_array)->whereBetween('created_at', ['2018-01-01', '2022-12-31'])->select(DB::raw('count(id) as `data`'),DB::raw("DATE_FORMAT(created_at, '%Y-%m') episodes_year_month"))
|
||||
$patient_registered_per_month_under_insurance = Patient::whereIn('id',$insurance_members_array)->whereBetween('created_at', ['2018-01-01', '2022-12-31'])->select(DB::raw('count(id) as `data`'),DB::raw("DATE_FORMAT(created_at, '%Y-%m') episodes_year_month"))
|
||||
->groupBy('episodes_year_month')->orderBy('episodes_year_month')->get();
|
||||
|
||||
return $patient_registered_per_month_under_insurance;
|
||||
|
||||
/* set_time_limit(0);
|
||||
$patient_visits_per_month = \Streamline\Models\PatientEpisode::select(DB::raw('count(id) as `data`'),DB::raw("DATE_FORMAT(created_at, '%Y-%m') episodes_year_month"))
|
||||
$patient_visits_per_month = PatientEpisode::select(DB::raw('count(id) as `data`'),DB::raw("DATE_FORMAT(created_at, '%Y-%m') episodes_year_month"))
|
||||
->groupBy('episodes_year_month')->orderBy('episodes_year_month')->get();
|
||||
//return $patient_visits_per_month;
|
||||
|
||||
$patient_visits_per_month_for_insured = \Streamline\Models\PatientEpisode::whereIn('patient_id',$insurance_members_array)->whereBetween('created_at', ['2019-01-01', '2022-12-31'])->select(DB::raw('count(id) as `data`'),DB::raw("DATE_FORMAT(created_at, '%Y-%m') episodes_year_month"))
|
||||
$patient_visits_per_month_for_insured = PatientEpisode::whereIn('patient_id',$insurance_members_array)->whereBetween('created_at', ['2019-01-01', '2022-12-31'])->select(DB::raw('count(id) as `data`'),DB::raw("DATE_FORMAT(created_at, '%Y-%m') episodes_year_month"))
|
||||
->groupBy('episodes_year_month')->orderBy('episodes_year_month')->get();
|
||||
|
||||
|
||||
@@ -91,7 +87,7 @@ class HomeController extends Controller
|
||||
$year_month_array = explode("-", $record->episodes_year_month);
|
||||
$families_array = [];
|
||||
|
||||
$per_month_records = \Streamline\Models\PatientEpisode::whereIn('patient_id',$insurance_members_array)->whereYear('created_at', '=', $year_month_array[0])->whereMonth('created_at', '=', $year_month_array[1])->get();
|
||||
$per_month_records = PatientEpisode::whereIn('patient_id',$insurance_members_array)->whereYear('created_at', '=', $year_month_array[0])->whereMonth('created_at', '=', $year_month_array[1])->get();
|
||||
|
||||
foreach ($per_month_records as $single_record) {
|
||||
$family_id = get_name($single_record->patient_id, 'patient_id', 'family_id', 'insurance_members');
|
||||
|
||||
@@ -5,10 +5,8 @@ namespace Streamline\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use Streamline\Models\District;
|
||||
use Streamline\Models\HospitalInformation;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
//use Log;
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Streamline\Models\Parish;
|
||||
@@ -152,7 +150,7 @@ class HospitalInformationController extends Controller {
|
||||
$current_lab_stamp = $request->current_lab_stamp;
|
||||
$new_lab_stamp = $lab_stamp_destination_path . $lab_stamp_name;
|
||||
$hospital_information->lab_stamp = $new_lab_stamp ? $new_lab_stamp : $current_lab_stamp;
|
||||
$hospital_information->updated_by = auth()->user()->id;
|
||||
$hospital_information->updated_by = Auth::id();
|
||||
$hospital_information->save();
|
||||
|
||||
//update the streamline setup table with the new finished step
|
||||
@@ -218,7 +216,6 @@ class HospitalInformationController extends Controller {
|
||||
'stamp' => 'nullable|file|mimes:jpg,jpeg,bmp,png,webp,gif,svg',
|
||||
'lab_stamp' => 'nullable|file|mimes:jpg,jpeg,bmp,png,gif,svg,webp',
|
||||
'logo' => 'nullable|file|mimes:jpg,jpeg,bmp,png,gif,svg,webp',
|
||||
'email' => 'email',
|
||||
'back_date' => 'required|numeric|min:0',
|
||||
]);
|
||||
|
||||
@@ -230,7 +227,7 @@ class HospitalInformationController extends Controller {
|
||||
flash($string)->error();
|
||||
return back()->withErrors($validator)->withInput();
|
||||
} else {
|
||||
$logged_in_user_id = Auth::user()->id;
|
||||
$logged_in_user_id = Auth::id();
|
||||
$hospital_information = HospitalInformation::find($id);
|
||||
|
||||
$hospital_information->name = $request->name;
|
||||
|
||||
@@ -57,11 +57,8 @@ class ModuleController extends Controller
|
||||
flash($request->name . " Module has been saved")->success();
|
||||
return redirect("/modules/");
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash($request->name . " Module already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash($request->name . " Module already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Streamline\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Streamline\Enums\Roles;
|
||||
use Streamline\Http\Controllers\Controller;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
@@ -30,7 +31,7 @@ class RoleController extends Controller {
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request) {
|
||||
if (Auth::user()->hasRole('Super Admin')) {
|
||||
if (Auth::user()->hasRole(Roles::SUPER_ADMIN->value)) {
|
||||
$roles = Role::withCount('users')->withCount('permissions')->orderBy('name')->get();
|
||||
} else {
|
||||
$roles = Role::where('name', '!=', 'Super Admin')->withCount('users')->withCount('permissions')->orderBy('name')->get();
|
||||
|
||||
@@ -42,7 +42,7 @@ class SecurityQuestionController extends Controller {
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \Streamline\Models\SecurityQuestion $securityQuestion
|
||||
* @param SecurityQuestion $securityQuestion
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(SecurityQuestion $securityQuestion) {
|
||||
@@ -52,7 +52,7 @@ class SecurityQuestionController extends Controller {
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \Streamline\Models\SecurityQuestion $securityQuestion
|
||||
* @param SecurityQuestion $securityQuestion
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(SecurityQuestion $securityQuestion) {
|
||||
@@ -63,7 +63,7 @@ class SecurityQuestionController extends Controller {
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Streamline\Models\SecurityQuestion $securityQuestion
|
||||
* @param SecurityQuestion $securityQuestion
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, SecurityQuestion $securityQuestion) {
|
||||
@@ -73,7 +73,7 @@ class SecurityQuestionController extends Controller {
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \Streamline\Models\SecurityQuestion $securityQuestion
|
||||
* @param SecurityQuestion $securityQuestion
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(SecurityQuestion $securityQuestion) {
|
||||
|
||||
@@ -7,7 +7,10 @@ use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use OwenIt\Auditing\Models\Audit;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Streamline\Enums\Roles;
|
||||
use Streamline\Models\GeneralSettings;
|
||||
use Streamline\Models\PasswordSecurity;
|
||||
use Streamline\Models\SecurityQuestion;
|
||||
use Streamline\Models\StaffPositions;
|
||||
@@ -291,10 +294,10 @@ class UserController extends Controller
|
||||
$security_questions = SecurityQuestion::orderBy('name')->pluck('name', 'id');
|
||||
$security_questions->prepend('- select -', '');
|
||||
|
||||
if (Auth::user()->hasRole('Super Admin')) {
|
||||
if (Auth::user()->hasRole(Roles::SUPER_ADMIN->value)) {
|
||||
$roles = Role::pluck('name', 'name')->all();
|
||||
} else {
|
||||
$roles = Role::where('name', '!=', 'Super Admin')->pluck('name', 'name')->all();
|
||||
$roles = Role::where('name', '!=', Roles::SUPER_ADMIN->value)->pluck('name', 'name')->all();
|
||||
}
|
||||
|
||||
return view('users.create', compact('positions', 'councils', 'blood_groups', 'roles', 'security_questions'));
|
||||
@@ -369,7 +372,7 @@ class UserController extends Controller
|
||||
// $user->assignRole($request->input('roles'));
|
||||
|
||||
/*========= start catering for password expiration ========*/
|
||||
$general_settings = \Streamline\Models\GeneralSettings::find(1);
|
||||
$general_settings = GeneralSettings::find(1);
|
||||
$user_password_expiration_days = $general_settings->password_expiration_days;
|
||||
|
||||
$passwordSecurity = PasswordSecurity::create([
|
||||
@@ -421,10 +424,10 @@ class UserController extends Controller
|
||||
$security_questions->prepend('- select -', '');
|
||||
|
||||
$user = User::find($id);
|
||||
if (Auth::user()->hasRole('Super Admin')) {
|
||||
if (Auth::user()->hasRole(Roles::SUPER_ADMIN->value)) {
|
||||
$roles = Role::pluck('name', 'name')->all();
|
||||
} else {
|
||||
$roles = Role::where('name', '!=', 'Super Admin')->pluck('name', 'name')->all();
|
||||
$roles = Role::where('name', '!=', Roles::SUPER_ADMIN->value)->pluck('name', 'name')->all();
|
||||
}
|
||||
$userRole = $user->roles->pluck('name', 'name')->all();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user