Skip to content

fix(nurse-doctor): correct mandatory-field enforcement (vitals, clinical obs, family history) - #441

Open
gkbishnoi07 wants to merge 3 commits into
angular-zard-migrationfrom
fix/mandatory-field-corrections
Open

fix(nurse-doctor): correct mandatory-field enforcement (vitals, clinical obs, family history)#441
gkbishnoi07 wants to merge 3 commits into
angular-zard-migrationfrom
fix/mandatory-field-corrections

Conversation

@gkbishnoi07

Copy link
Copy Markdown

What

Aligns several mandatory-field behaviours to the original AMRIT logic after the Zard migration.

  • Waist Circumference falsely required — removed a template [required] that popped the mandatory dialog on submit though no form-level validator exists. (QA)
  • Cancer-vitals BP falsely required — removed [required]="benAge > 30" on Systolic/Diastolic BP; BP is optional in cancer screening. (QA)
  • Family History (General OPD) — reverted an over-eager family-member validation; General OPD / ANC / PNC / NCD-care family history stays optional, exactly as main. NCD screening keeps its original family-member + Diabetes-Mellitus requirement.
  • Clinical Observations — restored to mandatory (matching original main: Validators.required + template required, re-arming the existing checkQuickConsultDoctorData gate) and added the red * the original never showed — which was the actual gap reported.

Testing

  • Vitals: Waist Circumference and cancer-screening BP submit without false mandatory errors.
  • Family History: optional in General OPD/ANC/PNC; NCD screening still requires a Diabetes-Mellitus row + family member (IDRS).
  • Quick Consult: Clinical Observations shows a red * and blocks Next when empty.

[22] Waist Circumference was falsely required for NCD screening (age >= 30) via a
template [required] and blocked submit; removed (no form-level validator exists).
[10] Cancer vitals Systolic/Diastolic BP (1st reading) raised a mandatory popup for
age > 30 via a template [required]; removed — BP is optional in cancer screening.
[21] Quick Consult "Clinical Observations" was required (Validators.required +
template required) and wrongly blocked Next; made optional to match the general
case-record findings field.
[20] Family History: require a family member whenever a real disease is chosen
(mirrors the existing NCD-screening rule); empty / None / Nil rows keep family
history optional overall.
…MRIT logic)

The original app never validated family member in checkNurseRequirements — only the
NCD-screening path enforces it. Per product decision, follow the original: General OPD
(and ANC/PNC/NCD-care/COVID) family history stays optional. Reverts the [20] check.
…) + show red *

The earlier [21] change made Clinical Observations optional, but the original app
had it mandatory (clinicalObservation: [null, Validators.required] + template
required) — the checkQuickConsultDoctorData gate pushes it to the required list
when the control errors. The real gap Shivani reported was the MISSING visual
marker, not the blocking. So: restore Validators.required + template required
(re-arming the existing Next-gate) and add zRequired so the field finally shows
the red * the original never had.
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1762a686-2b4a-4194-9fa3-01466183df5b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants