Exemplo n.º 1
0
 /**
  * Show the form for creating a new resource.
  *
  * @param   $ppoid, ppo id selected in ppo explorer;
  *          $diagnosisid, id selected in ppo explorer;
  *          $patientid, id selected patient selection;
  *
  * @return \Illuminate\Http\Response
  */
 public function create($ppoid, $diagnosisid, $patientid)
 {
     $diagnosis = Diagnosis::findOrFail($diagnosisid);
     $patient = Patient::findOrFail($patientid);
     $ppo = Ppo::with('diagnoses', 'regimen', 'author', 'ppoItems')->findOrFail($ppoid);
     $ppo->ppoItems->load('doseUnit', 'mitteUnit', 'medication', 'lucodes');
     $rx = new Collection();
     $supportiveRx = new Collection();
     foreach ($ppo->ppoItems as $item) {
         if ($item->ppo_section_id == 1) {
             $rx->push($item);
         } elseif ($item->ppo_section_id == 2) {
             $supportiveRx->push($item);
         }
     }
     return view('prescriptions.create', compact('patient', 'ppo', 'diagnosis', 'rx', 'supportiveRx'));
 }
Exemplo n.º 2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $patient = Patient::findOrFail($id);
     $patient->delete();
     return redirect()->route('patients.index')->with('success-message', 'Patient deleted.');
 }