/** * 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')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $ppo = Ppo::findOrFail($id); $regimens = Regimen::lists('name', 'id'); $diagnoses = Diagnosis::lists('name', 'id'); $reasons = DoseModificationReason::lists('name', 'id'); $diagnosesSelected = $ppo->diagnoses->pluck('id')->all(); $reasonsSelected = $ppo->reasons->pluck('id')->all(); return view('ppos.edit', compact('ppo', 'regimens', 'diagnosesSelected', 'diagnoses', 'reasons', 'reasonsSelected')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $diagnosis = Diagnosis::findOrFail($id); $diagnosis->delete(); return redirect()->route('diagnoses.index')->with('success-message', 'Diagnosis deleted.'); }
/** * Show the form for creating a new resource in ajax modal. * * @return \Illuminate\Http\Response */ public function addDiagnosisAjax(Request $request) { $cats = DiagnosisSecondaryCategory::lists('name', 'id'); if ($request->isMethod('post')) { $this->validate($request, ['name' => 'required']); $input = $request->all(); Diagnosis::create($input); return redirect()->route('ppos.create')->with('success-message', 'Diagnosis list updated'); } return view('ppos.add_diagnosis_ajax', compact('cats')); }