fix: amm-2229 incorrect details on case-sheet issue fix#137
fix: amm-2229 incorrect details on case-sheet issue fix#1375Amogh merged 1 commit intorelease-3.6.2from
Conversation
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/history-case-sheet/history-case-sheet.component.htmlsrc/app/app-modules/nurse-doctor/history/general-opd-history/personal-history/personal-history.component.htmlsrc/app/app-modules/nurse-doctor/history/general-opd-history/personal-history/personal-history.component.ts
| personalHistory?.riskySexualPracticesStatus === undefined | ||
| ? null | ||
| : personalHistory?.riskySexualPracticesStatus | ||
| : personalHistory?.riskySexualPracticesStatus == "1" | ||
| ? "Yes" | ||
| : "No" |
There was a problem hiding this comment.
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.
| 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.




📋 Description
JIRA ID: amm-2229
incorrect details on case-sheet issue fix
✅ Type of Change
Summary by CodeRabbit
Bug Fixes
New Features