BUG-01 — Clinical Notes Are Never Saved (Silent Data Loss)
Severity: Critical
Component: Patient Profile
File: src/app/patients/patient-profile/patient-profile.ts
Status: Open
Summary
The "Save Notes" action in the Patient Profile page silently discards all clinical notes entered by the physician. The note is never written back to the data layer.
Description
The Patient Profile view includes a rich-text editor (powered by Kendo Editor) where a physician can write or update clinical notes for a patient. When the "Save" button is clicked, it invokes saveNotes():
// patient-profile.ts — line ~127
public saveNotes(): void {
console.log('Saving patient notes...');
// In a real app, save to backend service
}
This method only logs to the console. It never calls PatientsService.updatePatientNotes(), even though that method is fully implemented and ready to use:
// patients.service.ts
public updatePatientNotes(id: number, notes: string): boolean {
const patient = this.patientsData.find((p) => p.id === id);
if (patient) {
patient.notes = notes;
return true;
}
return false;
}
Additionally, saveNotes() does not read the current value from the editor component — no @ViewChild reference or two-way binding captures what the doctor has typed. Even if the service call were added, the wrong (or empty) value would be passed.
There is also no user feedback after clicking Save — no success toast, no error state, no loading indicator. The user has no way of knowing the save failed.
Steps to Reproduce
- Navigate to any patient profile:
http://localhost:4200/#/patients/1
- Scroll to the "Patient Notes" section
- Type or modify content in the rich-text editor
- Click the Save button
- Navigate away and return to the same profile
Result: All edits are lost. The original note is displayed as if nothing was saved.
Expected: The updated note persists across navigation.
Root Cause
Two separate issues compound this bug:
-
saveNotes() does not call the service. The implementation was left as a stub (console.log placeholder) and the real service call was never wired up.
-
The editor's current value is not captured. The component has no [(ngModel)] binding or @ViewChild reference to the EditorComponent to read its current HTML content before saving.
Impact
- Patient safety risk in a production context: clinical notes written by a physician — diagnoses, observations, treatment plans — are silently discarded with no warning.
- No error surfaced: the UI gives no indication that the save failed; a user assumes the note was saved.
- Data loss on every save action.
Fix Specification
Step 1 — Capture the editor value
Add a two-way binding or @ViewChild to the Kendo Editor in patient-profile.html:
<kendo-editor [(value)]="patientNoteContent" ...></kendo-editor>
And declare the property in patient-profile.ts:
public patientNoteContent: string = '';
Load the existing note value in loadPatientData():
private loadPatientData(): void {
const patientData = this.patientsService.getPatientById(this.patientId);
if (patientData) {
this.patient = patientData;
this.labResults = patientData.labResults;
this.patientNoteContent = patientData.notes ?? ''; // ← populate editor
} else {
this.router.navigate(['/patients']);
}
}
Step 2 — Wire up the service call
public saveNotes(): void {
const success = this.patientsService.updatePatientNotes(
this.patientId,
this.patientNoteContent
);
if (success) {
// Show success notification
} else {
// Show error notification
}
}
Step 3 — Add user feedback
Use a Kendo Notification or a simple status flag to inform the user whether the save succeeded or failed.
Acceptance Criteria
BUG-01 — Clinical Notes Are Never Saved (Silent Data Loss)
Severity: Critical
Component: Patient Profile
File:
src/app/patients/patient-profile/patient-profile.tsStatus: Open
Summary
The "Save Notes" action in the Patient Profile page silently discards all clinical notes entered by the physician. The note is never written back to the data layer.
Description
The Patient Profile view includes a rich-text editor (powered by Kendo Editor) where a physician can write or update clinical notes for a patient. When the "Save" button is clicked, it invokes
saveNotes():This method only logs to the console. It never calls
PatientsService.updatePatientNotes(), even though that method is fully implemented and ready to use:Additionally,
saveNotes()does not read the current value from the editor component — no@ViewChildreference or two-way binding captures what the doctor has typed. Even if the service call were added, the wrong (or empty) value would be passed.There is also no user feedback after clicking Save — no success toast, no error state, no loading indicator. The user has no way of knowing the save failed.
Steps to Reproduce
http://localhost:4200/#/patients/1Result: All edits are lost. The original note is displayed as if nothing was saved.
Expected: The updated note persists across navigation.
Root Cause
Two separate issues compound this bug:
saveNotes()does not call the service. The implementation was left as a stub (console.logplaceholder) and the real service call was never wired up.The editor's current value is not captured. The component has no
[(ngModel)]binding or@ViewChildreference to theEditorComponentto read its current HTML content before saving.Impact
Fix Specification
Step 1 — Capture the editor value
Add a two-way binding or
@ViewChildto the Kendo Editor inpatient-profile.html:And declare the property in
patient-profile.ts:Load the existing note value in
loadPatientData():Step 2 — Wire up the service call
Step 3 — Add user feedback
Use a Kendo Notification or a simple status flag to inform the user whether the save succeeded or failed.
Acceptance Criteria