updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
@@ -0,0 +1,5 @@
<?php
return [
'name' => 'Investigations'
];
@@ -0,0 +1,13 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
@@ -0,0 +1,530 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Http\Request;
use Streamline\Models\Dental;
use Streamline\Models\DentalUsage;
use Streamline\Models\Requisition;
use Illuminate\Support\Facades\Auth;
use Streamline\Models\ChartOfAccount;
use Streamline\Models\HospitalInformation;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\QueryException;
class DentalController extends Controller
{
public function __construct()
{
$this->middleware('auth');
$this->middleware('permission:dental-list', ['only' => ['index']]);
$this->middleware('permission:dental-create', ['only' => ['create', 'store']]);
$this->middleware('permission:dental-edit', ['only' => ['edit', 'update', 'edit_all', 'update_all']]);
$this->middleware('permission:dental-delete', ['only' => ['destroy', 'inactive', 'activate']]);
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$dentals = Dental::orderBy('name', 'asc')->paginate(2000);
return view('investigations::dentals.index', compact('dentals'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$cost_of_goods_accounts = ChartOfAccount::where(['type' => 7])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$cost_of_goods_accounts = ['' => '- select -'] + $cost_of_goods_accounts;
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ['' => '- select -'] + $payables_accounts;
return view('investigations::dentals.create', compact('cost_of_goods_accounts', 'expense_accounts', 'payables_accounts'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
request()->validate([
'name' => 'required'
]);
$logged_in_user_id = Auth::user()->id;
$dental = new Dental;
$dental->name = $request->name;
$dental->expenses_account_id = $request->expenses_account_id;
$dental->payables_account_id = $request->payables_account_id;
$dental->cost_of_goods_account = $request->cost_of_goods_account;
$dental->created_by = $logged_in_user_id;
$dental->updated_by = $logged_in_user_id;
try {
$dental->save();
flash($request->name . " Dental has been saved")->success();
return redirect("/dentals/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$dental = Dental::where(['id' => $id])->first();
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ['' => '- select -'] + $payables_accounts;
if (!$dental) {
flash()->error("There is no such dental");
return redirect('/dentals/');
} else {
return view('investigations::dentals.edit', compact('dental', 'expense_accounts', 'payables_accounts'));
}
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
request()->validate([
'name' => 'required'
]);
$logged_in_user_id = Auth::user()->id;
$dental = Dental::find($id);
$dental->name = $request->name;
$dental->expenses_account_id = $request->expenses_account_id;
$dental->payables_account_id = $request->payables_account_id;
$dental->updated_by = $logged_in_user_id;
try {
$dental->save();
flash($request->name . " dental has been updated")->success();
return redirect("/dentals/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$dental = Dental::find($id);
if ($dental->delete()) {
flash("dental has been deleted.")->success();
return redirect('/dentals/');
}
}
/**
* Display a listing of the inactive resource(s).
*
* @return \Illuminate\Http\Response
*/
public function inactive()
{
$dentals = Dental::onlyTrashed()
->orderBy('name', 'asc')
->paginate(50);
if (count($dentals) < 1) {
flash()->error("There is no inactive dental item");
return redirect('/dentals/');
} else {
return view('investigations::dentals.inactive', compact('dentals'));
}
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function activate($id)
{
$dental = Dental::withTrashed()->find($id);
if ($dental->restore()) {
flash("dental has been activated.")->success();
return redirect('/dentals/inactive');
}
}
/**
* Search a resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function search(Request $request)
{
$query_name = $request->query_name;
$query_active = $request->query_active;
if ($query_name != "") {
$dentals = Dental::where([
['active', '=', $query_active],
['name', 'LIKE', '%' . $query_name . '%']
])
->orderBy('name', 'asc')
->paginate(10)
->setPath('');
$dentals->appends(array(
'query_name' => $query_name,
'query_active' => $query_active
));
if (count($dentals)) {
if ($query_active) {
return view('investigations::dentals.index', compact('dentals')) //;
->withDetails($dentals)
->withQuery($query_name, $query_active);
} else {
return view('investigations::dentals.inactive', compact('dentals')) //;
->withDetails($dentals)
->withQuery($query_name, $query_active);
}
}
}
flash()->error("No Details found. Try searching again!");
return redirect('/dentals/');
}
/**
* Display a listing of the active resources for bulk editing.
*
* @return \Illuminate\Http\Response
*/
public function edit_all()
{
$dentals = Dental::orderBy('name', 'asc')->paginate(2000);
if (count($dentals) < 1) {
flash()->error("There is no active dental");
return redirect('/dentals/');
} else {
return view('investigations::dentals.edit.all', compact('dentals'));
}
}
/**
* Update all the resources in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function update_all(Request $request)
{
request()->validate([
'name' => 'required'
]);
$logged_in_user_id = Auth::user()->id;
$id_array = $request->id;
$name_array = $request->name;
for ($x = 0; $x < count($id_array); $x++) {
$dental = Dental::find($id_array[$x]);
$dental->name = $name_array[$x];
$dental->updated_by = $logged_in_user_id;
try {
$dental->save();
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
flash("Dentals have been updated")->success();
return redirect("/dentals/");
}
public function get_dentals()
{
//code to be returned to view
$code = "<option> -- select -- </option>";
$dentals = Dental::orderBy('name', 'asc')->get();
foreach ($dentals as $dental) {
$code .= "<option value='" . $dental->id . "'>" . $dental->name . "</option>";
}
return $code;
}
public function dental_usage_report(Request $request)
{
$dentals = Dental::orderBy('name', 'asc')->get();
$hospital_information = HospitalInformation::first();
$dental_options = DB::table('dentals')->orderBy('name', 'asc')->pluck('name', 'id')->prepend('- All Dentals - ', 'all_dentals');
$search_by = $request->search_by;
$reg_date = $request->reg_date;
$start_date = $request->start_date;
$end_date = $request->end_date;
$filters = [];
$search_string = "";
if ($search_by == 0) {
// last 24 hours
$last_day = Carbon::now()->subDay();
array_push($filters, ['start_date', '>', $last_day]);
if ($request->dental_id != 'all_dentals') {
array_push($filters, ['dental_id', '=', $request->dental_id]);
}
$search_string = "<h4 class='label label-info'>Showing results of ".streamline_date($last_day)."</h4>";
} elseif ($search_by == 1) {
// custom date
if (is_null($request->reg_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$selected_date_filter = Carbon::createFromFormat('d/m/Y', $request->reg_date)->toDateString();
array_push($filters, ['start_date', $selected_date_filter]);
if ($request->dental_id != 'all_dentals') {
array_push($filters, ['dental_id', '=', $request->dental_id]);
}
$search_string = "<h4 class='label label-info'>Showing results of ".streamline_date($selected_date_filter)."</h4>";
} elseif ($search_by == 2) {
// custom date range
if (is_null($start_date) || is_null($end_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$start_date_search = Carbon::createFromFormat('d/m/Y', $start_date)->startOfDay()->toDateTimeString();
$end_date_search = Carbon::createFromFormat('d/m/Y', $end_date)->endOfDay()->toDateTimeString();
array_push($filters, ['start_date', '>', $start_date_search]);
array_push($filters, ['end_date', '<', $end_date_search]);
if ($request->dental_id != 'all_dentals') {
array_push($filters, ['dental_id', '=', $request->dental_id]);
}
$search_string = "<h4 class='label label-info'>Showing between ".streamline_date($start_date_search). " and ".streamline_date($end_date_search)."</h4>";
}
$dental_usages = (!empty($search_by) && !empty($end_date) && !empty($start_date) && !empty($reg_date))? DentalUsage::where($filters)->orderBy('id','desc')->limit(500)->get(): DentalUsage::orderBy('id','desc')->limit(500)->get();
return view('investigations::dentals.dental_usage_report', compact('dentals', 'hospital_information', 'dental_usages', 'dental_options', 'search_string'));
}
public function dental_requisitions(Request $request)
{
$results = Dental::orderBy('name','asc')->get();
$names_array = Dental::orderBy('name')->distinct()->pluck('name');
$labs = Dental::orderBy('name')->pluck('name', 'id');
$date_filter = [];
if(isset($request->start_date) && isset($request->end_date)){
if (isset($request->quotation_type)) {
$item_type = $request->quotation_type;
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
array_push($date_filter, ['created_at', '>', $start_date]);
array_push($date_filter, ['created_at', '<', $end_date]);
}
} else {
$date_from = Carbon::today()->subDays(30)->format('Y-m-d');
$date_to = Carbon::today()->addDays(1)->format('Y-m-d');
array_push($date_filter, ['created_at', '>', $date_from]);
array_push($date_filter, ['created_at', '<', $date_to]);
}
$previous_requisitions_results = DB::table('requisitions')->where('quotation_type_id', '=', 3)->where($date_filter)->orderBy('created_at','desc')->get();
return view('investigations::dentals.dental_requisition', compact('results', 'names_array', 'labs', 'previous_requisitions_results'));
}
public function dental_usage_listing()
{
$dentals = Dental::orderBy('name', 'asc')->get();
$hospital_information = HospitalInformation::first();
$dental_usages = DentalUsage::orderBy('id','desc')->limit(20)->get();
return view('investigations::dentals.dental_usage', compact('dentals', 'hospital_information', 'dental_usages'));
}
public function store_dental_usage(Request $request)
{
$dental_items_array = $request->labItem;
$available_qty_array = $request->availableQty;
$available_qty_unit_cost_array = $request->unitCost;
$usage_qty_array = $request->requiredQty;
$usage_qty_cost_array = $request->totalCost;
if($request->dates == 'today'){
$start = Carbon::now()->startOfDay()->toDateTimeString();
$end = Carbon::now()->endOfDay()->toDateTimeString();
}else{
$start = Carbon::parse($request->start_date)->endOfDay()->toDateTimeString();
$end = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
}
for($i = 0; $i < count($dental_items_array); $i++){
if($dental_items_array[$i]){
$dental_usage = new DentalUsage;
$dental_usage->dental_id = $dental_items_array[$i];
$dental_usage->unit_cost_price = $unit_cost = $available_qty_unit_cost_array[$i];
$dental_usage->available_quantity = $available_qty_array[$i];
$dental_usage->available_quantity_cost = ((int)$unit_cost * $available_qty_array[$i]);
$dental_usage->usage_quantity = $usage_qty_array[$i];
$dental_usage->usage_quantity_cost = $usage_qty_cost_array[$i];
$dental_usage->remaining_quantity = $remaining_qty = ((int)$available_qty_array[$i] - (int)$usage_qty_array[$i]);
$dental_usage->remaining_quantity_cost = ($remaining_qty * $unit_cost);
$dental_usage->created_by = Auth::id();
$dental_usage->start_date = $start;
$dental_usage->end_date = $end;
if(!($remaining_qty < 0)){
$dental = Dental::find($dental_items_array[$i]);
$dental->pharmacy_stock = ($dental->pharmacy_stock - (int)$usage_qty_array[$i]);
$dental_usage->save();
$dental->save();
}else{
flash('Item\'s '.get_name($dental_items_array[$i], 'id', 'name', 'labs').' requested use quantity exceeds what is available.');
}
}
}
flash('Dentals to be used from '.streamline_date($start).' to '.streamline_date($end).' have saved successfully')->success();
return redirect()->route('dentals.usage_listing');
}
public function get_dental_quantity(Request $request){
$dental_item = Dental::where('id', $request->id)->first();
return $dental_item;
}
public function dentals_requisition_search(Request $request)
{
$item_type = $request->item_type;
$item_ids_array = $request->items_ids;
$results = null;
$filters = [];
$items = null;
$results = Dental::whereIn('id', $item_ids_array)->orderBy('name','asc')->get();
$labs = Dental::orderBy('name')->pluck('name', 'id');
$date_filter = [];
if(isset($request->start_date) && isset($request->end_date)){
if (isset($request->quotation_type)) {
$item_type = $request->quotation_type;
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
array_push($date_filter, ['created_at', '>', $start_date]);
array_push($date_filter, ['created_at', '<', $end_date]);
}
} else {
$date_from = Carbon::today()->subDays(30)->format('Y-m-d');
$date_to = Carbon::today()->addDays(1)->format('Y-m-d');
array_push($date_filter, ['created_at', '>', $date_from]);
array_push($date_filter, ['created_at', '<', $date_to]);
}
$previous_requisitions_results = DB::table('requisitions')->where('quotation_type_id', '=', 5)->where($date_filter)->orderBy('created_at','desc')->get();
return view('investigations::dentals.dental_requisition',compact('items','item_type','labs','results','previous_requisitions_results'));
}
public function store_dental_requisitions(Request $request)
{
$drug_id_array = $request->drug_id;
$quantity_array = $request->quantity;
$item_type = $request->item_type;
$user_id = auth()->user()->id;
/* return back if no quantity has been filled */
if (array_sum($quantity_array) < 1) {
flash('Please insert some values!')->error();
return redirect()->back()->withInput();
}
if (isset($request->complete_request)) {
$filtered_drugs_array = [];
$filtered_quantities_array = [];
$associative_requested_drugs_array = [];
for ($i=0; $i < count($drug_id_array) ; $i++) {
if ($quantity_array[$i] != "") {
$associative_requested_drugs_array[$drug_id_array[$i]] = $quantity_array[$i];
$filtered_drugs_array[] = $drug_id_array[$i];
$filtered_quantities_array[] = $quantity_array[$i];
}
}
$new_requisition = new Requisition;
$new_requisition->quotation_type_id = $item_type;
$new_requisition->drug_id = implode(',', $filtered_drugs_array);
$new_requisition->quantity_requested = implode(',', $filtered_quantities_array);
$new_requisition->created_by = $user_id;
$new_requisition->save();
flash('Requisition number ' . $new_requisition->id . ' made successfully')->success();
return redirect('/dentals');
}
}
}
@@ -0,0 +1,179 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Http\Request;
use Streamline\Models\InvestigationCategory;
use Illuminate\Support\Facades\Auth;
use Illuminate\Database\QueryException;
use Streamline\Models\InvestigationSuperCategory;
class InvestigationCategoryController extends Controller {
public function __construct() {
$this->middleware('auth');
$this->middleware('permission:investigations-category-list', ['only' => ['index']]);
$this->middleware('permission:investigations-category-create', ['only' => ['create', 'store']]);
$this->middleware('permission:investigations-category-edit', ['only' => ['edit', 'update']]);
$this->middleware('permission:investigations-category-delete', ['only' => ['destroy', 'inactive', 'activate']]);
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index() {
$investigation_categories = InvestigationCategory::orderBy('name', 'asc')
->paginate(50);
$super_categories = InvestigationSuperCategory::pluck('name', 'id');
return view('investigations::investigation_categories.index', compact('investigation_categories', 'super_categories'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function create() {
$super_categories = InvestigationSuperCategory::pluck('name', 'id')->toArray();
$super_categories = ['' => '- select -'] + $super_categories;
return view('investigations::investigation_categories.create', compact('super_categories'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request) {
request()->validate([
'name' => 'required'
]);
//validation passed
$investigation_category = new InvestigationCategory;
$logged_in_user_id = Auth::user()->id;
$investigation_category->name = $request->name;
$investigation_category->super_category_id = $request->super_category_id;
$investigation_category->created_by = $logged_in_user_id;
$investigation_category->updated_by = $logged_in_user_id;
try {
$investigation_category->save();
flash($request->name . " Investigation Category has been saved")->success();
return redirect("/investigation_categories/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id) {
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function edit($id) {
$investigation_category = InvestigationCategory::where(['id' => $id])->first();
$super_categories = InvestigationSuperCategory::pluck('name', 'id')->toArray();
$super_categories = ['' => '- select -'] + $super_categories;
if (!$investigation_category) {
flash()->error("InvestigationCategory not found");
return redirect('/investigation_categories/');
} else {
return view('investigations::investigation_categories.edit', compact('investigation_category', 'super_categories'));
}
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id) {
request()->validate([
'name' => 'required'
]);
//validation passed
$investigation_category = InvestigationCategory::find($id);
$investigation_category->name = $request->name;
$investigation_category->super_category_id = $request->super_category_id;
try {
$investigation_category->save();
flash($request->name . " Investigation Category has been updated")->success();
return redirect("/investigation_categories/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id) {
$investigation_category = InvestigationCategory::find($id);
if ($investigation_category->delete()):
flash("InvestigationCategory has been deleted.")->success();
return redirect('/investigation_categories/');
endif;
}
/**
* Display a listing of the inactive resource(s).
*
* @return \Illuminate\Http\Response
*/
public function inactive() {
$investigation_categories = InvestigationCategory::onlyTrashed()
->orderBy('name', 'asc')
->paginate(50);
if (count($investigation_categories) < 1) {
flash()->error("There is no inactive investigation_category");
return redirect('/investigation_categories/');
} else {
return view('investigations::investigation_categories.inactive', compact('investigation_categories'));
}
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function activate($id) {
$investigation_category = InvestigationCategory::withTrashed()->find($id);
if ($investigation_category->restore()):
flash("InvestigationCategory has been activated.")->success();
return redirect('/investigation_categories/inactive');
endif;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,506 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Streamline\Models\Investigation;
use Streamline\Models\OrderedInvestigation;
use Streamline\Models\InvestigationResults;
use Streamline\Models\HospitalInformation;
use Barryvdh\Snappy\Facades\SnappyPdf;
use Barryvdh\DomPDF\Facade\Pdf as DomPDF;
use Streamline\Models\Patient;
use Streamline\Models\ObstetricUltrasoundReports;
class InvestigationPrintController extends Controller {
public function __construct() {
$this->middleware('auth');
}
public function print_lab_result_details($id) {
$ordered_investigation = OrderedInvestigation::find($id);
$hospital_information = HospitalInformation::find(1);
$investigation_ids = [];
$patient = Patient::find($ordered_investigation->patient_id);
$results = [];
$investigation_results = InvestigationResults::where('order_id', '=', $id)->get();
foreach ($investigation_results as $result) {
$investigations = explode(",", $result->investigation_id);
$values = explode(",", $result->value);
$comments = explode(",", $result->comment);
$per_investigation = explode(",", $result->per_investigation);
$count_two = 0;
foreach ($investigations as $investigation) {
$investigation_ids[] = $investigation;
$results[$count_two]['name'] = get_name($investigation, 'id', 'name', 'investigations');
if(get_name($investigation, 'id', 'range_type', 'investigations') == 1) {
$results[$count_two]['range'] = get_dynamic_normal_range($investigation, get_patient_age_group($patient->id), get_name($patient->id, 'id', 'gender', 'patients'));
} else {
$results[$count_two]['range'] = get_name($investigation, 'id', 'normal_ranges', 'investigations');
}
//$results[$count_two]['range'] = get_name($investigation, 'id', 'normal_ranges', 'investigations');
$results[$count_two]['type'] = get_name($investigation, 'id', 'type', 'investigations');
$results[$count_two]['units'] = get_name($investigation, 'id', 'units', 'investigations');
$results[$count_two]['result'] = isset($values[$count_two]) ? $values[$count_two] : "";
$results[$count_two]['comment'] = isset($comments[$count_two]) ? $comments[$count_two] : "";
$results[$count_two]['authenticated'] = isset($per_investigation[$count_two]) ? $per_investigation[$count_two] : "";
$count_two++;
}
}
$data = [
'ordered_investigation' => $ordered_investigation,
'results' => $results,
'hospitalInfo' => $hospital_information,
'id' => $id,
'patient' => $patient,
'investigation_ids' => $investigation_ids,
];
$print_footer = (!is_null($hospital_information->print_footer)) ? '&nbsp&nbsp&nbsp&nbsp&nbsp<i>' . $hospital_information->print_footer . '</i>' : '';
$pdf = SnappyPDF::loadView("investigations::investigations/print/print-lab-result-details", $data)
->setOrientation('portrait')
->setPaper('a4')
->setOption('margin-bottom', 5)
->setOption('margin-top', 5)
->setOption('footer-html', '<i>&copy; ' . date('Y') . ' Stre@mline</i>' . $print_footer);
return $pdf->inline('Investigation Details' . date(" d-m-y h:ia") . '.pdf');
}
public function print_historical_results_labs(Request $request) {
$patient_id = $request->patient_id;
$hospital_information = HospitalInformation::first();
//prepare the arrays
$dates = array();
$invs_array = array();
$values = array();
$patients = InvestigationResults::where('patient_id', '=', $patient_id)
->where('result_type', '=', 'Lab')
->where('all_authenticated', '=', 1)
->limit(7)
->get();
foreach ($patients as $patient) {
$dates[] = streamline_date($patient->created_at);
$investigations = explode(",", $patient->investigation_id);
foreach ($investigations as $investigation) {
if (!in_array($investigation, $invs_array)) {
$invs_array[] = $investigation;
}
}
}
//loop through the investigation ids to add values
for ($i = 0; $i < count($invs_array); $i++) {
//count for the returnInvestigations
$count = 0;
foreach ($patients as $patient) {
//get values from csv to array
$investigations = explode(",", $patient->investigation_id);
$return_values = explode(",", $patient->value);
$comments = explode(",", $patient->comment);
//check if current investigation is in array
if (in_array($invs_array[$i], $investigations)) {
//get key of that investigation which exists
$key = array_search($invs_array[$i], $investigations);
if ($patient->result_type == 'Ultrasound_Obstetric') {
//assign real$return_values value
$values[$i][$count] = array($return_values[$key], $patient->order_id, $patient_id, $patient->episode_id);
} elseif (get_name($invs_array[$i], 'id', 'type', 'investigations') == 1) {
// assign real value representing id
$values[$i][$count] = $return_values[$key] ?? "";
} else {
//assign real value
$values[$i][$count] = ($return_values[$key] ?? "") . " - (" . ($comments[$key] ?? "") . ")";
}
} else {
//assign N/A
$values[$i][$count] = "N/A";
}
$count++;
}
}
$patient = Patient::find($patient_id);
$data = [
'patient_id' => $patient_id,
'patient' => $patient,
'dates' => $dates,
'invs_array' => $invs_array,
'values' => $values,
'hospitalInfo' => $hospital_information
];
$pdf = SnappyPDF::loadView("investigations::investigations/print/print-historical-results-labs", $data)
->setOrientation('portrait')
->setPaper('a4')
->setOption('margin-bottom', 5)
->setOption('margin-top', 5)
->setOption('footer-html', '<i>&copy; ' . date('Y') . ' Stre@mline</i>');
return $pdf->inline($patient->first_name . ' ' . $patient->last_name . 'Historical Results' . date(" d-m-y h:ia") . '.pdf');
}
public function print_historical_results_imaging(Request $request) {
$patient_id = $request->patient_id;
$hospital_information = HospitalInformation::first();
//prepare the arrays
$dates = array();
$invs_array = array();
$values = array();
$patients = InvestigationResults::where('patient_id', '=', $patient_id)
->whereIn('investigation_results.result_type', ['Imaging', 'Ultrasound', 'Ultrasound_Obstetric'])
->where('all_authenticated', '=', 1)
->limit(7)
->get();
foreach ($patients as $patient) {
$dates[] = streamline_date($patient->created_at);
$investigations = explode(",", $patient->investigation_id);
foreach ($investigations as $investigation) {
if (!in_array($investigation, $invs_array)) {
$invs_array[] = $investigation;
}
}
}
//loop through the investigation ids to add values
for ($i = 0; $i < count($invs_array); $i++) {
//count for the returnInvestigations
$count = 0;
foreach ($patients as $patient) {
//get values from csv to array
$investigations = explode(",", $patient->investigation_id);
$return_values = explode(",", $patient->value);
$comments = explode(",", $patient->comment);
//check if current investigation is in array
if (in_array($invs_array[$i], $investigations)) {
//get key of that investigation which exists
$key = array_search($invs_array[$i], $investigations);
if ($patient->result_type == 'Ultrasound_Obstetric') {
//assign real$return_values value
$values[$i][$count] = array($return_values[$key], $patient->order_id, $patient_id, $patient->episode_id);
} elseif (get_name($invs_array[$i], 'id', 'type', 'investigations') == 1) {
// assign real value representing id
$values[$i][$count] = $return_values[$key] ?? "";
} else {
//assign real value
$values[$i][$count] = ($return_values[$key] ?? "") . " - (" . ($comments[$key] ?? "") . ")";
}
} else {
//assign N/A
$values[$i][$count] = "N/A";
}
$count++;
}
}
$patient = Patient::find($patient_id);
$data = [
'patient_id' => $patient_id,
'patient' => $patient,
'dates' => $dates,
'invs_array' => $invs_array,
'values' => $values,
'hospitalInfo' => $hospital_information
];
$pdf = SnappyPDF::loadView("investigations::investigations/print/print-historical-results-labs", $data)
->setOrientation('portrait')
->setPaper('a4')
->setOption('margin-bottom', 5)
->setOption('margin-top', 5)
->setOption('footer-html', '<i>&copy; ' . date('Y') . ' Stre@mline</i>');
return $pdf->inline($patient->first_name . ' ' . $patient->last_name . 'Historical Results' . date(" d-m-y h:ia") . '.pdf');
}
public function print_patient_investigation_results($result_id) {
$result = InvestigationResults::find($result_id);
$patient_id = $result->patient_id;
$hospital_information = HospitalInformation::first();
$patient = Patient::where(['id' => $patient_id])->first();
$inv = [];
$inv['episode_id'] = $result->episode_id;
$inv['date'] = streamline_date(get_name($result->episode_id, 'id', 'created_at', 'patient_episodes'));
$created_by = is_null($result->updated_by) ? $result->created_by : $result->updated_by;
$investigations = explode(",", $result->investigation_id);
$values = explode(",", $result->value);
$comments = explode(",", $result->comment);
$data = [];
$count = 0;
foreach ($investigations as $investigation) {
$investigation_details = Investigation::find($investigation);
if ($investigation_details) {
$data[$count]['name'] = $investigation_details->name;
$data[$count]['range'] = $investigation_details->normal_ranges;
$data[$count]['slug'] = $investigation_details->slug;
$data[$count]['result'] = $values[$count];
$data[$count]['comment'] = $comments[$count];
$data[$count]['type'] = $investigation_details->type;
$count++;
}
}
$inv['data'] = $data;
$data = [
'inv' => $inv,
'patient' => $patient,
'hospitalInfo' => $hospital_information,
'created_at' => $result->created_at,
'created_by' => $created_by,
'performed_at' => streamline_date_time($result->created_at),
'requested_at' => streamline_date_time(get_name($result->order_id, 'id', 'created_at', 'ordered_investigations'))
];
$pdf = SnappyPDF::loadView("investigations::investigations/print/print_patient_investigation_results", $data)
->setOrientation('portrait')
->setPaper('a4')
->setOption('margin-bottom', 5)
->setOption('margin-top', 5)
->setOption('footer-html', '<i>&copy; ' . date('Y') . ' Stre@mline</i>');
return $pdf->inline($patient->first_name . ' ' . $patient->last_name . ' Investigation results' . date(" d-m-y h:ia") . '.pdf');
}
public function print_ultrasound_results_obstetric($obstetric_result_id) {
$report = ObstetricUltrasoundReports::where(['id' => $obstetric_result_id])->first();
// for old kisiizi records which use the order_id
if (!$report) {
$report = ObstetricUltrasoundReports::where(['order_id' => $obstetric_result_id])->first();
}
$invs_order = OrderedInvestigation::find($report->order_id);
if ($invs_order) {
$patient_id = $invs_order->patient_id;
$episode_id = $invs_order->episode_id;
$patient = Patient::find($patient_id);
$anc_details = DB::table('ante_natal_clinic_registrations')->where('episode_id', $episode_id)->first();
$data = [
'patient_id' => $patient_id,
'episode_id' => $episode_id,
'patient' => $patient,
'report' => $report,
'anc_details' => $anc_details,
'invs_order' => $invs_order
];
//dompdf
$pdf_obstetric = new DomPDF();
$html = view("investigations::investigations/print/print_ultrasound_results_obstetric", $data)->render();
$pdf_obstetric = DomPDF::loadHtml($html);
$pdf_obstetric->setPaper('A4', 'potrait');
$options = [
'isPhpEnabled' => true,
'isHtml5ParserEnabled' => true,
// Add more options
];
DomPDF::setOptions($options);
return $pdf_obstetric->stream($patient->first_name . ' ' . $patient->last_name . ' ' . 'Ultrasound Obstetric results' . date(" d-m-y h:ia") . '.pdf', array('Attachment' => false));
} else {
flash("Unable to find obstetric results")->error();
return redirect('/home');
}
}
public function print_selective_lab_result_details(Request $request) {
$invs_to_print = $request->invs_to_print;
if (is_null($invs_to_print)) {
flash("Please select investigations to print")->error();
return redirect('/home');
}
$id = $request->id;
$investigation_ids = [];
$ordered_investigation = OrderedInvestigation::find($id);
$hospital_information = HospitalInformation::find(1);
$patient = Patient::find($ordered_investigation->patient_id);
$results = [];
$investigation_results = InvestigationResults::where('order_id', '=', $id)->get();
foreach ($investigation_results as $result) {
$investigations = explode(",", $result->investigation_id);
$values = explode(",", $result->value);
$comments = explode(",", $result->comment);
$per_investigation = explode(",", $result->per_investigation);
$count_two = 0;
foreach ($investigations as $investigation) {
if (in_array($investigation, $invs_to_print)) {
$investigation_ids[] = $investigation;
$results[$count_two]['name'] = get_name($investigation, 'id', 'name', 'investigations');
if(get_name($investigation, 'id', 'range_type', 'investigations') == 1) {
$results[$count_two]['range'] = get_dynamic_normal_range($investigation, get_patient_age_group($patient->id), get_name($patient->id, 'id', 'gender', 'patients'));
} else {
$results[$count_two]['range'] = get_name($investigation, 'id', 'normal_ranges', 'investigations');
}
$results[$count_two]['type'] = get_name($investigation, 'id', 'type', 'investigations');
$results[$count_two]['units'] = get_name($investigation, 'id', 'units', 'investigations');
$results[$count_two]['result'] = $values[$count_two] ?? "";
$results[$count_two]['comment'] = $comments[$count_two] ?? "";
$results[$count_two]['authenticated'] = $per_investigation[$count_two] ?? "";
}
$count_two++;
}
}
$data = [
'ordered_investigation' => $ordered_investigation,
'results' => $results,
'hospitalInfo' => $hospital_information,
'id' => $id,
'patient' => $patient,
'investigation_ids' => count($investigation_ids) > 0 ? $investigation_ids : explode(",", $ordered_investigation->investigation_id),
];
$pdf = SnappyPDF::loadView("investigations::investigations/print/print-lab-result-details", $data)
->setOrientation('portrait')
->setPaper('a4')
->setOption('margin-bottom', 5)
->setOption('margin-top', 5)
->setOption('footer-html', '<i>&copy; ' . date('Y') . ' Stre@mline</i>');
return $pdf->inline('Investigation Details' . date(" d-m-y h:ia") . '.pdf');
}
public function print_selective_patient_investigation_results(Request $request) {
$invs_to_print = $request->invs_to_print;
if (is_null($invs_to_print)) {
flash("Please select investigations to print")->error();
return redirect('/home');
}
$result_id = $request->result_id;
$result = InvestigationResults::find($result_id);
$patient_id = $result->patient_id;
$hospital_information = HospitalInformation::first();
$patient = Patient::where(['id' => $patient_id])->first();
$inv = [];
$inv['episode_id'] = $result->episode_id;
$inv['date'] = streamline_date(get_name($result->episode_id, 'id', 'created_at', 'patient_episodes'));
$created_by = is_null($result->updated_by) ? $result->created_by : $result->updated_by;
$investigations = explode(",", $result->investigation_id);
$values = explode(",", $result->value);
$comments = explode(",", $result->comment);
$data = [];
$count = 0;
foreach ($investigations as $investigation) {
if (in_array($investigation, $invs_to_print)) {
$investigation_details = Investigation::find($investigation);
if ($investigation_details) {
$data[$count]['name'] = $investigation_details->name;
$data[$count]['range'] = $investigation_details->normal_ranges;
$data[$count]['slug'] = $investigation_details->slug;
$data[$count]['result'] = $values[$count];
$data[$count]['comment'] = $comments[$count];
$data[$count]['type'] = $investigation_details->type;
$count++;
}
}
}
$inv['data'] = $data;
$data = [
'inv' => $inv,
'patient' => $patient,
'hospitalInfo' => $hospital_information,
'created_by' => $created_by,
'performed_at' => streamline_date_time($result->created_at),
'requested_at' => streamline_date_time(get_name($result->order_id, 'id', 'created_at', 'ordered_investigations'))
];
$pdf = SnappyPDF::loadView("investigations::investigations/print/print_patient_investigation_results", $data)
->setOrientation('portrait')
->setPaper('a4')
->setOption('margin-bottom', 5)
->setOption('margin-top', 5)
->setOption('footer-html', '<i>&copy; ' . date('Y') . ' Stre@mline</i>');
return $pdf->inline($patient->first_name . ' ' . $patient->last_name . ' Investigation results' . date(" d-m-y h:ia") . '.pdf');
}
}
@@ -0,0 +1,188 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Database\QueryException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Streamline\Models\Investigation;
use Streamline\Models\InvestigationResultTemplate;
class InvestigationResultTemplateController extends Controller {
public function index() {
$result_templates = InvestigationResultTemplate::orderBy('template', 'asc')->get();
$investigations = Investigation::get();
return view('investigations::investigation_result_templates.index', compact('result_templates', 'investigations'));
}
public function create() {
$investigations = DB::table("investigations")->whereNull("deleted_at")->orderBy("name")->pluck("name", "id")->toArray();
$investigations = [0 => 'All Investigations'] + $investigations;
$investigations = ['' => '- select -'] + $investigations;
return view('investigations::investigation_result_templates.create', compact('investigations'));
}
public function store(Request $request) {
request()->validate([
'investigation_id' => 'required'
]);
$logged_in_user_id = Auth::user()->id;
if ($request->is_specialised_variable == 1) {
$ids = $request->investigation_specialised_variable;
$templates = $request->template_var;
for($x = 0; $x < count($ids); $x++) {
$result_template = new InvestigationResultTemplate;
$result_template->investigation_id = $ids[$x];
$result_template->template = $templates[$x];
$result_template->is_specialised_variable = 1;
$result_template->created_by = $logged_in_user_id;
$result_template->updated_by = $logged_in_user_id;
$result_template->save();
}
} else {
$result_template = new InvestigationResultTemplate;
$result_template->template = $request->template;
$result_template->investigation_id = $request->investigation_id;
$result_template->is_specialised_variable = $request->is_specialised_variable;
$result_template->created_by = $logged_in_user_id;
$result_template->updated_by = $logged_in_user_id;
$result_template->save();
}
flash("Result Template has been saved")->success();
return redirect("/result_templates/");
}
public function show($id) {
//
}
public function edit($id) {
$result_template = InvestigationResultTemplate::where(['id' => $id])->first();
if (!$result_template) {
flash()->error("Result Template not found");
return redirect('/result_templates/');
} else {
return view('investigations::investigation_result_templates.edit', compact('result_template'));
}
}
public function update(Request $request, $id) {
request()->validate([
'template' => 'required'
]);
$logged_in_user_id = Auth::user()->id;
$result_template = InvestigationResultTemplate::find($id);
$result_template->template = $request->template;
$result_template->created_by = $logged_in_user_id;
$result_template->updated_by = $logged_in_user_id;
try {
$result_template->save();
flash($request->name . "Result Template has been saved")->success();
return redirect("/result_templates/");
} catch (QueryException $e) {
flash("An error occurred. Please try again")->error();
return back()->withInput();
}
}
public function destroy($id) {
$result_template = InvestigationResultTemplate::find($id);
if ($result_template->delete()){
flash("Result Template has been deleted.")->error();
return redirect('/result_templates/');
} else {
flash("An error occurred. Please try again")->error();
return back()->withInput();
}
}
public function inactive() {
$result_templates = InvestigationResultTemplate::onlyTrashed()
->paginate(50);
if (count($result_templates) < 1) {
flash()->error("There is no inactive Result Templates");
return redirect('/result_templates/');
} else {
return view('investigations::investigation_result_templates.inactive', compact('result_templates'));
}
}
public function activate($id) {
$result_template = InvestigationResultTemplate::withTrashed()->find($id);
if ($result_template->restore()){
flash("Result Template has been activated.")->success();
return redirect('/result_templates/');
} else {
flash("An error occurred. Please try again")->error();
return back()->withInput();
}
}
public function check_investigation_speciality_type($id, $counter) {
if (get_name($id, 'id', 'type', 'investigations') == 1){
$code = "<label for='investigation_specialised_variable'>Investigation Specialised Variable</label>";
$code .= "<select name='investigation_specialised_variable[]' class='form-control' id='" . $counter . "'>";
$code .= "<option value=''> --select-- </option>";
$variables = DB::table('investigation_specialised_variables')
->where('investigation_id', $id)
->whereNull('deleted_at')
->get();
foreach ($variables as $variable){
$code .= "<option value='" . $variable->id . "'>" . $variable->name . "</option>";
}
$code .= "</select><br><br>";
$code .= "<label for='template'>Template</label>";
$code .= "<textarea class='form-control' rows='3' name='template_var[]'></textarea><br><br>";
} else {
$code = "0";
}
return $code;
}
public function get_templates_for_investigation($id, $is_variable) {
$templates = DB::table('investigation_result_templates')
->whereIn('investigation_id', [$id, 0])
->where('is_specialised_variable', $is_variable)
->whereNull('deleted_at')
->get();
$code = "<table class='table color-bordered-table success-bordered-table'>";
$code .= "<thead><tr>";
$code .= "<th>Template</th><th>Action</th>";
$code .= "</tr></thead><tbody>";
foreach($templates as $template) {
$code .= "<tr>";
$code .= "<td id='template_" . $template->id . "'>" . $template->template . "</td>";
$code .= "<td>";
$code .= "<button class='btn btn-rounded btn-success btn-sm' onclick='confirm_selection(" . '"' . $template->id . '"' . ")'>select</button>";
$code .= "</td>";
$code .= "</tr>";
}
$code .= "</tbody></table>";
return $code;
}
}
@@ -0,0 +1,250 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Streamline\Models\Investigation;
use Streamline\Models\InvestigationNormalRange;
use Streamline\Models\InvestigationSpecialisedVariable;
use Illuminate\Http\Request;
use Streamline\Models\UnitOfMeasure;
use Illuminate\Database\QueryException;
class InvestigationSpecialisedVariableController extends Controller
{
/**create
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index() {
$investigation_variables = InvestigationSpecialisedVariable::orderBy('name', 'asc')->get();
$investigations = Investigation::get();
$units = UnitOfMeasure::get();
return view('investigations::investigation_specialised_variables.index', compact('investigation_variables', 'investigations', 'units'));
}
/**
* Show the Investigation Variable for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create() {
$investigations = Investigation::get();
$units = UnitOfMeasure::get();
return view('investigations::investigation_specialised_variables.create', compact('investigations', 'units'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request) {
request()->validate([
'name' => 'required'
]);
$logged_in_user_id = Auth::user()->id;
$investigation_specialised_variable = new InvestigationSpecialisedVariable;
$investigation_specialised_variable->name = $request->name;
$investigation_specialised_variable->investigation_id = $request->investigation;
$investigation_specialised_variable->units = $request->unit;
$investigation_specialised_variable->normal_ranges = $request->normal_ranges;
$investigation_specialised_variable->range_type = $request->range_type;
$investigation_specialised_variable->created_by = $logged_in_user_id;
$investigation_specialised_variable->updated_by = $logged_in_user_id;
$investigation = Investigation::find($request->investigation);
$investigation->type = 1;
try {
$investigation_specialised_variable->save();
$investigation->save();
if ($request->range_type == 1) {
$age_id = $request->age_id;
$dynamic_range_male = $request->dynamic_range_male;
$dynamic_range_female = $request->dynamic_range_female;
for ($x = 0; $x < count($age_id); $x++){
$new_range = new InvestigationNormalRange;
$new_range->male_range = $dynamic_range_male[$x];
$new_range->female_range = $dynamic_range_female[$x];
$new_range->age_group_id = $age_id[$x];
$new_range->test_id = $investigation_specialised_variable->id;
$new_range->is_specialised_variable = 1;
$new_range->created_by = $logged_in_user_id;
$new_range->save();
}
}
flash($request->name . "Investigation Specialised Variable has been saved")->success();
return redirect("/investigation_variables/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id) {
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id) {
$investigations = Investigation::get();
$units = UnitOfMeasure::get();
$investigation_specialised_variable = InvestigationSpecialisedVariable::where(['id' => $id])->first();
if (!$investigation_specialised_variable) {
flash()->error("Drug Investigation Variable not found");
return redirect('/investigation_variables/');
} else {
return view('investigations::investigation_specialised_variables.edit', compact('investigation_specialised_variable', 'investigations', 'units'));
}
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id) {
request()->validate([
'name' => 'required'
]);
$logged_in_user_id = Auth::user()->id;
$investigation_specialised_variable = InvestigationSpecialisedVariable::find($id);
$investigation_specialised_variable->name = $request->name;
$investigation_specialised_variable->investigation_id = $request->investigation;
$investigation_specialised_variable->units = $request->unit;
$investigation_specialised_variable->normal_ranges = $request->normal_ranges;
$investigation_specialised_variable->range_type = $request->range_type;
$investigation_specialised_variable->created_by = $logged_in_user_id;
$investigation_specialised_variable->updated_by = $logged_in_user_id;
$investigation = Investigation::find($request->investigation);
$investigation->type = 1;
try {
$investigation_specialised_variable->save();
$investigation->save();
if ($request->range_type == 1) {
$age_id = $request->age_id;
$dynamic_range_male = $request->dynamic_range_male;
$dynamic_range_female = $request->dynamic_range_female;
for ($x = 0; $x < count($age_id); $x++){
$dynamic_normal_range = DB::table('investigations_normal_ranges')
->where('age_group_id', $age_id[$x])
->where('test_id', $investigation_specialised_variable->id)
->where('is_specialised_variable', 1)
->first();
if (!$dynamic_normal_range) {
$dynamic_normal_range = new InvestigationNormalRange;
$dynamic_normal_range->created_by = $logged_in_user_id;
} else {
$dynamic_normal_range = InvestigationNormalRange::find($dynamic_normal_range->id);
$dynamic_normal_range->updated_by = $logged_in_user_id;
}
$dynamic_normal_range->male_range = $dynamic_range_male[$x];
$dynamic_normal_range->female_range = $dynamic_range_female[$x];
$dynamic_normal_range->age_group_id = $age_id[$x];
$dynamic_normal_range->test_id = $investigation_specialised_variable->id;
$dynamic_normal_range->is_specialised_variable = 1;
$dynamic_normal_range->save();
}
}
flash($request->name . "Investigation Specialised Variable has been saved")->success();
return redirect("/investigation_variables/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id) {
$investigation_specialised_variable = InvestigationSpecialisedVariable::find($id);
$investigation_id = $investigation_specialised_variable->investigation_id;
if ($investigation_specialised_variable->delete()){
$variables = InvestigationSpecialisedVariable::where(['investigation_id' => $investigation_id])->count();
if ($variables < 1) {
$investigation = Investigation::find($investigation_id);
$investigation->type = 0;
$investigation->save();
}
flash("Investigation Variable has been deleted.")->success();
return redirect('/investigation_variables/');
}
}
/**
* Display a listing of the inactive resource(s).
*
* @return \Illuminate\Http\Response
*/
public function inactive() {
$investigation_variables = InvestigationSpecialisedVariable::onlyTrashed()
->orderBy('name', 'asc')
->paginate(50);
if (empty($investigation_variables)) {
flash()->error("There is no inactive Drug Routes");
return redirect('/investigation_variables/');
} else {
return view('investigations::investigation_specialised_variables.inactive', compact('investigation_variables'));
}
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function activate($id) {
$investigation_specialised_variable = InvestigationSpecialisedVariable::withTrashed()->find($id);
$investigation = Investigation::find($investigation_specialised_variable->investigation_id);
$investigation->type = 1;
if ($investigation_specialised_variable->restore()){
$investigation->save();
flash("Investigation Variable has been activated.")->success();
return redirect('/investigation_variables/');
}
}
}
@@ -0,0 +1,236 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Database\QueryException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Streamline\Models\Investigation;
use Streamline\Models\InvestigationSpecialisedVariable;
use Streamline\Models\InvestigationTestCode;
use Streamline\Models\LabInstrument;
class InvestigationTestCodesController extends Controller {
/**
* Display a listing of the resource.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View
*/
public function index() {
$test_codes = InvestigationTestCode::get();
$instruments = LabInstrument::pluck('name', 'id');
$investigations = Investigation::pluck('name', 'id');
$specialised_variables = InvestigationSpecialisedVariable::pluck('name', 'id');
return view('investigations::investigation_test_codes.index', compact('test_codes', 'investigations', 'instruments', 'specialised_variables'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View
*/
public function create() {
$investigations = Investigation::orderBy('name')
->pluck('name', 'id')
->prepend('- select -', '');
$instruments = LabInstrument::orderBy('name')
->pluck('name', 'id')
->prepend('- select -', '');
return view('investigations::investigation_test_codes.create', compact('investigations', 'instruments'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(Request $request) {
request()->validate([
'investigation_id' => 'required',
'machine_name' => 'required',
'test_code' => 'required'
]);
$test_code = new InvestigationTestCode();
$logged_in_user_id = Auth::user()->id;
if ($request->is_specialised_variable == 1){
if (is_null($request->investigation_specialised_variable)) {
flash("Please include the specialised variable for this investigation")->error();
return back()->withInput();
} else {
$test_code->investigation_id = $request->investigation_specialised_variable;
}
} else {
$test_code->investigation_id = $request->investigation_id;
}
$test_code->machine_name = $request->machine_name;
$test_code->test_code = $request->test_code;
$test_code->is_specialised_variable = $request->is_specialised_variable;
$test_code->created_by = $logged_in_user_id;
$test_code->updated_by = $logged_in_user_id;
try {
$test_code->save();
flash("Test Code has been saved")->success();
return redirect("/investigation_test_codes/");
} catch (QueryException $e) {
flash("Something went wrong. Please try again")->error();
return back()->withInput();
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id) {
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function edit($id) {
$test_code = InvestigationTestCode::where(['id' => $id])->first();
$investigations = Investigation::orderBy('name')
->pluck('name', 'id')
->prepend('- select -', '');
$instruments = LabInstrument::orderBy('name')
->pluck('name', 'id')
->prepend('- select -', '');
$specialised_variables = InvestigationSpecialisedVariable::orderBy('name')
->pluck('name', 'id')
->prepend('- select -', '');
if (!$test_code) {
flash()->error("Investigation test code not found");
return redirect('/investigation_test_codes/');
} else {
return view('investigations::investigation_test_codes.edit', compact('test_code', 'investigations', 'instruments', 'specialised_variables'));
}
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id) {
request()->validate([
'investigation_id' => 'required',
'machine_name' => 'required',
'test_code' => 'required'
]);
//validation passed
$test_code = InvestigationTestCode::find($id);
$logged_in_user_id = Auth::user()->id;
if ($request->is_specialised_variable == 1){
if (is_null($request->investigation_specialised_variable)) {
flash("Please include the specialised variable for this investigation")->error();
return back()->withInput();
} else {
$test_code->investigation_id = $request->investigation_specialised_variable;
}
} else {
$test_code->investigation_id = $request->investigation_id;
}
$test_code->machine_name = $request->machine_name;
$test_code->test_code = $request->test_code;
$test_code->is_specialised_variable = $request->is_specialised_variable;
$test_code->updated_by = $logged_in_user_id;
try {
$test_code->save();
flash("Test code has been updated")->success();
return redirect("/investigation_test_codes/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id) {
$test_code = InvestigationTestCode::find($id);
if ($test_code->delete()) {
flash("Test Code has been deleted.")->success();
return redirect('/investigation_test_codes/');
}
}
/**
* Display a listing of the inactive resource(s).
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View
*/
public function inactive() {
$test_codes = InvestigationTestCode::onlyTrashed()->get();
$investigations = Investigation::pluck('name', 'id');
$instruments = LabInstrument::pluck('name', 'id');
$specialised_variables = InvestigationSpecialisedVariable::pluck('name', 'id');
if (count($test_codes) < 1) {
flash()->error("There is no inactive test code");
return redirect('/investigation_test_codes/');
} else {
return view('investigations::investigation_test_codes.inactive', compact('test_codes', 'investigations', 'instruments', 'specialised_variables'));
}
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function activate($id) {
$test_code = InvestigationTestCode::withTrashed()->find($id);
if($test_code->restore()){
flash("Test code has been activated.")->success();
return redirect('/investigation_test_codes/inactive');
}
}
public function check_investigation_speciality_type($id) {
if (get_name($id, 'id', 'type', 'investigations') == 1){
$code = "<select name='investigation_specialised_variable' id='investigation_specialised_variable' class='form-control select'>";
$code .= "<option value=''> --select-- </option>";
$variables = InvestigationSpecialisedVariable::where('investigation_id', $id)->get();
foreach ($variables as $variable){
$code .= "<option value='" . $variable->id . "'>" . $variable->name . "</option>";
}
$code .= "</select>";
} else {
$code = "0";
}
return $code;
}
}
@@ -0,0 +1,762 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Streamline\Models\ChartOfAccount;
use Streamline\Models\HospitalInformation;
use Streamline\Models\Lab;
use Streamline\Models\LabForm;
use Streamline\Models\LabUsageListing;
use Streamline\Models\OrderedInvestigation;
use Streamline\Models\Supplier;
use Streamline\Models\UnitOfMeasure;
use Streamline\Models\Requisition;
class LabController extends Controller
{
public function __construct() {
$this->middleware('auth');
$this->middleware('permission:lab-management', ['only' => ['index']]);
$this->middleware('permission:labs-create', ['only' => ['create', 'store']]);
$this->middleware('permission:labs-bulk-create', ['only' => ['add_bulk', 'store_bulk']]);
$this->middleware('permission:labs-bulk-edit', ['only' => ['edit_bulk', 'update_bulk']]);
$this->middleware('permission:labs-edit', ['only' => ['edit', 'update']]);
$this->middleware('permission:labs-delete', ['only' => ['destroy', 'inactive', 'activate']]);
$this->middleware('permission:labs-usage-listing', ['only' => ['lab_usage_listing']]);
$this->middleware('permission:labs-report-usage', ['only' => ['actual_lab_usage', 'labs_usages_report']]);
$this->middleware('permission:labs-bulk-delete', ['only' => ['delete_bulk']]);
$this->middleware('permission:requisition-for-labs', ['only' => ['requisition_for_labs','store_lab_requisitions']]);
$this->middleware('permission:labs-stock-sheet', ['only' => ['stock_sheet', 'update_laboratory_stock_sheet']]);
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$labs = Lab::orderBy('name', 'asc')->get();
$labs= get_all_batch_details($labs,['store_stock','lab_stock'],['store_batches','lab_batches'],['total_store_stock','total_lab_stock'],5) ;
return view('investigations::labs.index', compact('labs'));
}
public function dashboard()
{
$end = Carbon::now()->endOfDay()->toDateTimeString();
$start = Carbon::now()->startOfDay()->toDateTimeString();
$labs = Lab::get();
$total_investigations = OrderedInvestigation::get();
$total_paid_investigations = OrderedInvestigation::where('payment_status', 1)->get();
$total_unpaid_investigations = OrderedInvestigation::where('payment_status', 0)->get();
$total_pending_investigations = OrderedInvestigation::where('investigation_status', 0)->get();
$total_investigation_deposits = DB::table('investigation_deposits')
->whereBetween('created_at', [$start, $end]);
return view('investigations::labs.dashboard', compact('labs', 'total_investigations', 'total_paid_investigations', 'total_unpaid_investigations', 'total_pending_investigations', 'total_investigation_deposits'));
}
public function lab_usage_listing()
{
/*$labs = DB::table('labs')->where('deleted_at', '=',null)->where('store_stock', '>', 0)->get();*/
$labs = Lab::orderBy('name', 'asc')->get();
$hospital_information = HospitalInformation::first();
$labs_usages = LabUsageListing::orderBy('id','desc')->limit(20)->get();
return view('investigations::labs.lab_usage_listing', compact('labs', 'hospital_information', 'labs_usages'));
}
public function clear_stock()
{
$lab_s = Lab::get();
foreach ($lab_s as $lab) {
$lab->delete();
}
$labs = Lab::get();
return view('investigations::labs.index', compact('labs'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$units = UnitOfMeasure::get();
$suppliers = Supplier::get();
$forms = LabForm::get();
$chart_of_accounts = ChartOfAccount::where(['type' => 1])
->orderBy('name', 'asc')
->pluck('name', 'id')
->toArray();
$chart_of_accounts = ['' => '- select -'] + $chart_of_accounts;
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ['' => '- select -'] + $payables_accounts;
return view('investigations::labs.create', compact('units', 'suppliers', 'forms', 'chart_of_accounts', 'expense_accounts', 'payables_accounts'));
}
public function add_bulk()
{
$units_of_measure = UnitOfMeasure::get();
$suppliers = Supplier::get();
$forms = LabForm::get();
//$chart_of_accounts = ChartOfAccount::get();
$chart_of_accounts = ChartOfAccount::where(['type' => 1])
->orderBy('name', 'asc')
->pluck('name', 'id')
->toArray();
$chart_of_accounts = ['' => '- select -'] + $chart_of_accounts;
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ['' => '- select -'] + $payables_accounts;
return view('investigations::labs.bulk.create', compact('units_of_measure', 'suppliers', 'forms', 'chart_of_accounts', 'expense_accounts', 'payables_accounts'));
}
public function get_lab_quantity(Request $request)
{
if (track_items_using_batches()){
$lab_stock =track_batch_stock(5,$request->id,'lab_stock');
$total_stock = 0;
foreach ($lab_stock as $lab) {
$total_stock += $lab->lab_stock;
}
$data = [
'laboratory_stock' => $total_stock,
'cost_price' => $lab_stock[0]->cost_price??0,
];
return $data;
}
return Lab::where('id', $request->id)->first();
}
public function actual_lab_usage(Request $request)
{
$lab_counter = 0;
$lab_item_array = $request->labItem;
$available_qty_array = $request->availableQty;
$available_qty_unit_cost_array = $request->unitCost;
$usage_qty_array = $request->requiredQty;
$usage_qty_cost_array = $request->totalCost;
if ($request->dates == 'today') {
$start = Carbon::now()->startOfDay()->toDateTimeString();
$end = Carbon::now()->endOfDay()->toDateTimeString();
} else {
$start = Carbon::parse($request->start_date)->endOfDay()->toDateTimeString();
$end = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
}
for ($i = 0; $i < count($lab_item_array); $i++) {
if ($lab_item_array[$i]) {
if(track_items_using_batches()){
$datat=get_lab_batches_to_use_based_on_needed_quantity($lab_item_array[$i],5,$usage_qty_array[$i],'lab_stock');
$cost_value=0;
foreach ($datat as $key=> $val){
$unit_cost_value =(int) get_name($key, 'id', 'cost_price', 'item_batch_watcher');
//caluclate cost value
$cost_value += $unit_cost_value * $val;
reduce_batch_item_stock(5,$lab_item_array[$i], $key, 'labs', 'lab_stock', $val, 'lab_usage_listings','Labs', null, null);
}
$usage_qty_cost_array[$i]=$cost_value;
}
$remaining_qty = record_lab_usage_listing($lab_item_array[$i],$available_qty_unit_cost_array[$i], $available_qty_array[$i],$usage_qty_array[$i], $usage_qty_cost_array[$i],
$start,$end);
if (!($remaining_qty < 0)) {
$lab = Lab::find($lab_item_array[$i]);
$lab->laboratory_stock = ($lab->laboratory_stock - (int)$usage_qty_array[$i]);
$lab->save();
} else {
flash('Lab Item\'s ' . get_name($lab_item_array[$i], 'id', 'name', 'labs') . ' requested use quantity exceeds what is available.');
}
}
}
flash('Labs used from ' . streamline_date($start) . ' to ' . streamline_date($end) . ' have saved successfully')->success();
return redirect('/labs/usage/listing');
}
public function store_bulk(Request $request)
{
$validator = Validator::make($request->all(), [
//'name' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
flash($string)->error();
return back()->withErrors($validator)->withInput();
} else {
$name_array = $request->name;
for ($i = 0; $i < count($name_array); $i++) {
if ($request->name[$i] != "" && !is_null($request->name[$i])) {
try {
$lab = new Lab;
$lab->name = $request->name[$i];
// $lab->cost_price = isset($request->cost_price[$i])?$request->cost_price[$i] : null;
// $lab->non_insured_price = isset($request->non_insured_price[$i])?$request->non_insured_price[$i] : null;
// $lab->insured_price = isset($request->insured_price[$i])?$request->insured_price[$i] : null;
// $lab->account_id = isset($request->chart_of_account[$i])? $request->chart_of_account[$i] : null;
// $lab->store_stock = isset($request->stock[$i])?$request->stock[$i] : 0 ;
// if ($request->chi_status[$i] == '1') {
// $lab->insurance_coverage = 1;
// } else {
// $lab->insurance_coverage = 0;
// }
$lab->reorder_level = isset($request->re_order_level[$i]) ? $request->re_order_level[$i] :0;
$lab->description = $request->description[$i];
$lab->form_id = $request->form[$i];
$lab->unit_id = $request->unit[$i];
// $lab->expiry_date = isset($request->expiry_date[$i])? $request->expiry_date[$i] : null;
// $lab->supplier_id = isset($request->supplier[$i])? $request->supplier[$i] : null ;
$lab->expenses_account_id = isset($request->expenses_account_id[$i]) ? $request->expenses_account_id[$i] : null;
$lab->created_by = Auth::id();
$lab->save();
} catch (\Exception $e) {
flash('Error: ' . $e->getMessage())->error();
return redirect()->back();
}
}
}
}
return redirect('labs');
}
public function edit_bulk()
{
$labs = Lab::get();
$units_of_measure = UnitOfMeasure::get()->pluck('name','id')->toArray();
$units_of_measure = ['' => '- select -'] + $units_of_measure;
$suppliers = Supplier::get();
$forms = LabForm::pluck('name','id')->toArray();
$forms = ['' => '- select -'] + $forms;
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ['' => '- select -'] + $payables_accounts;
return view('investigations::labs.bulk.edit', compact('units_of_measure', 'suppliers', 'forms', 'labs', 'expense_accounts', 'payables_accounts'));
}
public function update_bulk(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
flash($string)->error();
return back()->withErrors($validator)->withInput();
} else {
$name_array = $request->name;
for ($i = 0; $i < count($name_array); $i++) {
try {
$lab = Lab::find($request->id[$i]);
$lab->name = $request->name[$i];
$lab->cost_price = isset($request->cost_price[$i]) ? $request->cost_price[$i] : null ;
$lab->expiry_date = isset($request->cost_price[$i]) ? $request->expiry_date[$i] : null;
$lab->non_insured_price = isset($request->cost_price[$i]) ? $request->non_insured_price[$i] : null;
$lab->insured_price = isset($request->cost_price[$i]) ? $request->insured_price[$i] : null;
$lab->account_id = isset($request->chart_of_account[$i]) ? $request->chart_of_account[$i] : null;
$lab->store_stock = isset($request->stock[$i]) ? $request->stock[$i] : null;
$lab->reorder_level = isset($request->re_order_level[$i]) ? $request->re_order_level[$i] : null;
$lab->description = $request->description[$i];
$lab->form_id = isset($request->form[$i]) ? $request->form[$i] : null;
$lab->unit_id = isset($request->unit[$i]) ? $request->unit[$i] : null;
$lab->supplier_id = isset($request->supplier[$i]) ? $request->supplier[$i] : null;
$lab->expenses_account_id = isset($request->expenses_account_id[$i]) ? $request->expenses_account_id[$i] : null;
$lab->updated_by = Auth::id();
$lab->save();
} catch (\Exception $e) {
flash('Error: ' . $e->getMessage())->error();
return redirect()->back();
}
}
}
return redirect('labs');
}
public function delete_bulk(Request $request)
{
$ids_array = $request->ids;
for ($i = 0; $i < count($ids_array); $i++) {
$lab = Lab::find($ids_array[$i]);
if ($lab) {
$lab->delete();
}
}
return 'success';
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
flash($string)->error();
return back()->withErrors($validator)->withInput();
} else {
$lab = new Lab;
$lab->name = $request->name;
$lab->cost_price = is_null($request->cost_price) ? null :$request->cost_price;
$lab->non_insured_price = is_null($request->non_insured_price) ? null :$request->non_insured_price;
$lab->insured_price =is_null($request->insured_price) ? null : $request->insured_price;
$lab->account_id = is_null($request->chart_of_account) ? null :$request->chart_of_account;
$lab->expiry_date = is_null($request->expiry_date) ? null : Carbon::createFromFormat('d/m/Y', $request->expiry_date)->toDateString();
$lab->store_stock = is_null($request->stock) ? 0 : $request->stock;
if ($request->chi_status == '1') {
$lab->insurance_coverage = 1;
} else {
$lab->insurance_coverage = 0;
}
$lab->reorder_level = is_null($request->re_order_level) ? 0 : $request->re_order_level;
$lab->description = $request->description;
$lab->form_id = $request->form;
$lab->unit_id = $request->unit;
$lab->supplier_id = $request->supplier;
$lab->expenses_account_id = $request->expenses_account_id;
//$lab->payables_account_id = $request->payables_account_id;
$lab->created_by = Auth::id();
flash("New lab has been added")->success();
$lab->save();
return redirect('labs');
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$lab = Lab::find($id);
$units = UnitOfMeasure::get()->pluck('name', 'id')->toArray();
$units = ['' => '- select -'] + $units;
$suppliers = Supplier::get();
$forms = LabForm::get()->pluck('name', 'id')->toArray();
$forms = ['' => '- select -'] + $forms;
$chart_of_accounts = ChartOfAccount::where(['type' => 1])
->orderBy('name', 'asc')
->pluck('name', 'id')
->toArray();
$chart_of_accounts = ['' => '- select -'] + $chart_of_accounts;
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ['' => '- select -'] + $payables_accounts;
return view('investigations::labs.edit', compact('lab', 'units', 'suppliers', 'forms', 'chart_of_accounts', 'expense_accounts', 'payables_accounts'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
flash($string)->error();
return back()->withErrors($validator)->withInput();
} else {
$lab = Lab::find($id);
$lab->name = $request->name;
$lab->cost_price = is_null($request->cost_price) ? null :$request->cost_price;
$lab->non_insured_price = is_null($request->non_insured_price) ? null :$request->non_insured_price;
$lab->insured_price =is_null($request->insured_price) ? null : $request->insured_price;
$lab->account_id = is_null($request->chart_of_account) ? null :$request->chart_of_account;
$lab->store_stock =is_null($request->stock) ? null : $request->stock;
$lab->reorder_level = is_null($request->re_order_level) ? null :$request->re_order_level;
$lab->description = $request->description;
$lab->form_id = $request->form;
$lab->unit_id = $request->unit;
$lab->expiry_date = is_null($request->expiry_date) ? null : $request->expiry_date;
$lab->supplier_id = is_null($request->supplier) ? null :$request->supplier;
$lab->expenses_account_id = $request->expenses_account_id;
//$lab->payables_account_id = $request->payables_account_id;
$lab->updated_by = Auth::id();
try {
$lab->save();
} catch (\Exception $e) {
}
}
return redirect('labs');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$lab = Lab::find($id);
if ($lab->delete()) {
flash("Lab has been deleted.")->success();
return redirect('labs');
}
}
/**
* Display a listing of the inactive resource(s).
*
* @return \Illuminate\Http\Response
*/
public function inactive()
{
$labs = Lab::onlyTrashed()
->orderBy('name', 'asc')
->get();
if (count($labs) < 1) {
flash()->error("There is no inactive labs");
return redirect('labs');
}
return view('investigations::labs.inactive', compact('labs'));
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function activate($id)
{
$lab = Lab::withTrashed()->find($id);
if ($lab->restore()) {
flash("Labs has been activated.")->success();
return redirect('/labs/inactive');
}
}
/* requisition for labs */
public function requisition_for_labs(Request $request)
{
$results = Lab::orderBy('name', 'asc')->get();
$names_array = Lab::orderBy('name')->distinct()->pluck('name');
$labs = Lab::orderBy('name')->pluck('name', 'id');
// add start and end date
$date_filter = [];
if (isset($request->start_date) && isset($request->end_date)) {
if (isset($request->quotation_type)) {
$item_type = $request->quotation_type;
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
array_push($date_filter, ['created_at', '>', $start_date]);
array_push($date_filter, ['created_at', '<', $end_date]);
}
} else {
$date_from = Carbon::today()->subDays(30)->format('Y-m-d');
$date_to = Carbon::today()->addDays(1)->format('Y-m-d');
array_push($date_filter, ['created_at', '>', $date_from]);
array_push($date_filter, ['created_at', '<', $date_to]);
}
return view('investigations::labs.requisition_for_labs', compact('results', 'names_array', 'labs'));
}
/**
* Previous lab requisitions
* return @var object
*/
public function previous_requisition_for_labs(Request $request)
{
$search_by = $request->search_by;
$reg_date = $request->reg_date;
$start_date = $request->start_date;
$end_date = $request->end_date;
$filters = [];
$search_string = "";
if ($search_by == 0) {
// last 24 hours
$last_day = Carbon::now()->subDay();
array_push($filters, ['created_at', '>=', $last_day]);
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($last_day) . "</h4>";
} elseif ($search_by == 1) {
// custom date
if (is_null($request->reg_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$selected_date_filter = Carbon::createFromFormat('d/m/Y', $request->reg_date)->toDateString();
array_push($filters, ['created_at', $selected_date_filter]);
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($selected_date_filter) . "</h4>";
} elseif ($search_by == 2) {
// custom date range
if (is_null($start_date) || is_null($end_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$start_date_search = Carbon::createFromFormat('d/m/Y', $start_date)->startOfDay()->toDateTimeString();
$end_date_search = Carbon::createFromFormat('d/m/Y', $end_date)->endOfDay()->toDateTimeString();
array_push($filters, ['created_at', '>=', $start_date_search]);
array_push($filters, ['created_at', '<=', $end_date_search]);
$search_string = "<h4 class='label label-info'>Showing between " . streamline_date($start_date_search) . " and " . streamline_date($end_date_search) . "</h4>";
}else{
// last 24 hours
$last_day = Carbon::now()->subDay();
array_push($filters, ['created_at', '>=', $last_day]);
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($last_day) . "</h4>";
}
$data['previous_requisitions_results'] =Requisition::where('quotation_type_id', '=', 5)->where($filters)->orderBy('created_at', 'desc')->get();
$data['search_string'] = $search_string;
return view('investigations::labs.pre_requisition_for_labs', compact('data'));
}
public function store_lab_requisitions(Request $request)
{
$drug_id_array = $request->drug_id;
$quantity_array = $request->quantity;
$item_type = $request->item_type;
$user_id = Auth::id();
/* return back if no quantity has been filled */
if (array_sum($quantity_array) < 1) {
flash('Please insert some values!')->error();
return redirect()->back()->withInput();
}
if (isset($request->complete_request)) {
$filtered_drugs_array = [];
$filtered_quantities_array = [];
$associative_requested_drugs_array = [];
for ($i = 0; $i < count($drug_id_array); $i++) {
if ($quantity_array[$i] != "") {
$associative_requested_drugs_array[$drug_id_array[$i]] = $quantity_array[$i];
$filtered_drugs_array[] = $drug_id_array[$i];
$filtered_quantities_array[] = $quantity_array[$i];
}
}
$new_requisition = new Requisition;
$new_requisition->quotation_type_id = $item_type;
$new_requisition->drug_id = implode(',', $filtered_drugs_array);
$new_requisition->quantity_requested = implode(',', $filtered_quantities_array);
$new_requisition->created_by = $user_id;
$new_requisition->requisition_origin = 2; //1-pharmacy, 2-lab, 3-imaging
$new_requisition->save();
flash('Requisition number ' . $new_requisition->id . ' made successfully')->success();
//redirect to requisition
return redirect('/print_requisition_receipt/' . $new_requisition->id);
}
}
/* filter out items to requisition */
public function requisition_for_labs_search(Request $request)
{
$item_type = $request->item_type;
$item_ids_array = $request->items_ids;
$results = null;
$filters = [];
$items = null;
$results = Lab::whereIn('id', $item_ids_array)->orderBy('name', 'asc')->get();
$labs = Lab::orderBy('name')->pluck('name', 'id');
$date_filter = [];
if (isset($request->start_date) && isset($request->end_date)) {
if (isset($request->quotation_type)) {
$item_type = $request->quotation_type;
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
array_push($date_filter, ['created_at', '>', $start_date]);
array_push($date_filter, ['created_at', '<', $end_date]);
}
} else {
$date_from = Carbon::today()->subDays(30)->format('Y-m-d');
$date_to = Carbon::today()->addDays(1)->format('Y-m-d');
array_push($date_filter, ['created_at', '>', $date_from]);
array_push($date_filter, ['created_at', '<', $date_to]);
}
$previous_requisitions_results =Requisition::where('quotation_type_id', '=', 5)->where($date_filter)->orderBy('created_at', 'desc')->get();
return view('investigations::labs.requisition_for_labs', compact('items', 'item_type', 'labs', 'results', 'previous_requisitions_results'));
}
/* view stock sheet */
public function stock_sheet()
{
$labs = DB::table('labs')->whereNull('deleted_at')->orderBy('name', 'asc')->paginate(1000);
// getting the labs stock batches
$labs= calculate_stock_value($labs,5,'lab_stock');
if (empty($labs)) {
flash()->error("There is out of stock of labs");
return redirect('/labs/');
} else {
return view('investigations::labs.labs_stock_sheet', compact('labs'));
}
}
public function update_laboratory_stock_sheet(Request $request)
{
$lab_ids_array = $request->lab_id;
$quantities_array = $request->quantity;
$expiry_dates_array = $request->expiry_date;
$batch_numbers_array = $request->batch_number;
$batch_quantity_balances_array = $request->batch_quantity_balance;
$batch_unit_cost = $request->batch_unit_cost;
$batch_db_record_ids_array = $request->batch_drug_id;
$batch_expiry_dates_array = $request->expiry_date;
$batch_drug_ids_array = $request->batch_item_id;
//update batch tracking tables with reconciliations
for ($i=0; $i < count($batch_numbers_array) ; $i++) {
if (!is_null($batch_numbers_array[$i]) && !is_null($batch_quantity_balances_array[$i]) ){
reconcile_batches(5, $batch_drug_ids_array[$i], $batch_numbers_array[$i], $batch_quantity_balances_array[$i], $batch_expiry_dates_array[$i], "lab", $batch_unit_cost[$i], $batch_db_record_ids_array[$i]??0, null);
}
}
for ($i = 0; $i < count($lab_ids_array); $i++) {
$lab = Lab::withTrashed()->find($lab_ids_array[$i]);
$lab->laboratory_stock = $quantities_array[$i];
// $lab->expiry_date = $expiry_dates_array[$i];
$lab->save();
}
flash('stock sheet has been updated')->success();
return redirect('laboratory_stock_sheet');
}
public function labs_usages_report(Request $request)
{
$labs = [];
// $labs = DB::table('labs')->orderBy('name', 'asc')->where('deleted_at', '=', null)->get();
$hospital_information = HospitalInformation::first();
$labs_options = Lab::orderBy('name', 'asc')->pluck('name', 'id')->prepend('- All labs - ', 'all_labs');
$search_by = $request->search_by;
$reg_date = $request->reg_date;
$start_date = $request->start_date;
$end_date = $request->end_date;
$filters = [];
$search_string = "";
if ($search_by == 0) {
// last 24 hours
$last_day = Carbon::now()->subDay();
array_push($filters, ['start_date', '>=', $last_day]);
if ($request->lab_id != 'all_labs') {
array_push($filters, ['lab_id', '=', $request->lab_id]);
}
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($last_day) . "</h4>";
} elseif ($search_by == 1) {
// custom date
if (is_null($request->reg_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$selected_date_filter = Carbon::createFromFormat('d/m/Y', $request->reg_date)->toDateString();
array_push($filters, ['start_date', $selected_date_filter]);
if ($request->lab_id != 'all_labs') {
array_push($filters, ['lab_id', '=', $request->lab_id]);
}
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($selected_date_filter) . "</h4>";
} elseif ($search_by == 2) {
// custom date range
if (is_null($start_date) || is_null($end_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$start_date_search = Carbon::createFromFormat('d/m/Y', $start_date)->startOfDay()->toDateTimeString();
$end_date_search = Carbon::createFromFormat('d/m/Y', $end_date)->endOfDay()->toDateTimeString();
array_push($filters, ['start_date', '>=', $start_date_search]);
array_push($filters, ['end_date', '<=', $end_date_search]);
if ($request->lab_id != 'all_labs') {
array_push($filters, ['lab_id', '=', $request->lab_id]);
}
$search_string = "<h4 class='label label-info'>Showing between " . streamline_date($start_date_search) . " and " . streamline_date($end_date_search) . "</h4>";
}
$labs_usages = LabUsageListing::where($filters)->orderBy('id', 'desc')->limit(500)->get();
return view('investigations::labs.lab_usages_report', compact('labs', 'hospital_information', 'labs_usages', 'labs_options', 'search_string'));
}
}
@@ -0,0 +1,175 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;
use Streamline\Models\LabForm;
use Illuminate\Http\Request;
class LabFormController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$lab_forms = LabForm::get();
return view('investigations::lab_forms.index', compact('lab_forms'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('investigations::lab_forms.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
//'mobile_number' => 'regex:/07\d{2} \d{3} \d{3}/'
//'mobile_number' => 'regex:/(07)[0-9]{8}/'
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
return back()->withErrors($validator)->withInput();
} else {
$logged_in_user_id = Auth::user()->id;
$lab_form = new LabForm;
$lab_form->name = $request->name;
$lab_form->created_by = $logged_in_user_id;
$lab_form->updated_by = $logged_in_user_id;
try {
$lab_form->save();
flash($request->name . " LabForm has been saved")->success();
return redirect("/lab_forms/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
}
/**
* Display the specified resource.
*
* @param \Streamline\Models\LabForm $labForm
* @return \Illuminate\Http\Response
*/
public function show(LabForm $labForm)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \Streamline\Models\LabForm $labForm
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$lab_form = LabForm::where(['id' => $id])->first();
return view('investigations::lab_forms.edit', compact('lab_form'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \Streamline\Models\LabForm $labForm
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
return back()->withErrors($validator)->withInput();
} else {
$logged_in_user_id = Auth::user()->id;
$lab_form = LabForm::find($id);
$lab_form->name = $request->name;
$lab_form->updated_by = $logged_in_user_id;
try {
$lab_form->save();
flash($request->name . " LabForm has been updated")->success();
return redirect("/lab_forms/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
}
/**
* Remove the specified resource from storage.
*
* @param \Streamline\Models\LabForm $labForm
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$lab = LabForm::find($id);
if ($lab->delete()) {
flash("Lab has been deleted.")->success();
return redirect('labs');
}
}
public function inactive() {
$lab_forms = LabForm::onlyTrashed()
->orderBy('name', 'asc')
->get();
if (count($lab_forms) < 1) {
flash()->error("There is no inactive lab forms");
return redirect('lab_forms');
}
return view('investigations::lab_forms.inactive', compact('lab_forms'));
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function activate($id) {
$lab_form = LabForm::withTrashed()->find($id);
if($lab_form->restore()){
flash("Lab Form has been activated.")->success();
return redirect('/lab_forms/inactive');
}
}
}
@@ -0,0 +1,161 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Database\QueryException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Streamline\Models\LabInstrument;
class LabInstrumentsController extends Controller {
/**
* Display a listing of the resource.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View
*/
public function index() {
$instruments = LabInstrument::get();
return view('investigations::lab_instruments.index', compact('instruments'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View
*/
public function create() {
return view('investigations::lab_instruments.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function store(Request $request) {
request()->validate([
'name' => 'required'
]);
$instrument = new LabInstrument();
$logged_in_user_id = Auth::user()->id;
$instrument->name = $request->name;
$instrument->created_by = $logged_in_user_id;
$instrument->updated_by = $logged_in_user_id;
try {
$instrument->save();
flash("Lab Instrument has been saved")->success();
return redirect("/lab_instruments/");
} catch (QueryException $e) {
flash("Something went wrong. Please try again")->error();
return back()->withInput();
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id) {
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function edit($id) {
$instrument = LabInstrument::where(['id' => $id])->first();
if (!$instrument) {
flash()->error("Lab Instrument not found");
return redirect('/lab_instruments/');
} else {
return view('investigations::lab_instruments.edit', compact('instrument'));
}
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function update(Request $request, $id) {
request()->validate([
'name' => 'required',
]);
//validation passed
$instrument = LabInstrument::find($id);
$logged_in_user_id = Auth::user()->id;
$instrument->name = $request->name;
$instrument->updated_by = $logged_in_user_id;
try {
$instrument->save();
flash("Lab Instrument has been updated")->success();
return redirect("/lab_instruments/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function destroy($id) {
$instrument = LabInstrument::find($id);
if ($instrument->delete()) {
flash("Lab Instrument has been deleted.")->success();
return redirect('/lab_instruments/');
}
}
/**
* Display a listing of the inactive resource(s).
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View
*/
public function inactive() {
$instruments = LabInstrument::onlyTrashed()->get();
if (count($instruments) < 1) {
flash()->error("There is no inactive Lab Instrument");
return redirect('/lab_instruments/');
} else {
return view('investigations::lab_instruments.inactive', compact('instruments'));
}
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function activate($id) {
$instrument = LabInstrument::withTrashed()->find($id);
if($instrument->restore()){
flash("Lab Instrument has been activated.")->success();
return redirect('/lab_instruments/inactive');
}
}
}
@@ -0,0 +1,313 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Streamline\Models\InvestigationResults;
use Streamline\Models\InvestigationSpecialisedResult;
use Streamline\Models\LabInstrument;
use Streamline\Models\LabMachineRestart;
use Streamline\Models\LabMachineResult;
use Streamline\Models\OrderedInvestigation;
use Streamline\Models\TrackReceipt;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
class LabMachinesController extends Controller {
public function receive_results_mindray(Request $request) {
$test_id = $request->test_id; // the investigation order id
$arr_parameters = json_decode($request->parameters);
$results_time = $request->time;
$results_arr = [];
$flag_arr = [];
$test_code_arr = [];
foreach ($arr_parameters as $parameter) {
$results_arr[] = $parameter[1];
$flag_arr[] = $parameter[2];
$test_code_arr[] = $parameter[0];
}
$results = new LabMachineResult();
$results->sample_id = $test_id;
$results->results = implode(",", $results_arr);
$results->abnormal_flag = implode(",", $flag_arr);
$results->test_code = implode(",", $test_code_arr);
$results->results_time = $results_time;
$results->save();
}
public function receive_results_mispa(Request $request) {
$test_id = $request->SID ?? 0;
$patient_id = $request->PID ?? 0;
$machine_id = $request->machine_id ?? 0;
$arr_parameters = json_decode($request->results);
$results_arr = [];
$flag_arr = [];
$test_code_arr = [];
foreach ($arr_parameters as $parameter) {
$test_code_arr[] = $parameter[0];
$results_arr[] = str_replace(' ', '', $parameter[1]);
$flag_arr[] = strtoupper($parameter[2]);
}
$results = new LabMachineResult();
$results->sample_id = $test_id;
$results->results = implode(",", $results_arr);
$results->abnormal_flag = implode(",", $flag_arr);
$results->test_code = implode(",", $test_code_arr);
$results->machine_id = $machine_id;
$results->save();
}
public function import_results($sample_id) {
$lab_machine_result = LabMachineResult::where('sample_id', $sample_id)->orderBy('id', 'desc')->first();
$results = explode(",", $lab_machine_result->results);
$flag = explode(",", $lab_machine_result->abnormal_flag);
$test_code = explode(",", $lab_machine_result->test_code);
$machine_id = $lab_machine_result->machine_id;
$test_ids = [];
$test_flag = [];
$test_results = [];
for ($i = 0; $i < count($test_code); $i++) {
$filters = [];
if (is_integer($machine_id)) {
$filters[] = ['machine_name', '=', $machine_id];
}
$test_id = DB::table("investigation_test_codes")
->where("test_code", $test_code[$i])
->where($filters)->first()?->investigation_id;
if (is_numeric($test_id)) {
$test_flag[] = ($flag[$i] == "N") ? "" : $flag[$i];
$test_ids[] = $test_id;
$test_results[] = $results[$i];
}
}
if (count($test_ids) > 0) {
$correct_ids_array = [];
$correct_values_array = [];
$correct_comments_array = [];
$parent_investigation_id = get_name($test_ids[0], 'id', 'investigation_id', 'investigation_specialised_variables');
$specialized_variables = DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $parent_investigation_id)->orderBy('ranking','asc')->get();
foreach ($specialized_variables as $variable) {
$key = array_search($variable->id, $test_ids);
if (is_integer($key)) {
$correct_ids_array[] = $test_ids[$key];
$correct_values_array[] = $test_results[$key];
$correct_comments_array[] = $test_flag[$key];
}
}
$this->map_machine_results_to_patient($correct_ids_array, $sample_id, $correct_values_array, $correct_comments_array);
flash("Results have been imported successfully")->success();
} else {
flash("Results not imported because the test codes are missing")->error();
}
return redirect('/investigations/view_lab_results_details/' . $sample_id);
}
public function map_machine_results_to_patient($test_ids, $sample_id, $results, $comments) {
// get investigation order details
$investigation_order = OrderedInvestigation::find($sample_id);
$parent_investigation_id = get_name($test_ids[0], 'id', 'investigation_id', 'investigation_specialised_variables');
if ($investigation_order){
// investigation ids
$investigation_ids = explode(",", $investigation_order->investigation_id);
// check if investigations results are available
$investigation_result = InvestigationResults::where('order_id', $sample_id)->first();
if ($investigation_result){
// edit the results
$investigation_result->updated_by = Auth::id();
$values_array = explode(",", $investigation_result->value);
$comments_array = explode(",", $investigation_result->comment);
$specialised_results_id = $values_array[array_search($parent_investigation_id, $investigation_ids)];
if (InvestigationSpecialisedResult::find($specialised_results_id)) {
$investigation_specialised_results = InvestigationSpecialisedResult::find($specialised_results_id);
} else {
$investigation_specialised_results = new InvestigationSpecialisedResult();
$investigation_specialised_results->created_by = Auth::id();
}
$investigation_specialised_results->specialised_variable_id = implode(',', $test_ids);
$investigation_specialised_results->value = implode(',', $results);
$investigation_specialised_results->comment = implode(',', $comments);
$investigation_specialised_results->updated_by = Auth::id();
$investigation_specialised_results->save();
$values_array[array_search($parent_investigation_id, $investigation_ids)] = $investigation_specialised_results->id;
$comments_array[array_search($parent_investigation_id, $investigation_ids)] = "-";
$investigation_result->value = implode(",", $values_array);
$investigation_result->comment = implode(",", $comments_array);
$investigation_result->save();
} else {
// add new results to the table
$order = new InvestigationResults;
$order->per_investigation = implode(",", array_fill(0, count($investigation_ids), '0'));
$order->all_authenticated = 0;
$order->order_id = $sample_id;
$order->patient_id = $investigation_order->patient_id;
$order->episode_id = $investigation_order->episode_id;
$order->created_by = Auth::id();
$order->inpatient = 0;
$order->result_type = $investigation_order->order_type;
$values_array = array_fill(0, count($investigation_ids), '');
$comments_array = array_fill(0, count($investigation_ids), '');
$investigation_specialised_results = new InvestigationSpecialisedResult();
$investigation_specialised_results->specialised_variable_id = implode(',', $test_ids);
$investigation_specialised_results->value = implode(',', $results);
$investigation_specialised_results->comment = implode(',', $comments);
$investigation_specialised_results->created_by = Auth::id();
$investigation_specialised_results->updated_by = Auth::id();
$investigation_specialised_results->save();
$values_array[array_search($parent_investigation_id, $investigation_ids)] = $investigation_specialised_results->id;
$comments_array[array_search($parent_investigation_id, $investigation_ids)] = "-";
$order->investigation_id = $investigation_order->investigation_id;
$order->value = implode(",", $values_array);
$order->comment = implode(",", $comments_array);
// save the order
$order->save();
}
}
}
public function view_lab_machine_results(Request $request) {
$search_text = "";
$filters = [];
// if patient id is active, get all records regardless of date; else search by date
if (isset($request->lab_number) && $request->lab_number != '') {
$filters[] = ['sample_id', '=', $request->lab_number];
$search_text .= "Lab Number: " . $request->lab_number;
} else {
switch ($request->search_date_by){
case 'yesterday':
$end_date = Carbon::yesterday()->endOfDay();
$start_date = Carbon::yesterday()->startOfDay();
$search_text .= "Yesterday ";
break;
case 'custom_date':
$end_date = Carbon::parse($request->start_date)->endOfDay();
$start_date = Carbon::parse($request->start_date)->startOfDay();
$search_text .= "From: " . streamline_date($start_date) . " ";
break;
case 'custom_date_range':
$end_date = Carbon::parse($request->end_date)->endOfDay();
$start_date = Carbon::parse($request->start_date)->startOfDay();
$search_text .= "From: " . streamline_date($start_date) . " to " . streamline_date($end_date) . " ";
break;
case 'today':
default:
$end_date = Carbon::today()->endOfDay();
$start_date = Carbon::today()->startOfDay();
$search_text .= "Today ";
break;
}
$filters[] = ['created_at', '>', $start_date];
$filters[] = ['created_at', '<', $end_date];
}
$results = LabMachineResult::where($filters)->get();
$lab_machines = LabInstrument::pluck("name", "id")->prepend('- select -', '');
return view('investigations::lab_instruments.view_lab_machine_results', compact('results', 'search_text', 'lab_machines'));
}
public function restart_python_script(Request $request) {
$lab_instrument = LabInstrument::find($request->lab_instrument);
if(!$lab_instrument || is_null($lab_instrument->restart_lis_path)) {
flash("Could not find the lab instrument selected")->error();
return back()->withInput();
}
// 'public/uploads/lab_machine_scripts/kisiizi/restart_lis.py'
$process = new Process(['python3', base_path($lab_instrument->restart_lis_path)]);
$process->run();
$process->wait();
if (!$process->isSuccessful()) {
throw new ProcessFailedException($process);
}
$lab_machine_restart = new LabMachineRestart();
if (strpos($process->getOutput(), '1') !== false) {
flash("Lab integration has been restarted successfully")->success();
$lab_machine_restart->result = $process->getOutput();
} else {
flash("An error occurred while establishing a connection. Please contact the Stre@mline team")->error();
$lab_machine_restart->result = $process->getErrorOutput();
}
$lab_machine_restart->created_by = Auth::id();
$lab_machine_restart->save();
return redirect('lab_machines/view_lab_machine_results');
}
public function preview_lab_machine_results($id) {
$result = LabMachineResult::find($id);
$html_text = "<table class='table table-bordered table-striped'>";
$test_code_array = explode(",", $result->test_code);
$flag_array = explode(",", $result->abnormal_flag);
$results_array = explode(",", $result->results);
$html_text .= "<tr>";
$html_text .= "<th style='color: black' class='text-center'> Test Code </th>";
$html_text .= "<th style='color: black' class='text-center'> Specialised Variable </th>";
$html_text .= "<th style='color: black' class='text-center'> Result </th>";
$html_text .= "<th style='color: black' class='text-center'> Flag </th>";
$html_text .= "</tr>";
for ($i = 0; $i < count($test_code_array); $i++) {
$specialised_variable_id = get_name($test_code_array[$i], 'test_code', 'investigation_id', 'investigation_test_codes');
$specialised_variable_name = get_name($specialised_variable_id, 'id', 'name', 'investigation_specialised_variables');
$html_text .= "<tr>";
$html_text .= "<td class='text-center'>" . $test_code_array[$i] . "</td>";
$html_text .= "<td class='text-center'>" . $specialised_variable_name . "</td>";
$html_text .= "<td class='text-center'>" . $results_array[$i] . "</td>";
$html_text .= "<td class='text-center'>" . $flag_array[$i] . "</td>";
$html_text .= "</tr>";
}
$html_text .= "</table>";
return json_encode(["html" => $html_text]);
}
}
@@ -0,0 +1,174 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Http\Request;
use Streamline\Models\LaboratorySpecimen;
use Illuminate\Support\Facades\Validator;
class LaboratorySpecimenController extends Controller
{
public function __construct() {
$this->middleware('auth');
$this->middleware('permission:lab_specimen-list', ['only' => ['index']]);
$this->middleware('permission:lab_specimen-detail', ['only' => ['show']]);
$this->middleware('permission:lab_specimen-create', ['only' => ['create', 'store']]);
$this->middleware('permission:lab_specimen-edit', ['only' => ['edit', 'update']]);
$this->middleware('permission:lab_specimen-delete', ['only' => ['destroy']]);
$this->middleware('permission:lab_specimen-status', ['only' => ['activate, inactive']]);
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$lab_specimens = LaboratorySpecimen::orderBy('name', 'asc')->paginate(50);
return view('investigations::laboratory_specimen.index',compact('lab_specimens'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('investigations::laboratory_specimen.create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required|unique:laboratory_specimens'
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
return back()->withErrors($validator)->withInput();
} else {
$specimen = new LaboratorySpecimen;
$specimen->name = $request->name;
$specimen->save();
if (isset($request->other_specimen_names)) {
$other_specimens_array = $request->other_specimen_names;
for ($i=0; $i < count($other_specimens_array) ; $i++) {
if (!is_null($other_specimens_array[$i]) && $other_specimens_array[$i] != "") {
$lab_specimen = new LaboratorySpecimen;
$lab_specimen->name = $other_specimens_array[$i];
$lab_specimen->created_by = auth()->user()->id;
$lab_specimen->updated_by = auth()->user()->id;
$lab_specimen->save();
}
}
}
flash('New specimen added successfully')->success();
return redirect('laboratory_specimen');
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$lab_specimen = LaboratorySpecimen::find($id);
if (!$lab_specimen) {
flash()->error("There is no such specimen");
return redirect('laboratory_specimen');
} else {
return view('investigations::laboratory_specimen.edit', compact('lab_specimen'));
}
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$lab_specimen = LaboratorySpecimen::find($id);
$lab_specimen->name = $request->name;
$lab_specimen->update();
flash('successfully updated details for '.$lab_specimen->name)->success();
return redirect('laboratory_specimen');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$lab_specimen = LaboratorySpecimen::find($id);
if ($lab_specimen->delete()) {
flash($lab_specimen->name. ' has been successfully deleted')->success();
return redirect('laboratory_specimen');
}
flash('error occurred. Contact system admin')->error();
return redirect()->back()->withInput();
}
/*
*Display inactive bed categories
*/
public function inactive()
{
$lab_specimens = LaboratorySpecimen::onlyTrashed()->orderBy('name','asc')->paginate(50);
if (count($lab_specimens) < 1) {
flash()->error("There is no inactive specimens");
return redirect('laboratory_specimen');
} else {
return view('investigations::laboratory_specimen.inactive', compact('lab_specimens'));
}
}
/*
* Activate an inactive inpatient bed category
*/
public function activate($id)
{
$lab_specimens = LaboratorySpecimen::withTrashed()->find($id);
if ($lab_specimens->restore()):
flash("Specimen has been activated.")->success();
return redirect('/inactive/laboratory_specimen/');
endif;
}
}
@@ -0,0 +1,700 @@
<?php
namespace Modules\Investigations\Http\Controllers;
use Illuminate\Database\QueryException;
use Illuminate\Http\Request;
use Streamline\Models\Radiology;
use Streamline\Models\ChartOfAccount;
use Illuminate\Support\Facades\Auth;
use Streamline\Models\HospitalInformation;
use Illuminate\Support\Facades\Validator;
use Streamline\Models\RadiologyUsage;
use Illuminate\Support\Facades\DB;
use Streamline\Models\Requisition;
use Illuminate\Support\Carbon;
use Streamline\Models\GeneralForm;
class RadiologyController extends Controller
{
function __construct() {
$this->middleware('permission:radiologies-management', ['only' => ['index']]);
$this->middleware('permission:radiologies-create', ['only' => ['create', 'store']]);
$this->middleware('permission:radiologies-edit', ['only' => ['edit', 'update']]);
$this->middleware('permission:radiologies-delete', ['only' => ['destroy']]);
$this->middleware('permission:radiologies-usage-listing',['only'=>['radiology_usage_listing','store_radiology_usage']]);
$this->middleware('permission:radiologies-report-usage', ['only'=>['radiology_usages_report']]);
$this->middleware('permission:radiologies-stock-sheet', ['only'=>['radiology_stock_sheet']]);
$this->middleware('permission:requisition-for-radiologies', ['only'=>['requisition_for_radiologies','update_imaging_stock_sheet']]);
}
public function index()
{
$radiologies = Radiology::orderBy('name', 'asc')->get();
$chart_of_accounts = ChartOfAccount::orderBy('name', 'asc')->pluck('name', 'id');
$accounts = ChartOfAccount::orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$radiologies= get_all_batch_details($radiologies,['store_stock','lab_stock'],['store_batches','lab_batches'],['total_store_stock','total_lab_stock'],4);
return view('investigations::radiologies.index', compact('radiologies', 'chart_of_accounts', 'accounts'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$cost_of_goods_accounts = ChartOfAccount::where(['type' => 7])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$forms = ['' => '- select -'] + GeneralForm::where('item_type',4)->pluck('name', 'id')->toArray();
$cost_of_goods_accounts = ['' => '- select -'] + $cost_of_goods_accounts;
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ['' => '- select -'] + $payables_accounts;
return view('investigations::radiologies.create', compact('cost_of_goods_accounts','forms', 'payables_accounts', 'expense_accounts'));
}
//edit all radiologies
public function edit_all(){
$cost_of_goods_accounts = ChartOfAccount::where(['type' => 7])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expense_accounts = ChartOfAccount::where(['type' => 2])
->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$payables_accounts = ChartOfAccount::where(['type' => 6])
->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$forms = ['' => '- select -'] + GeneralForm::where('item_type',4)->pluck('name', 'id')->toArray();
$cost_of_goods_accounts = ['' => '- select -'] + $cost_of_goods_accounts;
$expense_accounts = ['' => '- select -'] + $expense_accounts;
$payables_accounts = ['' => '- select -'] + $payables_accounts;
$radiologies = Radiology::orderBy('name', 'asc')->get();
return view('investigations::radiologies.edit_all', compact('cost_of_goods_accounts','radiologies','forms', 'payables_accounts', 'expense_accounts'));
}
//update all radiologies
public function update_all(Request $request) {
$validator = Validator::make($request->all(), [
'name' => 'required',
'cost_price' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
return back()->withErrors($validator)->withInput();
} else {
$logged_in_user_id = Auth::user()->id;
$id_array = $request->id;
$name_array = $request->name;
$cost_price_array = $request->cost_price;
$payables_account_id_array = $request->payables_account_id;
$expenses_account_id_array = $request->expenses_account_id;
$form_id_array = $request->form_id;
$re_order_level_array = $request->re_order_level;
for ($x = 0; $x < count($id_array); $x++):
$radiology = Radiology::find($id_array[$x]);
$radiology->name = $name_array[$x];
$radiology->cost_price = $cost_price_array[$x];
$radiology->payables_account_id = $payables_account_id_array[$x];
$radiology->expenses_account_id = $expenses_account_id_array[$x];
$radiology->form_id = $form_id_array[$x];
$radiology->reorder_level = $re_order_level_array[$x];
$radiology->updated_by = $logged_in_user_id;
try {
$radiology->save();
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
endfor;
flash("Radiology has been updated")->success();
return redirect("/radiology/");
}
}
//function to add Radiology form
public function create_radiology_form()
{
return view('investigations::radiologies.create_radiology_form');
}
//functiion to store radiology form
public function store_radiology_form (Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
return back()->withErrors($validator)->withInput();
} else {
$data['name']=$request->name;
$data['type']= 4;
try{
//create new radiology form
$new_form = GeneralForm::add_new_form((object)$data);
if($new_form){
flash("Radiology form has been created successfully")->success();
return redirect('/radiology');
}
}catch (QueryException $e){
flash("Something went wrong. Please try again")->error();
return back()->withInput();
}
}
}
//edit form
public function edit_form($id){
$form = GeneralForm::find($id);
if (!$form) flash()->error("Sundry Form not found");return redirect()->route('radiology_forms.all');
return view('investigations::radiologies.edit_radiology_form', compact('form'));
}
//update form
public function update_radiology_form(Request $request, $id){
$validator = Validator::make($request->all(), [
'name' => 'required',
]);
if ($validator->fails()) {
$string = "";
foreach ($validator->errors()->getMessages() as $item) {
$string .= "{$item[0]}<br>";
}
return back()->withErrors($validator)->withInput();
} else {
$data['name']=$request->name;
$data['type']= 4;
try{
//update radiology form
$form = GeneralForm::find($id);
$form->update($data);
flash("Radiology form has been updated successfully")->success();
return redirect('/radiology_forms');
}catch (QueryException $e){
flash("Something went wrong. Please try again")->error();
return back()->withInput();
}
}
}
//delete form
public function delete_form($id){
try{
//delete radiology form
$form = GeneralForm::find($id);
$form->delete();
flash("Radiology form has been deleted successfully")->success();
return redirect('/radiology_forms');
}catch (QueryException $e){
flash("Something went wrong. Please try again")->error();
return back()->withInput();
}
}
//show inactive forms
public function inactive_forms(){
$inactive_forms = GeneralForm::onlyTrashed()
->where('item_type', 4)
->orderBy('name', 'asc')
->get();
if (count($inactive_forms) < 1) {
flash()->error("There is no inactive Radiology forms");
return redirect('radiology_forms');
}
return view('investigations::radiologies.inactive_radiology_forms', compact('inactive_forms'));
}
// reactivate form
public function activate_form($id) {
$lab_form = GeneralForm::withTrashed()->find($id);
if($lab_form->restore()){
flash("Radiology Form has been activated.")->success();
return redirect('/radiology_forms');
}
}
//get all radiology forms
public function get_all_radiology_form(){
$all_forms = GeneralForm::get_all_forms_type(4);
return view('investigations::radiologies.all_radiology_form',compact('all_forms'));
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
request()->validate([
'name' => 'required',
'cost_price' => 'required'
]);
$radiology = new Radiology();
$logged_in_user_id = Auth::user()->id;
$radiology->name = $request->name;
$radiology->cost_price = $request->cost_price;
$radiology->expenses_account_id = $request->expenses_account_id;
$radiology->payables_account_id = $request->payables_account_id;
$radiology->form_id = $request->form_id;
$radiology->reorder_level = $request->re_order_level;
$radiology->created_by = $logged_in_user_id;
$radiology->updated_by = $logged_in_user_id;
try {
$radiology->save();
flash("Radiology has been saved")->success();
return redirect("/radiology/");
} catch (QueryException $e) {
flash("Something went wrong. Please try again")->error();
return back()->withInput();
}
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$radiology = Radiology::where(['id' => $id])->first();
$payables_accounts = ChartOfAccount::where(['type' => 6])->orWhere(['type' => 9])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expenses_accounts = ChartOfAccount::where(['type' => 2])->orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$expenses_accounts = ['' => '- select -'] + $expenses_accounts;
$payables_accounts = ['' => '- select -'] + $payables_accounts;
$forms = ['' => '- select -'] + GeneralForm::where('item_type',4)->pluck('name', 'id')->toArray();
if (!$radiology) {
flash()->error("Radiology not found");
return redirect('/radiology/');
} else {
return view('investigations::radiologies.edit', compact('radiology', 'forms','payables_accounts', 'expenses_accounts'));
}
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
request()->validate([
'name' => 'required',
'cost_price' => 'required',
]);
//validation passed
$radiology = Radiology::find($id);
$logged_in_user_id = Auth::user()->id;
$radiology->name = $request->name;
$radiology->cost_price = $request->cost_price;
$radiology->expenses_account_id = $request->expenses_account_id;
$radiology->payables_account_id= $request->payables_account_id;
$radiology->form_id = $request->form_id;
$radiology->reorder_level = $request->re_order_level;
$radiology->updated_by = $logged_in_user_id;
try {
$radiology->save();
flash("Radiology has been updated")->success();
return redirect("/radiology/");
} catch (QueryException $e) {
flash("An error occurred")->error();
return back()->withInput();
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$radiology = Radiology::find($id);
if ($radiology->delete()) {
flash("The item has been deleted.")->success();
return redirect('/radiology/');
}
}
/**
* Display a listing of the inactive resource(s).
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View
*/
public function inactive() {
$radiologies = Radiology::onlyTrashed()->get();
$accounts = ChartOfAccount::orderBy('name', 'asc')->pluck('name', 'id')->toArray();
if (count($radiologies) < 1) {
flash()->error("There is no inactive Radiology");
return redirect('/radiology/');
} else {
return view('investigations::radiologies.inactive', compact('radiologies', 'accounts'));
}
}
/**
* Activate the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function activate($id) {
$radiology = Radiology::withTrashed()->find($id);
if($radiology->restore()){
flash("A Radiology has been activated.")->success();
return redirect('/radiology/inactive');
}
}
public function radiology_usage_listing(){
$radiologies = DB::table('radiologies')->orderBy('name', 'asc')->where('deleted_at', '=',null)->get();
$hospital_information = HospitalInformation::first();
return view('investigations::radiologies.radiology_usage', compact('radiologies', 'hospital_information'));
}
public function store_radiology_usage(Request $request){
$lab_counter = 0;
$radiologies_item_array = $request->labItem;
$available_qty_array = $request->availableQty;
$available_qty_unit_cost_array = $request->unitCost;
$usage_qty_array = $request->requiredQty;
$usage_qty_cost_array = $request->totalCost;
if($request->dates == 'today'){
$start = Carbon::now()->startOfDay()->toDateTimeString();
$end = Carbon::now()->endOfDay()->toDateTimeString();
}else{
$start = Carbon::parse($request->start_date)->endOfDay()->toDateTimeString();
$end = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
}
for($i = 0; $i < count($radiologies_item_array); $i++){
if($radiologies_item_array[$i]){
if(track_items_using_batches()){
$datat=get_lab_batches_to_use_based_on_needed_quantity($radiologies_item_array[$i],4,$usage_qty_array[$i],'lab_stock');
$cost_value=0;
foreach ($datat as $key=> $val){
$unit_cost_value =(int) get_name($key, 'id', 'cost_price', 'item_batch_watcher');
//caluclate cost value
$cost_value += $unit_cost_value * $val;
reduce_batch_item_stock(4,$radiologies_item_array[$i], $key, 'radiologies', 'lab_stock', $val, 'radiology_usages','Imaging', null, null);
}
$usage_qty_cost_array[$i]=$cost_value;
}
$remaining_qty = record_radiology_usage_listing($radiologies_item_array[$i],$available_qty_unit_cost_array[$i], $available_qty_array[$i],$usage_qty_array[$i], $usage_qty_cost_array[$i],
$start,$end);
if(!($remaining_qty < 0)){
$radiology = Radiology::find($radiologies_item_array[$i]);
$radiology->pharmacy_stock = ($radiology->pharmacy_stock - (int)$usage_qty_array[$i]);
$radiology->save();
}else{
flash('Item\'s '.get_name($radiologies_item_array[$i], 'id', 'name', 'labs').' requested use quantity exceeds what is available.');
}
}
}
flash('Radiologies Used from '.streamline_date($start).' to '.streamline_date($end).' have saved successfully')->success();
return redirect('/radiology_listing');
}
public function get_radiology_quantity(Request $request){
if (track_items_using_batches()){
// that is if batches is enabled
$lab_stock =track_batch_stock(4,$request->id,'lab_stock');
$total_stock = 0;
foreach ($lab_stock as $lab) {
$total_stock += $lab->lab_stock;
}
$data = [
'pharmacy_stock' => $total_stock,
'cost_price' => $lab_stock[0]->cost_price??0,
];
return $data;
}
return Radiology::where('id', $request->id)->first();
}
public function requisition_for_radiologies(Request $request)
{
$results = Radiology::orderBy('name','asc')->get();
$names_array = Radiology::orderBy('name')->distinct()->pluck('name');
$labs = Radiology::orderBy('name')->pluck('name', 'id');
$date_filter = [];
if(isset($request->start_date) && isset($request->end_date)){
if (isset($request->quotation_type)) {
$item_type = $request->quotation_type;
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
array_push($date_filter, ['created_at', '>', $start_date]);
array_push($date_filter, ['created_at', '<', $end_date]);
}
} else {
$date_from = Carbon::today()->subDays(30)->format('Y-m-d');
$date_to = Carbon::today()->addDays(1)->format('Y-m-d');
array_push($date_filter, ['created_at', '>', $date_from]);
array_push($date_filter, ['created_at', '<', $date_to]);
}
$previous_requisitions_results = Requisition::where('quotation_type_id', '=', 4)->where($date_filter)->orderBy('created_at','desc')->get();
$results = get_all_batch_details($results,['store_stock','lab_stock'],['store_batches','lab_batches'],['total_store_stock','total_lab_stock'],4);
return view('investigations::radiologies.requisition_for_radiologies', compact('results', 'names_array', 'labs', 'previous_requisitions_results'));
}
public function previous_requisition_for_radiologies(Request $request){
$search_by = $request->search_by;
$reg_date = $request->reg_date;
$start_date = $request->start_date;
$end_date = $request->end_date;
$date_filter = [];
$search_string = "";
if ($search_by == 0) {
// last 24 hours
$last_day = Carbon::now()->subDay();
array_push($date_filter, ['created_at', '>=', $last_day]);
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($last_day) . "</h4>";
} elseif ($search_by == 1) {
// custom date
if (is_null($request->reg_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$selected_date_filter = Carbon::createFromFormat('d/m/Y', $request->reg_date)->toDateString();
array_push($date_filter, ['created_at', '=',$selected_date_filter]);
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($selected_date_filter) . "</h4>";
} elseif ($search_by == 2) {
// custom date range
if (is_null($start_date) || is_null($end_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$start_date_search = Carbon::createFromFormat('d/m/Y', $start_date)->startOfDay()->toDateTimeString();
$end_date_search = Carbon::createFromFormat('d/m/Y', $end_date)->endOfDay()->toDateTimeString();
array_push($date_filter, ['created_at', '>=', $start_date_search]);
array_push($date_filter, ['created_at', '<=', $end_date_search]);
$search_string = "<h4 class='label label-info'>Showing between " . streamline_date($start_date_search) . " and " . streamline_date($end_date_search) . "</h4>";
} else {
// last 24 hours
$last_day = Carbon::now()->subDay();
array_push($date_filter, ['created_at', '>=', $last_day]);
$search_string = "<h4 class='label label-info'>Showing results of " . streamline_date($last_day) . "</h4>";
}
$previous_requisitions_results = Requisition::where('quotation_type_id', '=', 4)->where($date_filter)->orderBy('created_at','desc')->get();
return view('investigations::radiologies.prev_requisition_for_radiologies', compact('previous_requisitions_results','search_string'));
}
public function store_radiology_requisitions(Request $request)
{
$drug_id_array = $request->drug_id;
$quantity_array = $request->quantity;
$item_type = $request->item_type;
$user_id = Auth::id();
/* return back if no quantity has been filled */
if (array_sum($quantity_array) < 1) {
flash('Please insert some values!')->error();
return redirect()->back()->withInput();
}
if (isset($request->complete_request)) {
$filtered_drugs_array = [];
$filtered_quantities_array = [];
$associative_requested_drugs_array = [];
for ($i=0; $i < count($drug_id_array) ; $i++) {
if ($quantity_array[$i] != "") {
$associative_requested_drugs_array[$drug_id_array[$i]] = $quantity_array[$i];
$filtered_drugs_array[] = $drug_id_array[$i];
$filtered_quantities_array[] = $quantity_array[$i];
}
}
$new_requisition = new Requisition;
$new_requisition->quotation_type_id = $item_type;
$new_requisition->drug_id = implode(',', $filtered_drugs_array);
$new_requisition->quantity_requested = implode(',', $filtered_quantities_array);
$new_requisition->created_by = $user_id;
$new_requisition->requisition_origin= 3; // 1-pharmacy, 2-lab, 3-imaging
$new_requisition->save();
flash('Requisition number ' . $new_requisition->id . ' made successfully')->success();
//redirect to requisition
return redirect('/print_requisition_receipt/' . $new_requisition->id);
}
}
/* filter out items to requisition */
public function requisition_for_radiology_search(Request $request)
{
$item_type = $request->item_type;
$item_ids_array = $request->items_ids;
$results = null;
$filters = [];
$items = null;
$results = Radiology::whereIn('id', $item_ids_array)->orderBy('name','asc')->get();
$labs = Radiology::orderBy('name')->pluck('name', 'id');
$date_filter = [];
if(isset($request->start_date) && isset($request->end_date)){
if (isset($request->quotation_type)) {
$item_type = $request->quotation_type;
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
array_push($date_filter, ['created_at', '>', $start_date]);
array_push($date_filter, ['created_at', '<', $end_date]);
}
} else {
$date_from = Carbon::today()->subDays(30)->format('Y-m-d');
$date_to = Carbon::today()->addDays(1)->format('Y-m-d');
array_push($date_filter, ['created_at', '>', $date_from]);
array_push($date_filter, ['created_at', '<', $date_to]);
}
$previous_requisitions_results = Requisition::where('quotation_type_id', '=', 5)->where($date_filter)->orderBy('created_at','desc')->get();
$results = get_all_batch_details($results,['store_stock','lab_stock'],['store_batches','lab_batches'],['total_store_stock','total_lab_stock'],4);
return view('investigations::radiologies.requisition_for_radiologies',compact('items','item_type','labs','results','previous_requisitions_results'));
}
public function radiology_usages_report(Request $request)
{
$radiologies = DB::table('radiologies')->orderBy('name', 'asc')->where('deleted_at', '=',null)->get();
$hospital_information = HospitalInformation::first();
$radiologies_options = DB::table('radiologies')->orderBy('name', 'asc')->pluck('name', 'id')->prepend('- All Radiologies - ', 'all_radiologies');
$search_by = $request->search_by;
$reg_date = $request->reg_date;
$start_date = $request->start_date;
$end_date = $request->end_date;
$filters = [];
$search_string = "";
if ($search_by == 0) {
// last 24 hours
$last_day = Carbon::now()->subDay();
array_push($filters, ['start_date', '>=', $last_day]);
if ($request->radiology_id != 'all_radiologies') {
array_push($filters, ['radiology_id', '=', $request->radiology_id]);
}
$search_string = "<h4 class='label label-info'>Showing results of ".streamline_date($last_day)."</h4>";
} elseif ($search_by == 1) {
// custom date
if (is_null($request->reg_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$selected_date_filter = Carbon::createFromFormat('d/m/Y', $request->reg_date)->toDateString();
array_push($filters, ['start_date', $selected_date_filter]);
if ($request->radiology_id != 'all_radiologies') {
array_push($filters, ['radiology_id', '=', $request->radiology_id]);
}
$search_string = "<h4 class='label label-info'>Showing results of ".streamline_date($selected_date_filter)."</h4>";
} elseif ($search_by == 2) {
// custom date range
if (is_null($start_date) || is_null($end_date)) {
flash('Please select a date')->error();
return redirect()->back();
}
$start_date_search = Carbon::createFromFormat('d/m/Y', $start_date)->startOfDay()->toDateTimeString();
$end_date_search = Carbon::createFromFormat('d/m/Y', $end_date)->endOfDay()->toDateTimeString();
array_push($filters, ['start_date', '>=', $start_date_search]);
array_push($filters, ['end_date', '<=', $end_date_search]);
if ($request->radiology_id != 'all_radiologies') {
array_push($filters, ['radiology_id', '=', $request->radiology_id]);
}
$search_string = "<h4 class='label label-info'>Showing between ".streamline_date($start_date_search). " and ".streamline_date($end_date_search)."</h4>";
}
$radiologies_usages = RadiologyUsage::where($filters)->orderBy('id','desc')->limit(500)->get();
return view('investigations::radiologies.radiology_usages_report', compact( 'hospital_information', 'radiologies_usages', 'radiologies_options', 'search_string'));
}
//radiology stock sheet
public function radiology_stock_sheet()
{
$radiologies = DB::table('radiologies')->whereNull('deleted_at')->orderBy('name', 'asc')->get();
// getting the radiology stock batches
$radiologies= calculate_stock_value($radiologies,4,'lab_stock');
if (empty($radiologies)) {
flash()->error("There is out of stock of labs");
return redirect('/radiology/');
} else {
return view('investigations::radiologies.radiology_stock_sheet', compact('radiologies'));
}
}
public function update_imaging_stock_sheet(Request $request){
$radio_ids_array = $request->lab_id;
$quantities_array = $request->quantity;
$expiry_dates_array = $request->expiry_date;
$batch_numbers_array = $request->batch_number;
$batch_unit_cost = $request->batch_unit_cost;
$batch_quantity_balances_array = $request->batch_quantity_balance;
$batch_db_record_ids_array = $request->batch_drug_id;
$batch_expiry_dates_array = $request->expiry_date;
$batch_drug_ids_array = $request->batch_item_id;
//update batch tracking tables with reconciliations
for ($i=0; $i < count($batch_numbers_array) ; $i++) {
if (!is_null($batch_numbers_array[$i]) && !is_null($batch_quantity_balances_array[$i]) ){
reconcile_batches(4, $batch_drug_ids_array[$i], $batch_numbers_array[$i], $batch_quantity_balances_array[$i], $batch_expiry_dates_array[$i], "lab", $batch_unit_cost[$i], $batch_db_record_ids_array[$i]??0, null);
}
}
for ($i = 0; $i < count($radio_ids_array); $i++) {
$lab = Radiology::withTrashed()->find($radio_ids_array[$i]);
$lab->pharmacy_stock = $quantities_array[$i];
// $lab->expiry_date = $expiry_dates_array[$i];
$lab->save();
}
flash('stock sheet has been updated')->success();
return redirect('radiology_stock_sheet');
}
}
@@ -0,0 +1,113 @@
<?php
namespace Modules\Investigations\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Investigations\Providers\RouteServiceProvider;
class InvestigationsServiceProvider extends ServiceProvider {
/**
* @var string $moduleName
*/
protected $moduleName = 'Investigations';
/**
* @var string $moduleNameLower
*/
protected $moduleNameLower = 'investigations';
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
);
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'Resources/views');
$this->publishes([
$sourcePath => $viewPath
], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'));
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (\Config::get('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}
@@ -0,0 +1,68 @@
<?php
namespace Modules\Investigations\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'Modules\Investigations\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(module_path('Investigations', '/Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(module_path('Investigations', '/Routes/api.php'));
}
}
@@ -0,0 +1,70 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.add_dental') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('dentals.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('dentals.clinical_data_home') }}</a></li>
<li><a href="{{ route('dentals.index') }}">{{ __('dentals.dentals') }}</a></li>
<li class="active">{{ __('dentals.create') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::open(['route' => 'dentals.store', 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('name', __('dentals.dental')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('cost_price','Item Cost Price') }}
{{ Form::text('cost_price','',['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('payables_account_id', 'Payables Accounts') }}
{{ Form::select('payables_account_id', $payables_accounts, null, ['class' => 'form-control', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('expenses_account_id', 'Expenses Accounts') }}
{{ Form::select('expenses_account_id', $expense_accounts, null, ['class' => 'form-control', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
{{ Form::button(__('dentals.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('dentals.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
@endpush
@@ -0,0 +1,222 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.dental_requisitions') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('labs.dashboard') }}</a></li>
<li><a href="{{ url('labs') }}">{{ __('dentals.dentals') }}</a></li>
<li class="active">{{ __('dentals.dental_requisitions') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
@include('flash::message')
<div class="row">
<div class="col-sm-8">
<div class="row">
<div class="col-sm-12">
<div class="panel">
<div class="panel-heading">{{ __('dentals.dental_requisitions') }}</div>
<div class="panel-body">
{{ Form::open(['route' => 'dentals.dentals_requisition_search', 'method' => 'ANY', 'role' => 'search']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group" id="drug_names">
<input type="hidden" name="item_type" value="4">
{{ Form::select('items_ids[]',$labs,'',['id'=>'labs_ids', 'multiple'=>true, 'class' => 'form-control col-sm-8 labs_ids']) }}
</div>
</div>
<div class="col-md-6">
<button type="submit" class="btn btn-info"><span class="glyphicon glyphicon-search"></span> {{ __('labs.select_requisition_items') }}</button>
</div>
</div>
@if(isset($criteria) && isset($resultCount))
<p>
{{ __('labs.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;{{ __('labs.total_results') }} : <code>{{ $resultCount }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('drugs.index') }}">{{ __('labs.clear_search') }}</a>
</p>
@endif
{{ Form::close() }}
{{ Form::open(['method' => 'post', 'route'=>'dentals.store_dental_requisitions'])}}
<input type="hidden" name="item_type" value="3">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-hover"">
<thead>
<tr>
<th style="width: 5%">#</th>
<th style="width: 65%">{{ __('labs.name') }}</th>
<th style="width: 30%">{{ __('labs.quantity_requested') }}</th>
</tr>
</thead>
<tbody>
@if(count($results) > 0)
@php $count = 0; @endphp
@foreach($results as $result)
@php $count++; @endphp
<tr>
<td>{{ $count }}</td>
<td>
{{ $result->name }}
<input type="hidden" name="drug_id[]" value="{{ $result->id }}">
</td>
<td>
<input type="number" name="quantity[]" min="0" class="form-control col-sm-12 compulsory">
</td>
</tr>
@endforeach
@else
<td colspan="3"><span style="color: red;">{{ __('labs.search_records') }}</span></td>
@endif
</tbody>
</table>
</div>
@if(count($results) > 0)
{{ Form::button(__('labs.complete_request'),['type'=>'submit','name'=>'complete_request','value'=>'1','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::close() }}
@endif
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel">
<div class="panel-heading">{{ __('dentals.previous_dental_requisitions') }}</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>{{ __('labs.requisition') }} #</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.date_requested') }}</th>
<th>{{ __('labs.status') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@if(count($previous_requisitions_results) > 0)
@foreach($previous_requisitions_results as $result)
<tr>
<td># {{ sprintf('%04u', $result->id) }}</td>
<td>
<?php
$drug_id_explode = explode(",", $result->drug_id);
?>
{{ count($drug_id_explode) }} {{ __('labs.items') }}
</td>
<td>
{{ streamline_date($result->created_at) }}
</td>
<td>
@if($result->issue_status == 1)
<label class="label label-success">{{ __('labs.approved') }}</label>
@else
<label class="label label-danger">{{ __('labs.not_approved') }}</label>
@endif
</td>
<td>
<form name="bill_form" action="{{ url('previous_issued_items_details') }}" method="post">
{{ csrf_field() }}
<input type="hidden" name="requisition_id" value="{{ $result->id }}"/>
<input type="hidden" name="item_type" value="4">
<button type="submit" name="add_bill_button" class="btn btn-sm btn-rounded btn-info">
<i class="fa fa-info-circle"></i>
<span style="margin-left: 10px;">{{ __('labs.details') }}</span>
</button>
</form>
</td>
</tr>
@endforeach
@else
<td colspan="7"><span style="color: red;">{{ __('labs.search_records') }}</span></td>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ __('labs.requisition') }} #</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.date_requested') }}</th>
<th>{{ __('labs.status') }}</th>
<th></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/js/mask.js') }}"></script>
<!-- data time piker dependency -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<!-- -->
<script>
$('.labs_ids').select2({
placeholder: "Select"
});
var substringMatcher = function (strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(strs, function (i, str) {
if (substrRegex.test(str)) {
matches.push(str);
}
});
cb(matches);
};
};
$('#datepicker-autoclose1,#datepicker-autoclose2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
setDate: new Date(),
readOnly: true
});
$('.table').DataTable({
"pageLength": 10,
order: [],
});
</script>
@endpush
@@ -0,0 +1,475 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet"
type="text/css" />
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet"
type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.dental_usage') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('dentals.home') }}</a></li>
<li class="active"><i class="fa fa-bank"></i> {{ __('dentals.dental_usage') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
@include('flash::message')
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">{{ __('dentals.previous_dentals_usage') }}</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.cost') }}</th>
<th>{{ __('labs.date') }}</th>
<th>{{ __('labs.recorded_by') }}</th>
</tr>
</thead>
<tbody>
@if (!empty($dental_usages))
@php $counter = 1; @endphp
@foreach ($dental_usages as $result)
<tr>
<td>
{{ $counter }}.
</td>
<td>
{{ get_name($result->dental_id, 'id', 'name', 'dentals') }}
</td>
<td>
{{ $result->usage_quantity }}
</td>
<td>
{{ ugandan_shillings($result->usage_quantity_cost) }}
</td>
<td>
{{ streamline_date($result->created_at) }}
</td>
<td>
{{ get_full_name($result->created_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
</tr>
@php $counter++; @endphp
@endforeach
@else
<td colspan="6"><span style="color: red;">Please search for records</span></td>
@endif
</tbody>
<tfoot>
<tr>
<th>#</th>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.cost') }}</th>
<th>{{ __('labs.date') }}</th>
<th>{{ __('labs.recorded_by') }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="col-md-12">
@include('flash::message')
<div class="panel">
<div class="panel-body">
{{ Form::open(['route' => 'dentals.store_dental_usage', 'data-toggle' => 'validator', 'method' => 'POST']) }}
<div class="row">
<div class="col-md-12">
<div class="pull-left">
<a href="javascript:void(0)" class="text-center db">
@php $hospital_information = \Streamline\Models\HospitalInformation::first(); @endphp
<img src="{{ asset($hospital_information->logo) }}"
style="max-height: 160px; margin: auto; max-width: 260px;"
alt="Home" /><br />
</a>
<address>
<h3> &nbsp;<b class="text-danger">{{ $hospital_information->name }}</b></h3>
<p class="text-muted m-l-5">{{ $hospital_information->phone_number }},
{{ $hospital_information->email }},
<br />
{{ get_name($hospital_information->sub_county, 'id', 'name', 'subcounties') }},
{{ get_name($hospital_information->district, 'id', 'name', 'districts') }},
<br /> {{ $hospital_information->country }}.
</p>
</address>
</div>
<div class="pull-right text-right">
<address>
<p class="m-t-30"><b>{{ __('labs.date') }} : </b> <i
class="fa fa-calendar"></i>
{{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
</address>
<div class="form-group">
{{ Form::label('dates', __('labs.enter_dates')) }}
<select class="form-control compulsory" name="dates" id="dates" required>
<option value="">-{{ __('labs.select') }}-</option>
<option value="today">{{ __('labs.today') }}</option>
<option value="custom_date_range">{{ __('labs.date_range') }}</option>
</select>
</div>
<div id="sDate" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('labs.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class' => 'form-control required compulsory', 'readonly', 'id' => 'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('labs.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class' => 'form-control required compulsory', 'readonly', 'id' => 'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-12">
<h3><b>{{ __('dentals.dental_usage') }}</b></h3>
</div>
</div>
<br />
@php
$options = "<option value=''>--" . __('labs.select') . '--</option>';
foreach ($dentals as $item) {
$options .= "<option value='$item->id'>$item->name</option>";
}
@endphp
<div class="input_fields_wrap">
<div class="row">
<div class="span1"></div>
<div class="col-3">
<div class=" control-group">
<label class="control-label" for="item">{{ __('dentals.name') }} :</label>
<div class="form-group">
<select name='labItem[]' id='lab-item_0'
class="form-control calculate select">
<option>- {{ __('labs.select') }} -</option>
@foreach ($dentals as $item)
<option style='color: orange;' value='{{ $item->id }}'>
{{ $item->name }}</option>
@endforeach
</select>
</div>
</div>
</div><!-- Item -->
@php
$options = "<option value=''>- " . __('labs.select') . ' -</option>';
foreach ($dentals as $item) {
$options .= "<option value='$item->id'>$item->name</option>";
}
@endphp
<div class='col-2'>
<div class="form-group">
<label class='control-label'
class=''>{{ __('labs.available_quantity') }}</label>
<div class=''>
<input type='text' name='availableQty[]' id ='available-qty_0'
class='form-control compulsory' readonly>
</div>
</div>
</div>
<div class="col-2">
<div class="form-group">
<label class="control-label">{{ __('labs.quantity_required') }}</label>
<input type='text' name='requiredQty[]' id ='required-qty_0'
class='form-control compulsory'>
</div>
</div>
<div class='col-2'>
<div class="form-group">
<label class='control-label' class=''>{{ __('labs.unit_cost') }}</label>
<input type='text' name='unitCost[]' id ='cost_0' class='form-control'
readonly>
</div>
</div>
<div class='col-2'>
<div class="form-group">
<label class='control-label'
class=''>{{ __('labs.total_cost') }}</label>
<input type='text' name='totalCost[]' id ='total-cost_0'
class='form-control' readonly>
</div>
</div>
{{-- <div class="col-1">
<div class="form-group text-right" style="margin-top: 30px; margin-left: 3px;">
<a class="label label-success add_item" style="color: white"><i class="fa fa-plus"></i> {{ __('labs.add_item') }}</a>
</div>
</div> --}}
</div>
</div>
<div class="row">
<div class='col-3'>
<button type="submit" id="add_item" style="display: none"
class ="btn btn-info btn-rounded float-right add_item"><i class="fa fa-plus"></i>
{{ __('labs.add_item') }}</button>
</div>
<div class='col-6'></div>
<div class='col-3'>
<button type="submit" id="submit_usage" style="display: none"
class ="btn btn-success btn-rounded float-right">{{ __('labs.submit_usage') }}</button>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel">
<div class="panel-heading">{{ __('dentals.dental_stock') }}</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.store_stock') }}</th>
<th>{{ __('dentals.dental_stock') }}</th>
</tr>
</thead>
<tbody>
@foreach ($dentals as $item)
<tr>
<td>{{ $item->name }}</td>
<td>{{ $item->store_stock }}</td>
<td>{{ $item->pharmacy_stock }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.store_stock') }}</th>
<th>{{ __('dentals.dental_stock') }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript"
src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$(document).ready(function() {
$(".input_fields_wrap").on('change', "select,input", function() {
// var i = parseInt(this.id.replace("item_", ""), 10);
var i = parseInt(this.id.substr(this.id.indexOf("_") + 1));
var lab_item_select = $("#lab-item_" + i);
var lab_item = $("#lab-item_" + i).val();
var available_qty = $("#available-qty_" + i);
var cost = $('#cost_' + i);
var total_cost = $('#total-cost_' + i);
if (lab_item === "") {
alert("<?php echo __('labs.select_lab_item'); ?>");
return false;
}
$.ajax({
method: 'POST',
url: '{{ route('dentals.get_dental_quantity') }}',
data: {
'id': lab_item,
_token: '{{ csrf_token() }}',
},
success: function(response) {
available_qty.val(response['pharmacy_stock']);
cost.val(response['non_insured_price']);
var required_qty = $('#required-qty_' + i);
if (response['pharmacy_stock'] >= required_qty.val()) {
$("[id^='cost_']").each(function() {
total = Number($(this).val()) * required_qty.val();
});
total_cost.val(total);
if (total > 0) {
$('#submit_usage').show();
$('#add_item').show();
}
} else {
alert('<?php echo __('labs.amount_not_available'); ?>');
required_qty.val(0);
$('#submit_usage').hide();
$('#add_item').hide();
}
},
error: function(error) {
console.log(error);
}
});
.9
});
})
var max_fields = 20; //maximum input boxes allowed
var wrapper = $(".input_fields_wrap"); //Fields wrapper
var add_button = $(".add_item"); //Add button ID
var x = 1; //initlal text box count
$(add_button).click(function(e) { //on add input button click
e.preventDefault();
if (x < max_fields) { //max input box allowed
x++; //text box increment
$(wrapper).append("\
<div class='row'>\n\
<div class='span1'></div>\n\
<div class='col-3'>\n\
<div class='form-group'>" +
"<div class='controls'>\n\
<select name='labItem[]' id='lab-item_" + x + "' class='form-control compulsory'>" +
"<?php echo $options; ?>" +
"</select>\n\
</div>\n\
</div>\n\
</div>\n\
<div class='col-2'>\n\
<div>\n\
<div class='form-group'>" +
"<input type='number' name='availableQty[]' id ='available-qty_" + x + "' class='form-control compulsory' readonly>\n\
</div>\n\
</div>\n\
</div>\n\
<div class='col-2'>\n\
<div class='form-group'>" +
"<div class='controls'>\n\
<input type='number' name='requiredQty[]' id='required-qty_" + x +
"' class='form-control compulsory'>" +
"\n\
</div>\n\
</div>\n\
</div>\n\
<div class='col-2'>\n\
<div>\n\
<div class='form-group'>\n\
<input type='text' name='unitCost[]' id='cost_" + x + "' class='form-control' readonly>\n\
</div>\n\
</div>\n\
</div>\n\
\<div class='col-2'>\n\
<div>\n\
<div class='form-group'>\n\
<input type='text' name='totalCost[]' id='total-cost_" + x + "' class='form-control' readonly>\n\
</div>\n\
</div>\n\
</div>\n\
\ <div class='col-1'>\n\
<div class=''>\n\
<div class='form-group text-right'>\n\
&nbsp;<a href='#' class='remove_field btn btn-sm btn-rounded btn-danger' style='margin-top:-15px;' title='Delete item'><i class='fa fa-trash'></i></a>\n\
</div>\n\
</div>\n\
</div>\n\
</div>\n\
</div>\n\
</div>\n\
");
$('#lab-item_' + x).select2(); //add input box
}
});
$(wrapper).on("click", ".remove_field", function(e) { //user click on remove text
e.preventDefault();
$(this).parent('div').parent('div').parent('div').parent('div').remove();
var final_total = 0;
var total_field = $("#total_amount");
$("[id^='amount_']").each(function() {
final_total += Number($(this).val());
});
total_field.val(final_total);
x--;
});
$('.select').select2({
placeholder: "-- <?php echo __('labs.select'); ?> --"
});
$('.table').DataTable({
"pageLength": 10,
order: [],
});
$('#dates').change(function(e) {
if ($(this).val() === "custom_date_range") {
$("#sDate").show();
$("#eDate").show();
} else {
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
@endpush
@@ -0,0 +1,237 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.dental_usages_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('dentals.home') }}</a></li>
<li class="active"><i class="fa fa-bank"></i> {{ __('dentals.dental_usages_report') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-2">
{{ Form::open(['route' => 'dentals.usage_report','data-toggle'=>'validator']) }}
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('hmis_reports.date')) }}
{{ Form::select('search_by', ['0'=>__('hmis_reports.last_24_hours'),'1'=>__('hmis_reports.custom_date'),'2'=>__('hmis_reports.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-4" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('hmis_reports.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('hmis_reports.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-2">
{{ Form::label('dentals',__('dentals.dental')) }}
{{ Form::select('dental_id', $dental_options,'',['class' => 'form-control', 'id' => 'dental_id']) }}
</div>
<div class="col-sm-2"><br>
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-heading">{{ __('dentals.dental_usages_report') }} {!! $search_string ?? $search_string !!}</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.cost') }}</th>
<th>{{ __('labs.date') }}</th>
<th>{{ __('labs.recorded_by') }}</th>
</tr>
</thead>
<tbody>
@if(count($dental_usages))
@php $counter = 1; @endphp
@foreach($dental_usages as $result)
<tr>
<td>
{{ $counter }}.
</td>
<td>
{{ get_name($result->dental_id, 'id', 'name', 'dentals') }}
</td>
<td>
{{ $result->usage_quantity }}
</td>
<td>
{{ ugandan_shillings($result->usage_quantity_cost) }}
</td>
<td>
{{ streamline_date($result->created_at) }}
</td>
<td>
{{ get_full_name($result->created_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
</tbody>
<tfoot>
<tr>
<th>#</th>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.cost') }}</th>
<th>{{ __('labs.date') }}</th>
<th>{{ __('labs.recorded_by') }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel">
<div class="panel-heading">{{ __('dentals.dental_stock') }}</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.store_stock') }}</th>
<th>{{ __('dentals.dental_stock') }}</th>
</tr>
</thead>
<tbody>
@foreach($dentals as $item)
<tr>
<td>{{ $item->name }}</td>
<td>{{ $item->store_stock }}</td>
<td>{{ $item->pharmacy_stock }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th>{{ __('dentals.name') }}</th>
<th>{{ __('labs.store_stock') }}</th>
<th>{{ __('dentals.dental_stock') }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.select').select2({
placeholder: "-- <?php echo __('labs.select'); ?> --"
});
$('#dental_id').select2({
placeholder: "-- All Dentals --"
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 10,
order: [],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
});
</script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,65 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.edit_dental') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('dentals.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('dentals.clinical_data_home') }}</a></li>
<li><a href="{{ route('dentals.index') }}">{{ __('dentals.dentals') }}</a></li>
<li class="active">{{ __('dentals.edit') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($dental, ['method' => 'PUT', 'route' => ['dentals.update',$dental] , 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('name', __('dentals.dental')) }}
{{ Form::text('name', $dental->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('payables_account_id', 'Payables Accounts') }}
{{ Form::select('payables_account_id', $payables_accounts, $dental->payables_account_id, ['class' => 'form-control', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('expenses_account_id', 'Expenses Accounts') }}
{{ Form::select('expenses_account_id', $expense_accounts, $dental->expenses_account_id, ['class' => 'form-control', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
{{ Form::button(__('dentals.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('dentals.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
@endpush
@@ -0,0 +1,98 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.edit_all_dentals') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('dentals.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('dentals.clinical_data_home') }}</a></li>
<li><a href="{{ route('dentals.index') }}">{{ __('dentals.dentals') }}</a></li>
<li class="active">{{ __('dentals.edit_all_dentals') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($dentals, ['method' => 'ANY', 'route' => ['dentals.update_all'], 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-sm-6">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th hidden>{{ __('dentals.id') }}</th>
<th>{{ __('dentals.dental') }}</th>
</tr>
</thead>
<tfoot>
<tr>
<th hidden>{{ __('dentals.id') }}</th>
<th>{{ __('dentals.dental') }}</th>
</tr>
</tfoot>
<tbody>
@foreach($dentals as $dental)
<tr>
<td hidden>{{ Form::text('id[]', $dental->id, ['class' => 'form-control']) }}</td>
<td>
<p style="display: none">{{ $dental->name }}</p>
{{ Form::text('name[]', $dental->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
{{ Form::button(__('dentals.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('dentals.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@include('investigations::dentals.menu')
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,84 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.activate_dentals') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('dentals.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('dentals.clinical_data_home') }}</a></li>
<li><a href="{{ route('dentals.index') }}">{{ __('dentals.dentals') }}</a></li>
<li class="active">{{ __('dentals.inactive') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<p class="text-muted m-b-30">{{ __('dentals.export_data_to_copy_csv_pdf_print') }}</p>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-hover table-striped">
<thead>
<tr>
<th>{{ __('dentals.dental') }}</th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th>{{ __('dentals.dental') }}</th>
<th></th>
</tr>
</tfoot>
<tbody>
@foreach($dentals as $dental)
<tr>
<td>{{ $dental->name }}</td>
<td>
{{ Form::model($dental->id ,['method' => 'POST', 'route' => ['dentals.activate', $dental->id]]) }}
<button type="submit" class="btn btn-rounded btn-warning" onclick="return confirm('<?php echo __('dentals.are_you_sure') ?>')"><i class="fa fa-check"></i> {{ __('dentals.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,132 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('dentals.dentals') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('dentals.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('dentals.clinical_data_home') }}</a></li>
<li><a href="{{ route('dentals.index') }}">{{ __('dentals.dentals') }}</a></li>
<li class="active">{{ __('dentals.view') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
@include('flash::message')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped table-hover color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('dentals.dental') }}</th>
<th>{{ __('dentals.expense_account') }}</th>
<th>{{ __('dentals.payables_account') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($dentals as $dental)
<tr>
<td>{{ $dental->name }}</td>
<td>{{ get_name($dental->expenses_account_id, "id", "name", "chart_of_accounts") }}</td>
<td>{{ get_name($dental->payables_account_id, "id", "name", "chart_of_accounts") }}</td>
<td>
<a href="/dentals/{{ $dental->id }}/edit/" class="btn btn-rounded btn-warning"><i class="fa fa-pencil"></i> {{ __('dentals.edit') }}</a>
</td>
<td>
{{ Form::model($dental->id ,['method' => 'DELETE', 'route' => ['dentals.destroy', $dental->id]]) }}
<button type="submit" class="btn btn-rounded btn-danger" onclick="return confirm('<?php echo __('dentals.are_you_sure') ?>')"><i class="fa fa-trash"></i> {{ __('dentals.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $dentals->links() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
'copy',
{
extend: 'csv',
message: 'LIST OF DENTALS'
},
{
extend: 'excel',
message: 'LIST OF DENTALS',
exportOptions: {
columns: [0, 1]
},
sheetName: 'LIST OF DENTALS ON STREAMLINE'
},
{
extend: 'pdf',
message: 'LIST OF DENTALS',
orientation: 'landscape',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1]
},
customize: function(doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{
extend: 'print',
message: 'LIST OF DENTALS',
exportOptions: {
columns: [0, 1]
},
customize: function(win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
</script>
@endpush
@@ -0,0 +1,25 @@
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
@if (Route::current()->getName() != 'dentals.create')
<a href="{{ route('dentals.create') }}" class="nav-item btn btn-success ti-plus"> {{ __('dentals.add_new_dental') }}</a>
@endif
@if (Route::current()->getName() != 'dentals.edit.all')
<a href="{{ route('dentals.edit.all') }}" class="nav-item btn btn-warning ti-pencil"> {{ __('dentals.edit_all_dentals') }}</a>
@endif
@if (Route::current()->getName() != 'dentals.index')
<a href="{{ route('dentals.index') }}" class="nav-item btn btn-info ti-eye"> {{ __('dentals.view_dentals') }}</a>
@endif
@if(Auth::user()->can('dental-usage-report') && Route::current()->getName() != 'dentals.usage_report')
<a href="{{ route('dentals.usage_report') }}" class="nav-item btn btn-info ti-bar-chart"> {{ __('dentals.dental_usage_report') }}</a>
@endif
@if( Auth::user()->can('dental-requisitions') && Route::current()->getName() != 'dentals.requisitions')
<a href="{{ route('dentals.requisitions') }}" class="nav-item btn btn-info ti-eye"> {{ __('dentals.dental_requisitions') }}</a>
@endif
@if( Auth::user()->can('dental-usage-listing') && Route::current()->getName() != 'dentals.usage_listing')
<a href="{{ route('dentals.usage_listing') }}" class="nav-item btn btn-info ti-eye"> {{ __('dentals.dental_usage_listing') }}</a>
@endif
@if (Route::current()->getName() != 'dentals.inactive')
<a href="{{ route('dentals.inactive') }}" class="nav-item btn btn-danger ti-trash"> {{ __('dentals.view_inactive_dentals') }}</a>
@endif
</div>
</div>
@@ -0,0 +1,58 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_categories.add_investigation_category') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigation_categories.dashboard') }}</a></li>
<li><a href="/investigation_categories/index">{{ __('investigation_categories.investigation_categories') }}</a></li>
<li class="active">{{ __('investigation_categories.create') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_categories.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::open(['route' => 'investigation_categories.store', 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('investigation_categories.investigation_category_name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('super_category_id', __('investigation_categories.super_category_name')) }}
{{ Form::select('super_category_id', $super_categories, '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
{{ Form::button(__('investigation_categories.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigation_categories.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
@endpush
@@ -0,0 +1,58 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_categories.edit_investigation_category') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigation_categories.dashboard') }}</a></li>
<li><a href="/investigation_categories/index">{{ __('investigation_categories.investigation_categories') }}</a></li>
<li class="active">{{ __('investigation_categories.edit') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_categories.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($investigation_category, ['method' => 'PUT', 'route' => ['investigation_categories.update',$investigation_category], 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('investigation_categories.investigation_category_name')) }}
{{ Form::text('name', $investigation_category->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('super_category_id', __('investigation_categories.super_category_name')) }}
{{ Form::select('super_category_id', $super_categories, $investigation_category->super_category_id, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
{{ Form::button(__('investigation_categories.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigation_categories.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
@endpush
@@ -0,0 +1,89 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_categories.activate_investigation_categories') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigation_categories.dashboard') }}</a></li>
<li><a href="/investigation_categories/index">{{ __('investigation_categories.investigation_categories') }}</a></li>
<li class="active">{{ __('investigation_categories.activate') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_categories.menu')
</div>
</div>
@include('flash::message')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('investigation_categories.investigation_category_name') }}</th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th>{{ __('investigation_categories.investigation_category_name') }}</th>
<th></th>
</tr>
</tfoot>
<tbody>
@foreach($investigation_categories as $investigation_category)
<tr>
<td>{{ $investigation_category->name }}</td>
<td>
{{ Form::model($investigation_category->id ,['method' => 'POST', 'route' => ['investigation_categories.activate', $investigation_category->id]]) }}
<button type="submit" class="btn btn-warning" onclick="return confirm('<?php echo __('investigation_categories.are_you_sure');?>')"><i class="fa fa-check"></i> {{ __('investigation_categories.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,97 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_categories.investigation_categories') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigation_categories.dashboard') }}</a></li>
<li><a href="/investigation_categories/index">{{ __('investigation_categories.investigation_categories') }}</a></li>
<li class="active">{{ __('investigation_categories.view') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_categories.menu')
</div>
</div>
@include('flash::message')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('investigation_categories.investigation_category_name') }}</th>
<th>{{ __('investigation_categories.super_category_name') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th>{{ __('investigation_categories.investigation_category_name') }}</th>
<th>{{ __('investigation_categories.super_category_name') }}</th>
<th></th>
<th></th>
</tr>
</tfoot>
<tbody>
@foreach($investigation_categories as $investigation_category)
<tr>
<td>{{ $investigation_category->name }}</td>
<td>{{ $super_categories[$investigation_category->super_category_id] ?? '' }}</td>
<td>
<a href="/investigation_categories/{{ $investigation_category->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('investigation_categories.edit') }}</a>
</td>
<td>
{{ Form::model($investigation_category->id ,['method' => 'DELETE', 'route' => ['investigation_categories.destroy', $investigation_category->id]]) }}
<button type="submit" class="btn btn-danger" onclick="return confirm('<?php echo __('investigation_categories.are_you_sure');?>')"><i class="fa fa-trash"></i> {{ __('investigation_categories.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="{{ route('investigation_categories.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('investigation_categories.add_investigation_category') }}</a>
<a href="{{ route('investigation_categories.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('investigation_categories.view_investigation_categories') }}</a>
<a href="{{ route('investigation_categories.inactive') }}" class="nav-item btn btn-default ti-pencil"> {{ __('investigation_categories.activate_investigation_categories') }}</a>
</div>
</div>
@@ -0,0 +1,120 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.new_result_template') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li><a href="/result_templates/">{{ __('investigation_result_templates.investigation_result_templates') }}</a></li>
<li class="active">{{ __('investigations.register') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_result_templates.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
{{ Form::open(['route' => 'result_templates.store','data-toggle'=>'validator']) }}
<div class="form-group">
{{ Form::label('investigation_id', __('investigation_result_templates.investigation')) }}
{{ Form::select('investigation_id', $investigations, '', ['class' => 'form-control select', 'onchange' => 'check_for_specialsed_variables(this.value)', 'id' => 'investigation_id']) }}
</div>
<div class="form-group" id="specialised_variables_div" style="display: none">
{{ Form::hidden('is_specialised_variable', 0, ['id' => 'is_specialised_variable']) }}
<div id="specialised_variables"></div>
<label class="label label-info" id="add_variable">{{ __('investigation_result_templates.add_variable') }}</label><br><br>
</div>
<div class="form-group" id="template_div">
{{ Form::label('template', __('investigation_result_templates.template')) }}
{{ Form::textarea('template', '', ['class' => 'form-control', 'rows'=>'7']) }}
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
var variable_counter = 0;
function check_for_specialsed_variables(id) {
if (id != 0 && id != '') {
$.ajax({
method: 'GET',
url: '/result_templates/check_investigation_speciality_type/' + id + '/' +variable_counter,
success: function(response){
if (response !== "0") {
$('#specialised_variables_div').show();
$('#template_div').hide();
$('#specialised_variables').html(response);
$('#is_specialised_variable').val(1);
$("#" + variable_counter).select2({
placeholder: "-- select --"
});
variable_counter++;
} else {
$('#template_div').show();
$('#specialised_variables_div').hide();
$('#specialised_variables').html("");
$('#is_specialised_variable').val(0);
}
},
error: function () {
//
}
});
}
}
$('#add_variable').click(function () {
let id = $('#investigation_id').val();
$.ajax({
method: 'GET',
url: '/result_templates/check_investigation_speciality_type/' + id + '/' +variable_counter,
success: function(response){
$('#specialised_variables').append(response);
$("#" + variable_counter).select2({
placeholder: "-- select --"
});
variable_counter++;
},
error: function () {
//
}
});
});
$('.select').select2();
</script>
@endpush
@@ -0,0 +1,69 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.edit_result_template') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li><a href="/result_templates/">{{ __('investigation_result_templates.investigation_result_templates') }}</a></li>
<li class="active">{{ __('investigations.register') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_result_templates.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
{{ Form::model($result_template, ['method' => 'PUT', 'route' => ['result_templates.update',$result_template]]) }}
<div class="form-group">
{{ Form::label('investigation_id', __('investigation_result_templates.investigation')) }}
@if($result_template->investigation_id == 0)
{{ Form::text('investigation_id', __('investigation_result_templates.all_investigations'), ['class' => 'form-control', 'readonly']) }}
@elseif($result_template->is_specialised_variable == 1)
{{ Form::text('investigation_id', get_name($result_template->investigation_id, 'id', 'name', 'investigation_specialised_variables'), ['class' => 'form-control', 'readonly']) }}
@else
{{ Form::text('investigation_id', get_name($result_template->investigation_id, 'id', 'name', 'investigations'), ['class' => 'form-control', 'readonly']) }}
@endif
</div>
<div class="form-group">
{{ Form::label('template', __('investigation_result_templates.template')) }}
{{ Form::textarea('template', $result_template->template, ['class' => 'form-control', 'rows'=>'7']) }}
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script></script>
@endpush
@@ -0,0 +1,81 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.inactive_result_templates') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li><a href="/result_templates/">{{ __('investigation_result_templates.investigation_result_templates') }}</a></li>
<li class="active">{{ __('investigations.inactive') }}</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_result_templates.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>{{ __('investigation_result_templates.template') }}</th>
<th>{{ __('investigation_result_templates.investigation') }}</th>
<th>{{ __('investigations.action') }}</th>
</tr>
</thead>
<tbody>
@foreach($result_templates as $result_template)
<tr>
<td>{{ $result_template->template }}</td>
<td>
@if($result_template->investigation_id == 0)
{{ __('investigation_result_templates.all_investigations') }}
@elseif($result_template->is_specialised_variable == 1)
{{ get_name($result_template->investigation_id, 'id', 'name', 'investigation_specialised_variables') }}
({{ get_name(get_name($result_template->investigation_id, 'id', 'investigation_id', 'investigation_specialised_variables'), 'id', 'name', 'investigations') }})
@else
{{ get_name($result_template->investigation_id, 'id', 'name', 'investigations') }}
@endif
</td>
<td>
{{ Form::model($result_template->id ,['method' => 'POST', 'route' => ['result_templates.activate', $result_template->id]]) }}
<button type="submit" class="btn btn-rounded btn-warning" onclick="return confirm('<?php echo __('investigations.are_you_sure')?>')"><i class="fa fa-check"></i> {{ __('investigations.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('.table').DataTable();
</script>
@endpush
@@ -0,0 +1,84 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.view_result_templates') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li class="active">{{ __('investigation_result_templates.investigation_result_templates') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_result_templates.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>{{ __('investigation_result_templates.template') }}</th>
<th>{{ __('investigation_result_templates.investigation') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($result_templates as $item)
<tr>
<td>{{ $item->template }}</td>
<td>
@if($item->investigation_id == 0)
{{ __('investigation_result_templates.all_investigations') }}
@elseif($item->is_specialised_variable == 1)
{{ get_name($item->investigation_id, 'id', 'name', 'investigation_specialised_variables') }}
({{ get_name(get_name($item->investigation_id, 'id', 'investigation_id', 'investigation_specialised_variables'), 'id', 'name', 'investigations') }})
@else
{{ get_name($item->investigation_id, 'id', 'name', 'investigations') }}
@endif
</td>
<td>
<a href="{{ route('result_templates.edit', $item->id) }}" class="btn btn-warning btn-rounded"><i class="fa fa-pencil"></i> {{ __('investigations.edit') }}</a>
</td>
<td>
{{ Form::model($item->id ,['method' => 'DELETE', 'route' => ['result_templates.destroy', $item->id]]) }}
<button type="submit" class="btn btn-danger btn-rounded" onclick="return confirm('<?php echo __('investigations.are_you_sure')?>')"><i class="fa fa-trash"></i> {{ __('investigations.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('.table').DataTable();
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<a href="{{ route('result_templates.create') }}" class="nav-item btn btn-success"><i class="fa fa-plus"></i> <span style="margin-left: 10px;">{{ __('investigation_result_templates.add_result_templates') }}</span></a>
<a href="{{ route('result_templates.index') }}" class="nav-item btn btn-info"><i class="fa fa-eye"></i> <span style="margin-left: 10px;">{{ __('investigation_result_templates.view_result_templates') }}</span></a>
<a href="{{ route('result_templates.inactive') }}" class="nav-item btn btn-danger"><i class="fa fa-trash"></i> <span style="margin-left: 10px;">{{ __('investigation_result_templates.inactive_result_templates') }}</span></a>
</div>
</div>
@@ -0,0 +1,131 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.new_investigation_variable') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li><a href="/investigation_specialised_variables/">{{ __('investigations.investigation_variables') }}</a></li>
<li class="active">{{ __('investigations.register') }}</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_specialised_variables.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
{{ Form::open(['route' => 'investigation_variables.store','data-toggle'=>'validator']) }}
<div class="form-group">
{{ Form::label('name', __('investigations.variable_name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>{{ __('investigations.investigation') }}</label>
<select class="form-control select" name="investigation" required>
<option> -{{ __('investigations.select') }}- </option>
@foreach($investigations as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label>{{ __('investigations.units') }}</label>
<select class="form-control select" name="unit" required>
<option> -select- </option>
@foreach($units as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
</div>
<div class="form-group">
{{ Form::label('range_type', __('investigations.is_the_range_normal')) }}
{{ Form::select('range_type', ['' => '--select--',1 => 'Dynamic', 2 => 'Constant'], '', ['class' => 'form-control', 'required']) }}
</div>
<div class="form-group" style="display: none;" id="constant_div">
{{ Form::label('normal_ranges', __('investigations.normal_range')) }}
{{ Form::text('normal_ranges', '', ['class' => 'form-control']) }}
</div>
<div style="display: none;" id="dynamic_div">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="row">
<div class="col-md-6">
<h5>{{ __('investigations.male') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_male[]', '', ['class' => 'form-control']) }}
{{ Form::hidden('age_id[]', $age->id) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h5>{{ __('investigations.female') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_female[]', '', ['class' => 'form-control']) }}
<br>
@endforeach
</div>
</div>
<hr>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$('.select').select2({
placeholder: " -select- "
});
$('#range_type').change(function (e) {
e.preventDefault();
if(this.value == 2){
$('#constant_div').show();
$('#dynamic_div').hide();
}else{
$('#constant_div').hide();
$('#dynamic_div').show();
}
});
</script>
@endpush
@@ -0,0 +1,120 @@
@extends('layouts.main')
@section('title', '| Edit Drug Route')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.edit_investigation_specialised_variables') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li><a href="/investigation_variables/">{{ __('investigations.investigation_specialised_variables') }}</a></li>
<li class="active">{{ __('investigations.edit') }}</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_specialised_variables.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
{{ Form::model($investigation_specialised_variable, ['method' => 'PUT', 'route' => ['investigation_variables.update',$investigation_specialised_variable]]) }}
<div class="form-group">
{{ Form::label('name', __('investigations.variable_name')) }}
{{ Form::text('name', $investigation_specialised_variable->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
<label>{{ __('investigations.investigation') }}</label>
<select class="form-control" name="investigation">
<option value="{{ get_name($investigation_specialised_variable->investigation_id, 'id', 'id', 'investigations') }}">{{ get_name($investigation_specialised_variable->investigation_id, 'id', 'name', 'investigations') }}</option>
<option> -{{ __('investigations.select') }}- </option>
@foreach($investigations as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label>{{ __('investigations.units') }}</label>
<select class="form-control" name="unit">
<option> -{{ __('investigations.select') }}- </option>
@foreach($units as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
</div>
<div class="form-group">
{{ Form::label('range_type', __('investigations.is_the_range_normal')) }}
{{ Form::select('range_type', ['' => '--select--',1 => 'Dynamic', 2 => 'Constant'], $investigation_specialised_variable->range_type, ['class' => 'form-control']) }}
</div>
<div class="form-group" @if($investigation_specialised_variable->range_type == 1) style="display: none;" @endif id="constant_div">
{{ Form::label('normal_ranges', __('investigations.normal_range')) }}
{{ Form::text('normal_ranges', $investigation_specialised_variable->normal_ranges, ['class' => 'form-control']) }}
</div>
<div @if($investigation_specialised_variable->range_type != 1) style="display: none;" @endif id="dynamic_div">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="row">
<div class="col-md-6">
<h5>{{ __('investigations.male') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_male[]', get_dynamic_normal_range_specialized($investigation_specialised_variable->id, $age->id, 1), ['class' => 'form-control']) }}
{{ Form::hidden('age_id[]', $age->id) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h5>{{ __('investigations.female') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_female[]', get_dynamic_normal_range_specialized($investigation_specialised_variable->id, $age->id, 2), ['class' => 'form-control']) }}
<br>
@endforeach
</div>
</div>
<hr>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
@endsection
@push('scripts')
<script>
$('#range_type').change(function (e) {
e.preventDefault();
if(this.value == 2){
$('#constant_div').show();
$('#dynamic_div').hide();
}else{
$('#constant_div').hide();
$('#dynamic_div').show();
}
});
</script>
@endpush
@@ -0,0 +1,69 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.inactive_specialised_variable') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li><a href="/investigation_variables/">{{ __('investigation_specialised_variables') }}</a></li>
<li class="active">{{ __('investigations.inactive') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_specialised_variables.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>{{ __('investigations.variable_name') }}</th>
<th>{{ __('investigations.action') }}</th>
</tr>
</thead>
<tbody>
@foreach($investigation_variables as $route)
<tr>
<td>{{ $route->name }}</td>
<td>
{{ Form::model($route->id ,['method' => 'POST', 'route' => ['investigation_variables.activate', $route->id]]) }}
<button type="submit" class="btn btn-rounded btn-warning" onclick="return confirm('<?php echo __('investigations.are_you_sure')?>')"><i class="fa fa-check"></i> {{ __('investigations.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('.table').DataTable();
</script>
@endpush
@@ -0,0 +1,147 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.investigation_specialised_variables') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('investigations.clinical_data_home') }}</a></li>
<li class="active">{{ __('investigations.investigation_specialised_variables') }}</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_specialised_variables.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>{{ __('investigations.variable_name') }}</th>
<th>{{ __('investigations.investigation') }}</th>
<th>{{ __('investigations.normal_range') }}</th>
<th>{{ __('investigations.flag') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($investigation_variables as $item)
<tr>
<th>{{ $item->name }}</th>
<th>{{ get_name($item->investigation_id, 'id', 'name', 'investigations') }}</th>
<th>
@if($item->range_type == 1)
<a href="#" onclick="view_normal_ranges(<?php echo $item->id ?>)">{{ __('investigations.view_reference_ranges') }}</a>
@else
{{ $item->normal_ranges }}
@endif
</th>
<th>{{ $item->flags }}</th>
<td>
<a href="/investigation_variables/{{ $item->id }}/edit/" class="btn btn-warning btn-rounded"><i class="fa fa-pencil"></i> {{ __('investigations.edit') }}</a>
</td>
<td>
{{ Form::model($item->id ,['method' => 'DELETE', 'route' => ['investigation_variables.destroy', $item->id]]) }}
<button type="submit" class="btn btn-danger btn-rounded" onclick="return confirm('<?php echo __('investigations.are_you_sure')?>')"><i class="fa fa-trash"></i> {{ __('investigations.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<div class="modal" id="modal_categorized_ranges" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="categorized_ranges_title"></b></h4>
</div>
<div class="modal-body">
<div class="row">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="col-md-6">
<h3>{{ __('investigations.male') }}</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_male_' . $age->id]) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h3>{{ __('investigations.female') }}</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_female_' . $age->id]) }}
<br>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('.table').DataTable();
function view_normal_ranges(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_specialised_investigation_normal_ranges/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$('#categorized_ranges_title').text("Investigation Reference Ranges For " + responseArray["name"]);
let male_result = responseArray["male"];
let female_result = responseArray["female"];
for (var key in male_result) {
if (male_result.hasOwnProperty(key)) {
$("#dynamic_range_male_" + key).val(male_result[key]);
}
}
for (var key1 in female_result) {
if (female_result.hasOwnProperty(key1)) {
$("#dynamic_range_female_" + key1).val(female_result[key1]);
}
}
$('#modal_categorized_ranges').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<a href="{{ route('investigation_variables.create') }}" class="nav-item btn btn-success"><i class="fa fa-plus"></i> <span style="margin-left: 10px;">{{ __('investigations.add_investigation_specialised_variable') }}</span></a>
<a href="{{ route('investigation_variables.index') }}" class="nav-item btn btn-info"><i class="fa fa-eye"></i> <span style="margin-left: 10px;">{{ __('investigations.view_investigation_specialised_variables') }}</span></a>
<a href="{{ route('investigation_variables.inactive') }}" class="nav-item btn btn-danger"><i class="fa fa-trash"></i> <span style="margin-left: 10px;">{{ __('investigations.activate_investigation_specialised_variables') }}</span></a>
</div>
</div>
@@ -0,0 +1,95 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.add_test_code') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="investigation_test_codes">{{ __('investigation_result_templates.test_codes') }}</a></li>
<li class="active">{{ __('investigation_result_templates.create') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'investigation_test_codes.store', 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('investigation_id',__('investigation_result_templates.investigation')) }}
{{ Form::select('investigation_id',$investigations, '',['class' => 'form-control select compulsory', 'required', 'id'=>'investigation_id']) }}
</div>
<div class="form-group">
{{ Form::label('machine_name',__('investigation_result_templates.machine_name')) }}
{{ Form::select('machine_name',$instruments, '',['class' => 'form-control select compulsory', 'required', 'id'=>'machine_name']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="specialised_variables_div" style="display: none">
{{ Form::label('investigation_specialised_variable',__('investigation_result_templates.investigation_specialised_variable')) }}
<div id="specialised_variables"></div>
</div>
{{ Form::hidden('is_specialised_variable', 0, ['id' => 'is_specialised_variable']) }}
<div class="form-group">
{{ Form::label('test_code',__('investigation_result_templates.test_code')) }}
{{ Form::text('test_code','',['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
</div>
{{ Form::button(__('investigation_result_templates.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('investigation_result_templates.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#investigation_id, #machine_name").select2({
placeholder: "-- select --"
});
$("#investigation_id").change(function () {
$.ajax({
method: 'GET',
url: '/investigation_test_codes/check_investigation_speciality_type/' + this.value,
success: function(response){
if (response !== "0") {
$('#specialised_variables_div').show();
$('#specialised_variables').html(response);
$('#is_specialised_variable').val(1);
$("#investigation_specialised_variable").select2({
placeholder: "-- select --"
});
} else {
$('#specialised_variables_div').hide();
$('#specialised_variables').html("");
$('#is_specialised_variable').val(0);
}
},
error: function () {
//
}
});
});
});
</script>
@endpush
@@ -0,0 +1,112 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.edit_test_code') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigation_test_codes/">{{ __('investigation_result_templates.test_codes') }}</a></li>
<li class="active">{{ __('investigation_result_templates.edit') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_test_codes.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($test_code, ['method' => 'PUT', 'route' => ['investigation_test_codes.update',$test_code], 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('investigation_id',__('investigation_result_templates.investigation')) }}
@if($test_code->is_specialised_variable == 0)
{{ Form::select('investigation_id',$investigations, $test_code->investigation_id,['class' => 'form-control select compulsory', 'required', 'id'=>'investigation_id']) }}
@else
{{ Form::select('investigation_id',$investigations, get_name($test_code->investigation_id, 'id', 'investigation_id', 'investigation_specialised_variables'),['class' => 'form-control select compulsory', 'required', 'id'=>'investigation_id']) }}
@endif
</div>
<div class="form-group">
{{ Form::label('machine_name',__('investigation_result_templates.machine_name')) }}
{{ Form::select('machine_name',$instruments, $test_code->machine_name,['class' => 'form-control select compulsory', 'required', 'id'=>'machine_name']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="specialised_variables_div" @if($test_code->is_specialised_variable == 0) style="display: none" @endif>
{{ Form::label('investigation_specialised_variable',__('investigation_result_templates.investigation_specialised_variable')) }}
<div id="specialised_variables">
{{ Form::select('investigation_specialised_variable',$specialised_variables, $test_code->investigation_id,['class' => 'form-control select compulsory', 'id'=>'investigation_specialised_variable']) }}
</div>
</div>
{{ Form::hidden('is_specialised_variable', $test_code->is_specialised_variable, ['id' => 'is_specialised_variable']) }}
<div class="form-group">
{{ Form::label('test_code',__('investigation_result_templates.test_code')) }}
{{ Form::text('test_code',$test_code->test_code,['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
</div>
{{ Form::button(__('investigation_result_templates.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigation_result_templates.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#investigation_id, #machine_name").select2({
placeholder: "-- select --"
});
$("#investigation_id").change(function () {
$.ajax({
method: 'GET',
url: '/investigation_test_codes/check_investigation_speciality_type/' + this.value,
success: function(response){
if (response !== "0") {
$('#specialised_variables_div').show();
$('#specialised_variables').html(response);
$('#is_specialised_variable').val(1);
$("#investigation_specialised_variable").select2({
placeholder: "-- select --"
});
} else {
$('#specialised_variables_div').hide();
$('#specialised_variables').html("");
$('#is_specialised_variable').val(0);
}
},
error: function () {
//
}
});
});
});
</script>
@endpush
@@ -0,0 +1,89 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.activate_test_code') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigation_test_codes/">{{ __('investigation_result_templates.test_codes') }}</a></li>
<li class="active">{{ __('investigation_result_templates.activate') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_test_codes.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('investigation_result_templates.investigation') }}</th>
<th>{{ __('investigation_result_templates.machine_name') }}</th>
<th>{{ __('investigation_result_templates.test_code') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($test_codes as $test_code)
<tr>
<td>
@if($test_code->is_specialised_variable == 1)
{{ $specialised_variables[$test_code->investigation_id] }} ({{ $investigations[get_name($test_code->investigation_id, 'id', 'investigation_id', 'investigation_specialised_variables')] }})
@else
{{ $investigations[$test_code->investigation_id] }}
@endif
</td>
<td>{{ $instruments[$test_code->machine_name] }}</td>
<td>{{ $test_code->test_code }}</td>
<td>
{{ Form::model($test_code->id ,['method' => 'POST', 'route' => ['investigation_test_codes.activate', $test_code->id]]) }}
<button type="submit" class="btn btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-check"></i> {{ __('investigation_result_templates.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,93 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigation_result_templates.investigation_test_codes') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigation_result_templates.test_codes') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::investigation_test_codes.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
@include('flash::message')
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('investigation_result_templates.investigation') }}</th>
<th>{{ __('investigation_result_templates.machine_name') }}</th>
<th>{{ __('investigation_result_templates.test_code') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($test_codes as $test_code)
<tr>
<td>
@if($test_code->is_specialised_variable == 1)
{{ $specialised_variables[$test_code->investigation_id] }} ({{ $investigations[get_name($test_code->investigation_id, 'id', 'investigation_id', 'investigation_specialised_variables')] }})
@else
{{ $investigations[$test_code->investigation_id] }}
@endif
</td>
<td>{{ $instruments[$test_code->machine_name] }}</td>
<td>{{ $test_code->test_code }}</td>
<td>
<a href="/investigation_test_codes/{{ $test_code->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('investigation_result_templates.edit') }}</a>
</td>
<td>
{{ Form::model($test_code->id ,['method' => 'DELETE', 'route' => ['investigation_test_codes.destroy', $test_code->id]]) }}
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('investigation_result_templates.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'pdf', 'print', 'excel'
]
});
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="{{ route('investigation_test_codes.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('investigation_result_templates.add_test_code') }}</a>
<a href="{{ route('investigation_test_codes.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('investigation_result_templates.view_test_codes') }}</a>
<a href="{{ route('investigation_test_codes.inactive') }}" class="nav-item btn btn-default ti-pencil"> {{ __('investigation_result_templates.activate_test_codes') }}</a>
</div>
</div>
@@ -0,0 +1,634 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.alter') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
@php
$episode_id = 0; //initialise the episode_id
@endphp
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
{{ Form::open(['route' => 'investigations.save_altered_results', 'files' => true, 'enctype'=>'multipart/form-data']) }}
{{ Form::hidden('order_id',$id) }}
{{ Form::hidden('patient_id',$patient->id) }}
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.investigation_name') }}</th>
<th @if($result_type != "Lab") style="display: none;" @endif>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.units') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($invs as $result)
<!-- investigation_specialised_results id to update the table if valid -->
{{ Form::hidden('investigation_specialised_results_id[]', $result['result']) }}
@if(in_array($result['id'], $investigations_with_specialised_variables))
{{ Form::hidden('id[]',$result['id']) }}
<!-- placeholder values -->
{{ Form::hidden('value[]',"") }}
{{ Form::hidden('comment[]',"") }}
<tr>
<td colspan="5">
{{ $result['name'] }}
</td>
</tr>
@php
$specialised_variables = \Illuminate\Support\Facades\DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $result['id'])->get();
@endphp
@foreach($specialised_variables as $specialized_variable)
<tr>
<td>
{{ Form::hidden('specialized_id[]', $specialized_variable->id) }}
{{ $specialized_variable->name }}
</td>
<td>
{{ $specialized_variable->normal_ranges }}
</td>
<td>
@if(get_name($specialized_variable->units, 'id', 'name', 'drug_units') != "N/A")
{{ get_name($specialized_variable->units, 'id', 'name', 'drug_units') }}
@endif
</td>
<td>
{{ Form::textArea('specialized_value[]', isset($result['value'][$specialized_variable->id]) ? $result['value'][$specialized_variable->id] : '', ['class' => 'form-control compulsory', 'rows'=>'12', 'id' => 'invx_' . $specialized_variable->id]) }}
@if(does_investigation_have_template($specialized_variable->id, 1))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_specialised_results_template{{ $specialized_variable->id }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
</td>
<td>
{{ Form::textArea('specialized_comment[]', isset($result['comment'][$specialized_variable->id]) ? $result['comment'][$specialized_variable->id] : '', ['class' => 'form-control','rows'=>'12']) }}
</td>
</tr>
@endforeach
<tr><td colspan="5"></td></tr>
@else
<tr>
<td>
{{ $result['name'] }}
{{ Form::hidden('id[]',$result['id']) }}
</td>
<td @if($result_type != "Lab") style="display: none;" @endif>
{{ $result['range'] }}
</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'drug_units') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'drug_units') }}
@endif
</td>
<td>
@if($result['slug'] == "echo")
<div class="row">
<div class="col-md-7">
<button class="fcbtn btn btn-sm btn-info btn-outline btn-1d" data-toggle="modal" data-target=".bs-example-modal-lg" type="button">
<span class="btn-label"><i class="fa fa-plus"></i></span>{{ __('investigations.add_results') }}
</button>
</div>
<div class="col-md-4">
@php
$cardioEcho = \Streamline\Models\CardioEchoResult::where('episode_id', $result['episode_id'])->first();
$episode_id = $result['episode_id'];
@endphp
<span id="cardio_print_div" @if(!isset($cardioEcho)) style="display: none;" @endif>
<a target="_blank" class="fcbtn btn btn-sm btn-default btn-outline btn-1d" href='{{ url("/investigations/print-cardio-echo/{$patient->id}/{$result['episode_id']}") }}'> <i class="fa fa-print"></i> <span>{{ __('investigations.print') }}</span></a>
</span>
</div>
</div>
{{ Form::hidden('value[]', '', ['class' => 'form-control', 'rows'=>'6']) }}
@else
{{ Form::textArea('value[]', $result['result'], ['class' => 'form-control compulsory', 'rows'=>'6', 'id'=>'inv_'.$result['id']]) }}
@if(does_investigation_have_template($result['id'], 0))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_results_template{{ $result['id'] }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
<br>
{{ Form::label('lab_result_document', __('investigations.lab_result_document')) }}
{{-- {{ Form::file('lab_result_document[]', null) }} --}}
{{-- <input type="file" id="lab_result_doc_{{ $result['id'] }}" name="lab_result_document[]" /> --}}
@if (!empty($result['document']))
<br><a class="btn btn-sm label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank"> {{ $result['title'] }}</a> &nbsp;
@endif
@endif
</td>
<td>
{{ Form::textArea('comment[]', $result['comment'], ['class' => 'form-control','rows'=>'6']) }}
{{ Form::hidden('episode_ids[]', $result['episode_id']) }}
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button('Reset',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@php
$order_id = get_name($id, 'id', 'order_id', 'investigation_results');
$lab_machine_result = \Streamline\Models\LabMachineResult::where('sample_id', $order_id)->first();
@endphp
@if($lab_machine_result)
<a class="btn btn-primary btn-rounded btn-sm" href="/lab_machines/import_results/{{ $order_id }}">{{ __('investigations.import_results_from_machine') }}</a>
@endif
{{ Form::close() }}
</div>
</div>
</div>
<div id="result_template_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="resultTemplateModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="resultTemplateModalLabel">{{ __('investigations.select_a_template') }}</h2>
</div>
<input type="hidden" id="selected_investigation">
<div class="modal-body" id="template_view"></div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
</div>
</div>
</div>
</div>
<!-- MODAL - Content for adding Cardiology ECHO Result -->
<div id="cardio-echo-modal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="myLargeModalLabel">ECHO 2-D &amp; DOPPLER STUDY</h2>
</div>
<form id="cardio-echo-form" method="post" action="javascript:void(0)">
@csrf
{{ Form::hidden('patient_id',$patient->id, ['id' => 'patient_id']) }}
{{ Form::hidden('episode_id',$episode_id, ['id' => 'episode_id']) }}
{{ Form::hidden('cardio_template_selected',isset($cardioEcho) ? $cardioEcho->template_used : 0, ['id' => 'cardio_template_selected']) }}
<?php
// Get the previously saved mode measurements for cardio echo
if (isset($cardioEcho)):
$modeMeasurements = unserialize($cardioEcho->mode_measurements);
$dopplerStudy = unserialize($cardioEcho->doppler_study);
$cardioDescriptions = unserialize($cardioEcho->descriptions);
$template = \Streamline\Models\CardioEchoTemplate::find($cardioEcho->template_used);
$range = !empty($template->range)? unserialize($template->range):[];
else:
$modeMeasurements = $dopplerStudy = $cardioDescriptions = $range = [];
endif;
?>
<div class="modal-body">
<h4>2-D/M-MODE MEASUREMENTS (Centimeters)</h4>
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.result') }} cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">Result cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">Result cm</th>
</tr>
</thead>
<tbody>
<tr>
<td>IVS</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ivs_result" name="ivs_result" class="form-control" value="{{ $modeMeasurements['IVS'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ivs_range" id="ivs_range" class="form-control" value="{{ $range['IVS'] ?? '' }}" placeholder="(0.6 - 1.1)" readonly></span>
</td>
<td style="text-align: center;">AO</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="ao_result" name="ao_result"class="form-control" value="{{ $modeMeasurements['AO'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ao_range" id="ao_range" class="form-control" value="{{ $range['AO'] ?? '' }}" placeholder="(2.0 - 4)" readonly></span>
</td>
<td style="text-align: center;">EF (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ef_result" name="ef_result" class="form-control" value="{{ $modeMeasurements['EF (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ef_range" id="ef_range" class="form-control" value="{{ $range['EF (%)'] ?? '' }}" placeholder="( 55 - 80 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDd</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvidd_result" name="lvidd_result" class="form-control" value="{{ $modeMeasurements['LVIDd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvidd_range" id="lvidd_range" class="form-control" value="{{ $range['LVIDd'] ?? '' }}" placeholder="(3.5 - 5.7)" readonly></span>
</td>
<td style="text-align: center;">LA</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="la_result" name="la_result" class="form-control" value="{{ $modeMeasurements['LA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="la_range" id="la_range" class="form-control" value="{{ $range['LA'] ?? '' }}" placeholder="( 2.0 - 4.0 )" readonly></span>
</td>
<td style="text-align: center;">FS (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="fs_result" name="fs_result" class="form-control" value="{{ $modeMeasurements['FS (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="fs_range" id="fs_range" class="form-control" value="{{ $range['FS (%)'] ?? '' }}" placeholder="( 26 - 55 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDs</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvids_result" name="lvids_result" class="form-control" value="{{ $modeMeasurements['LVIDs'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvids_range" id="lvids_range" class="form-control" value="{{ $range['LVIDs'] ?? '' }}" placeholder="(2.5 - 4.0)" readonly></span>
</td>
<td style="text-align: center;">RV</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="rv_result" name="rv_result" class="form-control" value="{{ $modeMeasurements['RV'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="rv_range" id="rv_range" class="form-control" value="{{ $range['RV'] ?? '' }}" placeholder="(2.0 - 4.1)" readonly></span>
</td>
<td style="text-align: center;">TAPSE:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="tapse_result" name="tapse_result" class="form-control" value="{{ $modeMeasurements['TAPSE'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tapse_range" id="tapse_range" class="form-control" value="{{ $range['TAPSE'] ?? '' }}" placeholder="(1.6)" readonly></span>
</td>
</tr>
<tr>
<td>LVPW</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvpwd_result" name="lvpwd_result" class="form-control" value="{{ $modeMeasurements['LVPWd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvpwd_range" id="lvpwd_range" class="form-control" value="{{ $range['LVPWd'] ?? '' }}" placeholder="( 0.6 - 1.2 )" readonly></span>
</td>
<td style="text-align: center;">RA:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ra_result" name="ra_result" class="form-control" value="{{ $modeMeasurements['RA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ra_range" id="ra_range" class="form-control" value="{{ $range['RA'] ?? '' }}" placeholder="(16 cm2)" readonly></span>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h4>DOPPLER FINDINGS</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Mitral E/A ratio</td>
<td>
<input type="number" min="0" step="0.01" id="mitral_ea_ratio" name="mitral_ea_ratio" value="{{ $dopplerStudy['Mitral EA ratio'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>TR Max. PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="tr_pg" name ="tr_pg" value="{{ $dopplerStudy['TR PG'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tr_pg_range" id="tr_pg_range" class="form-control" value="{{ $range['TR PG'] ?? '' }}" placeholder="( 15 - 25 )" readonly></span>
</td>
<td>AV mean PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="av_mean" name ="av_vmean" value="{{ $dopplerStudy['AV Vmean'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
</tr>
<tr>
<td>AV Vel. max (m/s)</td>
<td>
<input type="number" min="0" step="0.01" id="av_vmax" name ="av_vmax" value="{{ $dopplerStudy['AV Vmax'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>RAP (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="rap" name="rap" value="{{ $dopplerStudy['RAP'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<h4>{{ __('investigations.description') }}</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Left Ventricle</td>
<td>
<textarea name="left_ventricle_description" id="left_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['left_ventricle_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Right Ventricle</td>
<td>
<textarea name="right_ventricle_description" id="right_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['right_ventricle_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Left Atrium</td>
<td>
<textarea name="left_atrium_description" id="left_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['left_atrium_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Right Atrium</td>
<td>
<textarea name="right_atrium_description" id="right_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['right_atrium_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic Valve</td>
<td>
<textarea name="aortic_valve_description" id="aortic_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['aortic_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Mitral Valve</td>
<td>
<textarea name="mitral_valve_description" id="mitral_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['mitral_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Pulmonary Valve</td>
<td>
<textarea name="pulmonary_valve_description" id="pulmonary_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['pulmonary_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Tricuspid Valve</td>
<td>
<textarea name="tricuspid_valve_description" id="tricuspid_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['tricuspid_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic root and arch</td>
<td>
<textarea name="aortic_root_and_arch_description" id="aortic_root_and_arch_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['aortic_root_and_arch_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Pericardium</td>
<td>
<textarea name="pericardium_description" id="pericardium_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['pericardium_description'] ?? '' }}
</textarea>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<!-- <div class="col-md-6">
<label class="control-label">Additional Comments</label>
<textarea id="cardio_echo_comments" name="cardio_echo_comments" rows="5" class="form-control">{{ $cardioEcho->comments ?? '' }}</textarea>
</div> -->
<div class="col-md-12">
<label class="control-label">{{ __('investigations.conclusion') }}</label>
<textarea id="cardio_echo_conclusion" name="cardio_echo_conclusion" rows="5" class="form-control">{{ $cardioEcho->conclusion ?? '' }}</textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
<button type="submit" id="submit-echo-results" class="btn btn-success waves-effect text-left">{{ __('investigations.submit_results') }}</button>
</div>
</form>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- modal to flash successful submission of cardio-echo results -->
<div class="modal fade" id="flashEchoSubmissionSuccess" tabindex="-1" role="dialog">
<div class="modal-dialog vertical-align-center modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
{{ __('investigations.successful_submission_of_echo_results') }}
</div>
</div>
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<button class="btn btn-success waves-effect text-left" data-dismiss="modal">{{ __('investigations.ok') }}</button>
</div>
<div class="col-sm-4"></div>
</div>
</div>
</div>
</div>
</div>
<!-- end of modal for flash successful submission of echo results -->
@endsection
@push('scripts')
<script type="text/javascript">
$("[id^='select_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 0);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(id);
});
$("[id^='select_specialised_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 1);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(0 + "-" + id);
});
function add_templates(id, is_variable) {
$.ajax({
method: 'GET',
url: '/result_templates/get_templates_for_investigation/' + id + '/' + is_variable,
success: function(response){
$('#template_view').html(response);
}
});
}
function confirm_selection(id){
let input_field_id = $('#selected_investigation').val();
if(input_field_id[0] == 0) {
let split_text = input_field_id.split("-");
$('#invx_'+split_text[1]).val($('#template_'+id).text());
} else {
$('#inv_'+input_field_id).val($('#template_'+id).text());
}
$('#result_template_modal').modal('hide');
}
$('#submit-echo-results').click(function () {
var patient_id = $('#patient_id').val();
var episode_id = $('#episode_id').val();
var cardio_template_selected = $('#cardio_template_selected').val();
var lad_result = $('#lad_result').val();
var ivs_result = $('#ivs_result').val();
var fs_result = $('#fs_result').val();
var ao_result= $('ao_result').val();
var lvidd_result = $('#lvidd_result').val();
var ef_result = $('#ef_result').val();
var lad_ao_result = $('#lad_ao_result').val();
var lvpwd_result = $('#lvpwd_result').val();
var ea_result = $('#ea_result').val();
var rvidd_result = $('#rvidd_result').val();
var sv_result = $('#sv_result').val();
var tapse_result = $('#tapse_result').val();
var lvids_result = $('#lvids_result').val();
var ra_result = $('#ra_result').val();
var rv_result = $('#rv_result').val();
var av_vmax = $('#av_vmax').val();
var av_mean = $('#av_mean').val();
var mitral_ea_ratio = $('#mitral_ea_ratio').val();
var tr_pg = $('#tr_pg').val();
var rap = $('#rap').val();
var mitral_valve_insufficiency = $('#mitral_valve_insufficiency').val();
var mitral_valve_stenosis = $('#mitral_valve_stenosis').val();
var aortic_valve_insufficiency = $('#aortic_valve_insufficiency').val();
var aortic_valve_stenosis = $('#aortic_valve_stenosis').val();
var pulmonary_valve_insufficiency = $('#pulmonary_valve_insufficiency').val();
var pulmonary_valve_stenosis = $('#pulmonary_valve_stenosis').val();
var tricuspid_valve_insufficiency = $('#tricuspid_valve_insufficiency').val();
var tricuspid_valve_stenosis = $('#tricuspid_valve_stenosis').val();
var cardio_echo_comments = $('#cardio_echo_comments').val();
var cardio_echo_conclusion = $('#cardio_echo_conclusion').val();
var left_ventricle_description = $('#left_ventricle_description').val();
var right_ventricle_description = $('#right_ventricle_description').val();
var right_atrium_description = $('#right_atrium_description').val();
var left_atrium_description = $('#left_atrium_description').val();
var aortic_valve_description = $('#aortic_valve_description').val();
var mitral_valve_description = $('#mitral_valve_description').val();
var pulmonary_valve_description = $('#pulmonary_valve_description').val();
var tricuspid_valve_description = $('#tricuspid_valve_description').val();
var aortic_root_and_arch_description = $('#aortic_root_and_arch_description').val();
var pericardium_description = $('#pericardium_description').val();
let data = {
'patient_id' : patient_id,
'episode_id' : episode_id,
'cardio_template_selected' : cardio_template_selected,
'lad_result' : lad_result,
'ivs_result' : ivs_result,
'fs_result' : fs_result,
'ao_result': ao_result,
'lvidd_result' : lvidd_result,
'ef_result' : ef_result,
'lad_ao_result' : lad_ao_result,
'lvpwd_result' : lvpwd_result,
'ea_result' : ea_result,
'rvidd_result': rvidd_result,
'sv_result': sv_result,
'tapse_result': tapse_result,
'lvids_result': lvids_result,
'ra_result': ra_result,
'rv_result': rv_result,
'av_vmax': av_vmax,
'av_mean': av_mean,
'mitral_ea_ratio': mitral_ea_ratio,
'tr_pg': tr_pg,
'rap': rap,
'mitral_valve_insufficiency': mitral_valve_insufficiency,
'mitral_valve_stenosis': mitral_valve_stenosis,
'aortic_valve_insufficiency': aortic_valve_insufficiency,
'aortic_valve_stenosis': aortic_valve_stenosis,
'pulmonary_valve_insufficiency': pulmonary_valve_insufficiency,
'pulmonary_valve_stenosis': pulmonary_valve_stenosis,
'tricuspid_valve_insufficiency': tricuspid_valve_insufficiency,
'tricuspid_valve_stenosis': tricuspid_valve_stenosis,
'left_ventricle_description': left_ventricle_description,
'right_ventricle_description': right_ventricle_description,
'right_atrium_description': right_atrium_description,
'left_atrium_description': left_atrium_description,
'aortic_valve_description': aortic_valve_description,
'mitral_valve_description': mitral_valve_description,
'pulmonary_valve_description': pulmonary_valve_description,
'tricuspid_valve_description': tricuspid_valve_description,
'aortic_root_and_arch_description': aortic_root_and_arch_description,
'pericardium_description': pericardium_description,
'cardio_echo_comments': cardio_echo_comments,
'cardio_echo_conclusion': cardio_echo_conclusion,
};
console.log(JSON.stringify(data));
$.ajax({
type: "post",
url: '/investigations/store-cardio-echo',
data: data,
cache: false,
success: function (result) {
console.log(JSON.stringify(result));
$("#cardio-echo-modal").modal("hide");
$("#flashEchoSubmissionSuccess").modal("show");
$("#cardio_print_div").show();
}
});
});
</script>
@endpush
@@ -0,0 +1,542 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.alter_obstetric_ultrasound') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'investigations.submit_ultrasound_obstetric_report']) }}
{{ Form::hidden('order_id',$order_id) }}
{{ Form::hidden('patient_id',$patient_id) }}
{{ Form::hidden('episode_id',$episode_id) }}
{{ Form::hidden('alter_obstetric', $obstetric_ultrasound_report_id) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('scan_date', __('investigations.date_of_scan')) }}
<div class="input-group">
{{ Form::text('scan_date', \Carbon\Carbon::createFromFormat('Y-m-d', $report->scan_date)->format('d-m-Y'), ['class'=>'form-control compulsory', 'id'=>'scan_date', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('sonographer_name', __('investigations.sonographer')) }}
{{ Form::text('sonographer_name', get_full_name($report->sonographer, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control compulsory', 'readonly']) }}
{{ Form::hidden('sonographer', $report->sonographer) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('no_of_foetus', __('investigations.number_of_foetus')) }}
<input type="number" id="numberInput" name="no_of_foetus" class="form-control compulsory" min="1" max="3" value="{{ $report->no_of_foetus ?? '1' }}" onchange="showFoetusColumns()">
</div>
</div>
</div>
<h4>{{ __('investigations.obstetric_ultrasound_order_details') }}</h4>
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date(get_name($order_id, 'id', 'created_at', 'ordered_investigations')) }}</td>
</tr>
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'gravida', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'para', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'abortion', 'ante_natal_clinic_registrations') }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations')) }}
@endif
</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ get_name(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations'), 'id', 'name', 'ante_natal_clinic_accuracies') }}
@endif
</td>
<th>{{ __('investigations.edd') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations')) }}
@endif
</td>
</tr>
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
@php
$requester_id = get_name($order_id, 'id', 'created_by', 'ordered_investigations');
if($requester_id == 'N/A'){
$requested_by = Auth::user()->id;
} else {
$requested_by = $requester_id;
}
@endphp
{{ get_full_name($requested_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($requested_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ get_name($order_id, 'id', 'comment', 'ordered_investigations') }}</td>
</tr>
</table>
</div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.item') }}</th>
<th><div class="foetus1header hiddenx">1</div></th>
<th><div class="foetus2header hidden">2</div></th>
<th><div class="foetus3header hidden">3</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
<div class="form-group">
<input type="number" value="{{ split_string_null_check($report->crown_rump, 0) ?? '' }}" class="form-control" name="crown_rump1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r1 hidden">
<input type="number" value="{{ split_string_null_check($report->crown_rump, 1) ?? '' }}" class="form-control" name="crown_rump2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden">
<input type="number" value="{{ split_string_null_check($report->crown_rump, 2) ?? '' }}" class="form-control" name="crown_rump3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td>
<div class="form-group ">
<input type="number" value="{{ split_string_null_check($report->bi_parietal_diameter, 0) ?? '' }}" class="form-control" name="bi_parietal_diameter1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r2 hidden">
<input type="number" value="{{ split_string_null_check($report->bi_parietal_diameter, 1) ?? '' }}" class="form-control" name="bi_parietal_diameter2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r2 hidden">
<input type="number" value="{{ split_string_null_check($report->bi_parietal_diameter, 2) ?? '' }}" class="form-control" name="bi_parietal_diameter3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
<div class="form-group">
<input type="number" value="{{ split_string_null_check($report->head_circumference, 0) ?? '' }}" class="form-control" name="head_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r3 hidden">
<input type="number" value="{{ split_string_null_check($report->head_circumference, 1) ?? '' }}" class="form-control" name="head_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r3 hidden">
<input type="number" value="{{ split_string_null_check($report->head_circumference, 2) ?? '' }}" class="form-control" name="head_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
<div class="form-group ">
<input type="number" value="{{ split_string_null_check($report->abdominal_circumference, 0) ?? '' }}" class="form-control" name="abdominal_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r4 hidden">
<input type="number" value="{{ split_string_null_check($report->abdominal_circumference, 1) ?? '' }}" class="form-control" name="abdominal_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r4 hidden">
<input type="number" value="{{ split_string_null_check($report->abdominal_circumference, 2) ?? '' }}" class="form-control" name="abdominal_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
<div class="form-group ">
<input type="number" value="{{ split_string_null_check($report->femur_length, 0) ?? '' }}" class="form-control" name="femur_length1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r5 hidden">
<input type="number" value="{{ split_string_null_check($report->femur_length, 1) ?? '' }}" class="form-control" name="femur_length2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r5 hidden">
<input type="number" value="{{ split_string_null_check($report->femur_length, 2) ?? '' }}" class="form-control" name="femur_length3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
<div class="form-group">
<input type="number" value="{{ split_string_null_check($report->estimated_foetal_weight, 0) ?? '' }}" class="form-control" name="estimated_foetal_weight1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r6 hidden">
<input type="number" value="{{ split_string_null_check($report->estimated_foetal_weight, 1) ?? '' }}" class="form-control" name="estimated_foetal_weight2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r6 hidden">
<input type="number" value="{{ split_string_null_check($report->estimated_foetal_weight, 2) ?? '' }}" class="form-control" name="estimated_foetal_weight3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
<div class="form-group">
<input type="number" class="form-control" name="average_gestational_age1" value="{{ split_string_null_check($report->average_gestational_age, 0) ?? '' }}" placeholder=" ">
</div>
</td>
<td>
<div class="form-group foetus2r7 hidden">
<input type="number" class="form-control" name="average_gestational_age2" value="{{ split_string_null_check($report->average_gestational_age, 1) ?? '' }}" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r7 hidden">
<input type="number" class="form-control" name="average_gestational_age3" value="{{ split_string_null_check($report->average_gestational_age, 2) ?? '' }}" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
<div class="input-group">
{{ Form::text('expected_delivery_date1', split_string_null_check($report->expected_delivery_date, 0), ['class'=>'form-control', 'id'=>'expected_delivery_date1', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus2r8 hidden">
{{ Form::text('expected_delivery_date2', split_string_null_check($report->expected_delivery_date, 1), ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus3r8 hidden">
{{ Form::text('expected_delivery_date3', split_string_null_check($report->expected_delivery_date, 2), ['class'=>'form-control', 'id'=>'expected_delivery_date3', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
<select name="presentation1" class="form-control">
<option>{{ split_string_null_check($report->presentation, 0) }}</option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation2" class="form-control foetus2r9 hidden">
<option>{{ split_string_null_check($report->presentation, 1) }}</option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation3" class="form-control foetus3r9 hidden">
<option>{{ split_string_null_check($report->presentation, 2) }}</option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
<select name="placental_site1" class="form-control ">
<option>{{ split_string_null_check($report->placental_site, 0) }}</option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site2" class="form-control foetus2r10 hidden">
<option>{{ split_string_null_check($report->placental_site, 1) }}</option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site3" class="form-control foetus3r10 hidden">
<option>{{ split_string_null_check($report->placental_site, 2) }}</option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
<div class="form-group">
{{ Form::number('liquor_volume1', split_string_null_check($report->liquor_volume, 0), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus2r11 hidden">
{{ Form::number('liquor_volume2', split_string_null_check($report->liquor_volume, 1), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus3r11 hidden">
{{ Form::number('liquor_volume3', split_string_null_check($report->liquor_volume, 2), ['class' => 'form-control']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
<div class="form-group">
{{ Form::text('cord_artery_doppler1', split_string_null_check($report->cord_artery_doppler, 0), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus2r12 hidden">
{{ Form::text('cord_artery_doppler2', split_string_null_check($report->cord_artery_doppler, 1), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus3r12 hidden">
{{ Form::text('cord_artery_doppler3', split_string_null_check($report->cord_artery_doppler, 2), ['class' => 'form-control']) }}
</div>
</td>
</tr>
@php
//explode comments with separator ,,,
$comments = !empty($report->comments) ? explode(",,,",$report->comments) : '';
@endphp
<tr>
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
<div class="form-group">
<textarea class="form-control " name="comments1" rows="7" > {{ $comments[0] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus2r13 hidden">
<textarea class="form-control " name="comments2" rows="7" > {{ $comments[1] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus3r13 hidden">
<textarea class="form-control " name="comments3" rows="7" > {{ $comments[2] ?? ''}} </textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
{{-- show foetus data columns on change of foetus number input --}}
<script>
//function to load the colummns
function showFoetusColumns() {
var inputVal = parseInt(document.getElementById("numberInput").value);
// div classes with their respective visibility requirements
var divClasses = {
//foetus one sections
'foetus1header': 1,'foetus1r1': 1,'foetus1r2': 1, 'foetus1r3': 1,'foetus1r4': 1,'foetus1r5': 1,'foetus1r6': 1,'foetus1r7': 1,'foetus1r8': 1,'foetus1r9': 1, 'foetus1r10': 1,'foetus1r11': 1,'foetus1r12': 1,'foetus1r13': 1,
//foetus two sections
'foetus2header': 2,'foetus2r1': 2,'foetus2r2': 2,'foetus2r3': 2,'foetus2r4': 2,'foetus2r5': 2,'foetus2r6': 2,'foetus2r7': 2,'foetus2r8': 2,'foetus2r9': 2, 'foetus2r10': 2,'foetus2r11': 2,'foetus2r12': 2,'foetus2r13': 2,
//foetus three sections
'foetus3header': 3,'foetus3r1': 3,'foetus3r2': 3,'foetus3r3': 3,'foetus3r4': 3,'foetus3r5': 3,'foetus3r6': 3,'foetus3r7': 3,'foetus3r8': 3,'foetus3r9': 3, 'foetus3r10': 3,'foetus3r11': 3,'foetus3r12': 3,'foetus3r13': 3,
};
// Loop through the divClasses object
for (var className in divClasses) {
if (divClasses.hasOwnProperty(className)) {
var divs = document.querySelectorAll('.' + className);
divs.forEach(function(div) {
if (inputVal >= divClasses[className]) {
// Show the div
div.classList.remove('hidden');
} else {
// Hide the div and clear its input fields
div.classList.add('hidden');
var inputs = div.querySelectorAll('input, textarea');
inputs.forEach(function(input) {
input.value = ''; // Clear the value of the input field
});
// Reset select elements
var selects = div.querySelectorAll('select');
selects.forEach(function(select) {
select.selectedIndex = 0; // Reset to the first option
//select.value = '';
});
}
});
}
}
}
</script>
<script type="text/javascript">
//load all columns depending on number in input , on page load
window.onload = function() {
showFoetusColumns();
};
</script>
<script type="text/javascript">
$('#scan_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date1').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date3').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,211 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('layout.alter_investigations_results') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.alter_results']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.ordered_investigations') }}</th>
<th>{{ __('investigations.gender') }}</th>
<th>{{ __('investigations.date_of_birth') }}</th>
<th>{{ __('investigations.submission_date') }}</th>
<th>{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<tr>
<td>
{{ get_name($result->patient_id, 'id', 'number', 'patients') }}
</td>
<td>
{!! insurance_flag($result->patient_id) !!}
</td>
<td>
<?php $investigation_ids = explode(",", $result->investigation_id) ?>
<ol>
@foreach($investigation_ids as $investigation_id)
<li>{{ get_name($investigation_id, 'id', 'name', 'investigations') }}</li>
@endforeach
</ol>
</td>
<td>
<?php $gender = get_name($result->patient_id, 'id', 'gender', 'patients') ?>
@if($gender == 1)
{{ __('investigations.male') }}
@elseif($gender == 2)
{{ __('investigations.female') }}
@elseif($gender == 3)
{{ __('investigations.other') }}
@endif
</td>
<td>
{{ streamline_date_plain(get_name($result->patient_id, 'id', 'date_of_birth', 'patients')) }}
</td>
<td>
{{ removeSeconds($result->created_at) }}
</td>
<td class="text-center">
{{ Form::open(['route' => 'investigations.alter_ordered_results']) }}
{{ Form::hidden('patient_id',$result->patient_id) }}
{{ Form::hidden('id',$result->id) }}
<button type="submit" class="btn btn-rounded btn-warning btn-sm">{{ __('investigations.alter') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
@if(count($results) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_investigations_found') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,252 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.alter_radiology_ultrasound_results') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.alter_results_others']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', __('investigations.search_by_patient')) }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.performed_at') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<tr>
<td>
{!! insurance_flag($result->patient_id) !!}
({{ $result->patient_number }}) - ({{ $patient_categories[$result->patients_category_id] }})
</td>
<td>
{{ streamline_date_time_short($result->requested_at) }}
</td>
<td>{{ streamline_date_time_short($result->created_at) }}</td>
<td>
@if($result->inpatient == 1)
{{ get_ward_name($result->patient_id, $result->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($result->payment_status == 0)
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $result->order_id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $result->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td class="text-center">
@if($result->result_type == 'Ultrasound_Obstetric')
{{ Form::open(['route' => 'investigations.alter_ordered_results_obstetric']) }}
{{ Form::hidden('patient_id',$result->patient_id) }}
{{ Form::hidden('episode_id',$result->episode_id) }}
{{ Form::hidden('obstetric_ultrasound_report_id',$result->value) }}
{{ Form::hidden('order_id',$result->order_id) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.alter') }}</button>
{{ Form::close() }}
@else
{{ Form::open(['route' => 'investigations.alter_ordered_results']) }}
{{ Form::hidden('patient_id',$result->patient_id) }}
{{ Form::hidden('id',$result->id) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.alter') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
@if(count($results) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_investigations_found') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<div id="modal_specimen_edit"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function showQuickView(id, type) {
$.ajax({
method: 'POST',
url: '/investigations/view_lab_results_quick_view',
data: {'id': id, 'type': type},
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("Investigations for " + responseArray["patient_name"] + "(" + responseArray["patient_number"] + ")");
if (type == 2) {
$("#modal_specimen_edit").html('<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/' + id +'">Edit Specimen</a>');
} else {
$("#modal_specimen_edit").html("");
}
$('#modal_receive_request').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,413 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.authenticate_lab_investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.authenticate') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.authenticate_labs']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', __('investigations.search_by_patient')) }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
{{ Form::open(['route' => 'investigations.authenticate_investigations']) }}
<div class="white-box">
@include('flash::message')
@php
$indicator = '';
$normal_orders =array_filter($orders, function ($item) use ($indicator) {
return $item['urgent_ids'] == $indicator;
});
$urgent_orders= array_filter($orders, function ($item) use ($indicator) {
return $item['urgent_ids'] !== $indicator;
});
@endphp
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>
@if (count($urgent_orders) > 0)
&nbsp;&nbsp;<label class="label label-danger">{{ __('investigations.auth_incoming_lab_results_warning') }}</label>
@endif
</h4>
@endif
<div class="row">
<div class="col-md-9">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_orders)>0)
<li role="presentation" class="nav-item"> <a href="#orders_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.authenticate_lab_investigations') }} ({{ count($normal_orders) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_orders" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.auth_incoming_lab_investigations') }} ({{ count($urgent_orders) }})</a> </li>
@else
<li role="presentation" class="nav-item active"> <a href="#orders_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.authenticate_lab_investigations') }} ({{ count($normal_orders) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block tab-content">
<div class="table-responsive tab-pane <?php if(count($urgent_orders) < 1) echo 'active'; ?>" id="orders_nav_pill">
<table class="table table-striped table-bordered color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.date') }}</th>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.investigations') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.select') }}</th>
</tr>
</thead>
<tbody>
@foreach($normal_orders as $order)
{{ Form::hidden('order_id[]',$order['order_id']) }}
<tr>
<td>
{{ $order['date'] }}
</td>
<td>
{{ $order['number'] }}
</td>
<td>
{!! insurance_flag($order['id']) !!}
</td>
<td colspan="3">
<table class="table table-bordered table-striped table-borderless">
<tbody>
<?php $count = 0; ?>
@foreach($order['values'] as $value)
@if(get_name($value['investigation_id'], 'id', 'type', 'investigations') == 1)
<tr>
<td colspan="2">
{{ $value['name'] }}
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@php
// get the specialised results and check if it is valid
$specialised_results = \Illuminate\Support\Facades\DB::table('investigation_specialised_results')->find($value['value']);
$specialised_ids = [];
$specialised_values = [];
if(!is_null($specialised_results)){
$specialised_ids = explode(",", $specialised_results->specialised_variable_id);
$specialised_values = explode(",", $specialised_results->value);
}
@endphp
@if(count($specialised_ids) > 0)
@for($i = 0; $i < count($specialised_ids); $i++)
<tr>
<td>
{{ get_name($specialised_ids[$i], 'id', 'name', 'investigation_specialised_variables') }}
</td>
<td colspan="2">{{ $specialised_values[$i] }}</td>
</tr>
@endfor
@else
<tr><td></td><td colspan="2"></td></tr>
@endif
<tr><td colspan="3"></td></tr>
@else
<tr>
<td>
{{ $value['name'] }}
</td>
<td>
{{ $value['value'] }}
@if (!empty($value['document']))
<br><br><a class="label label-info" href="/patient_documents/{{ $value['document'] }}" target="_blank"> {{ $value['title'] }}</a>
@endif
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@endif
<?php $count++; ?>
@endforeach
{{ Form::hidden('count[]',$count) }}
</tbody>
</table>
</td>
</tr>
@endforeach
@if(count($orders) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.all_results_authenticated') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
@if (count($urgent_orders) > 0)
<div class="table-responsive tab-pane active" id="urgent_orders">
<table class="table table-striped table-bordered color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.date') }}</th>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.investigations') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.select') }}</th>
</tr>
</thead>
<tbody>
@foreach($urgent_orders as $urgent_order)
{{ Form::hidden('order_id[]',$urgent_order['order_id']) }}
<tr>
<td>
{{ $urgent_order['date'] }}
</td>
<td>
{{ $urgent_order['number'] }}
</td>
<td>
{!! insurance_flag($urgent_order['id']) !!}
</td>
<td colspan="3">
<table class="table table-bordered table-striped table-borderless">
<tbody>
<?php $count = 0; ?>
@foreach($urgent_order['values'] as $value)
@if(get_name($value['investigation_id'], 'id', 'type', 'investigations') == 1)
<tr>
<td colspan="2">
{{ $value['name'] }}
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@php
// get the specialised results and check if it is valid
$specialised_results = \Illuminate\Support\Facades\DB::table('investigation_specialised_results')->find($value['value']);
$specialised_ids = [];
$specialised_values = [];
if(!is_null($specialised_results)){
$specialised_ids = explode(",", $specialised_results->specialised_variable_id);
$specialised_values = explode(",", $specialised_results->value);
}
@endphp
@if(count($specialised_ids) > 0)
@for($i = 0; $i < count($specialised_ids); $i++)
<tr>
<td>
{{ get_name($specialised_ids[$i], 'id', 'name', 'investigation_specialised_variables') }}
</td>
<td colspan="2">{{ $specialised_values[$i] }}</td>
</tr>
@endfor
@else
<tr><td></td><td colspan="2"></td></tr>
@endif
<tr><td colspan="3"></td></tr>
@else
<tr>
<td>
{{ $value['name'] }}
</td>
<td>
{{ $value['value'] }}
@if (!empty($value['document']))
<br><br><a class="label label-info" href="/patient_documents/{{ $value['document'] }}" target="_blank"> {{ $value['title'] }}</a>
@endif
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@endif
<?php $count++; ?>
@endforeach
{{ Form::hidden('count[]',$count) }}
</tbody>
</table>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</div>
</div>
<div class="col-md-3">
<h5 class="heading btn-link">{{ __('investigations.please_login_as_senior_lab') }}</h5>
<div class="form-group">
{{ Form::label('username', __('investigations.username')) }}
{{ Form::text('username', '', ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="form-group">
{{ Form::label('password', __('investigations.password')) }}
<input class="form-control compulsory" type="password" name="password" required>
</div>
{{ Form::button(__('investigations.authenticate_results'),['type'=>'submit','id'=>'authenticate_submit_button','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
</div>
</div>
{{ Form::close() }}
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$("#authenticate_submit_button").click(function (e) { // loop thru for checked checkboxes and fill in array
var non_empty_investigations_ids_array = [];
$(".investigation_id").each(function () {
if ($(this).is(":checked")) {
var textname = $(this).attr('name');
$(this).focus();
non_empty_investigations_ids_array.push(textname);
}
});
/* check if the non_empty_investigations_ids_array array is empty and require atleast one id then return false */
if (non_empty_investigations_ids_array.length === 0) {
alert("Please check atleast one investigation to authenitcate<?php echo __('investigations.please_login_as_senior_lab') ?>");
console.log(non_empty_investigations_ids_array);
e.preventDefault();
return false;
}
});
</script>
@endpush
@@ -0,0 +1,307 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-7 col-sm-7 col-xs-12">
<h4 class="page-title"> {{ __('investigations.cardio_echo_template') }}</h4>
</div>
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.template') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['route' => 'investigations.cardio_echo_template']) }}
<div class="row">
<div class="col-md-6">
{{ Form::select('template', $templates, '', ['class' => 'form-control', 'required']) }}
</div>
<div class="col-md-3">
{{ Form::button("Select",['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
<div class="col-md-3">
<a class="btn btn-info pull-right" id="add_new_template_button">{{ __('investigations.add_new_template') }}</a>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($measurements == 0)
<h4 class="text-center"><code>{{ __('investigations.select_template_or_create') }}</code></h4>
@else
{{ Form::open(['route' => 'investigations.save_cardio_echo_template']) }}
{{ Form::hidden('id', $id) }}
<h4>2-D/M-MODE MEASUREMENTS (Centimeters)</h4>
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.results') }} cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.results') }} cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.results') }} cm</th>
</tr>
</thead>
<tbody>
<tr>
<td>IVS</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ivs_result" name="ivs_result" class="form-control" value="{{ $measurements['IVS'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ivs_range" class="form-control" value="{{ $range['IVS'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">AO</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="ao_result" name="ao_result"class="form-control" value="{{ $measurements['AO'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ao_range" class="form-control" value="{{ $range['AO'] ?? '' }}" placeholder="Enter range"></span>
</td>
<td style="text-align: center;">EF (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ef_result" name="ef_result" class="form-control" value="{{ $measurements['EF (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ef_range" class="form-control" value="{{ $range['EF (%)'] ?? '' }}" placeholder="Enter range"></span>
</td>
</tr>
<tr>
<td>LVIDd</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvidd_result" name="lvidd_result" class="form-control" value="{{ $measurements['LVIDd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvidd_range" class="form-control" value="{{ $range['LVIDd'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">LA</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="la_result" name="la_result" class="form-control" value="{{ $measurements['LA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="la_range" class="form-control" value="{{ $range['LA'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">FS (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="fs_result" name="fs_result" class="form-control" value="{{ $measurements['FS (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="fs_range" class="form-control" value="{{ $range['FS (%)'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
</tr>
<td>LVIDs</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvids_result" name="lvids_result" class="form-control" value="{{ $measurements['LVIDs'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvids_range" class="form-control" value="{{ $range['LVIDs'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">RV</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="rv_result" name="rv_result" class="form-control" value="{{ $measurements['RV'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="rv_range" class="form-control" value="{{ $range['RV'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">TAPSE:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="tapse_result" name="tapse_result" class="form-control" value="{{ $measurements['TAPSE'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tapse_range" class="form-control" value="{{ $range['TAPSE'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
</tr>
<tr>
<td>LVPW</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvpwd_result" name="lvpwd_result" class="form-control" value="{{ $measurements['LVPWd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvpwd_range" class="form-control" value="{{ $range['LVPWd'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">RA:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ra_result" name="ra_result" class="form-control" value="{{ $measurements['RA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ra_range" class="form-control" value="{{ $range['RA'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h4>DOPPLER FINDINGS</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Mitral E/A ratio</td>
<td>
<input type="number" min="0" step="0.01" id="mitral_ea_ratio" name="mitral_ea_ratio" value="{{ $doppler_study['Mitral EA ratio'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>TR Max. PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="tr_pg" name ="tr_pg" value="{{ $doppler_study['TR PG'] ?? '' }}" class="form-control" style="border-color: #A9A9A9"><br>
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tr_pg_range" class="form-control" value="{{ $range['TR PG'] ?? '' }}" placeholder="Enter range"></span>
</td>
<td>AV mean PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="av_mean" name ="av_vmean" value="{{ $doppler_study['AV Vmean'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
</tr>
<tr>
<td>AV Vel. max (m/s)</td>
<td>
<input type="number" min="0" step="0.01" id="av_vmax" name ="av_vmax" value="{{ $doppler_study['AV Vmax'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>RAP (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="rap" name="rap" value="{{ $doppler_study['RAP'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<h4>{{ __('investigations.description') }}</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Left Ventricle</td>
<td>
<textarea name="left_ventricle_description" id="left_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['left_ventricle_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Right Ventricle</td>
<td>
<textarea name="right_ventricle_description" id="right_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['right_ventricle_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Left Atrium</td>
<td>
<textarea name="left_atrium_description" id="left_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['left_atrium_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Right Atrium</td>
<td>
<textarea name="right_atrium_description" id="right_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['right_atrium_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic Valve</td>
<td>
<textarea name="aortic_valve_description" id="aortic_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['aortic_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Mitral Valve</td>
<td>
<textarea name="mitral_valve_description" id="mitral_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['mitral_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Pulmonary Valve</td>
<td>
<textarea name="pulmonary_valve_description" id="pulmonary_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['pulmonary_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Tricuspid Valve</td>
<td>
<textarea name="tricuspid_valve_description" id="tricuspid_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['tricuspid_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic root and arch</td>
<td>
<textarea name="aortic_root_and_arch_description" id="aortic_root_and_arch_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['aortic_root_and_arch_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Pericardium</td>
<td>
<textarea name="pericardium_description" id="pericardium_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['pericardium_description'] }}
</textarea>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<label class="control-label">{{ __('investigations.conclusion') }}</label>
<textarea id="cardio_echo_conclusion" name="cardio_echo_conclusion" rows="5" class="form-control">{{ $cardio_echo_conclusion }}</textarea>
</div>
</div>
<br><br>
{{ Form::button("Submit",['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button("Cancel",['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
@endif
</div>
<div class="modal fade" id="template_name_modal" tabindex="-1" role="dialog" aria-labelledby="episodeWithDoctorLabel1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="episodeWithDoctorLabel1">{{ __('investigations.new_template') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'investigations.create_cardio_echo_template']) }}
{{ Form::label('name', 'Name') }}
{{ Form::text('name', '', ['class' => 'form-control', 'required' => 'true'])}}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('Are you sure you want to create a new template');">{{ __('investigations.create') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
$('#add_new_template_button').click(function () {
$('#template_name_modal').modal('show');
});
</script>
@endpush
@@ -0,0 +1,448 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.add_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.create') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="white-box">
@if (session()->has('streamline_setup'))
<h3><font color="blue">Stre@mline {{ __('investigations.setup') }} ({{ __('investigations.step') }} 7 {{ __('investigations.of') }} 12)</font></h3>
{{ Form::open(['route' => 'investigations.store', 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('name', __('investigations.investigation_name')) }}
{{ Form::text('name', '', ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('category', __('investigations.category')) }}
{{ Form::select('category',$investigation_categories,'',['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('units', __('investigations.unit')) }}
{{ Form::select('units',$unit_of_measure,'',['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('minimum', __('investigations.minimum')) }}
{{ Form::text('minimum', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sample_container', __('investigations.sample_container')) }}
{{ Form::text('sample_container', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('comments', __('investigations.comments')) }}
{{ Form::textArea('comments', '', ['class'=>'form-control', 'rows' => 9]) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('non_insured_price', __('investigations.non_insured_price')) }}
{{ Form::number('non_insured_price', '', ['class' => 'form-control', 'id' => 'non_insured_price']) }}
</div>
@php
$price_list_categories = \Streamline\Models\PriceListCategories::select('patient_category_id', 'id')->get();
@endphp
@foreach($price_list_categories as $record)
<div class="form-group">
{{ Form::label('non_insured_price', get_name($record->patient_category_id, 'id', 'name', 'patient_categories').' Price') }}
{{ Form::hidden('price_list_category_id[]', $record->id) }}
{{ Form::number('price_list_price[]', '', ['class'=>'form-control price_list_price']) }}
</div>
@endforeach
<div class="form-group">
{{ Form::label('normal_ranges', __('investigations.normal_ranges')) }}
{{ Form::text('normal_ranges', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('lab_time', __('investigations.lab_time')) }}
{{ Form::text('lab_time', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('available',__('investigations.is_investigation_available'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('available', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('available', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="echo_div">
{{ Form::label('echo',__('investigations.echo_investigation_template'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('echo', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('echo', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('account_id',__('investigations.chart_of_account_name')) }}
{{ Form::select('account_id',$chart_of_accounts,'',['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4" style="background: #eceeef;">
<h4>{{ __('investigations.select_from_list') }}</h4>
@foreach ($investigations as $investigation)
<div class="form-group">
{{ Form::checkbox('selected_investigations[]', $investigation['name'], false) }} {{ $investigation['name'] }} &nbsp;&nbsp;
{{ Form::hidden('selected_category[]', $investigation['category']) }}
</div>
@endforeach
</div>
</div>
{{ Form::button(__('investigations.next'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 next']) }}
{{ Form::button(__('investigations.skip'),['type'=>'submit','name' => 'skip', 'value' => 'skip','class'=>'btn btn-default waves-effect waves-light m-r-10']) }}
@else
{{-- {{ Form::open(['route' => 'investigations.store', 'data-toggle' => 'validator']) }} --}}
{{ Form::open(['route' => 'investigations.store']) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('name', __('investigations.investigation_name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory','required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('category', __('investigations.category')) }}
{{ Form::select('category',$investigation_categories,'',['class' => 'form-control compulsory','required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('units', __('investigations.unit')) }}
{{ Form::select('units',$unit_of_measure,'',['class' => 'form-control compulsory','required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('minimum', __('investigations.minimum')) }}
{{ Form::text('minimum', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sample_container', __('investigations.sample_container')) }}
{{ Form::text('sample_container', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('range_type', 'Is the Reference Range ?') }}
{{ Form::select('range_type', ['' => '--select--',1 => 'Dynamic', 2 => 'Constant'], '', ['class' => 'form-control']) }}
</div>
<div class="form-group" style="display: none;" id="constant_div">
{{ Form::label('normal_ranges', __('investigations.normal_ranges')) }}
{{ Form::text('normal_ranges', '', ['class' => 'form-control']) }}
</div>
<div style="display: none;" id="dynamic_div">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="row">
<div class="col-md-6">
<h5>Male</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_male[]', '', ['class' => 'form-control']) }}
{{ Form::hidden('age_id[]', $age->id) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h5>Female</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_female[]', '', ['class' => 'form-control']) }}
<br>
@endforeach
</div>
</div>
<hr>
</div>
<div class="form-group">
{{ Form::label('lab_time', __('investigations.lab_time')) }}
{{ Form::text('lab_time', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('available',__('investigations.is_investigation_available'), ["class"=>'col-md-12','required']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('available', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('available', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="echo_div">
{{ Form::label('echo',__('investigations.echo_investigation_template'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('echo', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('echo', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('is_chronic',__('investigations.is_investigation_chronic'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('is_chronic', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('is_chronic', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('code', 'Item Code') }}
{{ Form::text('code', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('reference_areas', __('diagnoses.reference_areas')) }}
{{ Form::text('reference_text', '', ['class' => 'form-control', 'placeholder' => 'Reference text']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::text('reference_link', '', ['class' => 'form-control', 'placeholder' => 'Reference link e.g. http://google.com']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('non_insured_price', __('investigations.non_insured_price')) }}
{{ Form::number('non_insured_price', '', ['class' => 'form-control compulsory','required', 'id' => 'non_insured_price']) }}
</div>
@php
$price_list_categories = \Streamline\Models\PriceListCategories::select('patient_category_id', 'id')->get();
@endphp
@foreach($price_list_categories as $record)
<div class="form-group">
{{ Form::label('non_insured_price', get_name($record->patient_category_id, 'id', 'name', 'patient_categories').' Price') }}
{{ Form::hidden('price_list_category_id[]', $record->id) }}
{{ Form::number('price_list_price[]', '', ['class'=>'form-control price_list_price']) }}
</div>
@endforeach
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('comments', __('investigations.comments')) }}
{{ Form::textArea('comments', '', ['class'=>'form-control', 'rows' => 9]) }}
</div>
<div class="form-group">
{{ Form::label('account_id',__('investigations.chart_of_account_name')) }}
{{ Form::select('account_id',$chart_of_accounts,'',['class' => 'form-control compulsory','required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="wrapper">
<div class="row input_fields_wrap1 copy1">
<div class="col-sm-5">
{{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }}
{{ Form::text('hmis_no_outpatient[]', '', ['class'=>'form-control']) }}
</div>
<div class="col-sm-6">
{{ Form::label('hmis_category', __('investigations.hmis_category_out_patient')) }}
{{ Form::select('hmis_category[]', $hmis_categories, '', ['class' => 'form-control']) }}
</div>
</div>
<!-- {{ Form::label('hmis_no_outpatient', __('investigations.hmis_category_out_patient_number')) }}
{{ Form::text('hmis_no_outpatient', '', ['class'=>'form-control']) }} -->
</div>
<a class="add_field_hmis" style="color: blue;">{{ __('investigations.add_more') }}</a><br><br>
<div class="form-group">
{{ Form::label('hmis_category_inpatient', __('investigations.hmis_category_in_patient')) }}
<select class="form-control" id="hmis_category_inpatient" name="hmis_category_inpatient">
<option value="" selected disabled>- Select HMIS category -</option>
@foreach ($inpatient_hmis_categories as $inpatient_item)
<option value="{{ $inpatient_item['id'] }}">{{ $inpatient_item['title'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
{{ Form::label('hmis_no_inpatient', __('investigations.hmis_category_in_patient_number')) }}
<select class="form-control" id="inpatient_hmis_category_options" name="hmis_no_inpatient">
<option value="" selected disabled>- Select HMIS category first -</option>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('hmis_002_slug', __('investigations.hmis_002_category')) }}
{{ Form::select('hmis_002_slug', ['' => '--select--',1 => 'TB', 2 => 'RDT', 3=>'B/S', 4=>'RBS'], '', ['class' => 'form-control', 'id'=>'hmis_002_slug']) }}
</div>
</div>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@endif
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<!-- icheck -->
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".next,.submit-btn").click(function (e) { // make sure that all compulsory fields have been filled out
var empty_compulsory_fields = [];
$(".compulsory").each(function () {
if ($(this).val() == "") {
// var textname = $(this).attr('name');
$(this).focus();
empty_compulsory_fields.push(textname);
$(this).css('border','1px solid #F08080');
}
});
/* check if the array containing empty compulsory fields is not empty then return false */
if (empty_compulsory_fields.length != 0) {
alert("Please fill in all compulsory fields");
console.log(empty_compulsory_fields);
e.preventDefault();
return false;
}
});
$('#echo_div').hide();
var max_fields1 = 4; //maximum reference area/name divs allowed
var x1 = 1; //initial reference area/name div count
$(".add_field_hmis").on("click", function (e) {
e.preventDefault();
if (x1 < max_fields1) {
x1++;
var copy1 = $('.copy1').clone();
copy1.attr("class", 'row input_fields_wrap1');
copy1.attr("id", 'copy1' + x1);
copy1.append('<a href="#" class="remove_field1" style="color: maroon"><sup>X</sup></a>');
copy1.insertAfter('.copy1');
}
});
$("#wrapper").on("click", ".remove_field1", function (e) {
e.preventDefault();
console.log("about to remove div");
$(this).parent('div').remove();
x1--;
});
$('#range_type').change(function (e) {
e.preventDefault();
if(this.value == 2){
$('#constant_div').show();
$('#dynamic_div').hide();
}else{
$('#constant_div').hide();
$('#dynamic_div').show();
}
});
$('#select_all').change(function() {
if (this.checked === true) {
$(".item_checkbox").each(function() {
this.checked = true;
});
} else {
$(".item_checkbox").each(function() {
this.checked = false;
});
}
});
$('#non_insured_price').change(function(e) {
var non_insured_price = $(this).val();
if (non_insured_price > 0) {
$(".price_list_price").each(function () {
$(this).val(non_insured_price);
});
}
});
$('#category').change(function() {
if($(this).val() == '17') $('#echo_div').show();
else {
$('#echo_div').hide();
$('#echo').val(0);
}
});
});
$('#hmis_category_inpatient,#inpatient_hmis_category_options').select2();
$('#hmis_category_inpatient,#inpatient_hmis_category_options').prop('required',false);
$('#hmis_category_inpatient').change(function(e) {
category_options();
});
function category_options(){
let category = $('#hmis_category_inpatient').val();
$.ajax({
type: "POST",
url: "/get_hmis_categories_options",
data: {hmis_category: category},
cache: false,
success: function (response) {
if(response == 'false'){
alert("<?php echo __('procedures.failed_options'); ?>");
} else {
$('#inpatient_hmis_category_options').html(response);
$('#inpatient_hmis_category_options').prop('required',false);
}
}
});
}
$('#account_id, #category, #units').select2();
</script>
@endpush
@@ -0,0 +1,174 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<h4 class="page-title">{{ __('investigations.cancel_ordered_investigations') }}</h4>
</div>
<div class="col-lg-6 col-sm-6 col-md-6 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('investigations.dashboard') }}</a></li>
</ol>
</div>
</div>
{{ Form::open(['route' => 'investigations.investigations_to_cancel', 'method' => 'ANY']) }}
<div class="white-box">
<div class="row">
<div class="col-md-3">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('investigations.date')) }}
{{ Form::select('search_by', ['0'=>'Today','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('investigations.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('investigations.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
</div>
</div>
{{ Form::close() }}
<div class="white-box">
@include('flash::message')
<div class="table-responsive">
<table class="table table-hover color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>#</th>
<th>{{ __('investigations.date') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.investigations') }}</th>
<th>{{ __('investigations.action') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $count=1; @endphp
@foreach($ordered_investigations as $ordered_inv)
@php
$urgent_ids = $ordered_inv->urgent_ids;
$ordered_ids = explode(",", $ordered_inv->investigation_id);
$ordered_investigation_comments_string = "";
$ordered_investigation_comments_string = $ordered_inv->order_comments;
@endphp
<tr>
<td>{{ $count }}.</td>
<td>{{ streamline_date_time($ordered_inv->created_at) }}</td>
<td>{!! insurance_flag($ordered_inv->patient_id) !!} ({{ get_name($ordered_inv->patient_id, 'id', 'number', 'patients') }})</td>
<td>
<ol>
@for($i=0; $i < count($ordered_ids); $i++)
<li>{{ get_name($ordered_ids[$i], 'id', 'name', 'investigations') }}</li>
@endfor
</ol>
</td>
<td>
{{ Form::model($ordered_inv->id ,['method' => 'DELETE', 'route' => ['ordered_investigation.destroy', $ordered_inv->id]]) }}
<button type="submit" class="btn btn-rounded btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i>
<span style="margin-left: 10px;">{{ __('investigations.cancel_order') }}</span>
</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $ordered_inv->patient_id }}" class="btn btn-info btn-rounded">{{ __('investigations.select_patient') }}</a>
</td>
</tr>
@php $count++; @endphp
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
//order: [ [0, 'desc'] ],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
'pageLength' : 50,
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
</script>
@endpush
@@ -0,0 +1,360 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="panel">
{{ Form::model($investigation, ['method' => 'PUT', 'route' => ['investigations.update',$investigation], 'data-toggle' => 'validator']) }}
<div class="panel-body">
<div clas="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('investigations.investigation_name')) }}
{{ Form::text('name', $investigation->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('category', __('investigations.category')) }}
{{ Form::select('category',$investigation_categories,$investigation->category,['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('units', __('investigations.unit')) }}
{{ Form::select('units',$unit_of_measure,$investigation->units,['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('range_type', __('investigations.is_the_reference_range')) }}
{{ Form::select('range_type', [null => '--select--', 1 => 'Dynamic', 2 => 'Constant'], $investigation->range_type, ['class' => 'form-control']) }}
</div>
<div class="form-group" @if($investigation->range_type == 1) style="display: none;" @endif id="constant_div">
{{ Form::label('normal_ranges', __('investigations.normal_ranges')) }}
{{ Form::text('normal_ranges', $investigation->normal_ranges, ['class' => 'form-control']) }}
</div>
<div @if($investigation->range_type != 1) style="display: none;" @endif id="dynamic_div">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="row">
<div class="col-md-6">
<h5>{{ __('investigations.male') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_male[]', get_dynamic_normal_range($investigation->id, $age->id, 1), ['class' => 'form-control']) }}
{{ Form::hidden('age_id[]', $age->id) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h5>{{ __('investigations.female') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_female[]', get_dynamic_normal_range($investigation->id, $age->id, 2), ['class' => 'form-control']) }}
<br>
@endforeach
</div>
</div>
<hr>
</div>
<div class="form-group">
{{ Form::label('minimum', __('investigations.minimum')) }}
{{ Form::text('minimum', $investigation->minimum, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sample_container', __('investigations.sample_container')) }}
{{ Form::text('sample_container', $investigation->sample_container, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('non_insured_price', __('investigations.non_insured_price')) }}
{{ Form::number('non_insured_price', $investigation->non_insured_price, ['class' => 'form-control']) }}
</div>
@if($investigation->price_list_category && $investigation->price_list_category != '')
@php
$price_list_categories = explode(",", $investigation->price_list_category);
$price_list_prices = explode(",", $investigation->price_list_price);
@endphp
@for($i = 0; $i < count($price_list_categories); $i++)
<div class="form-group">
{{ Form::label('non_insured_price', get_name($price_list_categories[$i], 'id', 'name', 'patient_categories').' Price') }}
{{ Form::hidden('price_list_category_id[]', $price_list_categories[$i]) }}
{{ Form::number('price_list_price[]', $price_list_prices[$i], ['class'=>'form-control price_list_price']) }}
</div>
@endfor
@endif
<div class="form-group">
{{ Form::label('comments', __('investigations.comments')) }}
{{ Form::textArea('comments', $investigation->comments, ['class'=>'form-control', 'rows' => 2]) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('lab_time', __('investigations.lab_time')) }}
{{ Form::text('lab_time', $investigation->lab_time, ['class' => 'form-control']) }}
</div>
<div class="row">
<div class="col-6">
<div class="form-group">
{{ Form::label('', __('investigations.is_investigation_available'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('available', 1, $investigation->available == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('available', 0, $investigation->available == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-6">
<div class="form-group">
{{ Form::label('', __('investigations.is_investigation_chronic'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('is_chronic', 1, $investigation->is_chronic == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('is_chronic', 0, $investigation->is_chronic == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="form-group">
{{ Form::label('account_id',__('investigations.chart_of_account_name')) }}
{{ Form::select('account_id',$chart_of_accounts,$investigation->account_id,['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="echo_div">
{{ Form::label('echo', __('investigations.echo_investigation_template'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('echo', 1, $investigation->slug == 'echo', ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('echo', 0, $investigation->slug == null, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('code', 'Item Code') }}
{{ Form::text('code', $investigation->code, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('reference_areas', __('diagnoses.reference_areas')) }}
{{ Form::text('reference_text', $investigation->reference_text, ['class' => 'form-control', 'placeholder' => 'Reference text']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::text('reference_link', $investigation->reference_link, ['class' => 'form-control', 'placeholder' => 'Reference link e.g. http://google.com']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="wrapper">
<?php
$hmis_no_outpatient_array = array_filter(explode(",", $investigation->hmis_no_outpatient));
$hmis_category_array = array_filter(explode(",", $investigation->hmis_category));
?>
@if(count($hmis_no_outpatient_array) > 0)
@for ($x = 0; $x < count($hmis_no_outpatient_array); $x++)
<div class="row input_fields_wrap1 copy1">
<div class="col-sm-5">
{{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }}
{{ Form::text('hmis_no_outpatient[]', $hmis_no_outpatient_array[$x], ['class'=>'form-control']) }}
</div>
<div class="col-sm-5">
{{ Form::label('hmis_category', 'HMIS category (Out Patient)') }}
{{ Form::select('hmis_category_opd[]', $hmis_categories_opd, isset($hmis_category_array[$x]) ? $hmis_category_array[$x] : "", ['class' => 'form-control']) }}
</div>
</div>
@endfor
@else
<div class="row input_fields_wrap1 copy1">
<div class="col-sm-5">
{{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }}
{{ Form::text('hmis_no_outpatient[]', '', ['class'=>'form-control']) }}
</div>
<div class="col-sm-5">
{{ Form::label('hmis_category', 'HMIS category (Out Patient)') }}
{{ Form::select('hmis_category_opd[]', $hmis_categories_opd, '', ['class' => 'form-control']) }}
</div>
</div>
@endif
</div>
<a class="add_field_hmis" style="color: blue;">{{ __('investigations.add_more') }}</a><br><br>
<div class="form-group">
@php
$inpatient_option =$investigation->hmis_category_inpatient;
$inpatient_other = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] !== $inpatient_option;
});
$inpatient_selected = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] == $inpatient_option;
});
$categories_option = $investigation->hmis_no_inpatient;
$selected_hmis_categories_option=array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] == $categories_option;
});
$other_hmis_categories_options= array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] != $categories_option;
});
@endphp
{{ Form::label('hmis_category_inpatient', __('investigations.hmis_category_in_patient')) }}
<select class="form-control" id="hmis_category_inpatient" name="hmis_category_inpatient">
<option value="" <?php echo empty($inpatient_selected)? 'selected ':''; ?>disabled>- Select HMIS category -</option>
@foreach ($inpatient_selected as $option)
<option value="{{ $option['id'] }}" selected>{{ $option['title'] }}</option>
@endforeach
@foreach ($inpatient_other as $inpatient_item)
<option value="{{ $inpatient_item['id'] }}">{{ $inpatient_item['title'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
{{ Form::label('hmis_no_inpatient', __('investigations.hmis_category_in_patient_number')) }}
<select class="form-control" id="inpatient_hmis_category_options" name="hmis_no_inpatient">
@if (empty($selected_hmis_categories_option))
<option value="" selected disabled>- Select HMIS category <?php echo empty($inpatient_selected)? 'first ':'Option'; ?> -</option>
@else
@foreach ($selected_hmis_categories_option as $selected_option )
<option value="{{ $selected_option['id'] }}" selected>{{ $selected_option['name'] }}</option>
@endforeach
@endif
@foreach ($other_hmis_categories_options as $option )
<option value="{{ $option['id'] }}">{{ $option['name'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('hmis_002_slug', __('investigations.hmis_002_category')) }}
{{ Form::select('hmis_002_slug', ['' => '--select--',1 => 'TB', 2 => 'RDT', 3=>'B/S', 4=>'RBS'], $investigation->hmis_002_slug?? '', ['class' => 'form-control', 'id'=>'hmis_002_slug']) }}
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@php $spec_vars = \DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $investigation->id)->get(); @endphp
@if(count($spec_vars) > 0)
<br><br>
<a class="btn btn-warning" href="/investigations/edit_specialised_variables_ranking/{{ $investigation->id }}">{{ __('investigations.edit_specialised_variables_ranking') }}</a>
@endif
</div>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<!-- icheck -->
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#account_id, #category, #units').select2();
var echo_value = '{{ $investigation->slug }}';
var max_fields1 = 4; //maximum reference area/name divs allowed
var x1 = 1; //initial reference area/name div count
if(echo_value == 'echo') $('#echo_div').show();
else $('#echo_div').hide();
$('#category').change(function() {
if($(this).val() == '17') $('#echo_div').show();
else {
$('#echo_div').hide();
$('#echo').val(0)
}
});
$(".add_field_hmis").on("click", function (e) {
//alert('clicked here');
e.preventDefault();
if (x1 < max_fields1) {
x1++;
var copy1 = $('.copy1').clone();
copy1.attr("class", 'row input_fields_wrap1');
copy1.attr("id", 'copy1' + x1);
copy1.append('<a href="#" class="remove_field1" style="color: maroon"><sup>X</sup></a>');
copy1.insertAfter('.copy1');
}
});
$("#wrapper").on("click", ".remove_field1", function (e) {
e.preventDefault();
$(this).parent('div').remove();
x1--;
});
$('#range_type').change(function (e) {
e.preventDefault();
if(this.value == 2){
$('#constant_div').show();
$('#dynamic_div').hide();
}else{
$('#constant_div').hide();
$('#dynamic_div').show();
}
});
$('#hmis_category_inpatient').change(function(e) {
category_options();
});
function category_options(){
let category = $('#hmis_category_inpatient').val();
$.ajax({
type: "POST",
url: "/get_hmis_categories_options",
data: {hmis_category: category},
cache: false,
success: function (response) {
if(response == 'false'){
alert("<?php echo __('procedures.failed_options'); ?>");
} else {
$('#inpatient_hmis_category_options').html(response);
$('#inpatient_hmis_category_options').prop('required',true);
}
}
});
}
</script>
@endpush
@@ -0,0 +1,115 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style>
th{
white-space: nowrap;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit_investigation') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($investigations, ['method' => 'ANY', 'route' => ['investigations.update_all', 'data-toggle' => 'validator']]) }}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th hidden></th>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.category') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.minimum') }}</th>
<th>{{ __('investigations.sample_container') }}</th>
<th>{{ __('investigations.non_insured_price') }}</th>
<th>{{ __('investigations.insured_price') }}</th>
<th>{{ __('investigations.comments') }}</th>
<th>{{ __('investigations.lab_time') }}</th>
<th>{{ __('investigations.insurance_coverage') }}</th>
<th>{{ __('investigations.is_investigation_available') }}</th>
<th>{{ __('investigations.chart_of_account_name') }}</th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr>
<td hidden>{{ Form::text('id[]', $investigation->id, ['class' => 'form-control']) }}</td>
<td>
<p style="display: none">{{ $investigation->name }}</p>
{{ Form::text('name[]', $investigation->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</td>
<td>{{ Form::select('category[]',$investigation_categories,$investigation->category,['class' => 'form-control compulsory', 'required']) }}</td>
<td>{{ Form::text('normal_ranges[]', $investigation->normal_ranges, ['class' => 'form-control']) }}</td>
<td>{{ Form::text('minimum[]', $investigation->minimum, ['class' => 'form-control']) }}</td>
<td>{{ Form::text('sample_container[]', $investigation->sample_container, ['class' => 'form-control']) }}</td>
<td>{{ Form::number('non_insured_price[]', $investigation->non_insured_price, ['class' => 'form-control']) }}</td>
<td>{{ Form::number('insured_price[]', $investigation->insured_price, ['class' => 'form-control']) }}</td>
<td>{{ Form::textArea('comments[]', $investigation->comments, ['class'=>'form-control', 'rows' => 2]) }}</td>
<td>{{ Form::text('lab_time[]', $investigation->lab_time, ['class' => 'form-control']) }}</td>
<td>{{ Form::select('insurance_coverage[]', [1 => 'Yes', 0 => 'No'], $investigation->insurance_coverage, ['class' => 'form-control']) }}</td>
<td>{{ Form::select('available[]', [1 => 'Yes', 0 => 'No'], $investigation->available, ['class' => 'form-control']) }}</td>
<td>{{ Form::select('account_id[]',$chart_of_accounts,$investigation->account_id,['class' => 'form-control compulsory']) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@include('investigations::investigations.menu')
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,197 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<style>
th{
white-space: nowrap;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($investigations, ['method' => 'POST', 'route' => ['investigations.update.hmis.options']]) }}
<div class="table-responsive">
<table id="table" class="table table-striped">
<thead>
<tr>
<th hidden>Id</th>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.hmis_category_out_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_out_patient') }}</th>
<th>{{ __('investigations.hmis_category_in_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_in_patient') }}</th>
</tr>
</thead>
<tbody>
@php
$counter = 0;
@endphp
@foreach($investigations as $investigation)
<tr>
<td hidden>{{ Form::text('id[]', $investigation->id, ['class' => 'form-control']) }}</td>
<td>
<p style="display: none">{{ $investigation->name }}</p>
{{ Form::text('name[]', $investigation->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</td>
@php
$hmis_no_outpatient_array = explode(",", $investigation->hmis_no_outpatient);
$hmis_outpatient_category_array = explode(",", $investigation->hmis_category);
@endphp
<td>{{ Form::text('hmis_no_outpatient[]', $investigation->hmis_no_outpatient, ['class' => 'form-control','placeholder' => '']) }}</td>
<td>
@if(count($hmis_no_outpatient_array) > 0)
<!-- only display one field for noe -->
@for($i=0; $i < 1; $i++)
{{ Form::select('hmis_category[]', $hmis_categories, isset($hmis_outpatient_category_array[$i]) ? $hmis_outpatient_category_array[$i] : "", ['class' => 'form-control']) }}
@endfor
@endif
</td>
<td>
@php
$inpatient_option =$investigation->hmis_category_inpatient;
$inpatient_other = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] !== $inpatient_option;
});
$inpatient_selected = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] == $inpatient_option;
});
$categories_option = $investigation->hmis_no_inpatient;
$selected_hmis_categories_option=array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] == $categories_option;
});
$other_hmis_categories_options= array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] != $categories_option;
});
@endphp
{{-- {{ Form::text('hmis_no_inpatient[]', $investigation->hmis_no_inpatient, ['class' => 'form-control']) }} --}}
<select class="form-control hmis_category_inpatient" id="{{ 'hmis_category_inpatient_'. $counter }}" name="hmis_category_inpatient[]">
<option value selected='<?php echo empty($inpatient_selected)? 'selected ':''; ?>'>- Select HMIS category -</option>
@foreach ($inpatient_selected as $option)
<option value="{{ $option['id'] }}" selected>{{ $option['title'] }}</option>
@endforeach
@foreach ($inpatient_other as $inpatient_item)
<option value="{{ $inpatient_item['id'] }}">{{ $inpatient_item['title'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</td>
<td>
{{-- {{ Form::select('hmis_category_inpatient[]', $hmis_categories_ip, $investigation->hmis_category_inpatient, ['class' => 'form-control']) }} --}}
<select class="form-control inpatient_hmis_category_options" id="{{ 'inpatient_hmis_category_options_'. $counter }}" name="hmis_no_inpatient[]">
@if (empty($selected_hmis_categories_option))
<option value selected='selected'>- Select HMIS category <?php echo empty($inpatient_selected)? 'first ':'Option'; ?> -</option>
@else
@foreach ($selected_hmis_categories_option as $selected_option )
<option value="{{ $selected_option['id'] }}" selected>{{ $selected_option['name'] }}</option>
@endforeach
@endif
@if (!empty($inpatient_selected))
@foreach ($other_hmis_categories_options as $option )
<option value="{{ $option['id'] }}">{{ $option['name'] }}</option>
@endforeach
@endif
</select>
<div class="help-block with-errors"></div>
</td>
</tr>
@php
$counter++;
@endphp
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@include('investigations.menu')
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$(document).ready(function () {
$('#table').DataTable({
dom: 'Bfrtip',
pageLength: 30,
// bPaginate: false,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('.hmis_category_inpatient,.inpatient_hmis_category_options').select2();
$('#table tbody').on('change','.hmis_category_inpatient', function(e) {
if(!$('.hmis_category_inpatient').hasClass('select2-hidden-accessible')) $('.hmis_category_inpatient,.inpatient_hmis_category_options').select2();
let counter = this.id.split("_");let id = this.id;
category_options(id,counter);
});
});
function category_options(id,counter){
let category = $('#'+id).val();
$.ajax({
type: "POST",
url: "/get_hmis_categories_options",
data: {hmis_category: category},
cache: false,
success: function (response) {
if(response == 'false'){
alert("<?php echo __('procedures.failed_options'); ?>");
} else {
$('#inpatient_hmis_category_options_'+counter[3]).html(response);
$('#inpatient_hmis_category_options_'+counter[3]).prop('required',true);
}
}
});
}
</script>
@endpush
@@ -0,0 +1,175 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.edit_lab_specimen') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/view_lab_results/">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit_lab_specimen') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<div class="row">
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.patient_names') }}</th>
<td>
{{ get_full_name($ordered_investigation->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.age') }}/{{ __('investigations.gender') }}</th>
<td>
{{ get_patients_age(get_name($ordered_investigation->patient_id, 'id', 'date_of_birth', 'patients')) }}
/
{{ get_name($ordered_investigation->patient_id, 'id', 'gender', 'patients') == 1 ? "Male" : "Female" }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.patient_number') }}</th>
<td>{{ get_name($ordered_investigation->patient_id, 'id', 'number', 'patients') }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.lab_number') }}</th>
<td>{{ sprintf("%05u", $ordered_investigation->id) }}</td>
</tr>
</table>
</div>
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.doctor') }}</th>
<td>{{ get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.hospital_unit') }}</th>
<td>
@if($ordered_investigation->inpatient == 1)
{{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }}
@else
OPD
@endif
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.requested') }}</th>
<td>{{ streamline_date_time($ordered_investigation->created_at) }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.received') }}</th>
<td>{{ streamline_date_time($ordered_investigation->request_received_date) }}</td>
</tr>
</table>
</div>
<div class="col-md-2">
<div class="pull-right">
{{ getDNS1DBarcodePNG($ordered_investigation->id) }}
<h4>{{ sprintf("%04u", $ordered_investigation->id) }}</h4>
</div>
</div>
</div>
<hr>
@php
$specimens_array = explode(",", $ordered_investigation->specimen);
$status_array = explode(",", $ordered_investigation->specimen_status);
$reason_array = explode(",", $ordered_investigation->specimen_reason);
$counter = 0;
@endphp
{{ Form::open(['route' => 'investigations.save_investigation_specimen']) }}
{{ Form::hidden('id', $ordered_investigation->id) }}
<div class="row">
<div class="col-md-4">
<h4><strong>{{ __('investigations.specimen') }}</strong></h4>
</div>
<div class="col-md-3">
<h4><strong>{{ __('investigations.status') }}</strong></h4>
</div>
<div class="col-md-3">
<h4><strong>{{ __('investigations.reason') }}</strong></h4>
</div>
<div class="col-md-2"></div>
</div>
@for($i = 0; $i < count($specimens_array); $i++)
<div class="row" id="section{{$counter}}">
<div class="col-md-4">
<div class="form-group">
{{ Form::select('specimen[]', $specimen, $specimens_array[$i], ['class' => 'form-control modal_specimen', 'id' => 'modal_specimen']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::select('status[]', [0 => '--select--', 1 => __('investigations.taken'), 2 => __('investigations.not_taken'), 3 => __('investigations.rejected')], $status_array[$i], ['class' => 'form-control modal_status', 'id' => 'modal_status']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::textarea('reason[]', $reason_array[$i], ['class' => 'form-control modal_reason', 'rows' => 2]) }}
</div>
</div>
<div class="col-md-2">
<a class="btn btn-outline-danger text-danger" onclick="remove_div({{$counter}})">{{ __('investigations.remove') }}</a>
</div>
</div>
@php $counter++; @endphp
@endfor
<div id="modal_more_specimen_section"></div>
<a class="btn btn-info btn-rounded" style="color: white" id="modal_add_specimen_button"><i class="fa fa-plus"></i><span style="margin-left: 10px;"> {{ __('investigations.specimen') }}</span></a>
<button type="submit" class="btn btn-rounded btn-success">{{ __('investigations.save') }}</button>
{{ Form::close() }}
</div>
<div style="display: none">
<div class="form-group" id="specimen_div">
{{ Form::select('specimen[]', $specimen, null, ['class' => 'form-control modal_specimen', 'id' => 'modal_specimen']) }}
</div>
<div class="form-group" id="status_div">
{{ Form::select('status[]', [0 => '--select--', 1 => 'Taken', 2 => 'Not Taken', 3 => 'Rejected'], null, ['class' => 'form-control modal_status', 'id' => 'modal_status']) }}
</div>
<div class="form-group" id="reason_div">
{{ Form::textarea('reason[]', '', ['class' => 'form-control modal_reason', 'rows' => 2]) }}
</div>
<div id="remove_div">
<a class="btn btn-outline-danger text-danger" onclick="remove_div({{$counter}})">{{ __('investigations.remove') }}</a>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
let counter = <?php echo $counter; ?>
function remove_div(id) {
$('#section' + id).html("");
$('#section' + id).hide();
}
$('#modal_add_specimen_button').click( function () {
counter++;
let html_code = "<div class='row' id='section" + counter + "'>" +
"<div class='col-md-4'>" + $('#specimen_div').html() + "</div>" +
"<div class='col-md-3'>" + $('#status_div').html() + "</div>" +
"<div class='col-md-3'>" + $('#reason_div').html() + "</div>" +
"<div class='col-md-2'>" + '<a class="btn btn-outline-danger text-danger" onclick="remove_div(' + counter + ')">Remove</a>' + "</div>" +
"</div> <br>";
$('#modal_more_specimen_section').append(html_code);
});
</script>
@endpush
@@ -0,0 +1,85 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<div class="panel"></div>
</div>
</div>
{{ Form::open(['route' => 'investigations.save_specialised_variables_ranking' , 'data-toggle' => 'validator']) }}
{{ Form::hidden('inv_id', $id)}}
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h3>{{ __('investigations.specialised_variables_ranking') }} {{ get_name($id, 'id', 'name', 'investigations') }}</h3>
<hr>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th><h4>{{ __('investigations.variable_name') }}</h4></th>
<th><h4>{{ __('investigations.ranking_print_order') }}</h4></th>
</tr>
</thead>
<tbody>
@foreach($specialized_variables as $record)
<tr>
<td>{{ $record->name }}</td>
{{ Form::hidden('spec_id[]', $record->id)}}
<td>{{ Form::number('ranking[]', $record->ranking, ['class' => 'form-control ranking', 'onfocus' => 'this.oldvalue = this.value', 'id' => $record->id]) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
</div>
</div>
{{ Form::close() }}
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script type="text/javascript">
$('.ranking').on('focusout', function() {
let exclude_id = this.id;
let value = +this.value;
let oldvalue = +this.oldvalue;
$('.ranking').each(function () {
if (this.id !== exclude_id) {
if (oldvalue <= +this.value && value >= +this.value) {
this.value--;
} else if (oldvalue >= +this.value && value <= +this.value) {
this.value++;
}
}
});
});
</script>
@endpush
@@ -0,0 +1,131 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.historical_investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('patients.index') }}">{{ __('investigations.patients') }}</a></li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.historical_labs']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-bordered">
<thead>
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.gender') }}</th>
<th>{{ __('investigations.phone') }}</th>
<th>{{ __('investigations.action') }}</th>
</tr>
</thead>
<tbody>
@foreach($patients as $patient)
<tr>
<td>
{{ $patient->number }}
</td>
<td>
{!! insurance_flag($patient->patient_id) !!}
</td>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@elseif($patient->gender == 2)
{{ __('investigations.female') }}
@elseif($patient->gender == 3)
{{ __('investigations.other') }}
@endif
</td>
<td>
{{ $patient->phone }}
</td>
<td class="text-center">
<a href="/investigations/view_historical_results_labs/{{ $patient->patient_id }}" class="btn btn-rounded btn-primary btn-sm">{{ __('investigations.historical_results') }}</a>
</td>
</tr>
@endforeach
@if(count($patients) <= 0)
<tr>
<td colspan="5" class="text-center">
{{ __('investigations.no_historical_records') }}
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
</script>
@endpush
@@ -0,0 +1,128 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4">
<h4 class="page-title">{{ __('investigations.imaging_historical_results') }}</h4>
</div>
<div class="col-md-8">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.imaging_historical_results') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.imaging_historical_results']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-bordered">
<thead>
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.gender') }}</th>
<th>{{ __('investigations.phone') }}</th>
<th>{{ __('investigations.action') }}</th>
</tr>
</thead>
<tbody>
@foreach($patients as $patient)
<tr>
<td>
{{ $patient->number }}
</td>
<td>
{!! insurance_flag($patient->patient_id) !!}
</td>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@elseif($patient->gender == 2)
{{ __('investigations.female') }}
@elseif($patient->gender == 3)
{{ __('investigations.other') }}
@endif
</td>
<td>
{{ $patient->phone }}
</td>
<td class="text-center">
<a href="/investigations/view_historical_results_imaging/{{ $patient->patient_id }}" class="btn btn-rounded btn-primary btn-sm">{{ __('investigations.historical_results') }}</a>
</td>
</tr>
@endforeach
@if(count($patients) <= 0)
<tr>
<td colspan="5" class="text-center">
{{ __('investigations.no_historical_records') }}
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
</script>
@endpush
@@ -0,0 +1,109 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style>
th{
white-space: nowrap;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.activate_investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.activate_investigations') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.minimum') }}</th>
<th>{{ __('investigations.sample_container') }}</th>
<th>{{ __('investigations.non_insured_price') }}</th>
<th>{{ __('investigations.insured_price') }}</th>
<th>{{ __('investigations.comments') }}</th>
<th>{{ __('investigations.lab_time') }}</th>
<th>{{ __('investigations.category') }}</th>
<th>{{ __('investigations.is_investigation_available') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr>
<td>{{ $investigation->name }}</td>
<td>{{ $investigation->normal_ranges }}</td>
<td>{{ $investigation->minimum }}</td>
<td>{{ $investigation->sample_container }}</td>
<td>{{ $investigation->non_insured_price }}</td>
<td>{{ $investigation->insured_price }}</td>
<td>{{ $investigation->comments }}</td>
<td>{{ $investigation->lab_time }}</td>
<td>{{ isset($investigation_categories[$investigation->category]) ? $investigation_categories[$investigation->category] : "Not Set" }}</td>
<td>
@if ($investigation->available)
{{ __('investigations.yes') }}
@else
{{ __('investigations.no') }}
@endif
</td>
<td>
{{ Form::model($investigation->id ,['method' => 'POST', 'route' => ['investigations.activate', $investigation->id]]) }}
<button type="submit" class="btn btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-check"></i> {{ __('investigations.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,450 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">
@if($imaging_type == 'Imaging')
{{ __('investigations.incoming_radiology_investigations') }}
@elseif($imaging_type == 'Cardio')
{{ __('investigations.incoming_cardiology_investigations') }}
@elseif($imaging_type == 'Ultrasound')
{{ __('investigations.incoming_ultrasound_investigations') }}
@elseif($imaging_type == 'Ultrasound_Obstetric')
{{ __('investigations.incoming_obstetric_ultrasound_investigations') }}
@endif
</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.incoming') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['url' => '/investigations/incoming_imaging/' . $imaging_type, 'data-toggle' => 'validator']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
<!--Flash messages at the top -->
@include('flash::message')
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>&nbsp;&nbsp;
@if (count($urgent_incomings) > 0)
<label class="label label-danger"> There are Urgent
@if($imaging_type == 'Imaging')
{{ __('investigations.incoming_radiology_investigations') }}
@elseif($imaging_type == 'Cardio')
{{ __('investigations.incoming_cardiology_investigations') }}
@elseif($imaging_type == 'Ultrasound')
{{ __('investigations.incoming_ultrasound_investigations') }}
@elseif($imaging_type == 'Ultrasound_Obstetric')
{{ __('investigations.incoming_obstetric_ultrasound_investigations') }}
@endif
</label>
@endif
</h4>
<br>
@endif
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_incomings)>0)
<li role="presentation" class="nav-item"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_incoming_imaging" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.urgent_incoming_imaging_investigations') }} ({{ count($urgent_incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($results) }})</a> </li>
@else
<li role="presentation" class="active nav-item"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($results) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block">
<div class="tab-content">
<div id="per_results_nav_pill" class="tab-pane <?php if(count($urgent_incomings) < 1) echo 'active'; ?>">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th colspan="3" class="text-center">{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($incomings as $incoming)
<tr>
<td>
{!! insurance_flag($incoming->patient_id) !!}
({{ $incoming->patient_number }}) - ({{ $patient_categories[$incoming->patients_category_id] ?? '' }})
</td>
<td>{{ streamline_date_time_short($incoming->created_at) }}</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<label class="label label-success">{{ __('investigations.inpatient_bill_generated') }}</label>
@else
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@endif
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
@if($incoming->inpatient == 0 && $incoming->inpatient_bill_generated == 0 && $incoming->payment_status == 0 && !can_investigations_be_performed($incoming->patients_category_id))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
@if($imaging_type == 'Ultrasound_Obstetric')
{{ Form::open(['route' => 'investigations.ultrasound_obstetric_report']) }}
@else
{{ Form::open(['route' => 'investigations.ordered_results']) }}
@endif
{{ Form::hidden('order_id',$incoming->id) }}
{{ Form::hidden('order_type', $imaging_type) }}
{{ Form::hidden('patient_id',$incoming->patient_id) }}
{{ Form::hidden('episode_id',$incoming->episode_id) }}
<button type="submit" class="btn btn-success btn-rounded btn-sm">{{ __('investigations.add_results') }}</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
@if(count($incomings) <= 0)
<tr>
<td colspan="8" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_requests_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<div id="all_complete_nav_pill" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>Performed At</th>
<th>{{ __('investigations.turn_around_time') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.done_by') }}</th>
<th class="text-center">{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<tr>
<td>
{!! insurance_flag($result->patient_id) !!}
({{ $result->patient_number }}) - ({{ $patient_categories[$result->patients_category_id] ?? '' }})
</td>
<td>
{{ streamline_date_time_short($result->created_at) }}
</td>
<td>{{ $result->results_created_at ? streamline_date_time_short($result->results_created_at) : "N/A" }}</td>
<td>{{ \Carbon\Carbon::parse($result->results_created_at)->diffForHumans(\Carbon\Carbon::parse($result->created_at)) }} request</td>
<td>
@if($result->inpatient == 1 || $result->inpatient_bill_generated == 1)
{{ get_ward_name($result->patient_id, $result->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($result->payment_status == 0)
@if($result->inpatient_bill_generated == 1)
<label class="label label-success">{{ __('investigations.inpatient_bill_generated') }}</label>
@else
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@endif
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $result->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $result->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td>
{{ get_full_name($result->created_by, "id", "first_name", "last_name", "users") }}
</td>
@if($result->inpatient == 0 && $result->inpatient_bill_generated == 0 && $result->payment_status == 0 && !can_investigations_be_performed($result->patients_category_id))
<td class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
@if($imaging_type == 'Ultrasound_Obstetric')
<a class="btn btn-success btn-sm" href="/investigations/view_patient_investigation_obstetric/{{ $result->results_value }}">{{ __('investigations.view_results') }}</a>
@else
<a class="btn btn-success btn-sm" href="/investigations/view_patient_investigation/{{ $result->results_id }}">{{ __('investigations.view_results') }}</a>
@endif
</td>
@endif
</tr>
@endforeach
@if(count($results) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_requests_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@if (count($urgent_incomings) > 0)
<div id="urgent_incoming_imaging" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th colspan="3" class="text-center">{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($urgent_incomings as $urgent_incoming)
<tr>
<td>
{!! insurance_flag($urgent_incoming->patient_id) !!}
({{ $urgent_incoming->patient_number }}) - ({{ $patient_categories[$urgent_incoming->patients_category_id] ?? '' }})
</td>
<td>{{ streamline_date_time_short($urgent_incoming->created_at) }}</td>
<td>
@if($urgent_incoming->inpatient == 1 || $urgent_incoming->inpatient_bill_generated == 1)
{{ get_ward_name($urgent_incoming->patient_id, $urgent_incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($urgent_incoming->payment_status == 0)
@if($urgent_incoming->inpatient_bill_generated == 1)
<label class="label label-success">{{ __('investigations.inpatient_bill_generated') }}</label>
@else
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@endif
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $urgent_incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $urgent_incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
@if($urgent_incoming->inpatient == 0 && $urgent_incoming->inpatient_bill_generated == 0 && $urgent_incoming->payment_status == 0 && !can_investigations_be_performed($urgent_incoming->patients_category_id))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
@if($imaging_type == 'Ultrasound_Obstetric')
{{ Form::open(['route' => 'investigations.ultrasound_obstetric_report']) }}
@else
{{ Form::open(['route' => 'investigations.ordered_results']) }}
@endif
{{ Form::hidden('order_id',$urgent_incoming->id) }}
{{ Form::hidden('order_type', $imaging_type) }}
{{ Form::hidden('patient_id',$urgent_incoming->patient_id) }}
{{ Form::hidden('episode_id',$urgent_incoming->episode_id) }}
<button type="submit" class="btn btn-success btn-rounded btn-sm">{{ __('investigations.add_results') }}</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $urgent_incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $urgent_incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<div id="modal_specimen_edit"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function showQuickView(id, type) {
$.ajax({
method: 'POST',
url: '/investigations/view_lab_results_quick_view',
data: {'id': id, 'type': type},
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("Investigations for " + responseArray["patient_name"] + "(" + responseArray["patient_number"] + ")");
if (type == 2) {
$("#modal_specimen_edit").html('<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/' + id +'">Edit Specimen</a>');
} else {
$("#modal_specimen_edit").html("");
}
$('#modal_receive_request').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,492 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.incoming_lab_investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.incoming') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.incoming_labs']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>
@if (count($urgent_incomings) > 0)
&nbsp;&nbsp;<label class="label label-danger">{{ __('investigations.urgent_incoming_lab_investigations_warning') }}</label>
@endif
</h4>
<br>
@endif
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_incomings)>0)
<li role="presentation" class="nav-item"> <a href="#results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.incoming_lab_investigations') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_incoming" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.urgent_incoming_lab_investigations') }} ({{ count($urgent_incomings) }})</a> </li>
@else
<li role="presentation" class="nav-item active"> <a href="#results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.incoming_lab_investigations') }} ({{ count($incomings) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block">
<div class="tab-content">
<div id="results_nav_pill" class="tab-pane <?php if(count($urgent_incomings) < 1) echo 'active'; ?>">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.time') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.patient_category') }}</th>
<th>{{ __('investigations.source') }}</th>
<th class="text-center">{{ __('investigations.payment') }}</th>
<th class="text-center">{{ __('investigations.actions') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($incomings as $incoming)
<tr>
<td>
{{ streamline_date_time_short($incoming->created_at) }}
</td>
<td>{!! insurance_flag($incoming->patient_id) !!} ({{ get_name($incoming->patient_id, 'id', 'number', 'patients') }})</td>
<td>{{ patient_category($incoming->patient_id) }}</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
<span style='font-size: x-small'>OPD</span>
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
@if($incoming->inpatient == 0 && $incoming->inpatient_bill_generated == 0 && $incoming->payment_status == 0 && !can_investigations_be_performed(get_name($incoming->patient_id, 'id', 'category_id', 'patients')))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
<a href="#" class="btn btn-success btn-rounded btn-sm" onclick="receive_request({{ $incoming->id }})" disabled>{{ __('investigations.receive_request') }}</a>
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
@if(count($incomings) <= 0)
<tr>
<td colspan="8" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_requests_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@if (count($urgent_incomings)>0)
<div id="urgent_incoming" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.time') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.patient_category') }}</th>
<th>{{ __('investigations.source') }}</th>
<th class="text-center">{{ __('investigations.payment') }}</th>
<th class="text-center">{{ __('investigations.actions') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($urgent_incomings as $urgent_incoming)
<tr>
<td>
{{ streamline_date_time_short($urgent_incoming->created_at) }}
</td>
<td>{!! insurance_flag($urgent_incoming->patient_id) !!} ({{ get_name($urgent_incoming->patient_id, 'id', 'number', 'patients') }})</td>
<td>{{ patient_category($urgent_incoming->patient_id) }}</td>
<td>
@if($urgent_incoming->inpatient == 1 || $urgent_incoming->inpatient_bill_generated == 1)
{{ get_ward_name($urgent_incoming->patient_id, $urgent_incoming->episode_id) }}
@else
<span style='font-size: x-small'>OPD</span>
@endif
</td>
<td>
@if($urgent_incoming->payment_status == 0)
@if($urgent_incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
@if($urgent_incoming->inpatient == 0 && $urgent_incoming->inpatient_bill_generated == 0 && $urgent_incoming->payment_status == 0 && !can_investigations_be_performed(get_name($urgent_incoming->patient_id, 'id', 'category_id', 'patients')))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
<a href="#" class="btn btn-success btn-rounded btn-sm" onclick="receive_request({{ $urgent_incoming->id }})" disabled>{{ __('investigations.receive_request') }}</a>
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $urgent_incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $urgent_incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_patient_number', __('investigations.patient_number')) }}
{{ Form::text('modal_patient_number', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_patient_number']) }}
</div>
<div class="form-group">
{{ Form::label('modal_hospital_unit', __('investigations.hospital_unit')) }}
{{ Form::text('modal_hospital_unit', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_hospital_unit']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_patient_age', __('investigations.patient_age')) }}
{{ Form::text('modal_patient_age', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_patient_age']) }}
</div>
<div class="form-group">
{{ Form::label('modal_patient_telephone', __('investigations.patient_telephone')) }}
{{ Form::text('modal_patient_telephone', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_patient_telephone']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_received_date', __('investigations.date_received')) }}
{{ Form::text('modal_received_date', date('d/m/Y'), ['class'=>'form-control', 'readonly', 'id'=>'modal_received_date']) }}
</div>
<div class="form-group">
{{ Form::label('modal_lab_number', __('investigations.lab_number')) }}
@if(is_lab_number_editing_enabled())
{{ Form::text('modal_lab_number', '', ['class'=>'form-control', 'id' => 'modal_lab_number']) }}
@else
{{ Form::text('modal_lab_number', '', ['class'=>'form-control', 'id' => 'modal_lab_number', 'readonly']) }}
@endif
{{ Form::hidden('modal_order_id','', ['id' => 'modal_order_id']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_patient_gender', __('investigations.patient_gender')) }}
{{ Form::text('modal_patient_gender', '', ['class'=>'form-control', 'readonly', 'id'=>'modal_patient_gender']) }}
</div>
<div class="form-group">
{{ Form::label('modal_requested_by', __('investigations.requested_by')) }}
{{ Form::text('modal_requested_by', '', ['class'=>'form-control', 'readonly', 'id'=>'modal_requested_by']) }}
</div>
</div>
</div>
<br>
<h5 class="text-center">{{ __('investigations.tests_to_take') }}</h5>
<div class="table-responsive" id="modal_tests_table"></div>
<hr>
<div class="row">
<div class="col-md-5">
<div class="form-group" id="modal_specimen_div">
{{ Form::label('modal_specimen', __('investigations.specimen')) }}
{{ Form::select('modal_specimen[]', $specimen, null, ['class' => 'form-control modal_specimen compulsory', 'id' => 'modal_specimen']) }}
</div>
</div>
<div class="col-md-5">
<div class="form-group" id="modal_status_div">
{{ Form::label('modal_status', __('investigations.status')) }}
{{ Form::select('modal_status[]', [0 => __('investigations.select'), 1 => __('investigations.taken'), 2 => __('investigations.not_taken'), 3 => __('investigations.rejected')], null, ['class' => 'form-control modal_status compulsory', 'id' => 'modal_status']) }}
</div>
</div>
<div class="col-md-2">
<br>
<button class="btn btn-info btn-rounded" style="color: white" id="modal_add_specimen_button"><i class="fa fa-plus"></i><span style="margin-left: 10px;"> {{ __('investigations.specimen') }}</span></button>
</div>
</div>
<div class="row">
<div class="col-md-10">
{{ Form::label('modal_reason', __('investigations.reason') . "/" . __('investigations.comment')) }}
{{ Form::textarea('modal_reason[]', '', ['class' => 'form-control modal_reason', 'rows' => 2]) }}
</div>
<div class="col-md-2"></div>
</div>
<hr>
<div id="modal_more_specimen_section"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-rounded waves-effect text-left" onclick="save_receive_request()">{{ __('investigations.save') }}</button>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function receive_request(orderId) {
$.ajax({
method: 'POST',
url: '/investigations/get_receive_request_details',
data: {'id': orderId},
success: function(response){
let response_array = JSON.parse(response);
$("#modal_tests_table").html(response_array["html"]);
$("#modal_patient_number").val(response_array["patient_number"]);
$("#modal_heading").html("<?php echo __('investigations.receiving_lab_request_for') ?> " + response_array["patient_name"]);
$("#modal_hospital_unit").val(response_array["source"]);
$("#modal_lab_number").val(response_array["lab_number"]);
$("#modal_order_id").val(response_array["order_id"]);
$("#modal_patient_age").val(response_array["patient_age"]);
$("#modal_patient_telephone").val(response_array["telephone_number"]);
$("#modal_requested_by").val(response_array["requested_by"]);
$("#modal_patient_gender").val(response_array["patient_gender"]);
$('#modal_receive_request').modal('show');
}
});
}
$('#modal_add_specimen_button').click( function () {
let html_code = "<div class='row'>" +
"<div class='col-md-5'>" + $('#modal_specimen_div').html() + "</div>" +
"<div class='col-md-5'>" + $('#modal_status_div').html() + "</div>" +
"</div> <br> <div class='row'>" +
"<div class='col-md-10'><label for='modal_reason'>Reason/Comment</label>" +
"<textarea class='form-control modal_reason' rows='2' name='modal_reason[]'></textarea>" +
"</div><div class='col-md-2'></div>" +
"</div> <hr>";
$('#modal_more_specimen_section').append(html_code);
});
function save_receive_request() {
let selectedDate = $('#modal_received_date').val();
let orderID = $('#modal_order_id').val();
let labNumber = $('#modal_lab_number').val();
let specimenArray = [];
let statusArray = [];
let reasonArray = [];
// get the selected specimen
$('.modal_specimen').each(function () {
specimenArray.push(this.value);
});
if (specimenArray.length == 1 && specimenArray[0] == 0){
alert("<?php echo __('investigations.please_select_specimen') ?>");
return;
}
// get the selected status
$('.modal_status').each(function () {
statusArray.push(this.value);
});
// get the added reason
$('.modal_reason').each(function () {
reasonArray.push(this.value.replaceAll(',', ';'));
});
$.ajax({
method: 'POST',
url: '/investigations/save_receive_request_details',
data: {
'id': orderID,
'lab_number': labNumber,
'date': selectedDate,
'specimen': specimenArray,
'status': statusArray,
'reason': reasonArray
},
success: function(response){
if (response == 1) {
alert("Request has been received successfully");
location.reload();
//window.open('/investigations/print_request_barcode/' + orderID, '_blank');
} else {
// alert("Unable to receive the request. Please try again");
alert(response);
}
}
});
}
$('#modal_received_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,240 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style>
table td{
border-left: 1px solid #dddddd;
}
th{
white-space: nowrap;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.investigations') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!-- Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.minimum') }}</th>
<th>{{ __('investigations.sample_container') }}</th>
<th>{{ __('investigations.non_insured_price') }}</th>
<th>{{ __('investigations.comments') }}</th>
<th>{{ __('investigations.lab_time') }}</th>
<th>{{ __('investigations.category') }}</th>
<th>{{ __('investigations.hmis_category_out_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_out_patient') }}</th>
<th>{{ __('investigations.hmis_category_in_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_in_patient') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr>
<td>
{{ $investigation->name }}
@if(!$investigation->available) ({{ __('investigations.not_available') }}) @endif
</td>
<td>
@if($investigation->range_type == 1)
<a href="#" onclick="view_normal_ranges(<?php echo $investigation->id ?>)">View Reference Ranges</a>
@else
{{ $investigation->normal_ranges }}
@endif
</td>
<td>{{ $investigation->minimum }}</td>
<td>{{ $investigation->sample_container }}</td>
<td>{{ $investigation->non_insured_price }}</td>
<td>{{ $investigation->comments }}</td>
<td>{{ $investigation->lab_time }}</td>
<td>{{ $investigation_categories[$investigation->category] ?? "Not Set" }}</td>
@php
$hmis_no_outpatient_array = explode(",", $investigation->hmis_no_outpatient);
$hmis_outpatient_category_array = explode(",", $investigation->hmis_category);
@endphp
<td>{{ $investigation->hmis_no_outpatient }}</td>
<td>
@if(count($hmis_no_outpatient_array) > 0)
<ul>
@for($i=0; $i < count($hmis_outpatient_category_array); $i++)
<li>{{ $hmis_categories[$hmis_outpatient_category_array[$i]] ?? "" }}</li>
@endfor
</ul>
@endif
</td>
<td>{{ $investigation->hmis_no_inpatient }}</td>
<td>{{ $investigation_categories[$investigation->hmis_category_inpatient] ?? "" }}</td>
<td>
<a href="/investigations/{{ $investigation->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('investigations.edit') }}</a>
</td>
<td>
@if (!in_array($investigation->id, $ordered_investigations_ids))
{{ Form::model($investigation->id ,['method' => 'DELETE', 'route' => ['investigations.destroy', $investigation->id]]) }}
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('investigations.delete') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $investigations->links() }}
</div>
</div>
</div>
<div class="modal" id="modal_categorized_ranges" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="categorized_ranges_title"></b></h4>
</div>
<div class="modal-body">
<div class="row">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="col-md-6">
<h3>Male</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_male_' . $age->id]) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h3>Female</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_female_' . $age->id]) }}
<br>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
function view_normal_ranges(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_investigation_normal_ranges/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$('#categorized_ranges_title').text("Investigation Reference Ranges For " + responseArray["name"]);
let male_result = responseArray["male"];
let female_result = responseArray["female"];
for (var key in male_result) {
if (male_result.hasOwnProperty(key)) {
$("#dynamic_range_male_" + key).val(male_result[key]);
}
}
for (var key1 in female_result) {
if (female_result.hasOwnProperty(key1)) {
$("#dynamic_range_female_" + key1).val(female_result[key1]);
}
}
$('#modal_categorized_ranges').modal('show');
}
});
}
$('.table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
'copy',
{extend: 'csv',
message: "<?php echo __('investigations.list_of_investigations') ?>"
},
{extend: 'excel',
message: "<?php echo __('investigations.list_of_investigations') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
sheetName: "<?php echo __('investigations.list_of_investigations') ?>"
},
{extend: 'pdf',
message: "<?php echo __('investigations.list_of_investigations') ?>",
orientation: 'portrait',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{extend: 'print',
message: "<?php echo __('investigations.list_of_investigations') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
</script>
@endpush
@@ -0,0 +1,444 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
<link href="{{ asset('elite/bower_components/switchery/dist/switchery.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.order_investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.order') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
<br>
</div>
</div>
<div class="white-box">
<!--Flash messages at the top -->
@include('flash::message')
@foreach ($errors->all() as $error)
<div>{{ $error }}</div>
@endforeach
@if (count($chronic_array) > 0)
<table class='table color-bordered-table success-bordered-table'>
<thead><tr><th colspan="2">Patient's Chronic Investigations</th></tr></thead>
<tbody>
@foreach ($chronic_array as $chronic_inv)
@if(isset($investigations[$chronic_inv->investigation_id]))
<tr>
<td>{{ $investigations[$chronic_inv->investigation_id] }}</td>
<td><button type="button" class="btn btn-sm btn-rounded btn-outline-primary" onclick="add_inv_to_order({{ $chronic_inv->investigation_id }})">Add to current order</button></td>
</tr>
@endif
@endforeach
</tbody>
</table>
<hr>
@endif
{{ Form::open(['route' => 'investigations.submit_ordered_investigations']) }}
@php $patient_insurance_status = patient_insurance_status($patient_id); @endphp
{{ Form::hidden('patient_id', $patient_id, ['id' => 'patient_id']) }}
{{ Form::hidden('episode_id', $episode_id, ['id' => 'episode_id']) }}
{{ Form::hidden('patient_insurance_status', $patient_insurance_status, ['id' => 'patient_insurance_status'])}}
<div id='payments_items'>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class='row'>
<div class='col-3'>{{ __('investigations.investigation') }}</div>
<div class='col-2'>{{ __('investigations.lab_comments') }}</div>
<div class='col-3'>{{ __('investigations.order_comments') }}</div>
<div class='col-2' @if(view_investigation_price_on_order()==0) style='display: none' @endif>Cost</div>
<div class='col-1'>{{ __('investigations.urgent') }}</div>
<div class='col-1'></div>
</div>
</th>
</tr>
</thead>
@php
$counter = 0;
$total_selling_price = 0;
@endphp
<tbody class='input_fields_wrap'>
@if(count($ordered_investigations) > 0)
@foreach($ordered_investigations as $ordered_investigation)
{{ Form::hidden('order_id[]', $ordered_investigation->id) }}
@php
$investigations_ids = explode(",", $ordered_investigation->investigation_id);
$urgent_ids_array = explode(",", $ordered_investigation->urgent_ids);
$order_comments_array = explode(",", $ordered_investigation->order_comments);
$eye_array = explode(",", $ordered_investigation->eye);
@endphp
@for($i = 0; $i < count($investigations_ids); $i++)
<tr>
<td>
<div class='row'>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
{{ Form::select('investigations_id[]', $investigations_to_order, $investigations_ids[$i], ['class' => 'form-control compulsory required investigations_id_class', 'id' => 'investigations_id_' . $counter, 'required']) }}
</div>
<div id='chi_coverage_div_{{ $counter }}'>
@if (is_chi_enabled())
@if (is_patient_item_covered($patient_id, $investigations_ids[$i], 3))
&nbsp;&nbsp;<br><span style="color: darkgreen"><b>Covered by CHI</b></span>
@else
&nbsp;&nbsp;<br><span style="color: darkorange"><b>Not covered by CHI</b></span>
@endif
@endif
</div>
</div>
<div @if(!is_eye_module_enabled() || !is_patient_in_eye_clinic($episode_id)) style='display: none' @endif>
<hr>
<label><b>Eye</b></label>
{{ Form::select('eye[]', [2 => 'Both', 0 => 'Left', 1 => 'Right'], $eye_array[$i] ?? 2, ['class' => 'form-control compulsory', 'required', 'onchange' => 'eye_select(this.value, ' . $counter . ')']) }}
</div>
</div>
<div class='col-2'>
<div style='padding: 3px 3px 3px 4px; color: #C85F6A;' class='well margin-none span12' id='lab_comments_{{ $counter }}'>{{ get_name($investigations_ids[$i], 'id', 'comments', 'investigations') }}</div>
</div>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
<textarea class='form-control order_comments' name='order_comments[]' id='order_comments_{{ $counter }}' rows='3'>{{ $order_comments_array[$i] }}</textarea>
</div>
</div>
</div>
@php
if($patient_insurance_status == 1) {
$selling_price = get_item_insurance_co_payment($patient_id, $investigations_ids[$i], 3, false, 0);
} else {
// check if the patient category is attached to a price list
$price_list_id = is_patient_category_attached_to_price_list($patient_id);
if ($price_list_id) {
$selling_price = get_price_list_category_price($price_list_id, 2, $investigations_ids[$i]);
} else {
$selling_price = get_name($investigations_ids[$i], 'id', 'non_insured_price', 'investigations');
}
}
$selling_price = $selling_price * ((isset($eye_array[$i]) && $eye_array[$i] == 2) ? 2 : 1);
$total_selling_price += $selling_price;
@endphp
<div class='col-2' @if(view_investigation_price_on_order()==0) style='display: none' @endif>
<div class='form-group'>
<div class='controls'>
<input type='number' name='investigation_cost[]' id='investigation_cost_{{ $counter }}' class='form-control investigation_cost compulsory' readonly value='{{ $selling_price }}'/>
</div>
</div>
</div>
<div class='col-1'>
<input type='checkbox' name='urgent_id[]' id='urgent_id_{{ $counter }}' class='js-switch' data-color='#f96262' data-size='small' value="{{ $investigations_ids[$i] }}" @if(in_array($investigations_ids[$i], $urgent_ids_array)) checked @endif/>
</div>
<div class='col-1'>
<div class='form-group' style='margin-top: 10px;'>
@if($counter == 0)
<button class='btn btn-sm btn-rounded btn-success add_item' style='color: white; margin-left: 25px;'><i class='fa fa-plus'></i></button>
@else
<button class='remove_field btn btn-sm btn-rounded btn-danger' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>
@endif
</div>
</div>
</div>
</td>
</tr>
@php $counter++; @endphp
@endfor
@endforeach
@else
<tr>
<td>
<div class='row'>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
<select name='investigations_id[]' id='investigations_id_{{ $counter }}' class='form-control compulsory required investigations_id_class'>@php echo $investigations_select_code; @endphp</select>
</div>
<div id='chi_coverage_div_{{ $counter }}'></div>
</div>
<div @if(!is_eye_module_enabled() || !is_patient_in_eye_clinic($episode_id)) style='display: none' @endif>
<hr>
<label><b>Eye</b></label>
<select name='eye[]' class='form-control compulsory' onchange="eye_select(this.value, {{ $counter }})">
<option selected value='0'>Left</option>
<option value='1'>Right</option>
<option value='2'>Both</option>
</select>
</div>
</div>
<div class='col-2'>
<div style='padding: 3px 3px 3px 4px; color: #C85F6A;' class='well margin-none span12' id='lab_comments_{{ $counter }}' ></div>
</div>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
<textarea class='form-control order_comments' name='order_comments[]' id='order_comments_{{ $counter }}' rows='3'></textarea>
</div>
</div>
</div>
<div class='col-2' @if(view_investigation_price_on_order()==0) style='display: none' @endif>
<div class='form-group'>
<div class='controls'>
<input type='number' name='investigation_cost[]' id='investigation_cost_{{ $counter }}' class='form-control investigation_cost compulsory' readonly/>
</div>
</div>
</div>
<div class='col-1'>
<input type='checkbox' name='urgent_id[]' id='urgent_id_{{ $counter }}' class='js-switch' data-color='#f96262' data-size='small'/>
</div>
<div class='col-1'>
<div class='form-group' style='margin-top: 10px;'>
<button class='btn btn-sm btn-rounded btn-success add_item' style='color: white; margin-left: 25px;'><i class='fa fa-plus'></i></button>
</div>
</div>
</div>
</td>
</tr>
@endif
</tbody>
@if( Auth::user()->can('add-row-on-prescription'))
<tr>
<td>
<div class='row'>
<div class='col-6'>
</div>
<div class='col-1 prompts_div' id='prompts_div_{{ $counter }}'></div>
<div class='col-1'>
</div>
<div class='col-1 first_dose_quantity_div' style="display: none">
</div>
<div class='col-1' @if(view_prescription_price_on_order()==0) style='display: none' @endif>
</div>
<div class='col-1'>
</div>
<div class='col-1'>
<div class='form-group' style='margin-top: 10px;'>
<button class='btn btn-sm btn-rounded btn-success add_item pull-left' style='color: white; margin-left: 25px;'><span>Add row</span></button>
</div>
</div>
</div>
</td>
</tr>
@endif
</table>
</div>
<h3 @if(view_procedure_price_on_order()==0) style='display: none' @endif>Total: <span id="itemGrandTotal"> {{ ugandan_shillings($total_selling_price) }}</span></h3>
<div class="pull-right">
{{ Form::button(__('investigations.submit_requests'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button','name'=>'submit_button','value'=>'submit_button']) }}
{{ Form::button(__('investigations.print_requests'),['type'=>'submit','class'=>'btn btn-primary waves-effect waves-light m-r-10', 'id'=>'print_request','name'=>'submit_button','value'=>'print_request']) }}
</div>
<br
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/switchery/dist/switchery.min.js') }}"></script>
<script type="text/javascript">
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
$('.js-switch').each(function () {
new Switchery($(this)[0], $(this).data());
});
var max_rows = 500;
var wrapper = $(".input_fields_wrap");
var add_button = $(".add_item");
var show_price_setting = <?php echo view_investigation_price_on_order(); ?>;
var is_eye_module_enabled = <?php echo (!is_eye_module_enabled() || !is_patient_in_eye_clinic($episode_id)) ? 1 : 0; ?>;
var x = <?php echo $counter + 1; ?> // initial row count
add_button.click(function (e) { // on add input button click
e.preventDefault();
add_invs_row();
});
function add_invs_row() {
if (x < max_rows) {
$(wrapper).append("\
<tr>\
<td>\
<div class='row'>\
<div class='col-3'>\
<div class='form-group'>\
<div class='controls'>\
<select name='investigations_id[]' id='investigations_id_" + x + "' class='form-control compulsory required investigations_id_class' required>@php echo $investigations_select_code; @endphp</select>\
</div>\
<div id='chi_coverage_div_" + x + "'></div>\
</div>\
<div "+(is_eye_module_enabled==1?'style="display:none"':'')+">\
<hr><label><b>Eye</b></label>\
<select name='eye[]' class='form-control compulsory' onchange='eye_select(this.value, " + x + ")'>\
<option selected value='0'>Left</option>\
<option value='1'>Right</option>\
<option value='2'>Both</option>\
</select></div>\
</div>\
<div class='col-2'>\
<div style='padding: 3px 3px 3px 4px; color: #C85F6A;' class='well margin-none span12' id='lab_comments_" + x + "' ></div>\
</div>\
<div class='col-3'>\
<div class='form-group'>\
<div class='controls'>\
<textarea class='form-control order_comments' name='order_comments[]' id='order_comments_" + x + "' rows='3'></textarea>\
</div>\
</div>\
</div>\
<div class='col-2'"+(show_price_setting==0?'style="display:none"':'')+">\
<div class='form-group'>\
<div class='controls'>\
<input type='number' name='investigation_cost[]' id='investigation_cost_" + x + "' class='form-control investigation_cost compulsory' readonly/>\
</div>\
</div>\
</div>\
<div class='col-1'>\
<input type='checkbox' name='urgent_id[]' id='urgent_id_" + x + "' class='js-switch' data-color='#f96262' data-size='small'/>\
</div>\
<div class='col-1'>\
<div class='form-group' style='margin-top: 10px;'>\
<button class='btn btn-sm btn-rounded btn-danger remove_field' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('investigations_id_'+x);
new Switchery($('#urgent_id_'+x)[0], $('#urgent_id_'+x).data());
x++;
}
}
$(wrapper).on("click", ".remove_field", function (e) {
e.preventDefault();
$(this).parent('div').parent('div').parent('div').parent('td').parent('tr').remove();
});
$(".investigations_id_class").select2({
width: "100%"
});
function eye_select(value, id) {
// for eye both
if(value == 2) {
let item = $("#investigations_id_" + id).val();
let patient_id = $('#patient_id').val();
$.ajax({
url: '/investigations/get_investigation_details',
data: {'investigation_id':item, 'patient_id':patient_id},
success: function(response){
let arr = JSON.parse(response);
$('#investigation_cost_' + id).val(arr["selling_price"] * 2);
calculateTotal();
}
});
}
}
$(".input_fields_wrap").on('change', ".investigations_id_class", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var item = $("#investigations_id_" + id).val();
var patient_id = $('#patient_id').val();
let patient_insurance_status = $('#patient_insurance_status').val();
$.ajax({
url: '/investigations/get_investigation_details',
data: {'investigation_id':item, 'patient_id':patient_id, 'patient_insurance_status': patient_insurance_status},
success: function(response){
let arr = JSON.parse(response);
$('#order_comments_' + id).text(arr["comments"]);
$('#investigation_cost_' + id).val(arr["selling_price"]);
$('#urgent_id_' + id).val(item);
if (arr["covered_by_chi"] !== "") {
$("#chi_coverage_div_" + id).html(arr["covered_by_chi"]).show();
} else {
$("#chi_coverage_div_" + id).hide();
}
calculateTotal();
}
});
});
function calculateTotal() {
//loop through the prices
let auto_price_grand_total = 0;
$(".investigation_cost").each(function(){
auto_price_grand_total += parseInt($(this).val());
});
// recalculate the grand total
$("#itemGrandTotal").html(numberWithCommas(auto_price_grand_total) + " Ugx");
}
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function generalSelect2Set(id) {
$('#'+id).select2({
width: "100%"
});
}
function add_inv_to_order(inv_id) {
add_invs_row();
$('#investigations_id_' + (x - 1)).select2().val(inv_id).trigger('change');
}
</script>
@endpush
@@ -0,0 +1,137 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-5">
<h4 class="page-title">{{ __('investigations.obstetric_ultrasound_request_template') }}</h4>
</div>
<div class="col-md-7">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.obstetric_ultrasound') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
<br>
</div>
</div>
<div class="white-box">
<div class="row">
<div class="col-md-5">
{{ Form::open(['route' => 'investigations.submit_ordered_obstetric_investigations']) }}
<div class="form-group">
{{ Form::label('investigations_id', __('investigations.investigation')) }}
{{ Form::select('investigations_id', $investigations, '', ['class' => 'form-control compulsory investigations', 'required']) }}
</div>
<div class="form-group">
{{ Form::label('comment', __('investigations.order_comment')) }}
{{ Form::textArea('comment', '', ['class'=>'form-control', 'rows' => 5]) }}
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button']) }}
{{ Form::close() }}
</div>
<div class="col-md-7">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.item') }}</th>
<th>{{ __('investigations.value') }}</th>
</tr>
</thead>
<tbody>
@if($anc_details)
<tr>
<td>{{ __('investigations.gravida') }}</td>
<td>{{ $anc_details->gravida }}</td>
</tr>
<tr>
<td>{{ __('investigations.para') }}</td>
<td>{{ $anc_details->para }}</td>
</tr>
<tr>
<td>{{ __('investigations.abortions') }}</td>
<td>{{ $anc_details->abortion }}</td>
</tr>
<tr>
<td colspan="2" class="text-center"><h4><b>{{ __('investigations.this_pregnancy') }}</b></h4></td>
</tr>
<tr>
<td>{{ __('investigations.lmp') }}</td>
<td>
@if($anc_details->lmp == 'N/A')
N/A
@else
{{ streamline_date($anc_details->lmp) }}
@endif
</td>
</tr>
<tr>
<td>{{ __('investigations.accuracy') }}</td>
<td>
@if($anc_details->accuracy == 'N/A')
N/A
@else
{{ get_name($anc_details->accuracy, 'id', 'name', 'ante_natal_clinic_accuracies') }}
@endif
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
@if($anc_details->edd == 'N/A')
N/A
@else
{{ streamline_date($anc_details->edd) }}
@endif
</td>
</tr>
<tr>
<td>{{ __('investigations.clinic') }}</td>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
</tr>
<tr>
<td>{{ __('investigations.requested_by') }}</td>
<td>{{ get_full_name(Auth::user()->id, 'id', 'first_name', 'last_name', 'users') }}</td>
</tr>
<tr>
<td>{{ __('investigations.phone') }}</td>
<td>{{ get_name(Auth::user()->id, 'id', 'phone', 'users') }}</td>
</tr>
@else
<tr>
<td colspan="2">{{ __('investigations.information_not_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$(".investigations").select2({
width: "100%"
});
</script>
@endpush
@@ -0,0 +1,9 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="/investigations/create" class="btn btn-default ti-plus"> {{ __('investigations.new_investigation') }}</a>
<a href="/investigations/" class="btn btn-default ti-pencil"> {{ __('investigations.active_investigations') }}</a>
<a href="/investigations/edit/all" class="btn btn-default ti-pencil"> {{ __('investigations.bulk_edit') }}</a>
<a href="/investigations/edit/hmis-options" class="btn btn-default ti-pencil"> {{ __('investigations.edit_hmis_options') }}</a>
<a href="/investigations/inactive" class="btn btn-default ti-pencil"> {{ __('investigations.inactive_investigations') }}</a>
</div>
</div>
@@ -0,0 +1,898 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.ordered') }} {{ $order_type }} {{ __('investigations.investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.incoming') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::open(['route' => 'investigations.save_ordered_results', 'files' => true, 'enctype'=>'multipart/form-data']) }}
{{-- {{ Form::open(['route' => 'investigations.ordered_results']) }} --}}
{{ Form::hidden('order_id',$order_id) }}
{{ Form::hidden('order_type', $order_type) }}
{{ Form::hidden('patient_id',$patient_id) }}
{{ Form::hidden('episode_id',$episode_id) }}
@php
$right_eye_diagnoses = explode(',',get_name($episode_id, 'episode_id', 'right_eye_diagnosis', 'eye_clinic_main_exam'));
$left_eye_diagnoses = explode(',',get_name($episode_id, 'episode_id', 'left_eye_diagnosis', 'eye_clinic_main_exam'));
$is_eye_module_enabled = is_eye_module_enabled() && is_patient_in_eye_clinic($episode_id);
@endphp
<div class="row">
<div class="col-md-6">
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>
@if($is_eye_module_enabled)
{{ __('patient_episode.left_eye_diagnosis') }}
@else
{{ __('investigations.primary_diagnosis') }}
@endif
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
@if($is_eye_module_enabled)
@if(count($left_eye_diagnoses) > 0)
<ol>
@for($x = 0; $x < count($left_eye_diagnoses); $x++)
<li>{{ isset($left_eye_diagnoses[$x]) ? get_name($left_eye_diagnoses[$x], 'id', 'name', 'diagnoses') : 'N/A' }}</li>
@endfor
</ol>
@else
No Diagnosis
@endif
@else
{{ $primary_diagnosis != 'N/A' ? $primary_diagnosis : '' }}
@endif
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6">
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>
@if($is_eye_module_enabled)
{{ __('patient_episode.right_eye_diagnosis') }}
@else
{{ __('investigations.other_diagnoses') }}
@endif
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
@if($is_eye_module_enabled)
@if(count($right_eye_diagnoses) > 0)
<ol>
@for($x = 0; $x < count($right_eye_diagnoses); $x++)
<li>{{ isset($right_eye_diagnoses[$x]) ? get_name($right_eye_diagnoses[$x], 'id', 'name', 'diagnoses') : 'N/A' }}</li>
@endfor
</ol>
@else
No Diagnosis
@endif
@else
@foreach($other_diagnoses as $value)
<tr>
<td>
{{ $value['other'] != 'N/A' ? $value['other'] : '' }}
</td>
</tr>
@endforeach
@endif
</td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="table color-bordered-table success-bordered-table table-striped table-bordered">
<thead>
<tr>
<th width="10%">{{ __('investigations.investigation') }}</th>
@if($order_type == 'Lab')
<th width="13%">{{ __('investigations.normal_ranges') }}</th>
<th width="10%">{{ __('investigations.units') }}</th>
@endif
<th width="12%">{{ __('investigations.order_comments') }}</th>
<th width="34%">{{ __('investigations.results') }}</th>
<th width="20%">{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<!-- investigation_specialised_results id to update the table if valid -->
{{ Form::hidden('investigation_specialised_results_id[]', $result['investigation_specialised_results_id']) }}
@if(in_array($result['id'], $investigations_with_specialised_variables))
{{ Form::hidden('id[]',$result['id']) }}
<!-- placeholder values -->
{{ Form::hidden('value[]',"") }}
{{ Form::hidden('comment[]',"") }}
<tr>
<td colspan="6">
@if($result['insured'] == 1)
<span style='color: green;'>{{ $result['name'] }}</span>
@else
<span style='color: orange;'>{{ $result['name'] }}</span>
@endif
</td>
@if ($is_eye_module_enabled && isset($result['eye']))
<hr>
@if ($result['eye'] == '0')
<span class="label label-info">Left Eye</span>
@elseif ($result['eye'] == '1')
<span class="label label-info">Right Eye</span>
@elseif ($result['eye'] == '2')
<span class="label label-info">Both Eyes</span>
@endif
@endif
</tr>
@php
$specialised_variables = \Illuminate\Support\Facades\DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $result['id'])->orderBy('ranking','asc')->get();
@endphp
@foreach($specialised_variables as $specialized_variable)
<tr>
<td>
{{ Form::hidden('specialized_id[]', $specialized_variable->id) }}
{{ $specialized_variable->name }}
</td>
@if($order_type == 'Lab')
<td>
@if($specialized_variable->range_type == 1)
{{ get_dynamic_normal_range_specialized($specialized_variable->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $specialized_variable->normal_ranges }}
@endif
</td>
<td>
@if(get_name($specialized_variable->units, 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($specialized_variable->units, 'id', 'name', 'unit_of_measure') }}
@endif
</td>
@endif
<td></td>
<td>
{{ Form::textArea('specialized_value[]', (isset($result['value']) && isset($result['value'][$specialized_variable->id])) ? $result['value'][$specialized_variable->id] : '', ['class' => 'form-control compulsory', 'rows'=>'12', 'id' => 'invx_' . $specialized_variable->id]) }}
@if(does_investigation_have_template($specialized_variable->id, 1))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_specialised_results_template{{ $specialized_variable->id }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
<br>
{{ Form::label('lab_result_document', __('investigations.lab_result_document')) }}
{{ Form::file('lab_result_document[]', null, ['id'=>'lab_result_doc_' . $specialized_variable->id]) }}
@if (!empty($result['document']))
<br><a class="label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank"> {{ $result['title'] }}</a>
@endif
</td>
<td>
{{ Form::textArea('specialized_comment[]', (isset($result['comment']) && isset($result['comment'][$specialized_variable->id])) ? $result['comment'][$specialized_variable->id] : '', ['class' => 'form-control','rows'=>'12']) }}
</td>
</tr>
@endforeach
<tr><td colspan="6"></td></tr>
@else
<tr>
<td>
@if($result['insured'] == 1)
<span style='color: green;'>
{{ $result['name'] }}
</span>
@else
<span style='color: orange;'>
{{ $result['name'] }}
</span>
@endif
@if ($is_eye_module_enabled && isset($result['eye']))
<hr>
@if ($result['eye'] == '0')
<span class="label label-info">Left Eye</span>
@elseif ($result['eye'] == '1')
<span class="label label-info">Right Eye</span>
@elseif ($result['eye'] == '2')
<span class="label label-info">Both Eyes</span>
@endif
@endif
{{ Form::hidden('id[]',$result['id']) }}
</td>
@if($order_type == 'Lab')
<td>
{{ $result['normal_range'] }}
</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'unit_of_measure') }}
@endif
</td>
@endif
<td>
{{ $result['order_comments'] }}
</td>
<td>
@if($result['slug'] == 'echo')
<div class="row">
<div class="col-md-7">
<button class="fcbtn btn btn-sm btn-info btn-outline btn-1d" data-toggle="modal" data-target="#cardio-echo-modal" type="button">
<span class="btn-label"><i class="fa fa-plus"></i></span>{{ __('investigations.add_results') }}
</button>
</div>
<div class="col-md-4">
<span id="cardio_print_div" @if(!isset($cardioEcho)) style="display: none;" @endif>
<a target="_blank" class="fcbtn btn btn-sm btn-default btn-outline btn-1d" href='{{ url("/investigations/print-cardio-echo/{$patient_id}/{$episode_id}") }}'> <i class="fa fa-print"></i> <span>{{ __('investigations.print') }}</span></a>
</span>
</div>
</div>
{{ Form::hidden('value[]', $result['value'], ['class' => 'form-control compulsory', 'rows'=>'12']) }}
@else
{{ Form::textArea('value[]', $result['value'], ['class' => 'form-control compulsory', 'rows'=>'12', 'id'=>'inv_'.$result['id']]) }}
@if(does_investigation_have_template($result['id'], 0))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_results_template{{ $result['id'] }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
<br>
{{ Form::label('lab_result_document', __('investigations.lab_result_document')) }}
{{ Form::file('lab_result_document[]', null, ['class' => 'form-control', 'id'=>'lab_result_doc_'.$result['id']]) }}
@if (!empty($result['document']))
<br><a class="label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank"> {{ $result['title'] }}</a>
@endif
@endif
</td>
<td>
@if ($result['slug'] != 'echo')
{{ Form::textArea('comment[]', $result['comment'], ['class' => 'form-control','rows'=>'12']) }}
@else
{{ Form::hidden('comment[]', $result['comment'], ['class' => 'form-control compulsory', 'rows'=>'12']) }}
@endif
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<hr>
<div class="row">
<div class="col-md-6">
<span style="font-weight: bold;">
{{ __('investigations.investigations_ordered_by') }}
</span>
<br>
<span style="color: green;">
{{ $doctor_name }} [ {{ $doctor_phone }} ]
</span>
</div>
<div class="col-md-6">
<button type="submit" name="submit_results" class="btn btn-info pull-right">{{ __('investigations.update_results') }}</button>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
<div id="result_template_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="resultTemplateModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="resultTemplateModalLabel">{{ __('investigations.select_a_template') }}</h2>
</div>
<input type="hidden" id="selected_investigation">
<div class="modal-body" id="template_view"></div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
</div>
</div>
</div>
</div>
<!-- MODAL - Content for adding Cardiology ECHO Result -->
<div id="cardio-echo-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="myLargeModalLabel">ECHO 2-D &amp; DOPPLER STUDY</h2>
</div>
<form id="cardio-echo-form" method="post" action="javascript:void(0)">
@csrf
{{ Form::hidden('patient_id',$patient_id, ['id' => 'patient_id']) }}
{{ Form::hidden('episode_id',$episode_id, ['id' => 'episode_id']) }}
{{ Form::hidden('cardio_template_selected',0, ['id' => 'cardio_template_selected']) }}
<?php
// Get the previously saved mode measurements for cardio echo
if (isset($cardioEcho)):
$modeMeasurements = unserialize($cardioEcho->mode_measurements);
$dopplerStudy = unserialize($cardioEcho->doppler_study);
$cardioDescriptions = unserialize($cardioEcho->descriptions);
$cardioDescriptionOrder = unserialize($cardioEcho->descriptions_order);
$range = unserialize($cardioEcho->range);
else:
$modeMeasurements = [];
$dopplerStudy = [];
$cardioDescriptions = [];
$cardioDescriptionOrder = [];
$range = [];
endif;
?>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
{{ Form::select('template', $templates, '', ['class' => 'form-control', 'required', 'id' => 'template']) }}
</div>
<div class="col-md-3">
<a class="btn btn-info btn-sm" id="apply_echo_cardio">{{ __('investigations.apply_echo_cardiology_template') }}</a>
</div>
<div class="col-md-3"></div>
</div>
<hr>
<h4>2-D/M-MODE MEASUREMENTS (Centimeters)</h4>
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>IVS</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ivs_result" name="ivs_result" class="form-control" value="{{ $modeMeasurements['IVS'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ivs_range" id="ivs_range" class="form-control" value="{{ $range['IVS'] ?? '' }}" placeholder="(0.6 - 1.1)" readonly></span>
</td>
<td style="text-align: center;">AO</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="ao_result" name="ao_result"class="form-control" value="{{ $modeMeasurements['AO'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ao_range" id="ao_range" class="form-control" value="{{ $range['AO'] ?? '' }}" placeholder="(2.0 - 4)" readonly></span>
</td>
<td style="text-align: center;">EF (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ef_result" name="ef_result" class="form-control" value="{{ $modeMeasurements['EF (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ef_range" id="ef_range" class="form-control" value="{{ $range['EF (%)'] ?? '' }}" placeholder="( 55 - 80 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDd</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvidd_result" name="lvidd_result" class="form-control" value="{{ $modeMeasurements['LVIDd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvidd_range" id="lvidd_range" class="form-control" value="{{ $range['LVIDd'] ?? '' }}" placeholder="(3.5 - 5.7)" readonly></span>
</td>
<td style="text-align: center;">LA</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="la_result" name="la_result" class="form-control" value="{{ $modeMeasurements['LA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="la_range" id="la_range" class="form-control" value="{{ $range['LA'] ?? '' }}" placeholder="( 2.0 - 4.0 )" readonly></span>
</td>
<td style="text-align: center;">FS (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="fs_result" name="fs_result" class="form-control" value="{{ $modeMeasurements['FS (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="fs_range" id="fs_range" class="form-control" value="{{ $range['FS (%)'] ?? '' }}" placeholder="( 26 - 55 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDs</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvids_result" name="lvids_result" class="form-control" value="{{ $modeMeasurements['LVIDs'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvids_range" id="lvids_range" class="form-control" value="{{ $range['LVIDs'] ?? '' }}" placeholder="(2.5 - 4.0)" readonly></span>
</td>
<td style="text-align: center;">RV</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="rv_result" name="rv_result" class="form-control" value="{{ $modeMeasurements['RV'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="rv_range" id="rv_range" class="form-control" value="{{ $range['RV'] ?? '' }}" placeholder="(2.0 - 4.1)" readonly></span>
</td>
<td style="text-align: center;">TAPSE:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="tapse_result" name="tapse_result" class="form-control" value="{{ $modeMeasurements['TAPSE'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tapse_range" id="tapse_range" class="form-control" value="{{ $range['TAPSE'] ?? '' }}" placeholder="(1.6)" readonly></span>
</td>
</tr>
<tr>
<td>LVPW</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvpwd_result" name="lvpwd_result" class="form-control" value="{{ $modeMeasurements['LVPWd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvpwd_range" id="lvpwd_range" class="form-control" value="{{ $range['LVPWd'] ?? '' }}" placeholder="( 0.6 - 1.2 )" readonly></span>
</td>
<td style="text-align: center;">RA:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ra_result" name="ra_result" class="form-control" value="{{ $modeMeasurements['RA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ra_range" id="ra_range" class="form-control" value="{{ $range['RA'] ?? '' }}" placeholder="(16 cm2)" readonly></span>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h4>DOPPLER FINDINGS</h4>
<div class="table-responsive">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Mitral E/A ratio</td>
<td>
<input type="number" min="0" step="0.01" id="mitral_ea_ratio" name="mitral_ea_ratio" value="{{ $dopplerStudy['Mitral EA ratio'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>TR Max. PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="tr_pg" name ="tr_pg" value="{{ $dopplerStudy['TR PG'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tr_pg_range" id="tr_pg_range" class="form-control" value="{{ $range['TR PG'] ?? '' }}" placeholder="( 15 - 25 )" readonly></span>
</td>
<td>AV mean PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="av_mean" name ="av_vmean" value="{{ $dopplerStudy['AV Vmean'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
</tr>
<tr>
<td>AV Vel. max (m/s)</td>
<td>
<input type="number" min="0" step="0.01" id="av_vmax" name ="av_vmax" value="{{ $dopplerStudy['AV Vmax'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>RAP (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="rap" name="rap" value="{{ $dopplerStudy['RAP'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<h4>{{ __('investigations.description') }}</h4>
<div class="table-responsive">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>
<span data-toggle="tooltip" data-original-title="Organise how you want the items to be printed on a PDF in order from 1 to 10">{{ __('investigations.print_order') }} <i class="fa fa-question"></i></span>
</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 10%">{{ Form::number('left_ventricle_order', $cardioDescriptionOrder['left_ventricle_order'] ?? 1, ['class' => 'form-control description_order', 'id' => 'left_ventricle_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Left Ventricle</td>
<td>
<textarea name="left_ventricle_description" id="left_ventricle_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['left_ventricle_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('right_ventricle_order', $cardioDescriptionOrder['right_ventricle_order'] ?? 2, ['class' => 'form-control description_order', 'id' => 'right_ventricle_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Right Ventricle</td>
<td>
<textarea name="right_ventricle_description" id="right_ventricle_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['right_ventricle_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('left_atrium_order', $cardioDescriptionOrder['left_atrium_order'] ?? 3, ['class' => 'form-control description_order', 'id' => 'left_atrium_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Left Atrium</td>
<td>
<textarea name="left_atrium_description" id="left_atrium_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['left_atrium_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('right_atrium_order', $cardioDescriptionOrder['right_atrium_order'] ?? 4, ['class' => 'form-control description_order', 'id' => 'right_atrium_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Right Atrium</td>
<td>
<textarea name="right_atrium_description" id="right_atrium_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['right_atrium_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('aortic_valve_order', $cardioDescriptionOrder['aortic_valve_order'] ?? 5, ['class' => 'form-control description_order', 'id' => 'aortic_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Aortic Valve</td>
<td>
<textarea name="aortic_valve_description" id="aortic_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['aortic_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('mitral_valve_order', $cardioDescriptionOrder['mitral_valve_order'] ?? 6, ['class' => 'form-control description_order', 'id' => 'mitral_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Mitral Valve</td>
<td>
<textarea name="mitral_valve_description" id="mitral_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['mitral_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('pulmonary_valve_order', $cardioDescriptionOrder['pulmonary_valve_order'] ?? 7, ['class' => 'form-control description_order', 'id' => 'pulmonary_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Pulmonary Valve</td>
<td>
<textarea name="pulmonary_valve_description" id="pulmonary_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['pulmonary_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('tricuspid_valve_order', $cardioDescriptionOrder['tricuspid_valve_order'] ?? 8, ['class' => 'form-control description_order', 'id' => 'tricuspid_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Tricuspid Valve</td>
<td>
<textarea name="tricuspid_valve_description" id="tricuspid_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['tricuspid_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('aortic_root_and_arch_order', $cardioDescriptionOrder['aortic_root_and_arch_order'] ?? 9, ['class' => 'form-control description_order', 'id' => 'aortic_root_and_arch_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Aortic root and arch</td>
<td>
<textarea name="aortic_root_and_arch_description" id="aortic_root_and_arch_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['aortic_root_and_arch_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('pericardium_order', $cardioDescriptionOrder['pericardium_order'] ?? 10, ['class' => 'form-control description_order', 'id' => 'pericardium_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Pericardium</td>
<td>
<textarea name="pericardium_description" id="pericardium_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['pericardium_description'] ?? '' }}</textarea>
</td>
</tr>
</tbody>
</table>
</div>
<hr>
<label class="control-label">{{ __('investigations.conclusion') }}</label>
<textarea id="cardio_echo_conclusion" name="cardio_echo_conclusion" rows="5" class="form-control">{{ $cardioEcho->conclusion ?? '' }}</textarea>
</div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
<button type="submit" id="submit-echo-results" class="btn btn-success waves-effect text-left">{{ __('investigations.submit_results') }}</button>
</div>
</form>
</div>
</div>
</div>
<!-- modal to flash successful submission of cardio-echo results -->
<div class="modal fade" id="flashEchoSubmissionSuccess" tabindex="-1" role="dialog">
<div class="modal-dialog vertical-align-center modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
{{ __('investigations.successful_submission_of_echo_results') }}
</div>
</div>
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<button class="btn btn-success waves-effect text-left" data-dismiss="modal">{{ __('investigations.ok') }}</button>
</div>
<div class="col-sm-4"></div>
</div>
</div>
</div>
</div>
</div>
<!-- end of modal for flash successful submission of echo results -->
@endsection
@push('scripts')
<script type="text/javascript">
$("[id^='select_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 0);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(id);
});
$("[id^='select_specialised_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 1);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(0 + "-" + id);
});
function add_templates(id, is_variable) {
$.ajax({
method: 'GET',
url: '/result_templates/get_templates_for_investigation/' + id + '/' + is_variable,
success: function(response){
$('#template_view').html(response);
}
});
}
function confirm_selection(id){
let input_field_id = $('#selected_investigation').val();
if(input_field_id[0] == 0) {
let split_text = input_field_id.split("-");
$('#invx_'+split_text[1]).val($('#template_'+id).text());
} else {
$('#inv_'+input_field_id).val($('#template_'+id).text());
}
$('#result_template_modal').modal('hide');
}
$('#apply_echo_cardio').click(function () {
var template_id = parseInt($('#template').val());
if (!isNaN(template_id) && template_id != 0) {
$.ajax({
type: "get",
url: '/fetch_cardio_echo_template/' + template_id,
cache: false,
success: function (result) {
var result_array = JSON.parse(result);
$('#cardio_template_selected').val(template_id);
$('#lad_result').val(result_array['LAD']);
$('#ivs_result').val(result_array['IVS']);
$('#fs_result').val(result_array['FS (%)']);
$('#ao_result').val(result_array['AO']);
$('#lvidd_result').val(result_array['LVIDd']);
$('#ef_result').val(result_array['EF (%)']);
$('#la_result').val(result_array['LA']);
$('#lvpwd_result').val(result_array['LVPWd']);
$('#ea_result').val(result_array['E:A']);
$('#rvidd_result').val(result_array['RVIDd']);
$('#sv_result').val(result_array['SV']);
$('#tapse_result').val(result_array['TAPSE']);
$('#lvids_result').val(result_array['LVIDs']);
$('#ra_result').val(result_array['RA']);
$('#rv_result').val(result_array['RV']);
$('#av_vmax').val(result_array['AV Vmax']);
$('#av_mean').val(result_array['AV Vmean']);
$('#mitral_ea_ratio').val(result_array['Mitral EA ratio']);
$('#tr_pg').val(result_array['TR PG']);
$('#rap').val(result_array['RAP']);
$('#mitral_valve_insufficiency').val(result_array['Mitral Valve I']);
$('#mitral_valve_stenosis').val(result_array['Mitral Valve S']);
$('#aortic_valve_insufficiency').val(result_array['Aortic Valve I']);
$('#aortic_valve_stenosis').val(result_array['Aortic Valve S']);
$('#pulmonary_valve_insufficiency').val(result_array['Pulmonary Valve I']);
$('#pulmonary_valve_stenosis').val(result_array['Pulmonary Valve S']);
$('#tricuspid_valve_insufficiency').val(result_array['Tricuspid Valve I']);
$('#tricuspid_valve_stenosis').val(result_array['Tricuspid Valve S']);
$('#left_ventricle_description').val(result_array['left_ventricle_description']);
$('#right_ventricle_description').val(result_array['right_ventricle_description']);
$('#right_atrium_description').val(result_array['right_atrium_description']);
$('#left_atrium_description').val(result_array['left_atrium_description']);
$('#aortic_valve_description').val(result_array['aortic_valve_description']);
$('#mitral_valve_description').val(result_array['mitral_valve_description']);
$('#pulmonary_valve_description').val(result_array['pulmonary_valve_description']);
$('#tricuspid_valve_description').val(result_array['tricuspid_valve_description']);
$('#aortic_root_and_arch_description').val(result_array['aortic_root_and_arch_description']);
$('#pericardium_description').val(result_array['pericardium_description']);
$('#cardio_echo_conclusion').val(result_array['conclusion']);
$('#lad_range').val(result_array['range_LAD']);
$('#ivs_range').val(result_array['range_IVS']);
$('#fs_range').val(result_array['range_FS (%)']);
$('#ao_range').val(result_array['range_AO']);
$('#lvidd_range').val(result_array['range_LVIDd']);
$('#ef_range').val(result_array['range_EF (%)']);
$('#la_range').val(result_array['range_LA']);
$('#lvpwd_range').val(result_array['range_LVPWd']);
$('#ea_range').val(result_array['range_E:A']);
$('#rvidd_range').val(result_array['range_RVIDd']);
$('#sv_range').val(result_array['range_SV']);
$('#tapse_range').val(result_array['range_TAPSE']);
$('#lvids_range').val(result_array['range_LVIDs']);
$('#ra_range').val(result_array['range_RA']);
$('#rv_range').val(result_array['range_RV']);
$('#tr_pg_range').val(result_array['range_TR PG']);
}
});
} else {
alert("Please select an echo cardiology template");
}
});
$('#submit-echo-results').click(function () {
var patient_id = $('#patient_id').val();
var episode_id = $('#episode_id').val();
var cardio_template_selected = $('#cardio_template_selected').val();
var lad_result = $('#lad_result').val();
var ivs_result = $('#ivs_result').val();
var fs_result = $('#fs_result').val();
var ao_result = $('#ao_result').val();
var lvidd_result = $('#lvidd_result').val();
var ef_result = $('#ef_result').val();
var la_result = $('#la_result').val();
var lvpwd_result = $('#lvpwd_result').val();
var ea_result = $('#ea_result').val();
var rvidd_result = $('#rvidd_result').val();
var sv_result = $('#sv_result').val();
var tapse_result = $('#tapse_result').val();
var lvids_result = $('#lvids_result').val();
var ra_result = $('#ra_result').val();
var rv_result = $('#rv_result').val();
var av_vmax = $('#av_vmax').val();
var av_mean = $('#av_mean').val();
var mitral_ea_ratio = $('#mitral_ea_ratio').val();
var tr_pg = $('#tr_pg').val();
var rap = $('#rap').val();
var mitral_valve_insufficiency = $('#mitral_valve_insufficiency').val();
var mitral_valve_stenosis = $('#mitral_valve_stenosis').val();
var aortic_valve_insufficiency = $('#aortic_valve_insufficiency').val();
var aortic_valve_stenosis = $('#aortic_valve_stenosis').val();
var pulmonary_valve_insufficiency = $('#pulmonary_valve_insufficiency').val();
var pulmonary_valve_stenosis = $('#pulmonary_valve_stenosis').val();
var tricuspid_valve_insufficiency = $('#tricuspid_valve_insufficiency').val();
var tricuspid_valve_stenosis = $('#tricuspid_valve_stenosis').val();
var cardio_echo_comments = $('#cardio_echo_comments').val();
var cardio_echo_conclusion = $('#cardio_echo_conclusion').val();
var left_ventricle_description = $('#left_ventricle_description').val();
var right_ventricle_description = $('#right_ventricle_description').val();
var right_atrium_description = $('#right_atrium_description').val();
var left_atrium_description = $('#left_atrium_description').val();
var aortic_valve_description = $('#aortic_valve_description').val();
var mitral_valve_description = $('#mitral_valve_description').val();
var pulmonary_valve_description = $('#pulmonary_valve_description').val();
var tricuspid_valve_description = $('#tricuspid_valve_description').val();
var aortic_root_and_arch_description = $('#aortic_root_and_arch_description').val();
var pericardium_description = $('#pericardium_description').val();
var left_ventricle_order = $('#left_ventricle_order').val();
var right_ventricle_order = $('#right_ventricle_order').val();
var right_atrium_order = $('#right_atrium_order').val();
var left_atrium_order = $('#left_atrium_order').val();
var aortic_valve_order = $('#aortic_valve_order').val();
var mitral_valve_order = $('#mitral_valve_order').val();
var pulmonary_valve_order = $('#pulmonary_valve_order').val();
var tricuspid_valve_order = $('#tricuspid_valve_order').val();
var aortic_root_and_arch_order = $('#aortic_root_and_arch_order').val();
var pericardium_order = $('#pericardium_order').val();
let data = {
'patient_id' : patient_id,
'episode_id' : episode_id,
'cardio_template_selected' : cardio_template_selected,
'lad_result' : lad_result,
'ivs_result' : ivs_result,
'fs_result' : fs_result,
'ao_result': ao_result,
'lvidd_result' : lvidd_result,
'ef_result' : ef_result,
'la_result' : la_result,
'lvpwd_result' : lvpwd_result,
'ea_result' : ea_result,
'rvidd_result': rvidd_result,
'sv_result': sv_result,
'tapse_result': tapse_result,
'lvids_result': lvids_result,
'ra_result': ra_result,
'rv_result': rv_result,
'av_vmax': av_vmax,
'av_mean': av_mean,
'mitral_ea_ratio': mitral_ea_ratio,
'tr_pg': tr_pg,
'rap': rap,
'mitral_valve_insufficiency': mitral_valve_insufficiency,
'mitral_valve_stenosis': mitral_valve_stenosis,
'aortic_valve_insufficiency': aortic_valve_insufficiency,
'aortic_valve_stenosis': aortic_valve_stenosis,
'pulmonary_valve_insufficiency': pulmonary_valve_insufficiency,
'pulmonary_valve_stenosis': pulmonary_valve_stenosis,
'tricuspid_valve_insufficiency': tricuspid_valve_insufficiency,
'tricuspid_valve_stenosis': tricuspid_valve_stenosis,
'left_ventricle_description': left_ventricle_description,
'right_ventricle_description': right_ventricle_description,
'right_atrium_description': right_atrium_description,
'left_atrium_description': left_atrium_description,
'aortic_valve_description': aortic_valve_description,
'mitral_valve_description': mitral_valve_description,
'pulmonary_valve_description': pulmonary_valve_description,
'tricuspid_valve_description': tricuspid_valve_description,
'aortic_root_and_arch_description': aortic_root_and_arch_description,
'pericardium_description': pericardium_description,
'left_ventricle_order': left_ventricle_order,
'right_ventricle_order': right_ventricle_order,
'right_atrium_order': right_atrium_order,
'left_atrium_order': left_atrium_order,
'aortic_valve_order': aortic_valve_order,
'mitral_valve_order': mitral_valve_order,
'pulmonary_valve_order': pulmonary_valve_order,
'tricuspid_valve_order': tricuspid_valve_order,
'aortic_root_and_arch_order': aortic_root_and_arch_order,
'pericardium_order': pericardium_order,
'cardio_echo_comments': cardio_echo_comments,
'cardio_echo_conclusion': cardio_echo_conclusion,
};
console.log(JSON.stringify(data));
$.ajax({
type: "post",
url: '/investigations/store-cardio-echo',
data: data,
cache: false,
success: function (result) {
console.log(JSON.stringify(result));
$("#cardio-echo-modal").modal("hide");
$("#flashEchoSubmissionSuccess").modal("show");
$("#cardio_print_div").show();
}
});
});
$('.description_order').on('focusout', function() {
let exclude_id = this.id;
let value = +this.value;
let oldvalue = +this.oldvalue;
$('.description_order').each(function () {
if (this.id !== exclude_id) {
if (oldvalue <= +this.value && value >= +this.value) {
this.value--;
} else if (oldvalue >= +this.value && value <= +this.value) {
this.value++;
}
}
});
});
</script>
@endpush
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
/*font-size: 1.2em;*/
}
thead {
/*display: table-header-group;*/
}
tfoot {
/*display: table-row-group;*/
}
tr {
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;">{{ __('investigations.lab_result_details') }}</h5>
<div class="row">
<table class="table table-light table-sm table-borderless">
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<td>{{ $patient->number}}</td>
<th>{{ __('investigations.patient_category') }}</th>
<td>{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<th>{{ __('investigations.residence') }}</th>
<td>{{ patient_residence($patient_id) }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.age') }}</th>
<td>
<?php echo \Carbon\Carbon::parse($patient->date_of_birth)->age; ?> {{ __('investigations.years') }}
</td>
<th></th>
<td></td>
</tr>
<tr>
<th scope="row">{{ __('investigations.gender') }}</th>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@else
{{ __('investigations.female') }}
@endif
</td>
<th>{{ __('investigations.printed_on') }}</th>
<td> <?php echo streamline_date(date('d-m-Y')); ?></td>
</tr>
</table>
</div>
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('investigations.investigation') }}</th>
@foreach($dates as $date)
<th>{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($invs_array); $i++)
<tr>
<td>{{ get_name($invs_array[$i], 'id', 'name', 'investigations') }}</td>
@foreach($values[$i] as $value)
<td>
@if(get_name($invs_array[$i], 'id', 'type', 'investigations') == 1)
<i style="color: blue"> {{ __('investigations.refer_to_investigation_report') }} </i>
@else
@if(!is_array($value) && !is_numeric($value))
{{ $value }}
@endif
@endif
</td>
@endforeach
</tr>
@endfor
</tbody>
</table>
</div>
</body>
</html>
@@ -0,0 +1,291 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
font-size: 0.8em;
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid !important;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;">{{ __('investigations.lab_result_details') }}</h5>
<div class="row">
<table class="table table-light table-sm table-borderless">
<tr>
<th scope="row">{{ __('investigations.patient_number') }}</th>
<td>{{ $patient->number}}</td>
<th>{{ __('investigations.lab_number') }}</th>
<td>
{{ $ordered_investigation->lab_number ?? $ordered_investigation->id }}
</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.patient_names') }}</th>
<td>{{ ucwords($patient->first_name) }} {{ ucwords($patient->last_name) }}</td>
<th>{{ __('investigations.hospital_unit') }}</th>
<td>
@if($ordered_investigation->inpatient == 1)
{{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }}
@else
OPD
@endif
</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.age') }}</th>
<td>
@php $dob = get_name($ordered_investigation->patient_id, 'id', 'date_of_birth', 'patients'); @endphp
{{ get_patients_age($dob, $ordered_investigation->created_at) }}
</td>
<th>{{ __('investigations.requested') }}</th>
<td>{{ streamline_date_time($ordered_investigation->created_at) }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.gender') }}</th>
<td>
{{ get_name($ordered_investigation->patient_id, 'id', 'gender', 'patients') == 1 ? "Male" : "Female" }}
</td>
<th>{{ __('investigations.received') }}</th>
<td>{{ streamline_date_time($ordered_investigation->request_received_date) }}</td>
</tr>
@php
$invs_results = DB::table('investigation_results')->where('investigation_id', $ordered_investigation->investigation_id)
->where('patient_id', $ordered_investigation->patient_id)
->where('episode_id', $ordered_investigation->episode_id)
->first();
$user_id = $invs_results ? $invs_results->created_by : $ordered_investigation->request_received_by;
$performed_at = $invs_results ? streamline_date_time($invs_results->created_at) : "N/A";
@endphp
<tr>
<th scope="row">{{ __('investigations.patient_category') }}</th>
<td>
{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}
</td>
<th>{{ __('investigations.performed_at') }}</th>
<td>{{ $performed_at }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.residence') }}</th>
<td>{{ patient_residence($patient->id) }}</td>
<th>{{ __('investigations.doctor') }}</th>
<td>
@php
$created_by = Streamline\Models\User::find($ordered_investigation->created_by);
if ($ordered_investigation->ordered_by) {
$ordered_by_name = $ordered_investigation->ordered_by;
} elseif ($created_by && $created_by->hasRole('Doctors')) {
$ordered_by_name = get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users');
} else {
$ordered_by_name = __('investigations.self_request');
}
@endphp
{{ $ordered_by_name }}
{{--{{ getDNS1DBarcodePNG($ordered_investigation->id) }}
&nbsp;<span>{{ sprintf("%04u", $ordered_investigation->id) }}</span>--}}
</td>
</tr>
</table>
</div>
<div class="row">
<div class="col-6">
<table class='table table-sm'>
<thead class="thead-light">
<tr>
<th>{{ __('investigations.tests') }}</th>
</tr>
</thead>
<tbody>
@foreach($investigation_ids as $record)
<tr>
<td>{{ get_name($record, 'id', 'name', 'investigations') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="col-6">
<table class='table table-sm'>
<thead class="thead-light">
<tr>
<th>{{ __('investigations.specimens') }}</th>
<th></th>
</tr>
</thead>
@php
$records = explode(",", $ordered_investigation->specimen);
$status_array = explode(",", $ordered_investigation->specimen_status);
@endphp
@for($i = 0; $i < count($records); $i++)
<tr>
<td>{{ get_name($records[$i], 'id', 'name', 'laboratory_specimens') }}</td>
<td>
@if ($status_array[$i] == 1)
<font color='green'>{{ __('investigations.taken') }}</font>
@elseif ($status_array[$i] == 2)
<font color='orange'>{{ __('investigations.not_taken') }}</font>
@elseif ($status_array[$i] == 3)
<font color='#ff4500'>{{ __('investigations.rejected') }}</font>
@endif
</td>
</tr>
@endfor
</tbody>
</table>
</div>
</div>
<div class="row-fluid">
<div class="col-auto">
<hr>
</div>
</div>
<div class="row">
<div class="col">
<h6>{{ __('investigations.test_results') }}</h6>
<table class='table table-sm'>
<thead class="thead-light">
<tr>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.unit') }}</th>
<th>{{ __('investigations.comment') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
@if($result['type'] == 0)
<tr>
<td><b>{{ $result['name'] }}</b></td>
<td>{!! nl2br(e($result['result'])) !!}</td>
<td>{{ $result['range'] }}</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{!! nl2br(e($result['comment'])) !!}</td>
</tr>
@elseif($result['type'] == 1)
<tr>
<td colspan="6"></td>
</tr>
<tr>
<td colspan="5"><b>{{ $result['name'] }}</b></td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $result['result'])->first();
if($specialised_results){
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
}
@endphp
@if($specialised_results)
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{!! nl2br(e($variable_value_array[$i])) !!}</td>
<td>
@if(get_name($variable_id_array[$i], 'id', 'range_type', 'investigation_specialised_variables') == 1)
{{ get_dynamic_normal_range_specialized($variable_id_array[$i], get_patient_age_group($patient->id), get_name($patient->id, 'id', 'gender', 'patients')) }}
@else
{{ get_name($variable_id_array[$i], 'id', 'normal_ranges', 'investigation_specialised_variables') }}
@endif
</td>
<td>
@if(get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{!! nl2br(e($variable_comment_array[$i])) !!}</td>
</tr>
@endfor
@endif
@endif
@endforeach
@if(count($results) < 1)
<tr><td colspan="5" class="text-center"><p><code>{{ __('investigations.no_results_available') }}</code></p></td></tr>
@endif
</tbody>
</table>
<br>
@php
$counter=0; $auth='';
if(!empty($results)) {
foreach($results as $result) if ($result['authenticated'] == '1') $counter++;
if($counter == count($results)) $auth='1';
}
@endphp
@if (is_add_lab_stamp_feature_enabled() && !empty($hospitalInfo->lab_stamp) && $auth =='1')
<table class="table table-borderless">
<tbody>
<tr>
<td>
<h6>{{ __('investigations.performed_by') }} :
<span @if (Auth::user()->can('hide-performed-by-on-lab-results-print-out')) style="display: none;" @endif><b>{{ get_full_name($user_id, 'id', 'first_name', 'last_name', 'users') }}</b></span>
</h6>
</td>
<td>
<h6>{{ __('investigations.verified_by') }} : <span>............................................................</span></h6>
<img style="max-width: 300px; max-height: 140px;" src="{{ asset($hospitalInfo->lab_stamp) }}" class="img-fluid mx-auto d-block mx-3" alt="{{ $hospitalInfo->name}} stamp">
</td>
</tr>
</tbody>
</table>
@else
<div class="row">
<div class="col-6">
<h6>
{{ __('investigations.performed_by') }} :
<span @if (Auth::user()->can('hide-performed-by-on-lab-results-print-out')) style="display: none;" @endif><b>{{ get_full_name($user_id, 'id', 'first_name', 'last_name', 'users') }}</b></span>
</h6>
</div>
<div class="col-6">
<h6>{{ __('investigations.verified_by') }} : <span>............................................................</span></h6>
</div>
</div>
@endif
</div>
</div>
</div>
</body>
</html>
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid !important;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;">{{ __('investigations.investigation_results') }}</h5>
<table class="table table-light table-sm table-borderless">
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<td>{{ $patient->number}}</td>
<th>{{ __('investigations.patient_category') }}</th>
<td>{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
</tr>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<th>{{ __('investigations.gender') }}</th>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@else
{{ __('investigations.female') }}
@endif
({{ get_patients_age($patient->date_of_birth, $created_at) }})
</td>
</tr>
<tr>
<th>{{ __('investigations.requested') }}</th>
<td>{{ $requested_at }}</td>
<th>{{ __('investigations.performed_at') }}</th>
<td>{{ $performed_at }}</td>
</tr>
</table>
<br>
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th style="width: 20%">{{ __('investigations.investigation_name') }}</th>
<th style="width: 60%">{{ __('investigations.results') }}</th>
<th style="width: 20%">{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($inv['data'] as $value)
@if($value['type'] == 0)
<tr>
<td>{{ $value['name'] }}</td>
<td>{!! nl2br(e($value['result'])) !!}</td>
<td>{!! nl2br(e($value['comment'])) !!}</td>
</tr>
@else
<tr>
<td colspan="3">{{ $value['name'] }}</td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $value['result'])->first();
if (!$specialised_results) {
continue;
}
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
@endphp
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{{ $variable_value_array[$i] }}</td>
<td>{{ $variable_comment_array[$i] }}</td>
</tr>
@endfor
<tr><td colspan="3"></td></tr>
@endif
@endforeach
</tbody>
</table>
<br>
<div class="row">
<div class="col">
<strong>{{ __('investigations.performed_by') }}: </strong> {{ get_full_name($created_by, 'id', 'first_name', 'last_name', 'users') }}
</div>
<div class="col"><b>{{ __('investigations.sign') }}:</b> ............................................................</div>
</div>
</div>
</body>
</html>
@@ -0,0 +1,433 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style style="text-css">
@page {
margin-left:20px;
margin-right:45px;
}
body{
font-size: 13px;
}
table, tr, td {
page-break-inside: avoid;
border-collapse: collapse;
table-layout: fixed;
width: 100%;
}
thead {
/*display: table-header-group;*/
}
tfoot {
/*display: table-row-group;*/
}
tr {
page-break-inside: avoid;
page-break-after: avoid;
page-break-before: avoid;
}
td {
word-wrap: break-word;
}
.center-align-image {
text-align:center;
}
footer {
position: fixed;
bottom: -60px;
left: 0px;
right: 0px;
height: 50px;
text-align: center;
line-height: 35px;
background-color:white;
}
</style>
</head>
<body>
@php
$hospital_info = \Streamline\Models\HospitalInformation::find(1);
@endphp
{{-- footer --}}
<footer>
<?php echo '<i>&copy; ' . date('Y') . ' Stre@mline</i>' ?>
</footer>
<div class="container-fluid ">
{{-- header --}}
@if(is_null($hospital_info->pdf_print_header))
<div class="center-align-image">
<img style="max-width: 300px; max-height: 140px;" src="{{ asset($hospital_info->logo) }}" class="mx-auto d-block mx-3" alt="Responsive image">
<br>
<p class="h6 text-center mt-0 font-weight-bold">
{{ $hospital_info->name . ' | ' . $hospital_info->phone_number . ' | ' . $hospital_info->email . ' | ' . $hospital_info->address . ' ' . $hospital_info->country }}
</p>
</div>
@else
<div class="center-align-image">
<img style="max-height: 150px;" src="{{ asset($hospital_info->pdf_print_header) }}" alt="Responsive image">
</div>
@endif
<hr>
<h5 class="heading" style="text-align: center;">{{ __('investigations.obstetric_ultrasound_order_details') }}</h5>
<div class="row">
<table class="table table-light table-sm table-borderless" >
<tr>
<th scope="row" width='18%'>{{ __('investigations.patient_number') }}</th>
<td width='30%'>{{ $patient->number}}</td>
<th width='16%'>{{ __('investigations.patient_category') }}</th>
<td>{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<th>{{ __('investigations.residence') }}</th>
<td rowspan="2">{{ patient_residence($patient->id) }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.age') }}</th>
<td>
<?php echo \Carbon\Carbon::parse($patient->date_of_birth)->age; ?> {{ __('investigations.years') }}
</td>
<th>&nbsp;</th>
</tr>
<tr>
<th scope="row">{{ __('investigations.gender') }}</th>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@else
{{ __('investigations.female') }}
@endif
</td>
<th>{{ __('investigations.printed_on') }}</th>
<td> <?php echo streamline_date(date('d-m-Y')); ?></td>
</tr>
<tr>
<th scope="row"></th>
<td>
</td>
<th>&nbsp;</tH>
<td>
</td>
</tr>
</table>
</div>
@php
$no_of_foetus = $report->no_of_foetus;
@endphp
<div class="row " >
<table class="table table-sm" style="width:100%;">
<thead class="thead-light">
<tr>
<th>{{ __('investigations.date_of_scan') }}</th>
<th>{{ __('investigations.sonographer') }}</th>
<th>{{ __('investigations.number_of_foetus') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ streamline_date($report->scan_date) }}</td>
<td>{{ get_full_name($report->sonographer, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ $report->no_of_foetus ?? '' }}</td>
</tr>
</tbody>
</table>
</div>
<div class="row " >
<table class="table table-sm" style="width:100%;">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date($invs_order->created_at) }}</td>
</tr>
@if($anc_details)
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ $anc_details->gravida }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ $anc_details->para }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ $anc_details->abortion }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>{{ streamline_date($anc_details->lmp) }}</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>{{ get_name($anc_details->accuracy, 'id', 'name', 'ante_natal_clinic_accuracies') }}</td>
<th>{{ __('investigations.edd') }}</th>
<td>{{ streamline_date($anc_details->edd) }}</td>
</tr>
@endif
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
{{ get_full_name($invs_order->created_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($invs_order->created_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ $invs_order->comment }}</td>
</tr>
</table>
</div>
<hr>
{{-- start foetus table --}}
<div class="row " >
<table class="table table-sm">
<thead class="thead-light">
<tr>
<th width="30%">{{ __('investigations.item') }}</th>
<th><div class="foetus1header hiddenx">1</div></th>
<th style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">2</th>
<th style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">3</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
{{ split_string_null_check($report->crown_rump, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->crown_rump, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->crown_rump, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td>
{{ split_string_null_check($report->bi_parietal_diameter, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->bi_parietal_diameter, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->bi_parietal_diameter, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
{{ split_string_null_check($report->head_circumference, 0)}}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->head_circumference, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->head_circumference, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
{{ split_string_null_check($report->abdominal_circumference, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->abdominal_circumference, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->abdominal_circumference, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
{{ split_string_null_check($report->femur_length, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->femur_length, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->femur_length, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
{{ split_string_null_check($report->estimated_foetal_weight, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->estimated_foetal_weight, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->estimated_foetal_weight, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
{{ split_string_null_check($report->average_gestational_age, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->average_gestational_age, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->average_gestational_age, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
{{ split_string_null_check($report->expected_delivery_date, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->expected_delivery_date, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->expected_delivery_date, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
{{ split_string_null_check($report->presentation, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->presentation, 1)}}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->presentation, 2)}}
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
{{ split_string_null_check($report->placental_site, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->placental_site, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->placental_site, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
{{ split_string_null_check($report->liquor_volume, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->liquor_volume, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->liquor_volume, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
{{ split_string_null_check($report->cord_artery_doppler, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->cord_artery_doppler, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->cord_artery_doppler, 2) }}
</td>
</tr>
<?php
$comments = !is_null($report->comments) ? explode(",,,",$report->comments) : '';
?>
<tr >
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
{{ $comments[0] ?? ''}}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ $comments[1] ?? ''}}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ $comments[2] ?? ''}}
</td>
</tr>
</tbody>
</table>
</div>
{{-- End foetus table --}}
</div>
</body>
</html>
@@ -0,0 +1,270 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
/*font-size: 1.2em;*/
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading font-weight-bold" style="text-align: center;">{{ __('investigations.department_of_cardiology') }}</h5>
<h6 class="heading font-weight-bold" style="text-align: center;">ECHOCARDIOLOGY REPORT</h6>
<div style="font-size: 15px">
<table class="table table-bordered">
<tbody>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.date') }}</td>
<td width="45%" style="padding: 2px;">{{ $date }}</td>
<td width="15%" style="padding: 2px;">{{ __('investigations.weight') }}(Kg)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.name') }}</td>
<td width="45%" style="padding: 2px;">
{{ $names }} ({{ $patient_number }})
</td>
<td width="15%" style="padding: 2px;">B.P(mmHg)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.gender') }}</td>
<td width="45%" style="padding: 2px;">
{{ $sex }}
</td>
<td width="15%" style="padding: 2px;">{{ __('investigations.pulse') }}(mmHg)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.age') }}</td>
<td width="45%" style="padding: 2px;">
{{ $age }}
</td>
<td width="15%" style="padding: 2px;">{{ __('investigations.height') }}(cm)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
</tbody>
</table>
<h6 class="heading font-weight-bold">M. MODE MEASUREMENTS</h6>
<table class="table table-sm color-bordered-table table-condensed table-bordered">
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 2px;">IVS</td>
<td style="padding: 2px;">
{{ $ivs }}
</td>
<td style="padding: 2px;">
{{ $range_IVS }}
</td>
<td style="padding: 2px;">AO</td>
<td style="padding: 2px;">
{{ $aortic }}
</td>
<td style="padding: 2px;">
{{ $range_AO }}
</td>
<td style="padding: 2px;">EF (%)</td>
<td style="padding: 2px;">
{{ $ef }}
</td>
<td style="padding: 2px;">
{{ $range_EF }}
</td>
</tr>
<tr>
<td style="padding: 2px;">LVIDd</td>
<td style="padding: 2px;">
{{ $lvidd }}
</td>
<td style="padding: 2px;">
{{ $range_LVIDd }}
</td>
<td style="padding: 2px;">LA</td>
<td style="padding: 2px;">
{{ $la }}
</td>
<td style="padding: 2px;">
{{ $range_LA }}
</td>
<td style="padding: 2px;">FS (%)</td>
<td style="padding: 2px;">
{{ $fs }}
</td>
<td style="padding: 2px;">
{{ $range_FS }}
</td>
</tr>
<tr>
<td style="padding: 2px;">LVIDs</td>
<td style="padding: 2px;">
{{ $lvids }}
</td>
<td style="padding: 2px;">
{{ $range_LVIDs }}
</td>
<td style="padding: 2px;">RV</td>
<td style="padding: 2px;">
{{ $rv }}
</td>
<td style="padding: 2px;">
{{ $range_RV }}
</td>
<td style="padding: 2px;">TAPSE</td>
<td style="padding: 2px;">
{{ $tapse }}
</td>
<td style="padding: 2px;">
{{ $range_TAPSE }}
</td>
</tr>
<tr>
<td style="padding: 2px;">LVPWd</td>
<td style="padding: 2px;">
{{ $lvpwd }}
</td>
<td style="padding: 2px;">
{{ $range_LVPWd }}
</td>
<td style="padding: 2px;">RA</td>
<td style="padding: 2px;">
{{ $ra }}
</td>
<td style="padding: 2px;">
{{ $range_RA }}
</td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;"></td>
</tr>
</tbody>
</table>
<h6 class="heading font-weight-bold">DOPPLER FINDINGS</h6>
<table class="table table-sm color-bordered-table table-condensed table-bordered">
<thead>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
</thead>
<tbody>
<tr>
<td style="padding: 2px;">Mitral E/A ratio</td>
<td style="padding: 2px;">{{ $mitral_ea_ratio }}</td>
<td style="padding: 2px;">&nbsp;</td>
<td style="padding: 2px;">TR Max. PG</td>
<td style="padding: 2px;">{{ $tr_pg }}</td>
<td style="padding: 2px;">(15 - 25 mmHg)</td>
</tr>
<tr>
<td style="padding: 2px;">AV Vel. Max</td>
<td style="padding: 2px;">{{ $av_vmax }}</td>
<td style="padding: 2px;">(m/s)</td>
<td style="padding: 2px;">RAP</td>
<td style="padding: 2px;">{{ $rap }}</td>
<td style="padding: 2px;">(mmHg)</td>
</tr>
<tr>
<td style="padding: 2px;">AV Mean PG</td>
<td style="padding: 2px;">{{ $av_mean }}</td>
<td style="padding: 2px;">(mmHg)</td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;">&nbsp;</td>
</tr>
</tbody>
</table>
<h6 class="heading font-weight-bold">{{ __('investigations.description') }}</h6>
<table class="table table-bordered">
<tbody>
@foreach ($descriptions_array as $description)
<tr>
<td style="padding: 5px; white-space: nowrap;" width="1">{{ $description["name"] }}</td>
<td style="padding: 5px;">{{ $description["value"] }}</td>
</tr>
@endforeach
</tbody>
</table>
<br>
<br>
<table class="table table-bordered">
<tbody>
@if($conclusion != "")
<tr>
<td style="padding: 5px;">
<span class="font-weight-bold">{{ __('investigations.conclusion') }}</span>
</td>
<td style="padding: 5px;">
{!! nl2br(e($conclusion)) !!}
</td>
</tr>
@endif
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td style="padding: 5px;">
<span class="font-weight-bold">{{ __('investigations.performed_by') }}</span>
</td>
<td style="padding: 5px;">
{{ get_full_name($created_by, "id", "first_name", "last_name", "users") }}
</td>
</tr>
<tr>
<td style="padding: 5px;">
<span class="font-weight-bold">{{ __('investigations.title') }}</span>
</td>
<td style="padding: 5px;">
{{ get_name(get_name($created_by, "id", "position_id", "users"), "id", "name", "staff_positions") }}<br>
{{ streamline_date($created_at) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
@@ -0,0 +1,165 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.investigation_requests') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.investigation_requests') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div style="float: right;">
<button class="btn btn-primary print-all-categories">{{ __('investigations.print_all_requests') }}</button><br>
</div>
</div>
</div><br>
<div class="row">
<div class="col-sm-12">
<div class="white-box" id="divToPrint">
<style type="text/css" media="print" >
/*class for the element we dont want to print*/
.no-print{
display:none;
}
</style>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<h2 style="text-align: center">{{ __('investigations.investigation_requests') }}</h2>
<p style="font-size: 1em">
{{--<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
<span><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
<span><b>Email:</b> {{ $hospital_information->email }}</span><br>--}}
</p>
@for ($x = 0; $x < count($category_ids_array); $x++)
<p style="font-size: 1em">
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.patient_name') }}:</b> {{ get_name($patient->id, 'id', 'first_name', 'patients') }} {{ get_name($patient->id, 'id', 'last_name', 'patients') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.patient_number') }}</b> : {{ get_name($patient->id, 'id', 'number', 'patients') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.age') }}</b> : {{ get_patients_age($patient->date_of_birth) }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.gender') }}</b> : @if(get_name($patient->id, 'id', 'gender', 'patients') == 1) {{ __('investigations.male') }} @elseif(get_name($patient->id, 'id', 'gender', 'patients') == 2) {{ __('investigations.female') }} @else {{ __('investigations.other') }} @endif</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.ward') }}</b> : @if($ordered_investigation->inpatient == 0) OPD @else {{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }} @endif</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.authorised_by') }}</b> : {{ get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.date') }}</b> : {{ streamline_date($ordered_investigation->created_at) }}</span><br>
</p>
<div class="table-bordered" style="padding: 10px; margin-bottom: 10px">
<h4 class="{{ $x }} no-print print-all text-center">{{ get_name($category_ids_array[$x], "id", "name", "investigation_categories") }}</h4>
<ol class="{{ $x }} no-print print-all">
@foreach($category_array[$category_ids_array[$x]] as $record)
@php $investigation_id = $record['id']; @endphp
<li>
@if(in_array($investigation_id,$urgent_ids_array)) <span style='font-size:16px;'>&#9650;&nbsp;</span> @endif
{{ get_name($investigation_id, "id", "name", "investigations") }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{{ get_name($investigation_id, "id", "minimum", "investigations") }}&nbsp;&nbsp;&nbsp;
{{ get_name($investigation_id, "id", "sample_container", "investigations") }}
@if($record['comment'] != '')
<br><br>
<p><b>{{ __('investigations.order_comments') }}:</b> {{ $record['comment'] }}</p>
@endif
<hr>
</li>
@endforeach
</ol>
<div class="text-center">
<button class="btn btn-primary no-print glyphicon glyphicon-print print-btn" id="{{ $x }}"> {{ __('investigations.print') }}</button>
</div>
</div>
<p class="{{ $x }} no-print print-all">=========================================</p>
@endfor
<i style="font-size: 0.8em;">&copy; Stre@mline</i>
</div>
<div class="col-md-3"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
// prepare for printing all categories
$(document).ready(function () {
$(".print-all-categories").click(function () {
// remove no-print attribute from all
$(".print-all").each(function () {
$(this).removeClass("no-print");
});
// print the whole document
print_investigations();
// add no-print attribute to all
$(".print-all").each(function () {
$(this).addClass("no-print");
});
});
});
// prepare for printing single category
$(document).ready(function () {
$(".print-btn").click(function () {
let id = $(this).attr("id");
// remove no-print attribute from all
$("." + id).each(function () {
$(this).removeClass("no-print");
});
// print the whole document
print_investigations();
// add no-print attribute to all
$("." + id).each(function () {
$(this).addClass("no-print");
});
});
});
function print_investigations() {
let myDiv = document.getElementById('divToPrint');
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
newWindow.document.write("<html><body " +
"class='' " +
" onload='window.print()'>" +
myDiv.innerHTML +
"</body></html>");
newWindow.document.close();
return false;
}
</script>
@endpush
@@ -0,0 +1,46 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.request_barcode') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.request_barcode') }}</li>
</ol>
</div>
</div>
<a onclick="printBarcode()" class="btn btn-rounded btn-sm pull-right" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_barcode') }}</span></a>
<br><br>
<div class="white-box text-center" id="print_div">
<h4>{{ $patient_name }}</h4>
{{ getDNS1DBarcodePNG($id) }}
<h4>{{ sprintf("%04u", $id) }}</h4>
</div>
@endsection
@push('scripts')
<script>
function printBarcode() {
let myDiv = document.getElementById('print_div');
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
newWindow.document.write("<html><body " +
"class='' " +
" onload='window.print()'>" +
myDiv.innerHTML +
"</body></html>");
newWindow.document.close();
return false;
}
</script>
@endpush
@@ -0,0 +1,504 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<style>
.hidden {
display: none;
}
</style>
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.obstetric_ultrasound_request_template') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'investigations.submit_ultrasound_obstetric_report']) }}
{{ Form::hidden('order_id',$order_id) }}
{{ Form::hidden('patient_id',$patient_id) }}
{{ Form::hidden('episode_id',$episode_id) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('scan_date', __('investigations.date_of_scan')) }}
<div class="input-group">
{{ Form::text('scan_date', date('d-m-Y'), ['class'=>'form-control compulsory', 'id'=>'scan_date', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('sonographer_name', __('investigations.sonographer')) }}
{{ Form::text('sonographer_name', get_full_name(Auth::user()->id, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control compulsory', 'readonly']) }}
{{ Form::hidden('sonographer', Auth::user()->id) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('no_of_foetus', __('investigations.number_of_foetus')) }}
<a href="javascript::void(0)" data-toggle="tooltip" rel="tooltip" data-placement="top" title="" data-original-title="Select the foetus number first, the number of foetus will trigger corresponding columns in the table"> <i class="fa fa-info-circle"></i></a>
<input type="number" id="numberInput" name="no_of_foetus" class="form-control compulsory" min="1" max="3" value="1" onchange="showFoetusColumns()">
</div>
</div>
</div>
<h4>{{ __('investigations.obstetric_ultrasound_order_details') }}</h4>
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date(get_name($order_id, 'id', 'created_at', 'ordered_investigations')) }}</td>
</tr>
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'gravida', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'para', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'abortion', 'ante_natal_clinic_registrations') }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations')) }}
@endif
</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ get_name(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations'), 'id', 'name', 'ante_natal_clinic_accuracies') }}
@endif
</td>
<th>{{ __('investigations.edd') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations')) }}
@endif
</td>
</tr>
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
@php
$requester_id = get_name($order_id, 'id', 'created_by', 'ordered_investigations');
if($requester_id == 'N/A'){
$requested_by = Auth::user()->id;
} else {
$requested_by = $requester_id;
}
@endphp
{{ get_full_name($requested_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($requested_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ get_name($order_id, 'id', 'comment', 'ordered_investigations') }}</td>
</tr>
</table>
</div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.item') }}</th>
<th><div class="foetus1header hiddenx">1</div></th>
<th><div class="foetus2header hidden">2</div></th>
<th><div class="foetus3header hidden">3</div></th>
</tr>
</thead>
<tbody>
<tr>
<td >{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
<div class="form-group foetus1r1 hiddenx" >
<input type="number" class="form-control" name="crown_rump1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r1 hidden" >
<input type="number" class="form-control" name="crown_rump2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden">
<input type="number" class="form-control" name="crown_rump3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td >
<div class="form-group foetus1r2 hiddenx" >
<input type="number" class="form-control" name="bi_parietal_diameter1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r2 hidden" >
<input type="number" class="form-control" name="bi_parietal_diameter2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden" >
<input type="number" class="form-control" name="bi_parietal_diameter3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
<div class="form-group foetus1r3 hiddenx" >
<input type="number" class="form-control" name="head_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r3 hidden" >
<input type="number" class="form-control" name="head_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r3 hidden" >
<input type="number" class="form-control" name="head_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
<div class="form-group foetus1r4 hiddenx" >
<input type="number" class="form-control" name="abdominal_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r4 hidden" >
<input type="number" class="form-control" name="abdominal_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r4 hidden" >
<input type="number" class="form-control" name="abdominal_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
<div class="form-group foetus1r5 hiddenx">
<input type="number" class="form-control" name="femur_length1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r5 hidden">
<input type="number" class="form-control" name="femur_length2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r5 hidden">
<input type="number" class="form-control" name="femur_length3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
<div class="form-group foetus1r6 hiddenx">
<input type="number" class="form-control" name="estimated_foetal_weight1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r6 hidden">
<input type="number" class="form-control" name="estimated_foetal_weight2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r6 hidden">
<input type="number" class="form-control" name="estimated_foetal_weight3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
<div class="form-group foetus1r7 hiddenx">
<input type="number" class="form-control" name="average_gestational_age1" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r7 hidden">
<input type="number" class="form-control" name="average_gestational_age2" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r7 hidden">
<input type="number" class="form-control" name="average_gestational_age3" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
<div class="input-group foetus1r8 hiddenx">
{{ Form::text('expected_delivery_date1', '', ['class'=>'form-control', 'id'=>'expected_delivery_date1', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus2r8 hidden">
{{ Form::text('expected_delivery_date2', '', ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus3r8 hidden">
{{ Form::text('expected_delivery_date3', '', ['class'=>'form-control', 'id'=>'expected_delivery_date3', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
<select name="presentation1" class="form-control foetus1r9 hiddenx">
<option></option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation2" class="form-control foetus2r9 hidden">
<option></option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation3" class="form-control foetus3r9 hidden">
<option></option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
<select name="placental_site1" class="form-control foetus1r10 hiddenx">
<option></option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site2" class="form-control foetus2r10 hidden">
<option></option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site3" class="form-control foetus3r10 hidden">
<option></option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
<div class="form-group foetus1r11 hiddenx">
<input type="number" class="form-control" name="liquor_volume1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r11 hidden">
<input type="number" class="form-control" name="liquor_volume2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r11 hidden">
<input type="number" class="form-control" name="liquor_volume3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
<div class="form-group foetus1r12 hiddenx">
{{ Form::text('cord_artery_doppler1', '', ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus2r12 hidden">
{{ Form::text('cord_artery_doppler2', '', ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus3r12 hidden">
{{ Form::text('cord_artery_doppler3', '', ['class' => 'form-control']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
<div class="form-group foetus1r13 hiddenx">
<textarea class="form-control" name="comments1" rows="7"></textarea>
</div>
</td>
<td>
<div class="form-group foetus2r13 hidden">
<textarea class="form-control" name="comments2" rows="7"></textarea>
</div>
</td>
<td>
<div class="form-group foetus3r13 hidden">
<textarea class="form-control" name="comments3" rows="7"></textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
{{-- show foetus data columns on change of foetus number input --}}
<script>
function showFoetusColumns() {
var inputVal = parseInt(document.getElementById("numberInput").value);
// div classes with their respective visibility requirements
var divClasses = {
//foetus one sections
'foetus1header': 1,'foetus1r1': 1,'foetus1r2': 1, 'foetus1r3': 1,'foetus1r4': 1,'foetus1r5': 1,'foetus1r6': 1,'foetus1r7': 1,'foetus1r8': 1,'foetus1r9': 1, 'foetus1r10': 1,'foetus1r11': 1,'foetus1r12': 1,'foetus1r13': 1,
//foetus two sections
'foetus2header': 2,'foetus2r1': 2,'foetus2r2': 2,'foetus2r3': 2,'foetus2r4': 2,'foetus2r5': 2,'foetus2r6': 2,'foetus2r7': 2,'foetus2r8': 2,'foetus2r9': 2, 'foetus2r10': 2,'foetus2r11': 2,'foetus2r12': 2,'foetus2r13': 2,
//foetus three sections
'foetus3header': 3,'foetus3r1': 3,'foetus3r2': 3,'foetus3r3': 3,'foetus3r4': 3,'foetus3r5': 3,'foetus3r6': 3,'foetus3r7': 3,'foetus3r8': 3,'foetus3r9': 3, 'foetus3r10': 3,'foetus3r11': 3,'foetus3r12': 3,'foetus3r13': 3,
'foetus4': 4,
'foetus44': 4,
};
// Loop through the divClasses object
for (var className in divClasses) {
if (divClasses.hasOwnProperty(className)) {
var divs = document.querySelectorAll('.' + className);
divs.forEach(function(div) {
if (inputVal >= divClasses[className]) {
div.classList.remove('hidden');
} else {
div.classList.add('hidden');
}
});
}
}
}
</script>
<script type="text/javascript">
$('#scan_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date1').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date3').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,185 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<h4 class="page-title">{{ __('investigations.view_cancelled_investigations') }}</h4>
</div>
<div class="col-lg-6 col-sm-6 col-md-6 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('investigations.dashboard') }}</a></li>
</ol>
</div>
</div>
{{ Form::open(['route' => 'investigations.view_deleted_ordered_invetigations', 'method' => 'ANY']) }}
<div class="white-box">
<div class="row">
<div class="col-md-3">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('investigations.date')) }}
{{ Form::select('search_by', ['0'=> __('investigations.last_24_hours'),'1'=>__('investigations.custom_date'),'2'=>__('investigations.date_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('investigations.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('investigations.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
</div>
</div>
{{ Form::close() }}
<div class="row">
<div class="col-sm-12">
@include('flash::message')
<div class="white-box" style="border-radius: 5px;">
<div class="table-responsive">
<table class="table table-hover color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>#</th>
<th>{{ __('investigations.date_ordered') }}</th>
<th>{{ __('investigations.date_cancelled') }}</th>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_name') }}</th>
<th>{{ __('investigations.ordered_investigations') }}</th>
<th>{{ __('investigations.actions') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $count=1; @endphp
@if(count($deleted_ordered_investigations) > 0)
@foreach($deleted_ordered_investigations as $ordered_inv)
@php
$urgent_ids = $ordered_inv->urgent_ids;
$ordered_ids = explode(",", $ordered_inv->investigation_id);
$ordered_investigation_comments_string = "";
$ordered_investigation_comments_string = $ordered_inv->order_comments;
@endphp
<tr>
<td>{{ $count }}.</td>
<td>{{ streamline_date_time($ordered_inv->created_at) }}</td>
<td>{{ streamline_date_time($ordered_inv->deleted_at) }}</td>
<td>{{ get_name($ordered_inv->patient_id, 'id', 'number', 'patients') }}</td>
<td>{!! insurance_flag($ordered_inv->patient_id) !!}</td>
<td>
<ol>
@for($i=0; $i < count($ordered_ids); $i++)
<li>{{ get_name($ordered_ids[$i], 'id', 'name', 'investigations') }}</li>
@endfor
</ol>
</td>
<td>
{{ Form::model($ordered_inv->id ,['method' => 'POST', 'route' => ['investigations.restore_deleted_ordered_invetigations', $ordered_inv->id]]) }}
<button type="submit" class="btn btn-rounded btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-restore"></i>
<span style="margin-left: 10px;">{{ __('investigations.restore_order') }}</span>
</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $ordered_inv->patient_id }}" class="btn btn-info btn-rounded">{{ __('investigations.select_patient') }}</a>
</td>
</tr>
@php $count++; @endphp
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
//order: [ [0, 'desc'] ],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
'pageLength' : 50,
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
</script>
@endpush
@@ -0,0 +1,110 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.historical_results_imaging') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
<div class="row">
<div class="col-md-2 offset-10 text-right">
<a class="btn btn-inverse" target="_blank" href="/investigations/print_historical_results_imaging/{{ $patient_id }}"><i class="fa fa-print"></i> {{ __('investigations.print') }}</a>
</div>
</div>
@include('flash::message')
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.investigation') }}</th>
@foreach($dates as $date)
<th>{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($invs_array); $i++)
<tr>
<td>{{ get_name($invs_array[$i], 'id', 'name', 'investigations') }}</td>
@foreach($values[$i] as $value)
@if(is_array($value))
<td>
{{ Form::open(['route' => 'investigations.view_patient_investigation_obstetric']) }}
{{ Form::hidden('patient_id',$value[2]) }}
{{ Form::hidden('episode_id',$value[3]) }}
{{ Form::hidden('obstetric_ultrasound_report_id',$value[0]) }}
{{ Form::hidden('order_id',$value[1]) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.view_results') }}</button>
{{ Form::close() }}
</td>
@elseif(get_name($invs_array[$i], 'id', 'type', 'investigations') == 1 && is_numeric($value))
<td>
<a class="btn btn-info btn-rounded btn-sm" style="color: white" onclick="showSpecialisedResults({{ $value }})">{{ __('investigations.view_results') }}</a>
</td>
@else
<td>{{ $value }}</td>
@endif
@endforeach
</tr>
@endfor
</tbody>
</table>
</div>
</div>
<div class="modal" id="modal_specialised_results" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
function showSpecialisedResults(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_lab_specialised_results/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("<?php echo __('investigations.specialised_results_investigation') ?> " + responseArray["investigation_name"]);
$('#modal_specialised_results').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,112 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.historical_results_labs') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<br/>
<div class="white-box">
<div class="row">
<div class="col-md-2 offset-10 text-right">
<a class="btn btn-inverse" target="_blank" href="/investigations/print_historical_results_labs/{{ $patient_id }}"><i class="fa fa-print"></i> {{ __('investigations.print') }}</a>
</div>
</div>
@include('flash::message')
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.investigation') }}</th>
@foreach($dates as $date)
<th>{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($invs_array); $i++)
<tr>
<td>{{ get_name($invs_array[$i], 'id', 'name', 'investigations') }}</td>
@foreach($values[$i] as $value)
@if(is_array($value))
<td>
{{ Form::open(['route' => 'investigations.view_patient_investigation_obstetric']) }}
{{ Form::hidden('patient_id',$value[2]) }}
{{ Form::hidden('episode_id',$value[3]) }}
{{ Form::hidden('obstetric_ultrasound_report_id',$value[0]) }}
{{ Form::hidden('order_id',$value[1]) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.view_results') }}</button>
{{ Form::close() }}
</td>
@elseif(get_name($invs_array[$i], 'id', 'type', 'investigations') == 1 && is_numeric($value))
<td>
<a class="btn btn-info btn-rounded btn-sm" style="color: white" onclick="showSpecialisedResults({{ $value }})">{{ __('investigations.view_results') }}</a>
</td>
@else
<td>{{ $value }}</td>
@endif
@endforeach
</tr>
@endfor
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="modal" id="modal_specialised_results" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
function showSpecialisedResults(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_lab_specialised_results/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("<?php echo __('investigations.specialised_results_investigation') ?> " + responseArray["investigation_name"]);
$('#modal_specialised_results').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,432 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('investigations.lab_results') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.view_results') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.view_lab_results']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2">
{{ Form::label('lab_number', __('investigations.search_by_lab_number')) }}
{{ Form::number('lab_number', '', ['class' => 'form-control']) }}
</div>
<div class="col-md-2">
{{ Form::label('search_patient', __('investigations.search_by_patient')) }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>
<label class="label"><a href="#" style="display: -webkit-inline-box;" onclick="export_to_excel();" title="Download {{ __('layout.lab_results') }} CSV" class="btn-sm btn-inverse waves-effect waves-light"><span class="glyphicon glyphicon-download"></span> Download CSV</a></label>
@if (count($urgent_incomings) > 0)
&nbsp;&nbsp;<label class="label label-danger">{{ __('investigations.urgent_incoming_lab_results_warning') }}</label>
@endif
</h4>
<br>
@elseif (count($urgent_incomings) > 0 && empty($search_text))
<h4><label class="label label-danger">{{ __('investigations.urgent_incoming_lab_results_warning') }}</label></h4>
@endif
<div class="row" id="lab_results_row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_incomings) > 0)
<li role="presentation" class="nav-item"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_incoming_results" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.urgent_incomplete') }} ({{ count($urgent_incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($all_complete) }})</a> </li>
@else
<li role="presentation" class="nav-item active"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($all_complete) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block">
<div class="tab-content">
<div id="per_results_nav_pill" class="tab-pane <?php if(count($urgent_incomings) < 1) echo 'active'; ?>">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.lab_number') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.received') }}</th>
<th>{{ __('investigations.patient') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.specimen') }}</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
@foreach($incomings as $incoming)
<tr>
<td>{{ $incoming->id }}</td>
<td>By {{ get_full_name($incoming->created_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($incoming->created_at) }}</td>
<td>By {{ get_full_name($incoming->request_received_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($incoming->request_received_date) }}</td>
<td>
{{ get_full_name($incoming->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
({{ get_name($incoming->patient_id, 'id', 'number', 'patients') }}) - ({{ get_name(get_name($incoming->patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }})
</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td onclick="showQuickView({{ $incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td onclick="showQuickView({{ $incoming->id }}, 2)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->specimen)) }} {{ __('investigations.samples') }}</td>
<td>
@if($incoming->inpatient == 0 && $incoming->inpatient_bill_generated == 0 && $incoming->payment_status == 0 && !can_investigations_be_performed(get_name($incoming->patient_id, 'id', 'category_id', 'patients')))
<code class="text-center">{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
@else
<a class="btn btn-success btn-rounded btn-sm" href="/investigations/view_lab_results_details/{{ $incoming->id }}">{{ __('investigations.add') }}</a>
@endif
</td>
</tr>
@endforeach
@if(count($incomings) < 1)
<tr>
<td colspan="9" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_results_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@if (count($urgent_incomings) > 0)
<div id="urgent_incoming_results" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.lab_number') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.received') }}</th>
<th>{{ __('investigations.patient') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.specimen') }}</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
@foreach($urgent_incomings as $urgent_incoming)
<tr>
<td>{{ $urgent_incoming->id }}</td>
<td>By {{ get_full_name($urgent_incoming->created_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($urgent_incoming->created_at) }}</td>
<td>By {{ get_full_name($urgent_incoming->request_received_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($urgent_incoming->request_received_date) }}</td>
<td>
{{ get_full_name($urgent_incoming->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
({{ get_name($urgent_incoming->patient_id, 'id', 'number', 'patients') }}) - ({{ get_name(get_name($urgent_incoming->patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }})
</td>
<td>
@if($urgent_incoming->inpatient == 1 || $urgent_incoming->inpatient_bill_generated == 1)
{{ get_ward_name($urgent_incoming->patient_id, $urgent_incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($urgent_incoming->payment_status == 0)
@if($urgent_incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td onclick="showQuickView({{ $urgent_incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $urgent_incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td onclick="showQuickView({{ $urgent_incoming->id }}, 2)"><i class="fa fa-search"></i> {{ count(explode(",", $urgent_incoming->specimen)) }} {{ __('investigations.samples') }}</td>
<td>
@if($urgent_incoming->inpatient == 0 && $urgent_incoming->inpatient_bill_generated == 0 && $urgent_incoming->payment_status == 0 && !can_investigations_be_performed(get_name($urgent_incoming->patient_id, 'id', 'category_id', 'patients')))
<code class="text-center">{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
@else
<a class="btn btn-success btn-rounded btn-sm" href="/investigations/view_lab_results_details/{{ $urgent_incoming->id }}">{{ __('investigations.add') }}</a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
<div id="all_complete_nav_pill" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.lab_number') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.received') }}</th>
<th>{{ __('investigations.performed_at') }}</th>
<th>{{ __('investigations.turn_around_time') }}</th>
<th>{{ __('investigations.patient') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.specimen') }}</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
@foreach($all_complete as $incoming)
<tr>
<td>{{ sprintf("%04u", $incoming->id) }}</td>
<td>{{ streamline_date_time_short($incoming->created_at) }}</td>
<td>{{ streamline_date_time_short($incoming->request_received_date) }}</td>
<td>{{ $incoming->results_created_at ? streamline_date_time_short($incoming->results_created_at) : "N/A" }}</td>
<td>{{ \Carbon\Carbon::parse($incoming->results_created_at)->diffForHumans(\Carbon\Carbon::parse($incoming->request_received_date)) }} request received</td>
<td>
{{ get_full_name($incoming->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
({{ get_name($incoming->patient_id, 'id', 'number', 'patients') }}) - ({{ get_name(get_name($incoming->patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }})
</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td onclick="showQuickView({{ $incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td onclick="showQuickView({{ $incoming->id }}, 2)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->specimen)) }} {{ __('investigations.samples') }}</td>
<td>
<a class="btn btn-success btn-rounded btn-sm" href="/investigations/view_lab_results_details/{{ $incoming->id }}">{{ __('investigations.view') }}</a>
</td>
</tr>
@endforeach
@if(count($all_complete) < 1)
<tr>
<td colspan="11" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_results_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<div id="modal_specimen_edit"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/FileSaver.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function showQuickView(id, type) {
$.ajax({
method: 'POST',
url: '/investigations/view_lab_results_quick_view',
data: {'id': id, 'type': type},
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("Lab details for " + responseArray["patient_name"] + "(" + responseArray["patient_number"] + ")");
if (type == 2) {
$("#modal_specimen_edit").html('<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/' + id +'">Edit Specimen</a>');
} else {
$("#modal_specimen_edit").html("");
}
$('#modal_receive_request').modal('show');
}
});
}
function export_to_excel() {
if ($('#urgent_incoming_results').is(":visible")) {
var row_ids = ['per_results_nav_pill','urgent_incoming_results','all_complete_nav_pill'];
var sheet_names = ['All Incoming','Urgent Incoming','All Complete'];
} else {
var row_ids = ['per_results_nav_pill','all_complete_nav_pill'];
var sheet_names = ['All Incoming','All Complete'];
}
var sheet_data =[];
for (let i = 0; i < row_ids.length; i++) {
sheet_data.push(XLSX.utils.table_to_sheet(document.getElementById(row_ids[i])));
}
/* create a new blank workbook */
var wb = XLSX.utils.book_new();
for (let index = 0; index < sheet_data.length; index++) {
XLSX.utils.book_append_sheet(wb, sheet_data[index], sheet_names[index]);
}
var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'binary' });
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), '{{ __("layout.lab_results") }}.xlsx');
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i < s.length; i++) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
</script>
@endpush
@@ -0,0 +1,414 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.lab_results') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/view_lab_results/">{{ __('investigations.view_results') }}</a></li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<a target="_blank" style="margin-left: 20px" class="btn btn-inverse btn-sm float-right" href='/investigations/print_lab_result_details/{{ $ordered_investigation->id }}'>{{ __('investigations.print') }}</a>
<a target="_blank" class="btn btn-primary btn-sm float-right" onclick="$('#modal_select_print_invs').modal('show');">Selective Print</a>
<br><br>
<div id="print_div">
<div class="row">
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.patient_names') }}</th>
<td>
{{ get_full_name($ordered_investigation->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.age') }}/{{ __('investigations.gender') }}</th>
<td>
{{ get_patients_age(get_name($ordered_investigation->patient_id, 'id', 'date_of_birth', 'patients')) }}
/
{{ get_name($ordered_investigation->patient_id, 'id', 'gender', 'patients') == 1 ? __('investigations.male') : __('investigations.female') }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.patient_number') }}</th>
<td>{{ get_name($ordered_investigation->patient_id, 'id', 'number', 'patients') }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.lab_number') }}</th>
<td>{{ $ordered_investigation->lab_number ?? $ordered_investigation->id }}</td>
</tr>
</table>
</div>
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.ordered_by') }}</th>
<td>
@php
$created_by = Streamline\Models\User::find($ordered_investigation->created_by);
if ($ordered_investigation->ordered_by) {
$ordered_by_name = $ordered_investigation->ordered_by;
} elseif ($created_by && $created_by->hasRole('Doctors')) {
$ordered_by_name = get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users');
} else {
$ordered_by_name = __('investigations.self_request');
}
@endphp
@if(is_editing_name_of_lab_doctor_enabled() && Auth::user()->can('edit-name-of-lab-doctor'))
<div class="row">
<div class="col-md-9"><input class="form-control" id="input_ordered_by" value="{{ $ordered_by_name }}"></div>
<div class="col-md-3"><button class="btn btn-block btn-success" style="margin-top: 2px;" onclick="update_ordered_by()">Update</button></div>
</div>
@else
{{ $ordered_by_name }}
@endif
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.hospital_unit') }}</th>
<td>
@if($ordered_investigation->inpatient == 1)
{{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }}
@else
OPD
@endif
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.requested') }}</th>
<td>{{ streamline_date_time($ordered_investigation->created_at) }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.received') }}</th>
<td>{{ streamline_date_time($ordered_investigation->request_received_date) }}</td>
</tr>
</table>
</div>
<div class="col-md-2">
<div class="pull-right">
{{ getDNS1DBarcodePNG($ordered_investigation->id) }}
<h4>{{ $ordered_investigation->id }}</h4>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<h4>{{ __('investigations.tests') }}</h4>
<table class='table table-bordered table-striped'>
<tbody>
@php
$records = explode(",", $ordered_investigation->investigation_id);
@endphp
@foreach($records as $record)
<tr>
<td>{{ get_name($record, 'id', 'name', 'investigations') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="col-md-6">
<h4>{{ __('investigations.specimens') }}</h4>
<table class='table table-bordered table-striped'>
<tbody>
@php
$records = explode(",", $ordered_investigation->specimen);
$status_array = explode(",", $ordered_investigation->specimen_status);
$reason_array = explode(",", $ordered_investigation->specimen_reason);
@endphp
@for($i = 0; $i < count($records); $i++)
<tr>
<td>{{ get_name($records[$i], 'id', 'name', 'laboratory_specimens') }}</td>
<td>
@if ($status_array[$i] == 1)
<font color='green'>{{ __('investigations.taken') }}</font>
@elseif ($status_array[$i] == 2)
<font color='orange'>{{ __('investigations.not_taken') }}</font>
@elseif ($status_array[$i] == 3)
<font color='#ff4500'>{{ __('investigations.rejected') }}</font>
@endif
</td>
<td>{{ isset($reason_array[$i]) ? $reason_array[$i] : "" }}</td>
</tr>
@endfor
</tbody>
</table>
@if($ordered_investigation->investigation_status == 0)
<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/{{ $id }}">{{ __('investigations.edit_specimens') }}</a>
@endif
</div>
</div>
<hr>
<h4 class="text-center">{{ __('investigations.test_results') }}</h4>
<div class="table-responsive">
<table class='table table-bordered table-striped'>
<thead>
<tr>
<th>{{ __('investigations.status') }}</th>
<th>{{ __('investigations.investigation') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.unit') }}</th>
<th>{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
@if($result['type'] == 0)
<tr>
<td>
@if($result['authenticated'] == 1)
<font color='green'>{{ __('investigations.authenticated') }}</font>
@else
<font color='#ff4500'>{{ __('investigations.not_authenticated') }}</font>
@endif
</td>
<td>{{ $result['name'] }}</td>
@if($result['result'] != "")
<td>
{!! nl2br(e($result['result'])) !!}
@if (!empty($result['document']))
<br><br> <a class="label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank">{{ __('investigations.lab_result_document') }}</a>
@endif
</td>
<td>{{ $result['range'] }}</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{{ $result['comment'] }}</td>
@else
<td colspan="3" class="text-center"><code>{{ __('investigations.no_results_for_this_investigation') }}</code></td>
<td>
@if(Auth::user()->can('remove-investigation-with-no-result'))
<a class="btn btn-link btn-block btn-sm text-danger" href="/investigations/remove_investigation_with_no_result/{{ $result['id'] }}/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to remove this investigation with no results?')">Remove Investigation</a>
@endif
</td>
@endif
</tr>
@elseif($result['type'] == 1)
<tr>
<td>
@if($result['authenticated'] == 1)
<font color='green'>{{ __('investigations.authenticated') }}</font>
@else
<font color='#ff4500'>{{ __('investigations.not_authenticated') }}</font>
@endif
</td>
<td colspan="5">{{ $result['name'] }}</td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $result['result'])->first();
if (!$specialised_results) {
continue;
}
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
@endphp
@if($specialised_results)
<!-- check if specialised has no results which would be the same as having an array filled with empty values -->
@if($specialised_results->value == implode(",", array_fill(0, count($variable_value_array), "")))
<tr>
<td></td>
<td></td>
<td colspan="3" class="text-center"><code>{{ __('investigations.no_results_for_this_investigation') }}</code></td>
<td>
@if(Auth::user()->can('remove-investigation-with-no-result'))
<a class="btn btn-link btn-block btn-sm text-danger" href="/investigations/remove_investigation_with_no_result/{{ $result['id'] }}/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to remove this investigation with no results?')">Remove Investigation</a>
@endif
</td>
</tr>
@else
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td></td>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{!! nl2br(e($variable_value_array[$i])) !!}</td>
<td>
@if(get_name($variable_id_array[$i], 'id', 'range_type', 'investigation_specialised_variables') == 1)
{{ get_dynamic_normal_range_specialized($variable_id_array[$i], get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ get_name($variable_id_array[$i], 'id', 'normal_ranges', 'investigation_specialised_variables') }}
@endif
</td>
<td>
@if(get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{{ $variable_comment_array[$i] }}</td>
</tr>
@endfor
@endif
@endif
<tr><td colspan="6"></td></tr>
@endif
@endforeach
@if(count($results) < 1)
<tr>
<td colspan="6" class="text-center">
<p><code>{{ __('investigations.no_results_available') }}</code></p>
<a class="btn btn-primary btn-rounded btn-sm" href="/investigations/reverse_receiving_investigations/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to un-receive this investigation order')">Un-receive Investigation Order</a>
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
@if($ordered_investigation->investigation_status == 0)
<div class="row">
<div class="col-md-6">
{{ Form::open(['route' => 'investigations.ordered_results']) }}
{{ Form::hidden('order_id',$ordered_investigation->id) }}
{{ Form::hidden('order_type', 'Lab') }}
{{ Form::hidden('patient_id',$ordered_investigation->patient_id) }}
{{ Form::hidden('episode_id',$ordered_investigation->episode_id) }}
<button type="submit" class="btn btn-success btn-rounded btn-sm">{{ __('investigations.enter_manual_results') }}</button>
{{ Form::close() }}
</div>
<div class="col-md-6">
@php $lab_machine_result = \Streamline\Models\LabMachineResult::where('sample_id', $ordered_investigation->id)->first(); @endphp
@if($lab_machine_result)
<a class="btn btn-primary btn-rounded btn-sm" href="javascript:void(0);" onclick="previewLabMachineResults({{ $lab_machine_result->id }})">Preview Results From Machine</a>
@endif
</div>
</div>
@endif
</div>
<div class="col-md-6">
@if(count($results) > 0 && is_sms_enabled())
<a class="btn btn-primary btn-rounded btn-sm pull-right" onclick="send_sms_to_patient('{{ $ordered_investigation->patient_id }}')">Send SMS Alert to Patient</a>
@endif
</div>
</div>
</div>
<div class="modal" id="modal_select_print_invs" tabindex="-1" role="dialog" aria-labelledby="modal_select_print_invs" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b>Select investigations you want to print</b></h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'investigations.print_selective_lab_result_details', 'target' => '_blank']) }}
@php $records = explode(",", $ordered_investigation->investigation_id); @endphp
@foreach($records as $record)
<input type="checkbox" name="invs_to_print[]" value="{{ $record }}">
<label>{{ get_name($record, 'id', 'name', 'investigations') }}</label><br>
@endforeach
{{ Form::hidden('id', $ordered_investigation->id) }}
<br><br><br>
<button type="submit" class="btn btn-success">Print</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.cancel') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
<div class="modal" id="modal_lab_machine_preview" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Results Preview</h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<a class="btn btn-primary btn-rounded btn-sm" href="/lab_machines/import_results/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to import these results')">Import Results From Machine</a>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
function send_sms_to_patient(patient_id) {
if (confirm("Are you sure you want to send an sms alert to the patient?")){
$.ajax({
method: 'GET',
url: '/sms/send_investigation_alert/' + patient_id,
success: function(response){
alert(response);
}
});
} else {
return false;
}
}
function previewLabMachineResults(id) {
$.ajax({
method: 'GET',
url: '/lab_machines/preview_lab_machine_results/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$('#modal_lab_machine_preview').modal('show');
}
});
}
function update_ordered_by () {
let id = "{{ $ordered_investigation->id }}";
let name = $('#input_ordered_by').val();
$.ajax({
url: '/investigations/update_by_ordered_by',
method : 'POST',
data : {'id':id,'name':name},
success : function (response) {
if(response == 1){
alert('Doctor Has Been Updated Successfully.')
$('#input_ordered_by').val(name);
}
},
error : function (error) {
console.log(error)
}
});
};
</script>
@endpush
@@ -0,0 +1,143 @@
@extends('layouts.main')
@push('styles')
<style type="text/css">
#divToPrint{
font-size: 13px;
color: #7c7c7c;
}
#results_table{
font-size: 1em;
font-weight: normal;
font-family: monospace
}
#results_table th{
border: 1px solid #dddddd;
}
#results_table td{
border: 1px solid #dddddd;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.result_details') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.result_details') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<br>
<div class="white-box">
<a target="_blank" href="/investigations/print_patient_investigation_results/{{ $result_id }}" class="btn btn-inverse float-right">{{ __('investigations.print') }}</a>
<a target="_blank" class="btn btn-primary float-right" onclick="$('#modal_select_print_invs').modal('show');">{{ __('investigations.selective_print') }}</a>
@include('flash::message')
<h4>{{ __('investigations.results_for_episode') }} {{ $inv['date'] }}</h4>
<table class="table table-striped table-bordered color-table success-table" id="results_table">
<thead>
<tr>
<th style="width: 30%">{{ __('investigations.investigation') }}</th>
<th @if($result_type != "Lab") style="display: none;" @else style="width: 20%" @endif>{{ __('investigations.normal_range') }}</th>
<th style="width: 30%">{{ __('investigations.results') }}</th>
<th style="width: 20%">{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($inv['data'] as $value)
@if($value['type'] == 0)
<tr>
<td>{{ $value['name'] }}</td>
<td @if($result_type != "Lab") style="display: none;" @endif>{{ $value['range'] }}</td>
@if($value['result'] != "" || $value['slug'] == "echo")
<td>
@if($value['slug'] == "echo" && $value['result'] == "")
<a target="_blank" class="fcbtn btn btn-sm btn-info btn-outline btn-1d" href='{{ url("/investigations/print-cardio-echo/{$patient->id}/{$episode_id}") }}'> <i class="fa fa-print"></i> <span>{{ __('investigations.view_echo_results') }}</span></a>
@else
{!! nl2br(e($value['result'])) !!}
@endif
</td>
<td>{!! nl2br(e($value['comment'])) !!}</td>
@else
<td class="text-center"><code>{{ __('investigations.no_results_for_this_investigation') }}</code></td>
<td>
@if(Auth::user()->can('remove-investigation-with-no-result'))
<a class="btn btn-link btn-block btn-sm text-danger" href="/investigations/remove_investigation_with_no_result/{{ $value['id'] }}/{{ $order_id }}" onclick="return confirm('Are you sure you want to remove this investigation with no results?')">{{ __('investigations.remove_investigation') }}</a>
@endif
</td>
@endif
</tr>
@else
<tr>
<td colspan="3">{{ $value['name'] }}</td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $value['result'])->first();
if (!$specialised_results) {
continue;
}
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
@endphp
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{{ $variable_value_array[$i] }}</td>
<td>{{ $variable_comment_array[$i] }}</td>
</tr>
@endfor
<tr><td colspan="3"></td></tr>
@endif
@endforeach
</tbody>
</table>
<br><br>
</div>
<div class="modal" id="modal_select_print_invs" tabindex="-1" role="dialog" aria-labelledby="modal_select_print_invs" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b>{{ __('investigations.select_investigations_you_want_to_print') }}</b></h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'investigations.print_selective_patient_investigation_results', 'target' => '_blank']) }}
@foreach($inv['data'] as $value)
<input type="checkbox" name="invs_to_print[]" value="{{ $value['id'] }}">
<label>{{ $value['name'] }}</label><br>
@endforeach
{{ Form::hidden('result_id', $result_id) }}
<br><br><br>
<button type="submit" class="btn btn-success">{{ __('investigations.print') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.cancel') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,447 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.other_ultrasound_results') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
@include('flash::message')
<div class="row">
<div class="col-md-3">
<div class="form-group">
{{ Form::label('scan_date', __('investigations.date_of_scan')) }}
<div class="input-group">
{{ Form::text('scan_date', streamline_date($report->scan_date), ['class'=>'form-control compulsory', 'readonly']) }}
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('sonographer_name', __('investigations.sonographer')) }}
{{ Form::text('sonographer_name', get_full_name($report->sonographer, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control compulsory', 'readonly']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('no_of_foetus', __('investigations.number_of_foetus')) }}
<input type="number" id="numberInput" name="no_of_foetus" class="form-control compulsory" min="1" readonly value="{{ $report->no_of_foetus ?? '1' }}" onchange="showFoetusColumns()">
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-1">
<label style="display: block;">&nbsp;</label>
<a href="<?php echo url("/investigations/print_ultrasound_results_obstetric/{$obstetric_result_id}") ?>" target="_blank" class="btn btn-inverse">{{ __('investigations.print') }}</a>
</div>
</div>
<h4>{{ __('investigations.obstetric_ultrasound_order_details') }}</h4>
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date($invs_order->created_at) }}</td>
</tr>
@if($anc_details)
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ $anc_details->gravida }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ $anc_details->para }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ $anc_details->abortion }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>{{ streamline_date($anc_details->lmp) }}</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>{{ get_name($anc_details->accuracy, 'id', 'name', 'ante_natal_clinic_accuracies') }}</td>
<th>{{ __('investigations.edd') }}</th>
<td>{{ streamline_date($anc_details->edd) }}</td>
</tr>
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
{{ get_full_name($invs_order->created_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($invs_order->created_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ $invs_order->comment }}</td>
</tr>
@else
<tr>
<td colspan="2">{{ __('investigations.information_not_available') }}</td>
</tr>
@endif
</table>
</div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th >{{ __('investigations.item') }}</th>
<th ><div class="foetus1header hiddenx">1</div></th>
<th><div class="foetus2header hidden">2</div></th>
<th><div class="foetus3header hidden">3</div></th>
</tr>
</thead>
<tbody>
{{-- @dd($report->crown_rump) --}}
<tr>
<td>{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('crown_rump1', split_string_null_check($report->crown_rump, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r1 hidden">
{{ Form::text('crown_rump2', split_string_null_check($report->crown_rump, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden">
{{ Form::text('crown_rump3', split_string_null_check($report->crown_rump, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('bi_parietal_diameter1', split_string_null_check($report->bi_parietal_diameter, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r2 hidden">
{{ Form::text('bi_parietal_diameter2', split_string_null_check($report->bi_parietal_diameter, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r2 hidden">
{{ Form::text('bi_parietal_diameter3', split_string_null_check($report->bi_parietal_diameter, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('head_circumference1', split_string_null_check($report->head_circumference, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r3 hidden">
{{ Form::text('head_circumference2', split_string_null_check($report->head_circumference, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r3 hidden">
{{ Form::text('head_circumference3', split_string_null_check($report->head_circumference, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('abdominal_circumference1', split_string_null_check($report->abdominal_circumference, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r4 hidden">
{{ Form::text('abdominal_circumference2', split_string_null_check($report->abdominal_circumference, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r4 hidden">
{{ Form::text('abdominal_circumference3', split_string_null_check($report->abdominal_circumference, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
{{-- @dd($report) --}}
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('femur_length1', split_string_null_check($report->femur_length, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r5 hidden">
{{ Form::text('femur_length2', split_string_null_check($report->femur_length, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r5 hidden">
{{ Form::text('femur_length3', split_string_null_check($report->femur_length, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
<div class="form-group">
{{ Form::text('estimated_foetal_weight1', split_string_null_check($report->estimated_foetal_weight, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r6 hidden">
{{ Form::text('estimated_foetal_weight2', split_string_null_check($report->estimated_foetal_weight, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r6 hidden">
{{ Form::text('estimated_foetal_weight3', split_string_null_check($report->estimated_foetal_weight, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
<div class="form-group">
{{ Form::text('average_gestational_age1', split_string_null_check($report->average_gestational_age, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r7 hidden">
{{ Form::text('average_gestational_age2', split_string_null_check($report->average_gestational_age, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r7 hidden">
{{ Form::text('average_gestational_age3', split_string_null_check($report->average_gestational_age, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
<div class="input-group">
{{ Form::text('expected_delivery_date1', split_string_null_check($report->expected_delivery_date, 0), ['class'=>'form-control', 'id'=>'expected_delivery_date1', 'readonly']) }}
</div>
</td>
<td>
<div class="input-group foetus2r8 hidden">
{{ Form::text('expected_delivery_date2', split_string_null_check($report->expected_delivery_date, 1), ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
</div>
</td>
<td>
<div class="input-group foetus3r8 hidden">
{{ Form::text('expected_delivery_date3', split_string_null_check($report->expected_delivery_date, 2), ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
<div class="form-group">
{{ Form::text('presentation1', split_string_null_check($report->presentation, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r9 hidden">
{{ Form::text('presentation2', split_string_null_check($report->presentation, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r9 hidden">
{{ Form::text('presentation3', split_string_null_check($report->presentation, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
<div class="form-group">
{{ Form::text('placental_site2', split_string_null_check($report->placental_site, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r10 hidden">
{{ Form::text('placental_site2', split_string_null_check($report->placental_site, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r10 hidden">
{{ Form::text('placental_site3', split_string_null_check($report->placental_site, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
<div class="form-group">
{{ Form::text('liquor_volume1', split_string_null_check($report->liquor_volume, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r11 hidden">
{{ Form::text('liquor_volume2', split_string_null_check($report->liquor_volume, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r11 hidden">
{{ Form::text('liquor_volume3', split_string_null_check($report->liquor_volume, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
<div class="form-group">
{{ Form::text('cord_artery_doppler1', split_string_null_check($report->cord_artery_doppler, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r12 hidden">
{{ Form::text('cord_artery_doppler2', split_string_null_check($report->cord_artery_doppler, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r12 hidden">
{{ Form::text('cord_artery_doppler3', split_string_null_check($report->cord_artery_doppler, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
@php
//explode comments with separator ,,,
$comments = !empty($report->comments) ? explode(",,,",$report->comments) : '';
@endphp
<tr>
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
<div class="form-group">
<textarea class="form-control " name="comments1" rows="7" readonly > {{ $comments[0] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus2r13 hidden">
<textarea class="form-control" name="comments2" rows="7" readonly > {{ $comments[1] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus3r13 hidden">
<textarea class="form-control" name="comments3" rows="7" readonly > {{ $comments[2] ?? ''}} </textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
{{-- show foetus data columns on change of foetus number input --}}
<script>
//function to load the colummns
function showFoetusColumns() {
var inputVal = parseInt(document.getElementById("numberInput").value);
// div classes with their respective visibility requirements
var divClasses = {
//foetus one sections
'foetus1header': 1,'foetus1r1': 1,'foetus1r2': 1, 'foetus1r3': 1,'foetus1r4': 1,'foetus1r5': 1,'foetus1r6': 1,'foetus1r7': 1,'foetus1r8': 1,'foetus1r9': 1, 'foetus1r10': 1,'foetus1r11': 1,'foetus1r12': 1,'foetus1r13': 1,
//foetus two sections
'foetus2header': 2,'foetus2r1': 2,'foetus2r2': 2,'foetus2r3': 2,'foetus2r4': 2,'foetus2r5': 2,'foetus2r6': 2,'foetus2r7': 2,'foetus2r8': 2,'foetus2r9': 2, 'foetus2r10': 2,'foetus2r11': 2,'foetus2r12': 2,'foetus2r13': 2,
//foetus three sections
'foetus3header': 3,'foetus3r1': 3,'foetus3r2': 3,'foetus3r3': 3,'foetus3r4': 3,'foetus3r5': 3,'foetus3r6': 3,'foetus3r7': 3,'foetus3r8': 3,'foetus3r9': 3, 'foetus3r10': 3,'foetus3r11': 3,'foetus3r12': 3,'foetus3r13': 3,
};
// Loop through the divClasses object
for (var className in divClasses) {
if (divClasses.hasOwnProperty(className)) {
var divs = document.querySelectorAll('.' + className);
divs.forEach(function(div) {
if (inputVal >= divClasses[className]) {
// Show the div
div.classList.remove('hidden');
} else {
// Hide the div and clear its input fields
div.classList.add('hidden');
var inputs = div.querySelectorAll('input, textarea');
inputs.forEach(function(input) {
input.value = ''; // Clear the value of the input field
});
// Reset select elements
var selects = div.querySelectorAll('select');
selects.forEach(function(select) {
select.selectedIndex = 0; // Reset to the first option
//select.value = '';
});
}
});
}
}
}
</script>
<script type="text/javascript">
//load all columns depending on number in input , on page load
window.onload = function() {
showFoetusColumns();
};
</script>
@endpush
@@ -0,0 +1,45 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('lab_forms.add_lab_form') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('lab_forms.home') }}</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::labs.menu')
@include('flash::message')
<div class="white-box" style="border-radius: 5px;">
{{ Form::open(['method'=>'POST', 'route'=>'lab_forms.store']) }}
<div class="form-group">
<label>{{ __('lab_forms.lab_form_name') }}</label>
<input name="name" class="form-control" type="text">
</div>
<div class="form-group text-right">
<input type="submit" class="btn btn-success">
</div>
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@@ -0,0 +1,48 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('lab_forms.edit_lab_form') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('lab_forms.home') }}</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::labs.menu')
@include('flash::message')
<div class="white-box" style="border-radius: 5px;">
{{ Form::open(['method'=>'PUT', 'route'=>['lab_forms.update', $lab_form]]) }}
<div class="form-group">
<label>{{ __('lab_forms.lab_form_name') }}</label>
<input type="hidden" value="{{ $lab_form->id }}">
<input name="name" class="form-control compulsory" required value="{{ $lab_form->name }}" type="text">
</div>
<div class="form-group text-right">
<input type="submit" class="btn btn-success">
</div>
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@@ -0,0 +1,198 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet"
type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style>
table.dataTable thead th:after {
content: "" !important;
}
.show-on-hover {
visibility: hidden !important;
}
.show-on-hover-sec:hover .show-on-hover,
.show-on-hover-sec:focus .show-on-hover {
visibility: initial !important;
}
.show-on-hover-none {
display: none !important;
}
.show-on-hover-sec:hover .show-on-hover-none,
.show-on-hover-sec:focus .show-on-hover-none {
display: flex !important;
gap: 4px
}
td .show-on-hover-none * {
text-transform: capitalize;
font-size: 12px;
}
.show-on-hover-sec td {
position: relative;
}
td .show-on-hover-none {
position: absolute;
bottom: .5rem;
}
td .show-on-hover-none .dropdown ul {
transform: translate(5px, 20px) !important;
}
.active-box {
font-weight: bold;
border-radius: 5px;
}
.text-content-view::after {
content: 'View';
}
.text-content-edit::after {
content: 'Edit';
}
.text-content-options::after {
content: 'Options ✢';
border: none;
}
.text-content-options.show::after {
content: 'Options --';
}
.text-content-archive::after {
content: 'Archive record';
}
.text-content-delete::after {
content: 'Delete item';
}
.text-content-delete-hard::after {
content: 'Permanently delete item';
}
.text-content-archive-restore::after {
content: 'Restore from archive'
}
.text-content-trash-restore::after {
content: 'Restore from trash'
}
.text-content-clear-logs::after {
content: 'Clear record logs'
}
.right-0 {
right: 0;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('lab_forms.view_lab_form') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('lab_forms.home') }}</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::labs.menu')
@include('flash::message')
<div class="white-box" style="border-radius: 5px;">
<div class="panel">
<div class=" d-flex justify-content-between flex-wrap">
{{-- <span>{{ __('clinical_data.lab_usages_report') }} </span> --}}
<div class="d-flex justify-content-between ">
@if (Auth::user()->can('labs-create'))
<a href="{{ route('labs.create') }}" class="mr-2 btn btn-default{{ url()->current() == route('labs.create') ? ' active-box ' : '' }} my-1">{{ __('labs.add_lab') }}</a>
<a href="{{ route('lab_forms.create') }}" class="mr-2 btn btn-default{{ url()->current() == route('lab_forms.create') ? ' active-box ' : '' }} my-1">{{ __('labs.add_lab_form') }}</a>
@endif
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>{{ __('lab_forms.lab_form_name') }}</th>
</tr>
</thead>
<tbody>
@foreach ($lab_forms as $item)
<tr class="show-on-hover-sec">
<td class="position-relative py-4">
{{ $item->name }}
<div class="show-on-hover-none d-flex justify-content-start gap-2 right-0 position-absolute pull-right"
style="z-index: 5">
<a href="{{ route('lab_forms.edit', $item->id) }}"
class="btn btn-rounded btn-warning text-content-edit btn-sm"><i
class="fa fa-pencil"></i>
</a>
{{ Form::model($item->id, ['method' => 'DELETE', 'route' => ['lab_forms.destroy', $item->id]]) }}
<button onclick="return confirm('<?php echo __('lab_forms.are_you_sure'); ?>')"
class="btn btn-rounded btn-danger text-content-delete btn-sm"><i
class="fa fa-trash"></i>
</button>
{{ Form::close() }}
</div>
</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th>{{ __('lab_forms.lab_form_name') }}</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
order: [
[0, 'desc']
],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
'pageLength': 50,
});
</script>
@endpush
@@ -0,0 +1,7 @@
<a href="{{ route('labs.create') }}">{{ __('lab_forms.add_lab') }}</a>
<a href="{{ route('labs.add_bulk') }}">{{ __('lab_forms.') }}</a>
<a href="{{ route('labs.edit_bulk') }}">{{ __('lab_forms.edit_lab_form') }}</a>
<a href="{{ route('labs.delete_bulk') }}">{{ __('lab_forms.delete_multiple_labs') }}</a>
<a href="{{ route('labs.clear_stock') }}">{{ __('lab_forms.clear_stock') }}</a>
<a href="{{ route('lab_forms.index') }}">{{ __('lab_forms.view_lab_form') }}</a>
<a href="{{ route('lab_forms.create') }}">{{ __('lab_forms.add_lab_form') }}</a>
@@ -0,0 +1,42 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('lab_instruments.add_lab_instrument') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('lab_instruments.dashboard') }}</a></li>
<li><a href="lab_instruments">{{ __('lab_instruments.lab_instruments') }}</a></li>
<li class="active">{{ __('lab_instruments.create') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['route' => 'lab_instruments.store', 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name',__('lab_instruments.lab_instrument_name')) }}
{{ Form::text('name','',['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
</div>
{{ Form::button(__('lab_instruments.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('lab_instruments.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
@endpush
@@ -0,0 +1,63 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('lab_instruments.edit_lab_instrument') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('lab_instruments.dashboard') }}</a></li>
<li><a href="/lab_instruments/">{{ __('lab_instruments.lab_instruments') }}</a></li>
<li class="active">{{ __('lab_instruments.edit') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::lab_instruments.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($instrument, ['method' => 'PUT', 'route' => ['lab_instruments.update',$instrument], 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name',__('lab_instruments.lab_instrument_name')) }}
{{ Form::text('name',$instrument->name,['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
</div>
{{ Form::button(__('lab_instruments.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('lab_instruments.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#investigation_id").select2({
placeholder: "-- select --"
});
});
</script>
@endpush
@@ -0,0 +1,78 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('lab_instruments.activate_lab_instrument') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('lab_instruments.dashboard') }}</a></li>
<li><a href="/lab_instruments/">{{ __('lab_instruments.lab_instruments') }}</a></li>
<li class="active">{{ __('lab_instruments.activate') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::lab_instruments.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('lab_instruments.lab_instrument') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($instruments as $instrument)
<tr>
<td>{{ $instrument->name }}</td>
<td>
{{ Form::model($instrument->id ,['method' => 'POST', 'route' => ['lab_instruments.activate', $instrument->id]]) }}
<button type="submit" class="btn btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-check"></i> {{ __('lab_instruments.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,84 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('lab_instruments.lab_instruments') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('lab_instruments.dashboard') }}</a></li>
<li class="active">{{ __('lab_instruments.lab_instruments') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::lab_instruments.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
@include('flash::message')
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('lab_instruments.lab_instrument') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($instruments as $instrument)
<tr>
<td>{{ $instrument->name }}</td>
<td>
<a href="/lab_instruments/{{ $instrument->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('lab_instruments.edit') }}</a>
</td>
<td>
{{ Form::model($instrument->id ,['method' => 'DELETE', 'route' => ['lab_instruments.destroy', $instrument->id]]) }}
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('lab_instruments.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'pdf', 'print', 'excel'
]
});
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="{{ route('lab_instruments.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('lab_instruments.add_lab_instrument') }}</a>
<a href="{{ route('lab_instruments.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('lab_instruments.view_lab_instruments') }}</a>
<a href="{{ route('lab_instruments.inactive') }}" class="nav-item btn btn-default ti-pencil"> {{ __('lab_instruments.activate_lab_instruments') }}</a>
</div>
</div>
@@ -0,0 +1,150 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('investigations.lab_results') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.view_results') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'lab_machines.view_lab_machine_results']) }}
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2">
{{ Form::label('lab_number', __('investigations.search_by_lab_number')) }}
{{ Form::number('lab_number', '', ['class' => 'form-control']) }}
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="row">
<div class="col-md-4">
{{ Form::open(['route' => 'lab_machines.restart_python_script', 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::select('lab_instrument', $lab_machines, '', ['class' => 'form-control compulsory', 'required']) }}
</div>
{{ Form::button(__('lab_instruments.restart_lab_integration'),['type'=>'submit','class'=>'btn btn-inverse waves-effect waves-light m-r-10']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('lab_instruments.sample_id') }}</th>
<th>{{ __('lab_instruments.results_time') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<tr>
<td class="text-center">{{ $result->sample_id }}</td>
<td>{{ streamline_date_time($result->created_at) }}</td>
<td>
@php $ordered_results = \Streamline\Models\OrderedInvestigation::find($result->sample_id); @endphp
@if($ordered_results)
<a class="btn btn-success btn-rounded btn-sm" href="/investigations/view_lab_results_details/{{ $result->sample_id }}">{{ __('lab_instruments.view_lab_order') }}</a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,73 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('laboratory_specimen.add_specimen') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('laboratory_specimen.dashboard') }}</a></li>
<li><a href="/laboratory_specimen/index">{{ __('laboratory_specimen.specimens') }}</a></li>
<li class="active">{{ __('laboratory_specimen.create') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::laboratory_specimen.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::open(['route' => 'laboratory_specimen.store', 'data-toggle' => 'validator', 'autocomplete' => 'off']) }}
<div class="form-group" id="optionsList">
{{ Form::label('name', __('laboratory_specimen.specimen_name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<a href="#" id="addOption">{{ __('laboratory_specimen.add_another') }}</a><br><br>
{{ Form::button(__('laboratory_specimen.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('laboratory_specimen.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script type="text/javascript">
$(function() {
$("#addOption").click(function(e) {
e.preventDefault();
$("#optionsList").append("<br>");
$("#optionsList").append("<input type='text' name='other_specimen_names[]' placeholder='' class='form-control' />");
});
$(".next,.submit-btn").click(function (e) { // make sure that all compulsory fields have been filled out
var empty_compulsory_fields = [];
$(".compulsory").each(function () {
if ($(this).val() == "") {
var textname = $(this).attr('name');
$(this).focus();
empty_compulsory_fields.push(textname);
$(this).css('border','1px solid #F08080');
}
});
/* check if the array containing empty compulsory fields is not empty then return false */
if (empty_compulsory_fields.length != 0) {
alert("<?php echo __('laboratory_specimen.please_compulsory_fields');?>");
console.log(empty_compulsory_fields);
e.preventDefault();
return false;
}
});
});
</script>
@endpush
@@ -0,0 +1,46 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('laboratory_specimen.edit_specimen') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('laboratory_specimen.dashboard') }}</a></li>
<li><a href="/laboratory_specimen/index">{{ __('laboratory_specimen.specimens') }}</a></li>
<li class="active">{{ __('laboratory_specimen.edit') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('investigations::laboratory_specimen.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($lab_specimen, ['method' => 'PUT', 'route' => ['laboratory_specimen.update',$lab_specimen] , 'data-toggle' => 'validator']) }}
<div class="form-group" id="optionsList">
{{ Form::label('name', __('laboratory_specimen.specimen_name')) }}
{{ Form::text('name', $lab_specimen->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
{{ Form::button(__('laboratory_specimen.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('laboratory_specimen.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script type="text/javascript">
</script>
@endpush
@@ -0,0 +1,82 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('laboratory_specimen.inactive_specimens') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('laboratory_specimen.dashboard') }}</a></li>
<li><a href="{{ route('laboratory_specimen.create') }}">{{ __('laboratory_specimen.add_specimen') }}</a></li>
<li class="active">{{ __('laboratory_specimen.inactive_specimens') }}</li>
</ol>
</div>
</div>
@include('investigations::laboratory_specimen.menu')
<div class="row">
<div class="col-sm-12">
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('laboratory_specimen.name') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($lab_specimens as $specimen)
<tr>
<td>{{ $counter }}</td>
<td>{{ $specimen->name }}</td>
<td>
<a href="/laboratory_specimen/{{ $specimen->id }}/activate/" class="btn btn-warning btn-sm">{{ __('laboratory_specimen.activate') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,97 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('laboratory_specimen.lab_specimens') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('laboratory_specimen.dashboard') }}</a></li>
<li><a href="{{ route('laboratory_specimen.create') }}">{{ __('laboratory_specimen.add_specimen') }}</a></li>
<li class="active">{{ __('laboratory_specimen.lab_specimens') }}</li>
</ol>
</div>
</div>
@include('investigations::laboratory_specimen.menu')
<div class="row">
<div class="col-sm-12">
@include('flash::message')
@if (count($errors) > 0)
<div class = "alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="white-box">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('laboratory_specimen.name') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($lab_specimens as $specimen)
<tr>
<td>{{ $counter }}</td>
<td>{{ $specimen->name }}</td>
<td>
<a href="/laboratory_specimen/{{ $specimen->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('laboratory_specimen.edit') }}</a>
</td>
<td>
{{ Form::model($specimen->id ,['method' => 'DELETE', 'route' => ['laboratory_specimen.destroy', $specimen->id]]) }}
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('<?php echo __('laboratory_specimen.are_you_sure');?>')"><i class="fa fa-trash"></i> {{ __('laboratory_specimen.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="{{ route('laboratory_specimen.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('laboratory_specimen.add_specimen') }}</a>
<a href="{{ route('laboratory_specimen.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('laboratory_specimen.view_specimen') }}</a>
<a href="{{ route('laboratory_specimen.inactive') }}" class="nav-item btn btn-default ti-pencil"> {{ __('laboratory_specimen.activate_specimen') }}</a>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More