mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 10:41:32 +00:00
The official image from streamline does not currently work for the arm64 platform. As a temporary measure, the source code and docker build scripts have been lifted from the official images and are used to build locally. Some additional modifications are made to reduce overall image size, these are documented in docker/README.md
55 lines
1.5 KiB
PHP
Executable File
55 lines
1.5 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Modules\Patients\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Streamline\Models\Alert;
|
|
use Streamline\Models\Patient;
|
|
|
|
class AlertsController extends Controller {
|
|
public function __construct() {
|
|
$this->middleware('auth');
|
|
}
|
|
|
|
/* Add a new patient alert i.e used by the alerts modal in the header */
|
|
public function store_patient_alerts(Request $request) {
|
|
$alert = new Alert;
|
|
$alert->patient_id = $request->alert_patient_id;
|
|
$alert->alerts = $request->patient_alerts;
|
|
$alert->created_by = auth()->user()->id;
|
|
$alert->save();
|
|
return $alert;
|
|
}
|
|
|
|
public function view_alerts() {
|
|
$patient_id = session()->get('patient_id');
|
|
$patient = Patient::find($patient_id);
|
|
|
|
$alerts = Alert::where('patient_id', $patient_id)->get();
|
|
|
|
return view('patients::alerts.view_alerts', compact('alerts', 'patient'));
|
|
}
|
|
|
|
public function edit_alert($id) {
|
|
$alert = Alert::where(['id' => $id])->first();
|
|
|
|
return view('patients::alerts.edit_alert', compact('alert'));
|
|
}
|
|
|
|
public function save_edit_alert(Request $request) {
|
|
$alert = Alert::find($request->id);
|
|
$alert->alerts = $request->name;
|
|
$alert->save();
|
|
|
|
flash("Alert has been saved")->success();
|
|
return redirect('/alerts/view_alerts/');
|
|
}
|
|
|
|
public function delete_alert($id) {
|
|
$alert = Alert::find($id);
|
|
$alert->delete();
|
|
flash("Alert has been deleted.")->success();
|
|
return redirect('/alerts/view_alerts/');
|
|
}
|
|
}
|