Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postStore(Request $request)
 {
     $record = new Record();
     $id = $request->input("patientID");
     $record->pt_id = $id;
     $record->diagnosis = $request->input("diagnosis");
     $record->treatment = $request->input("treatment");
     $presName = "";
     $presQty = "";
     $val = $request->input("xy");
     for ($count = 1; $count < $val + 1; $count++) {
         $presName .= $request->input("drug_" . $count);
         $presQty .= $request->input("drug_" . $count . "_qtt");
         $presName .= "#";
         $presQty .= "#";
     }
     $record->pres_med = $presName;
     $record->dispenseQuantity = $presQty;
     $record->save();
     $state = Queue::find($id);
     //retrieve whole row
     if (!is_null($state)) {
         $state->status = 'Payment';
         $state->save();
     }
     $todispense = new Dispensary();
     $todispense->case_ref = $record->id;
     $todispense->dispensed_drug_code = "{$presName}";
     $todispense->dispensed_quantity = "{$presQty}";
     $todispense->save();
     //other fields in this table is to be filled by nurse using DispensaryController
     return redirect()->action('DocController@index');
 }
Ejemplo n.º 2
0
 public function removeQueue(Request $request)
 {
     $queue = Queue::all();
     $patient = Patient::all();
     //insert delete from queue
     $queue = Queue::find($request->input('pt_id'));
     //$queue->delete();
     return redirect()->action('StaffController@index')->with('queue', $queue)->with('patient', $patient);
     //return view('staff.dashboard');
 }
Ejemplo n.º 3
0
 public function show($id)
 {
     $data = Queue::find($id);
     $data->status = 'Consulting';
     $data->save();
     $ic = $data->pt_ic;
     $data2 = Patient::where('pt_ic', $ic)->first();
     //$data3 = Record::where('pt_id', $data2);
     $inventory = Inventory::all();
     return view('doctor.newcase')->with('data', $data)->with('data2', $data2)->with('inventory', $inventory);
     //->with('history',$data3);
 }
Ejemplo n.º 4
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Queue $queueModel)
 {
     $data = $request->all();
     $id = $data['id'];
     $queue = Queue::find($id);
     $queue->is_present = true;
     $queue->save();
     dd($queue);
 }