123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <?php
- namespace App\Http\Controllers;
- use App\Models\Appointment;
- use App\Models\BDTDevice;
- use App\Models\CareMonth;
- use App\Models\Client;
- use App\Models\ClientBDTDevice;
- use App\Models\ClientInfoLine;
- use App\Models\Erx;
- use App\Models\Facility;
- use App\Models\Handout;
- use App\Models\IncomingReport;
- use App\Models\MBClaim;
- use App\Models\MBPayer;
- use App\Models\Note;
- use App\Models\NoteTemplate;
- use App\Models\Pro;
- use App\Models\Product;
- use App\Models\ProProAccess;
- use App\Models\SectionTemplate;
- use App\Models\Shipment;
- use App\Models\SupplyOrder;
- use App\Models\Ticket;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\File;
- use App\Models\Bill;
- use App\Models\ClientSMS;
- use Illuminate\Support\Facades\Http;
- use PDF;
- class McpController extends Controller
- {
- public function patients(Request $request)
- {
- $patients = Client::paginate(5);
- // SELECT * FROM client WHERE mcp_pro_id = :me.id
- return view('app.mcp.patients', compact('patients'));
- }
- public function notes(Request $request)
- {
- $notes = Note::paginate(5);
- // SELECT * FROM note WHERE client_id IN (SELECT id FROM client WHERE mcp_pro_id = :me.id);
- return view('app.mcp.notes', compact('notes'));
- }
- public function appointments(Request $request)
- {
- $appointments = Appointment::paginate(5);
- return view('app.mcp.appointments', compact('appointments'));
- }
- public function bills(Request $request)
- {
- $bills = Bill::paginate(5);
- return view('app.mcp.bills', compact('bills'));
- }
- public function erx_and_orders(Request $request)
- {
- $erxAndOrders = Erx::paginate(5);
- return view('app.mcp.erx_and_orders', compact('erxAndOrders'));
- }
- public function reports(Request $request)
- {
- $data = [];
- return view('app.mcp.reports', $data);
- }
- public function supply_orders(Request $request)
- {
- $supplyOrders = SupplyOrder::paginate(5);
- return view('app.mcp.supply_orders', compact('supplyOrders'));
- }
- public function client_messages(Request $request)
- {
- $clientMessages = ClientSMS::paginate(5);
- return view('app.mcp.client_messages', compact('clientMessages'));
- }
- public function new_patients_awaiting_visit(Request $request){
- $data = [
- 'records' => Client::where('mcp_pro_id', $this->performer->pro->id)
- ->where('has_mcp_done_onboarding_visit', '!=', 'YES')
- ->orderBy('created_at')
- ->get()
- ];
- return view('app.mcp.new_patients_awaiting_visit', $data);
- }
- public function notes_pending_signature(Request $request){
- $data = [
- 'records' => Note::where('hcp_pro_id', $this->performer->pro->id)
- ->where('is_cancelled', '<>', true)
- ->where('is_signed_by_hcp', '<>', true)
- ->orderBy('created_at')
- ->get()
- ];
- return view('app.mcp.notes_pending_signature', $data);
- }
- public function notes_pending_billing(Request $request){
- $data = [
- 'records' => Note::where('hcp_pro_id', $this->performer->pro->id)
- ->where('is_cancelled', '<>', true)
- ->where('is_signed_by_hcp', true)
- ->where('is_billing_marked_done', '<>', true)
- ->orderBy('created_at')
- ->get()
- ];
- return view('app.mcp.notes_pending_billing', $data);
- }
- public function reports_pending_signature(Request $request){
- $data = [
- 'records' => IncomingReport::where('hcp_pro_id', $this->performer->pro->id)
- ->where('has_hcp_pro_signed', '<>', true)
- ->where('is_entry_error', '<>', true)
- ->orderBy('created_at')
- ->get()
- ];
- return view('app.mcp.reports_pending_signature', $data);
- }
- public function patients_without_appointments(Request $request){
- $data = [];
- return view('app.mcp.patients_without_appointments', $data);
- }
- public function patients_overdue_for_visit(Request $request){
- $data = [];
- return view('app.mcp.patients_overdue_for_visit', $data);
- }
- public function cancelled_appointments_pending_review(Request $request){
- $data = [];
- return view('app.mcp.cancelled_appointments_pending_review', $data);
- }
- public function cancelled_bills_pending_review(Request $request){
- $data = [
- 'records' => Bill::where('hcp_pro_id', $this->performer->pro->id)
- ->where('bill_service_type', 'NOTE')
- ->where('is_cancelled', true)
- ->where('is_cancellation_acknowledged', '<>', true)
- ->orderBy('created_at')
- ->get()
- ];
- return view('app.mcp.cancelled_bills_pending_review', $data);
- }
- public function cancelled_supply_orders_pending_review(Request $request){
- $data = [
- 'records' => SupplyOrder::where('signed_by_pro_id', $this->performer->pro->id)
- ->where('is_cancelled', true)
- ->where('is_cancellation_acknowledged', '<>', true)
- ->orderBy('created_at')
- ->get()
- ];
- return view('app.mcp.cancelled_supply_orders_pending_review', $data);
- }
- public function erx_and_orders_pending_signature(Request $request){
- $data = [
- 'records' => Erx::where('hcp_pro_id', $this->performer->pro->id)
- ->where('pro_declared_status', '<>', 'CANCELLED')
- ->where('has_hcp_pro_signed', '<>', true)
- ->orderBy('created_at')
- ->get()
- ];
- return view('app.mcp.erx_and_orders_pending_signature', $data);
- }
- public function supply_orders_pending_signature(Request $request){
- $data = [];
- return view('app.mcp.supply_orders_pending_signature', $data);
- }
- }
|