fix(nurse-doctor): restrict visit categories to supported flows + stepper/navigation fixes - #439
fix(nurse-doctor): restrict visit categories to supported flows + stepper/navigation fixes#439gkbishnoi07 wants to merge 4 commits into
Conversation
…tory forms [37][32][4][35] The visit-category dropdown offered categories MMU has no flow for (Childhood & Adolescent, Family Planning, Neonatal); picking one stranded the user on Visit Details with no Next/Submit. handleVisitType() only implements 8 categories, so restrict the dropdown to those, and hide the adult NCD categories (NCD screening / NCD care) from beneficiaries under 30. [37] NCD Care History rendered blank: general-opd-history.loadFormData() runs on every ngOnChanges and assigned each section form unconditionally, so a transient stale/wrong parent form during a category switch nulled them all. Guard it to keep the last good reference until the correct form arrives. Note: [31] "stepper missing on category change" was caused by selecting one of the now-removed unsupported categories, so it is covered by the same whitelist.
…build on category change) hideAll() ran changeDetectorRef.detectChanges() (added in migration; absent in main). Because hideAll runs inside the visitCategory valueChanges handler, forcing CD while the show* flags flip true->false throws ExpressionChangedAfterItHasBeenCheckedError on a category *change*, aborting handleVisitType() before it rebuilds the steps -> stepper collapses to Visit Details and Next stops working. Remove the forced CD; the normal change-detection pass rebuilds the (reactive Zard) stepper. Bug [31].
… of a blank page handleVisitType had no else on the category if/else-if chain, so a visit category the app has no flow for (or a value mismatch like a bare 'Screening') fell through silently and rendered a blank page with no sections — the "Screening section is missing" symptom QA hit. Add a defensive else that alerts the user to re-select the category. No behavior change for the supported categories, which are all handled above.
|
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: Pro Plus 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 |
drtechie
left a comment
There was a problem hiding this comment.
can we remove all the comments?
|



What
Fixes several visit-category / stepper navigation defects in the nurse-doctor workarea.
age >= 30auto-select). (QA: 22-year-old could pick Neonatal/NCD screening.)general-opd-history.loadFormData()so a transient stale parent form can't null every section.detectChanges()inhideAll()that threwExpressionChangedAfterItHasBeenCheckedErrorand aborted the stepper rebuild. (QA: changing visit category, stepper not displaying.)handleVisitType— an unmapped category now surfaces a clear alert instead of a silent blank page.Testing
Nurse, fresh visit: dropdown shows only supported categories; a <30 beneficiary can't pick NCD screening/Neonatal; NCD Care → History shows its sections; changing category rebuilds the stepper.
Not a regression —
mainalso implements only these categories; the dropdown just never filtered.