Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/Livewire/HealthCare/AddMedicalRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Models\MedicalRecord;
use App\Models\PatientAppointment;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\Gate;
use Livewire\Attributes\Title;
use Livewire\Attributes\Validate;
Expand Down Expand Up @@ -45,13 +46,13 @@ public function add() {
'patient_id' => $this -> patient_id,
// Note: only doctors should be able to add records so set policy for that
'user_id' => Auth::user() -> id,
'visit_reason' => $this -> visit_reason,
'diagnosis' => $this -> diagnosis,
'treatment' => $this -> treatment,
'prescription' => $this -> prescriptions,
'visit_reason' => Crypt::encryptString($this -> visit_reason),
'diagnosis' => Crypt::encryptString($this -> diagnosis),
'treatment' => Crypt::encryptString($this -> treatment),
'prescription' => Crypt::encryptString($this -> prescriptions),
'visit_date' => date('Y-m-d'),
'follow_up_date' => $this -> follow_up_date,
'notes' => $this -> notes
'notes' => Crypt::encryptString($this -> notes)
];

// Insert the data into the MedicalRecords table
Expand Down
10 changes: 5 additions & 5 deletions resources/views/livewire/health-care/view-patient-data.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,26 @@
</div>
<div>
<h3 class="font-bold">Visit Reason</h3>
<p>{{ $record -> visit_reason }}</p>
<p>{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> visit_reason) }}</p>
</div>

<div>
<h3 class="font-bold">Diagnosis</h3>
<p>{{ $record -> diagnosis }}</p>
<p>{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> diagnosis) }}</p>
</div>
<div>
<h3 class="font-bold">Treatment</h3>
<p>{{ $record -> treatment }}</p>
<p>{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> treatment) }}</p>
</div>

<div>
<h3 class="font-bold">Prescription</h3>
<p>{{ $record -> prescription }}</p>
<p>{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> prescription) }}</p>
</div>

<div>
<h3 class="font-bold">Notes</h3>
<p>{{ $record -> notes }}</p>
<p>{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> notes) }}</p>
</div>

<div>
Expand Down