|
@@ -88,7 +88,7 @@ class PracticeManagementController extends Controller
|
|
|
$query = $query->where('is_signed_by_hcp', false);
|
|
|
break;
|
|
|
|
|
|
- // more cases can be added as needed
|
|
|
+ // more cases can be added as needed
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -137,7 +137,7 @@ class PracticeManagementController extends Controller
|
|
|
});
|
|
|
break;
|
|
|
|
|
|
- // more cases can be added as needed
|
|
|
+ // more cases can be added as needed
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
@@ -244,7 +244,7 @@ class PracticeManagementController extends Controller
|
|
|
$startDate = date('Y-m-d', strtotime("sunday -1 week"));
|
|
|
$endDateTime = new DateTime($startDate);
|
|
|
$endDateTime->modify('+6 day');
|
|
|
- $endDate = $endDateTime->format("Y-m-d");
|
|
|
+ $endDate = $endDateTime->format("Y-m-d");
|
|
|
|
|
|
$eventsData = $pro->getAvailabilityEvents($startDate, $endDate);
|
|
|
$events = json_encode($eventsData);
|
|
@@ -294,14 +294,16 @@ class PracticeManagementController extends Controller
|
|
|
}
|
|
|
|
|
|
// check video page
|
|
|
- public function checkVideo(Request $request, $uid) {
|
|
|
+ public function checkVideo(Request $request, $uid)
|
|
|
+ {
|
|
|
$session = AppSession::where('session_key', $request->cookie('sessionKey'))->first();
|
|
|
$client = !empty($uid) ? Client::where('uid', $uid)->first() : null;
|
|
|
$publish = false;
|
|
|
return view('app.video.check-video-minimal', compact('session', 'client'));
|
|
|
}
|
|
|
|
|
|
- public function getParticipantInfo(Request $request) {
|
|
|
+ public function getParticipantInfo(Request $request)
|
|
|
+ {
|
|
|
$sid = intval($request->get('uid')) - 1000000;
|
|
|
$session = AppSession::where('id', $sid)->first();
|
|
|
$result = [
|
|
@@ -371,22 +373,23 @@ class PracticeManagementController extends Controller
|
|
|
return view('app.practice-management.calendar');
|
|
|
}
|
|
|
|
|
|
- public function cellularDeviceManager(Request $request, $proUid = null){
|
|
|
+ public function cellularDeviceManager(Request $request, $proUid = null)
|
|
|
+ {
|
|
|
$proUid = $proUid ? $proUid : $request->get('pro-uid');
|
|
|
$performerPro = $this->performer->pro;
|
|
|
$targetPro = null;
|
|
|
$allPros = [];
|
|
|
$expectedForHcp = null;
|
|
|
- if($performerPro->pro_type == 'ADMIN'){
|
|
|
+ if ($performerPro->pro_type == 'ADMIN') {
|
|
|
$allPros = Pro::all();
|
|
|
$targetPro = Pro::where('uid', $proUid)->first();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$targetPro = $performerPro;
|
|
|
}
|
|
|
$clients = [];
|
|
|
- if($targetPro){
|
|
|
+ if ($targetPro) {
|
|
|
$clients = Client::where('mcp_pro_id', $targetPro->id)->orderBy('created_at', 'desc')->paginate(100);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$clients = Client::orderBy('created_at', 'desc')->paginate(100);
|
|
|
}
|
|
|
return view('app.practice-management.cellular-device-manager', compact('clients', 'allPros', 'targetPro'));
|
|
@@ -399,20 +402,19 @@ class PracticeManagementController extends Controller
|
|
|
$targetPro = null;
|
|
|
$allPros = [];
|
|
|
$expectedForHcp = null;
|
|
|
- if($performerPro->pro_type == 'ADMIN'){
|
|
|
+ if ($performerPro->pro_type == 'ADMIN') {
|
|
|
$allPros = Pro::all();
|
|
|
$targetPro = Pro::where('uid', $proUid)->first();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$targetPro = $performerPro;
|
|
|
}
|
|
|
$bills = [];
|
|
|
- if($targetPro){
|
|
|
- $expectedForHcp = DB::select(DB::raw("SELECT coalesce(SUM(hcp_expected_payment_amount),0) as expected_pay FROM bill WHERE hcp_pro_id = :targetProID AND is_signed_by_hcp IS TRUE AND is_cancelled = false"), ['targetProID' => $targetPro->id])[0]->expected_pay;
|
|
|
- $bills = Bill::where('hcp_pro_id', $targetPro->id)->orderBy('created_at', 'desc')->paginate(500);
|
|
|
- }else{
|
|
|
- $bills = Bill::orderBy('created_at', 'desc')->paginate(500);
|
|
|
+ if ($targetPro) {
|
|
|
+ $rows = DB::select(DB::raw("SELECT * FROM aemish_bill_report WHERE hcp_pro_id = :targetProID"), ['targetProID' => $targetPro->id]);
|
|
|
+ } else {
|
|
|
+ $rows = DB::select(DB::raw("SELECT * FROM aemish_bill_report"));
|
|
|
}
|
|
|
- return view('app.practice-management.hcp-bill-matrix', compact('bills', 'allPros', 'expectedForHcp', 'targetPro'));
|
|
|
+ return view('app.practice-management.hcp-bill-matrix', compact('rows', 'allPros', 'targetPro'));
|
|
|
}
|
|
|
|
|
|
public function billingManager(Request $request, $proUid = null)
|
|
@@ -422,17 +424,17 @@ class PracticeManagementController extends Controller
|
|
|
$targetPro = null;
|
|
|
$allPros = [];
|
|
|
$expectedForHcp = null;
|
|
|
- if($performerPro->pro_type == 'ADMIN'){
|
|
|
+ if ($performerPro->pro_type == 'ADMIN') {
|
|
|
$allPros = Pro::all();
|
|
|
$targetPro = Pro::where('uid', $proUid)->first();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$targetPro = $performerPro;
|
|
|
}
|
|
|
$notes = [];
|
|
|
- if($targetPro){
|
|
|
+ if ($targetPro) {
|
|
|
$expectedForHcp = DB::select(DB::raw("SELECT coalesce(SUM(hcp_expected_payment_amount),0) as expected_pay FROM bill WHERE hcp_pro_id = :targetProID AND is_signed_by_hcp IS TRUE AND is_cancelled = false"), ['targetProID' => $targetPro->id])[0]->expected_pay;
|
|
|
$notes = Note::where('hcp_pro_id', $targetPro->id)->orderBy('effective_dateest', 'desc')->paginate();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$notes = Note::orderBy('effective_dateest', 'desc')->paginate();
|
|
|
}
|
|
|
return view('app.practice-management.billing-manager', compact('notes', 'allPros', 'expectedForHcp', 'targetPro'));
|
|
@@ -445,14 +447,15 @@ class PracticeManagementController extends Controller
|
|
|
}
|
|
|
|
|
|
// Generate PDF
|
|
|
- public function downloadClaims() {
|
|
|
+ public function downloadClaims()
|
|
|
+ {
|
|
|
$claims = Claim::where('was_submitted', false)->orWhere('was_submitted', null)->orderBy('created_at', 'desc')->limit(100)->get();
|
|
|
view()->share('claims', $claims);
|
|
|
|
|
|
$pdf = PDF::loadView('app.practice-management.claims-pdf', $claims);
|
|
|
|
|
|
return $pdf->download('pdf_file.pdf');
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
public function tickets(Request $request, $proUid = null)
|
|
|
{
|