Skip to content

fix: amm-2229 incorrect details on case-sheet issue fix#137

Merged
5Amogh merged 1 commit intorelease-3.6.2from
amm-2229
Mar 26, 2026
Merged

fix: amm-2229 incorrect details on case-sheet issue fix#137
5Amogh merged 1 commit intorelease-3.6.2from
amm-2229

Conversation

@5Amogh
Copy link
Copy Markdown
Member

@5Amogh 5Amogh commented Mar 26, 2026

📋 Description

JIRA ID: amm-2229

incorrect details on case-sheet issue fix

✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)

Summary by CodeRabbit

  • Bug Fixes

    • Corrected display logic for risky sexual practices status field
    • Fixed form field value reading for allergy search functionality
    • Improved data conversion when loading patient history records
  • New Features

    • Enhanced allergic history section with allergen name column for better data visibility

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

📝 Walkthrough

Walkthrough

The changes update personal and sexual history display logic in case sheets and forms. Updates include: mapping risky sexual practices status value "1" to "Yes" for display, adding allergyName column to the allergy history table, refactoring form value reading for snomedTerm field, and converting risky sexual practices status data before patching form values.

Changes

Cohort / File(s) Summary
Risky Sexual Practices Status
src/app/app-modules/nurse-doctor/case-sheet/.../history-case-sheet.component.html, src/app/app-modules/nurse-doctor/history/.../personal-history.component.ts
Updated display logic to map status value "1" to "Yes"; added data conversion in addMasters() method to transform risky sexual practices status before form patching.
Allergy History Display
src/app/app-modules/nurse-doctor/case-sheet/.../history-case-sheet.component.html
Added allergyName column to allergic history table rendering.
Form Control Value Handling
src/app/app-modules/nurse-doctor/history/.../personal-history.component.html
Changed snomedTerm input field to read values directly from FormGroup control using optional chaining instead of nested property access.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A rabbit hops through forms so grand,
Where status "1" now makes a stand,
As "Yes" it shows with allergies in tow,
Form values dance and safely flow,
Data converts before we go! 🩺

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title refers to fixing incorrect details on case-sheet (amm-2229) and relates to the actual changes, but lacks specificity about what was actually fixed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch amm-2229

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 and usage tips.

@5Amogh
Copy link
Copy Markdown
Member Author

5Amogh commented Mar 26, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/history-case-sheet/history-case-sheet.component.html`:
- Around line 917-921: The template ternary is only guarding against undefined
and treats null as "No"; update the conditional around
personalHistory?.riskySexualPracticesStatus so null is treated as unanswered
(return null) as well — e.g., check for null/undefined (use == null or explicit
=== null || === undefined) before evaluating == "1" to render "Yes" or "No".
Locate the ternary that references personalHistory?.riskySexualPracticesStatus
and change the initial guard to cover both null and undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 593093d2-ae01-4a28-b065-302ab467102b

📥 Commits

Reviewing files that changed from the base of the PR and between 5cf7a52 and 02f4cf4.

📒 Files selected for processing (3)
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/history-case-sheet/history-case-sheet.component.html
  • src/app/app-modules/nurse-doctor/history/general-opd-history/personal-history/personal-history.component.html
  • src/app/app-modules/nurse-doctor/history/general-opd-history/personal-history/personal-history.component.ts

Comment on lines 917 to 921
personalHistory?.riskySexualPracticesStatus === undefined
? null
: personalHistory?.riskySexualPracticesStatus
: personalHistory?.riskySexualPracticesStatus == "1"
? "Yes"
: "No"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Handle null risky-sexual-practices status as unanswered, not "No"

Line 917 only guards undefined. When API returns null (valid “not answered” state), it currently falls through to Line 921 and renders "No", which is incorrect data display.

✅ Suggested fix
-              personalHistory?.riskySexualPracticesStatus === undefined
+              personalHistory?.riskySexualPracticesStatus == null
                 ? null
-                : personalHistory?.riskySexualPracticesStatus == "1"
+                : Number(personalHistory?.riskySexualPracticesStatus) === 1
                   ? "Yes"
                   : "No"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
personalHistory?.riskySexualPracticesStatus === undefined
? null
: personalHistory?.riskySexualPracticesStatus
: personalHistory?.riskySexualPracticesStatus == "1"
? "Yes"
: "No"
personalHistory?.riskySexualPracticesStatus == null
? null
: Number(personalHistory?.riskySexualPracticesStatus) === 1
? "Yes"
: "No"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/history-case-sheet/history-case-sheet.component.html`
around lines 917 - 921, The template ternary is only guarding against undefined
and treats null as "No"; update the conditional around
personalHistory?.riskySexualPracticesStatus so null is treated as unanswered
(return null) as well — e.g., check for null/undefined (use == null or explicit
=== null || === undefined) before evaluating == "1" to render "Yes" or "No".
Locate the ternary that references personalHistory?.riskySexualPracticesStatus
and change the initial guard to cover both null and undefined.

@5Amogh 5Amogh merged commit 8d1faa0 into release-3.6.2 Mar 26, 2026
2 of 3 checks passed
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