|
@@ -356,31 +356,31 @@ class PracticeManagementController extends Controller
|
|
{
|
|
{
|
|
|
|
|
|
$myInitiatives = $this->performer->pro->initiatives;
|
|
$myInitiatives = $this->performer->pro->initiatives;
|
|
- if($myInitiatives){
|
|
|
|
|
|
+ if ($myInitiatives) {
|
|
$myInitiatives = strtoupper($myInitiatives);
|
|
$myInitiatives = strtoupper($myInitiatives);
|
|
}
|
|
}
|
|
$myInitiativesList = explode('|', $myInitiatives);
|
|
$myInitiativesList = explode('|', $myInitiatives);
|
|
|
|
|
|
$myForeignLanguages = $this->performer->pro->foreign_languages;
|
|
$myForeignLanguages = $this->performer->pro->foreign_languages;
|
|
- if($myForeignLanguages){
|
|
|
|
|
|
+ if ($myForeignLanguages) {
|
|
$myForeignLanguages = strtoupper($myForeignLanguages);
|
|
$myForeignLanguages = strtoupper($myForeignLanguages);
|
|
}
|
|
}
|
|
$myForeignLanguagesList = explode('|', $myForeignLanguages);
|
|
$myForeignLanguagesList = explode('|', $myForeignLanguages);
|
|
|
|
|
|
- $clients = Client::whereNotNull('active_mcp_request_id')->where(function($query) use ($myInitiativesList){
|
|
|
|
|
|
+ $clients = Client::whereNotNull('active_mcp_request_id')->where(function ($query) use ($myInitiativesList) {
|
|
$query->whereNull('initiative')->orWhereIn('initiative', $myInitiativesList);
|
|
$query->whereNull('initiative')->orWhereIn('initiative', $myInitiativesList);
|
|
})
|
|
})
|
|
- ->where(function($query) use ($myForeignLanguagesList) {
|
|
|
|
- $query->whereNull('preferred_foreign_language')->orWhereIn('preferred_foreign_language', $myForeignLanguagesList);
|
|
|
|
- })->limit(3)->get();
|
|
|
|
|
|
+ ->where(function ($query) use ($myForeignLanguagesList) {
|
|
|
|
+ $query->whereNull('preferred_foreign_language')->orWhereIn('preferred_foreign_language', $myForeignLanguagesList);
|
|
|
|
+ })->limit(3)->get();
|
|
$results = [];
|
|
$results = [];
|
|
|
|
|
|
|
|
|
|
- foreach($clients as $client){
|
|
|
|
|
|
+ foreach ($clients as $client) {
|
|
$results[] = [
|
|
$results[] = [
|
|
'clientUid' => $client->uid,
|
|
'clientUid' => $client->uid,
|
|
'name' => $client->displayName(),
|
|
'name' => $client->displayName(),
|
|
- 'initials'=> substr($client->name_first, 0, 1) . substr($client->name_last, 0, 1)
|
|
|
|
|
|
+ 'initials' => substr($client->name_first, 0, 1) . substr($client->name_last, 0, 1)
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
@@ -395,11 +395,11 @@ class PracticeManagementController extends Controller
|
|
|
|
|
|
public function calendar(Request $request, $proUid = null)
|
|
public function calendar(Request $request, $proUid = null)
|
|
{
|
|
{
|
|
- $pros = Pro::all();
|
|
|
|
- if($this->pro && $this->pro->pro_type != 'ADMIN'){
|
|
|
|
|
|
+ $pros = Pro::all();
|
|
|
|
+ if ($this->pro && $this->pro->pro_type != 'ADMIN') {
|
|
$accessiblePros = ProProAccess::where('owner_pro_id', $this->pro->id);
|
|
$accessiblePros = ProProAccess::where('owner_pro_id', $this->pro->id);
|
|
$accessibleProIds = [];
|
|
$accessibleProIds = [];
|
|
- foreach($accessiblePros as $accessiblePro){
|
|
|
|
|
|
+ foreach ($accessiblePros as $accessiblePro) {
|
|
$accessibleProIds[] = $accessiblePro->id;
|
|
$accessibleProIds[] = $accessiblePro->id;
|
|
}
|
|
}
|
|
$accessibleProIds[] = $this->pro->id;
|
|
$accessibleProIds[] = $this->pro->id;
|
|
@@ -430,7 +430,8 @@ class PracticeManagementController extends Controller
|
|
return view('app.practice-management.cellular-device-manager', compact('clients', 'allPros', 'targetPro', 'proUid'));
|
|
return view('app.practice-management.cellular-device-manager', compact('clients', 'allPros', 'targetPro', 'proUid'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function treatmentServiceUtil(Request $request){
|
|
|
|
|
|
+ public function treatmentServiceUtil(Request $request)
|
|
|
|
+ {
|
|
$view_treatment_service_utilization_org = DB::select(DB::raw("SELECT * FROM view_treatment_service_utilization_org ORDER BY effective_date DESC"));
|
|
$view_treatment_service_utilization_org = DB::select(DB::raw("SELECT * FROM view_treatment_service_utilization_org ORDER BY effective_date DESC"));
|
|
$view_treatment_service_utilization = DB::select(DB::raw("SELECT * FROM view_treatment_service_utilization ORDER BY effective_date DESC, total_hrs DESC"));
|
|
$view_treatment_service_utilization = DB::select(DB::raw("SELECT * FROM view_treatment_service_utilization ORDER BY effective_date DESC, total_hrs DESC"));
|
|
$view_treatment_service_utilization_by_patient = DB::select(DB::raw("SELECT * FROM view_treatment_service_utilization_by_patient ORDER BY pro_lname ASC, pro_fname ASC, hcp_pro_id ASC, total_hrs DESC"));
|
|
$view_treatment_service_utilization_by_patient = DB::select(DB::raw("SELECT * FROM view_treatment_service_utilization_by_patient ORDER BY pro_lname ASC, pro_fname ASC, hcp_pro_id ASC, total_hrs DESC"));
|
|
@@ -528,45 +529,44 @@ class PracticeManagementController extends Controller
|
|
$filters['claims_created'] = $request->input('claims_created');
|
|
$filters['claims_created'] = $request->input('claims_created');
|
|
$filters['claims_closed'] = $request->input('claims_closed');
|
|
$filters['claims_closed'] = $request->input('claims_closed');
|
|
|
|
|
|
- if($filters['bills_created']) {
|
|
|
|
|
|
+ if ($filters['bills_created']) {
|
|
$notes->where(
|
|
$notes->where(
|
|
'bill_total_expected',
|
|
'bill_total_expected',
|
|
($filters['bills_created'] === 'yes' ? '>' : '<='),
|
|
($filters['bills_created'] === 'yes' ? '>' : '<='),
|
|
0);
|
|
0);
|
|
}
|
|
}
|
|
|
|
|
|
- if($filters['is_billing_marked_done']) {
|
|
|
|
|
|
+ if ($filters['is_billing_marked_done']) {
|
|
$notes->where(
|
|
$notes->where(
|
|
'is_billing_marked_done',
|
|
'is_billing_marked_done',
|
|
($filters['is_billing_marked_done'] === 'yes' ? '=' : '!='),
|
|
($filters['is_billing_marked_done'] === 'yes' ? '=' : '!='),
|
|
true);
|
|
true);
|
|
}
|
|
}
|
|
|
|
|
|
- if($filters['bills_resolved']) {
|
|
|
|
|
|
+ if ($filters['bills_resolved']) {
|
|
$notes->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id) > 0'); // have bills
|
|
$notes->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id) > 0'); // have bills
|
|
- if($filters['bills_resolved'] === 'yes') {
|
|
|
|
|
|
+ if ($filters['bills_resolved'] === 'yes') {
|
|
$notes->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND (is_cancelled = false AND is_verified = false) OR (is_cancelled = TRUE AND is_cancellation_acknowledged = FALSE)) > 0');
|
|
$notes->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND (is_cancelled = false AND is_verified = false) OR (is_cancelled = TRUE AND is_cancellation_acknowledged = FALSE)) > 0');
|
|
- }
|
|
|
|
- elseif($filters['bills_resolved'] === 'no') {
|
|
|
|
|
|
+ } elseif ($filters['bills_resolved'] === 'no') {
|
|
$notes->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND ((is_cancelled = true AND is_cancellation_acknowledged = true) OR is_verified = true)) = 0');
|
|
$notes->whereRaw('(SELECT count(id) FROM bill WHERE note_id = note.id AND ((is_cancelled = true AND is_cancellation_acknowledged = true) OR is_verified = true)) = 0');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if($filters['bills_closed']) {
|
|
|
|
|
|
+ if ($filters['bills_closed']) {
|
|
$notes->where(
|
|
$notes->where(
|
|
'is_bill_closed',
|
|
'is_bill_closed',
|
|
($filters['bills_closed'] === 'yes' ? '=' : '!='),
|
|
($filters['bills_closed'] === 'yes' ? '=' : '!='),
|
|
true);
|
|
true);
|
|
}
|
|
}
|
|
|
|
|
|
- if($filters['claims_created']) {
|
|
|
|
|
|
+ if ($filters['claims_created']) {
|
|
$notes->where(
|
|
$notes->where(
|
|
'claim_total_expected',
|
|
'claim_total_expected',
|
|
($filters['claims_created'] === 'yes' ? '>' : '<='),
|
|
($filters['claims_created'] === 'yes' ? '>' : '<='),
|
|
0);
|
|
0);
|
|
}
|
|
}
|
|
|
|
|
|
- if($filters['claims_closed']) {
|
|
|
|
|
|
+ if ($filters['claims_closed']) {
|
|
$notes->where(
|
|
$notes->where(
|
|
'is_claim_closed',
|
|
'is_claim_closed',
|
|
($filters['claims_closed'] === 'yes' ? '=' : '!='),
|
|
($filters['claims_closed'] === 'yes' ? '=' : '!='),
|
|
@@ -578,7 +578,8 @@ class PracticeManagementController extends Controller
|
|
return view('app.practice-management.billing-manager', compact('notes', 'allPros', 'expectedForHcp', 'targetPro', 'proUid', 'filters'));
|
|
return view('app.practice-management.billing-manager', compact('notes', 'allPros', 'expectedForHcp', 'targetPro', 'proUid', 'filters'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function billMatrix(Request $request) {
|
|
|
|
|
|
+ public function billMatrix(Request $request)
|
|
|
|
+ {
|
|
$bClients = [];
|
|
$bClients = [];
|
|
$bHCPPros = [];
|
|
$bHCPPros = [];
|
|
$bNAPros = [];
|
|
$bNAPros = [];
|
|
@@ -605,14 +606,14 @@ class PracticeManagementController extends Controller
|
|
public function medicarePartBClaims(Request $request)
|
|
public function medicarePartBClaims(Request $request)
|
|
{
|
|
{
|
|
|
|
|
|
- $medicarePartBOnly = $request->get("medicare_part_b");
|
|
|
|
|
|
+ $medicarePartBOnly = $request->get("medicare_part_b");
|
|
|
|
|
|
$allClaims = Claim::where('was_submitted', false)->orWhere('was_submitted', null)->orderBy('created_at', 'desc')->get();
|
|
$allClaims = Claim::where('was_submitted', false)->orWhere('was_submitted', null)->orderBy('created_at', 'desc')->get();
|
|
|
|
|
|
//Only medicare claims
|
|
//Only medicare claims
|
|
$claims = [];
|
|
$claims = [];
|
|
- foreach ($allClaims as $claim){
|
|
|
|
- if($claim->client != null && $claim->client->is_part_b_primary == 'YES' && !$claim->edi) {
|
|
|
|
|
|
+ foreach ($allClaims as $claim) {
|
|
|
|
+ if ($claim->client != null && $claim->client->is_part_b_primary == 'YES' && !$claim->edi) {
|
|
$claims[] = $claim;
|
|
$claims[] = $claim;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -639,21 +640,22 @@ class PracticeManagementController extends Controller
|
|
return view('app.practice-management.tickets', compact('tickets'));
|
|
return view('app.practice-management.tickets', compact('tickets'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function supplyOrders(Request $request) {
|
|
|
|
|
|
+ public function supplyOrders(Request $request)
|
|
|
|
+ {
|
|
|
|
|
|
// counts
|
|
// counts
|
|
$counts = $this->getSupplyOrderCounts();
|
|
$counts = $this->getSupplyOrderCounts();
|
|
|
|
|
|
// so clients
|
|
// so clients
|
|
$soClientIDs = DB::table('supply_order')->select('client_id')->distinct()->get()->toArray();
|
|
$soClientIDs = DB::table('supply_order')->select('client_id')->distinct()->get()->toArray();
|
|
- $soClientIDs = array_map(function($_x) {
|
|
|
|
|
|
+ $soClientIDs = array_map(function ($_x) {
|
|
return $_x->client_id;
|
|
return $_x->client_id;
|
|
}, $soClientIDs);
|
|
}, $soClientIDs);
|
|
$soClients = Client::whereIn('id', $soClientIDs)->get();
|
|
$soClients = Client::whereIn('id', $soClientIDs)->get();
|
|
|
|
|
|
// so products
|
|
// so products
|
|
$soProductIDs = DB::table('supply_order')->select('product_id')->distinct()->get()->toArray();
|
|
$soProductIDs = DB::table('supply_order')->select('product_id')->distinct()->get()->toArray();
|
|
- $soProductIDs = array_map(function($_x) {
|
|
|
|
|
|
+ $soProductIDs = array_map(function ($_x) {
|
|
return $_x->product_id;
|
|
return $_x->product_id;
|
|
}, $soProductIDs);
|
|
}, $soProductIDs);
|
|
$soProducts = Product::whereIn('id', $soProductIDs)->get();
|
|
$soProducts = Product::whereIn('id', $soProductIDs)->get();
|
|
@@ -673,16 +675,16 @@ class PracticeManagementController extends Controller
|
|
$supplyOrders = SupplyOrder::where('id', '>', 0);
|
|
$supplyOrders = SupplyOrder::where('id', '>', 0);
|
|
|
|
|
|
// apply filters
|
|
// apply filters
|
|
- if($filters['client']) $supplyOrders->where('client_id', $filters['client']);
|
|
|
|
- if($filters['product']) $supplyOrders->where('product_id', $filters['product']);
|
|
|
|
- if($filters['reason']) $supplyOrders->where('reason', 'ILIKE', '%' . $filters['reason'] . '%');
|
|
|
|
- if($filters['cu_memo']) $supplyOrders->where('cu_memo', 'ILIKE', '%' . $filters['cu_memo'] . '%');
|
|
|
|
- if($filters['pro_sign']) $supplyOrders->where('is_signed_by_pro', ($filters['pro_sign'] === 'signed'));
|
|
|
|
-
|
|
|
|
- if($filters['client_sign']) {
|
|
|
|
- if($filters['client_sign'] === 'signed')
|
|
|
|
|
|
+ if ($filters['client']) $supplyOrders->where('client_id', $filters['client']);
|
|
|
|
+ if ($filters['product']) $supplyOrders->where('product_id', $filters['product']);
|
|
|
|
+ if ($filters['reason']) $supplyOrders->where('reason', 'ILIKE', '%' . $filters['reason'] . '%');
|
|
|
|
+ if ($filters['cu_memo']) $supplyOrders->where('cu_memo', 'ILIKE', '%' . $filters['cu_memo'] . '%');
|
|
|
|
+ if ($filters['pro_sign']) $supplyOrders->where('is_signed_by_pro', ($filters['pro_sign'] === 'signed'));
|
|
|
|
+
|
|
|
|
+ if ($filters['client_sign']) {
|
|
|
|
+ if ($filters['client_sign'] === 'signed')
|
|
$supplyOrders->where('is_signed_by_client', true);
|
|
$supplyOrders->where('is_signed_by_client', true);
|
|
- elseif($filters['client_sign'] === 'waived')
|
|
|
|
|
|
+ elseif ($filters['client_sign'] === 'waived')
|
|
$supplyOrders->where('is_client_signature_waived', true);
|
|
$supplyOrders->where('is_client_signature_waived', true);
|
|
else
|
|
else
|
|
$supplyOrders->where('is_client_signature_waived', false)->where('is_signed_by_client', false);
|
|
$supplyOrders->where('is_client_signature_waived', false)->where('is_signed_by_client', false);
|
|
@@ -699,9 +701,9 @@ class PracticeManagementController extends Controller
|
|
->whereRaw('(SELECT status FROM shipment WHERE id = shipment_id LIMIT 1) = ?', [$filters['shipment']]);
|
|
->whereRaw('(SELECT status FROM shipment WHERE id = shipment_id LIMIT 1) = ?', [$filters['shipment']]);
|
|
}
|
|
}
|
|
|
|
|
|
- if($filters['lot_number']) $supplyOrders->where('lot_number', 'ILIKE', '%' . $filters['lot_number'] . '%');
|
|
|
|
- if($filters['imei']) $supplyOrders->where('imei', 'ILIKE', '%' . $filters['imei'] . '%');
|
|
|
|
- if($filters['cancelled']) $supplyOrders->where('is_cancelled', ($filters['cancelled'] === 'cancelled'));
|
|
|
|
|
|
+ if ($filters['lot_number']) $supplyOrders->where('lot_number', 'ILIKE', '%' . $filters['lot_number'] . '%');
|
|
|
|
+ if ($filters['imei']) $supplyOrders->where('imei', 'ILIKE', '%' . $filters['imei'] . '%');
|
|
|
|
+ if ($filters['cancelled']) $supplyOrders->where('is_cancelled', ($filters['cancelled'] === 'cancelled'));
|
|
|
|
|
|
$supplyOrders = $supplyOrders->orderBy('created_at', 'desc')->paginate();
|
|
$supplyOrders = $supplyOrders->orderBy('created_at', 'desc')->paginate();
|
|
|
|
|
|
@@ -712,14 +714,15 @@ class PracticeManagementController extends Controller
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- public function shipments(Request $request, $filter = null) {
|
|
|
|
|
|
+ public function shipments(Request $request, $filter = null)
|
|
|
|
+ {
|
|
|
|
|
|
// counts
|
|
// counts
|
|
$counts = $this->getShipmentCounts();
|
|
$counts = $this->getShipmentCounts();
|
|
|
|
|
|
// so clients
|
|
// so clients
|
|
$shClientIDs = DB::table('shipment')->select('client_id')->distinct()->get()->toArray();
|
|
$shClientIDs = DB::table('shipment')->select('client_id')->distinct()->get()->toArray();
|
|
- $shClientIDs = array_map(function($_x) {
|
|
|
|
|
|
+ $shClientIDs = array_map(function ($_x) {
|
|
return $_x->client_id;
|
|
return $_x->client_id;
|
|
}, $shClientIDs);
|
|
}, $shClientIDs);
|
|
$shClients = Client::whereIn('id', $shClientIDs)->get();
|
|
$shClients = Client::whereIn('id', $shClientIDs)->get();
|
|
@@ -734,23 +737,24 @@ class PracticeManagementController extends Controller
|
|
$filters['status'] = $request->input('status');
|
|
$filters['status'] = $request->input('status');
|
|
$filters['cancelled'] = $request->input('cancelled');
|
|
$filters['cancelled'] = $request->input('cancelled');
|
|
|
|
|
|
- if($filters['client']) $shipments->where('client_id', $filters['client']);
|
|
|
|
- if($filters['courier']) $shipments->where('courier', 'ILIKE', '%' . $filters['courier'] . '%');
|
|
|
|
- if($filters['tracking_num']) $shipments->where('tracking_number', 'ILIKE', '%' . $filters['tracking_num'] . '%');
|
|
|
|
- if($filters['label']) {
|
|
|
|
- if($filters['label'] === 'yes')
|
|
|
|
|
|
+ if ($filters['client']) $shipments->where('client_id', $filters['client']);
|
|
|
|
+ if ($filters['courier']) $shipments->where('courier', 'ILIKE', '%' . $filters['courier'] . '%');
|
|
|
|
+ if ($filters['tracking_num']) $shipments->where('tracking_number', 'ILIKE', '%' . $filters['tracking_num'] . '%');
|
|
|
|
+ if ($filters['label']) {
|
|
|
|
+ if ($filters['label'] === 'yes')
|
|
$shipments->whereNotNull('label_system_file_id');
|
|
$shipments->whereNotNull('label_system_file_id');
|
|
else
|
|
else
|
|
$shipments->whereNull('label_system_file_id');
|
|
$shipments->whereNull('label_system_file_id');
|
|
}
|
|
}
|
|
- if($filters['status']) $shipments->where('status', $filters['status']);
|
|
|
|
- if($filters['cancelled']) $shipments->where('is_cancelled', ($filters['cancelled'] === 'cancelled'));
|
|
|
|
|
|
+ if ($filters['status']) $shipments->where('status', $filters['status']);
|
|
|
|
+ if ($filters['cancelled']) $shipments->where('is_cancelled', ($filters['cancelled'] === 'cancelled'));
|
|
|
|
|
|
$shipments = $shipments->orderBy('created_at', 'desc')->paginate();
|
|
$shipments = $shipments->orderBy('created_at', 'desc')->paginate();
|
|
return view('app.practice-management.shipments', compact('shipments', 'filters', 'shClients', 'counts'));
|
|
return view('app.practice-management.shipments', compact('shipments', 'filters', 'shClients', 'counts'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function cellularMeasurements(Request $request){
|
|
|
|
|
|
+ public function cellularMeasurements(Request $request)
|
|
|
|
+ {
|
|
$measurements = Measurement::orderBy('ts', 'desc')->whereNotNull('ts')->paginate();
|
|
$measurements = Measurement::orderBy('ts', 'desc')->whereNotNull('ts')->paginate();
|
|
return view('app.practice-management.cellular-measurements', compact('measurements'));
|
|
return view('app.practice-management.cellular-measurements', compact('measurements'));
|
|
}
|
|
}
|
|
@@ -788,7 +792,8 @@ class PracticeManagementController extends Controller
|
|
return view('app.practice-management.supply-orders-shipment-underway', compact('supplyOrders', 'counts'));
|
|
return view('app.practice-management.supply-orders-shipment-underway', compact('supplyOrders', 'counts'));
|
|
}
|
|
}
|
|
|
|
|
|
- private function getSupplyOrderCounts() {
|
|
|
|
|
|
+ private function getSupplyOrderCounts()
|
|
|
|
+ {
|
|
return [
|
|
return [
|
|
"supplyOrders" => SupplyOrder::count(),
|
|
"supplyOrders" => SupplyOrder::count(),
|
|
"supplyOrdersReadyToShip" => SupplyOrder
|
|
"supplyOrdersReadyToShip" => SupplyOrder
|
|
@@ -801,7 +806,8 @@ class PracticeManagementController extends Controller
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
- public function shipmentsReadyToPrint(Request $request) {
|
|
|
|
|
|
+ public function shipmentsReadyToPrint(Request $request)
|
|
|
|
+ {
|
|
$counts = $this->getShipmentCounts();
|
|
$counts = $this->getShipmentCounts();
|
|
$shipments = Shipment
|
|
$shipments = Shipment
|
|
::where('is_cancelled', false)
|
|
::where('is_cancelled', false)
|
|
@@ -810,7 +816,9 @@ class PracticeManagementController extends Controller
|
|
->paginate();
|
|
->paginate();
|
|
return view('app.practice-management.shipments-ready-to-print', compact('shipments', 'counts'));
|
|
return view('app.practice-management.shipments-ready-to-print', compact('shipments', 'counts'));
|
|
}
|
|
}
|
|
- public function shipmentsShipmentUnderway(Request $request) {
|
|
|
|
|
|
+
|
|
|
|
+ public function shipmentsShipmentUnderway(Request $request)
|
|
|
|
+ {
|
|
$counts = $this->getShipmentCounts();
|
|
$counts = $this->getShipmentCounts();
|
|
$shipments = Shipment
|
|
$shipments = Shipment
|
|
::where('is_cancelled', false)
|
|
::where('is_cancelled', false)
|
|
@@ -820,7 +828,8 @@ class PracticeManagementController extends Controller
|
|
return view('app.practice-management.shipments-waiting-for-picker', compact('shipments', 'counts'));
|
|
return view('app.practice-management.shipments-waiting-for-picker', compact('shipments', 'counts'));
|
|
}
|
|
}
|
|
|
|
|
|
- private function getShipmentCounts() {
|
|
|
|
|
|
+ private function getShipmentCounts()
|
|
|
|
+ {
|
|
return [
|
|
return [
|
|
"shipments" => Shipment::count(),
|
|
"shipments" => Shipment::count(),
|
|
"shipmentsReadyToPrint" => Shipment
|
|
"shipmentsReadyToPrint" => Shipment
|
|
@@ -834,33 +843,38 @@ class PracticeManagementController extends Controller
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
|
|
- public function shipment(Request $request, Shipment $shipment) {
|
|
|
|
|
|
+ public function shipment(Request $request, Shipment $shipment)
|
|
|
|
+ {
|
|
return view('app.practice-management.shipment', compact('shipment'));
|
|
return view('app.practice-management.shipment', compact('shipment'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function shipmentsMultiPrint(Request $request, $ids) {
|
|
|
|
- $ids = array_map(function($_x) {
|
|
|
|
|
|
+ public function shipmentsMultiPrint(Request $request, $ids)
|
|
|
|
+ {
|
|
|
|
+ $ids = array_map(function ($_x) {
|
|
return intval($_x);
|
|
return intval($_x);
|
|
}, explode("|", $ids));
|
|
}, explode("|", $ids));
|
|
$shipments = Shipment::whereIn('id', $ids)->get();
|
|
$shipments = Shipment::whereIn('id', $ids)->get();
|
|
return view('app.practice-management.shipments-multi-print', compact('shipments'));
|
|
return view('app.practice-management.shipments-multi-print', compact('shipments'));
|
|
}
|
|
}
|
|
|
|
|
|
- public function claimsReport(Request $request){
|
|
|
|
|
|
+ public function claimsReport(Request $request)
|
|
|
|
+ {
|
|
return view('app.practice-management.claims-report');
|
|
return view('app.practice-management.claims-report');
|
|
}
|
|
}
|
|
|
|
|
|
- public function patientClaimSummary(Request $request){
|
|
|
|
|
|
+ public function patientClaimSummary(Request $request)
|
|
|
|
+ {
|
|
|
|
|
|
//Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed
|
|
//Patient | MCP | # Notes Total | # Notes without Billing Closed | # Notes without Claiming Closed
|
|
- $patients = Client::where('is_dummy', '=' , false)
|
|
|
|
- ->select('id','uid','name_first','name_last','mcp_pro_id',
|
|
|
|
|
|
+ $patients = Client::where('is_dummy', '=', false)
|
|
|
|
+ ->select('id', 'uid', 'name_first', 'name_last', 'mcp_pro_id',
|
|
DB::raw("(SELECT name_first||' '||name_last FROM pro where pro.id = client.mcp_pro_id) as mcp"),
|
|
DB::raw("(SELECT name_first||' '||name_last FROM pro where pro.id = client.mcp_pro_id) as mcp"),
|
|
DB::raw("(SELECT uid FROM pro where pro.id = mcp_pro_id) as mcp_pro_uid"),
|
|
DB::raw("(SELECT uid FROM pro where pro.id = mcp_pro_id) as mcp_pro_uid"),
|
|
DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id) as notes_total"),
|
|
DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id) as notes_total"),
|
|
DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_bill_closed IS NOT true) as notes_without_billing_closed"),
|
|
DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_bill_closed IS NOT true) as notes_without_billing_closed"),
|
|
DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_claim_closed IS NOT true) as notes_without_claiming_closed")
|
|
DB::raw("(SELECT COUNT(*) FROM note where note.client_id = client.id AND is_claim_closed IS NOT true) as notes_without_claiming_closed")
|
|
- )->get();
|
|
|
|
|
|
+ )->orderBy('notes_without_claiming_closed', 'desc')
|
|
|
|
+ ->paginate(50);
|
|
|
|
|
|
return view('app.practice-management.patient-claim-summary', compact('patients'));
|
|
return view('app.practice-management.patient-claim-summary', compact('patients'));
|
|
}
|
|
}
|