fix(prescription): require at least one prescription on doctor submit - #477
fix(prescription): require at least one prescription on doctor submit#477gkbishnoi07 wants to merge 1 commit into
Conversation
restore the doctor prescription-required gate in the workarea validation (standard submit + quick-consult paths) so a doctor cannot submit without adding a prescription. gated on attendantType === 'doctor', so the nurse flow is unchanged. added drug rows carry createdBy, so the presence check counts real prescriptions only.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|




Addresses the prescription part of issue 14 from the MMU-UI QA testing doc: the prescription section is non-mandatory but should be mandatory for the doctor.
Background
The doctor "at least one prescription" gate was removed during the migration (commit 2a4bbf0) to match the old app, which did not require a prescription. QA/mentor confirmed it should be mandatory, so this restores the gate.
Change
In
workarea-validation.service.ts, restore the prescription-required check on the doctor submit paths:checkNurseRequirements, the shared validator)checkQuickConsultDoctorData)Both are gated on
attendantType === 'doctor', so the nurse flow is unchanged. The check readspatientCaseRecordForm.drugPrescriptionForm.prescribedDrugs, keeps only rows with acreatedBy(every drug added viaaddMedicine()setscreatedByto the logged-in user, so template/empty rows are excluded), and if none remain it adds "Please add at least one prescription" to the mandatory-fields list, blocking submit.To verify