Skip to content

feat: update doctor diagnosis case sheet component#256

Open
ananyaa0518 wants to merge 3 commits intoPSMRI:mainfrom
ananyaa0518:main
Open

feat: update doctor diagnosis case sheet component#256
ananyaa0518 wants to merge 3 commits intoPSMRI:mainfrom
ananyaa0518:main

Conversation

@ananyaa0518
Copy link

@ananyaa0518 ananyaa0518 commented Feb 28, 2026

feat: Modern UI redesign for Doctor Diagnosis Case Sheet component

Doctor Diagnosis Case Sheet - Modern UI Redesign

Overview

This PR introduces a comprehensive UI/UX redesign of the Doctor Diagnosis Case Sheet component with improved styling, better visual hierarchy, and enhanced vital signs monitoring capabilities.

Changes Summary

Files Modified

  1. doctor-diagnosis-case-sheet.component.css - Complete styling overhaul
  2. doctor-diagnosis-case-sheet.component.html - Enhanced markup with inline styles
  3. doctor-diagnosis-case-sheet.component.ts - New vital sign validation methods

CSS Improvements

Typography Hierarchy

  • h2: 24px, 700 weight - Main titles
  • h3: 20px, 600 weight - Section titles
  • h4: 16px, 600 weight - Subsection titles
  • h5: 14px, 600 weight - Field labels
  • p: 14px - Body text with 1.5 line-height

Layout & Spacing

  • Consistent padding and margins across components
  • Improved column spacing with normalized padding
  • Better fieldset and legend styling with modern borders
  • Enhanced hover effects with subtle transitions

Table Styling

  • Improved borders: Clear border-collapse with proper spacing
  • Header styling: Gray background with better contrast
  • Row highlighting: Hover effects and striped rows
  • Responsive density: Optimized padding for readability

Vital Signs Highlighting

  • vital-abnormal: Yellow background for borderline values
  • vital-critical: Red background for critical values

Print Optimization

  • Full color support in printed documents
  • Page break controls to prevent breaking tables
  • Optimized fonts for PDF output

HTML Enhancements

  • Added HTML comments for section clarity
  • Improved inline styling for consistency
  • Better semantic HTML structure

TypeScript Component Additions

New Vital Sign Validation Methods

  • isAbnormalTemp(): Normal range 36.1–37.2°C
  • isAbnormalPulse(): Normal range 60–100 bpm
  • isAbnormalSPO2() / isCriticalSPO2(): Abnormal 90–95%, Critical <90%
  • isAbnormalBP(): Checks systolic and diastolic ranges
  • isAbnormalRespiratoryRate(): Normal range 12–20 breaths/min

Benefits

  • Improved Readability - Better typography hierarchy
  • Enhanced UX - Cleaner interface with visual feedback
  • Vital Monitoring - Color-coded vital signs for quick assessment
  • Print-Friendly - Optimized for PDF generation
  • Responsive - Works on desktop and mobile
  • Maintainability - Well-structured code

Testing Recommendations

  • Verify layout on desktop browsers
  • Test responsive design on mobile
  • Validate vital sign highlighting
  • Print preview testing
  • Cross-browser compatibility

Type: Feature
Priority: Medium
Affected Modules: Nurse-Doctor, Case Sheet

Summary by CodeRabbit

  • New Features

    • Vitals display visual badges and conditional highlighting for abnormal/critical temperature, pulse, SpO2, blood pressure, and respiratory rate.
  • Style

    • Complete visual overhaul of the case sheet: modern typography, consistent spacing, refreshed cards/tables/forms, responsive adjustments.
    • Improved print-optimized layout and added spacing/utilities for cleaner on-screen and printed case sheets.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 28, 2026

📝 Walkthrough

Walkthrough

This PR replaces and expands the doctor-diagnosis case sheet styling, adds six vitals-abnormality detection methods to the component, wires those methods into the template to conditionally style vitals, and imports the Inter font in global styles.

Changes

Cohort / File(s) Summary
Doctor Diagnosis CSS
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css
Full CSS overhaul: new layout, typography, spacing utilities, fieldset/card styles, table variants, input/textarea styles, vitals badges, print rules, responsive adjustments and helper utilities.
Doctor Diagnosis Template
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.html
Added margin wrappers for vertical spacing, minor label punctuation/formatting tweaks, and conditional class bindings on vitals cells to apply vital-abnormal / vital-critical. No data-flow or retrieval changes.
Doctor Diagnosis Component (TS)
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts
Added six public threshold-based vitals assessment methods: isAbnormalTemp, isAbnormalPulse, isAbnormalSPO2, isCriticalSPO2, isAbnormalBP, isAbnormalRespiratoryRate.
Global styles
src/styles.css
Imported Inter font from Google Fonts (@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I nibble at CSS, tidy margins, fonts in line,
I watch the vitals glow when thresholds cross the sign,
Tiny hops of logic mark the beats both calm and wild,
A casesheet blooms, all neat — from rabbit, proud and styled.

🚥 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 accurately summarizes the main change: a comprehensive redesign/update to the doctor diagnosis case sheet component, including CSS styling, HTML structure, and TypeScript validation methods.
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@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: 2

🧹 Nitpick comments (3)
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.html (1)

613-615: Consider using CSS utility classes instead of inline styles.

Multiple elements use inline style="margin-bottom: 12px;" while the CSS file defines spacing utilities like .m-b-10. Using CSS classes would improve maintainability and consistency.

♻️ Alternative approach using CSS classes

Add to CSS:

.m-b-12 {
    margin-bottom: 12px !important;
}

Then in HTML:

- <div class="col-xs-12" style="margin-bottom: 12px;">
+ <div class="col-xs-12 m-b-12">
🤖 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/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.html`
around lines 613 - 615, The div in doctor-diagnosis-case-sheet.component.html
uses an inline style for spacing; remove the inline style="margin-bottom: 12px;"
and instead apply a CSS utility class (either reuse .m-b-10 or add a new .m-b-12
rule in the component stylesheet) to the element with class "col-xs-12" that
wraps the <h4> (current_language_set?.casesheet?.chiefComplaint); update the
component CSS to include .m-b-12 { margin-bottom: 12px !important; } if you need
that exact spacing and then replace the inline style with the new utility class.
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts (1)

760-763: Redundant null/undefined checks can be simplified.

The condition !temp || temp === null || temp === undefined is redundant because !temp already evaluates to true for null and undefined. This applies to all six validation methods.

♻️ Simplified guard clause
  isAbnormalTemp(temp: any): boolean {
-   if (!temp || temp === null || temp === undefined) return false;
+   if (!temp) return false;
    const tempValue = parseFloat(temp);
+   if (isNaN(tempValue)) return false;
    return tempValue < 36.1 || tempValue > 37.2; // Normal: 36.1-37.2°C
  }

Note: Adding an explicit isNaN check makes the intent clearer, as parseFloat on invalid input returns NaN, and comparisons with NaN return false.

🤖 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/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts`
around lines 760 - 763, Replace the redundant null/undefined guard in
isAbnormalTemp (and the other five similar validation methods) by checking for
falsy input and invalid numbers succinctly: return false if the input is falsy
or parseFloat yields NaN, then compare the numeric value to the normal range;
specifically, call parseFloat(temp) into tempValue, if (!temp ||
isNaN(tempValue)) return false, otherwise return tempValue < 36.1 || tempValue >
37.2. This simplifies the checks while preserving behavior and clarifies intent
with an explicit isNaN check.
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css (1)

362-398: Consider updating deprecated page-break-* properties to break-*.

The page-break-after and page-break-inside properties are deprecated in favor of break-after and break-inside from the CSS Fragmentation spec.

However, note that browser support for break-* in print contexts varies. If supporting older browsers (especially Safari <17), you may want to include both properties for compatibility.

♻️ Update to modern properties with fallback
  h2 {
      font-size: 20px;
      margin-bottom: 16px;
-     page-break-after: avoid;
+     break-after: avoid;
  }

  fieldset {
-     page-break-inside: avoid;
+     break-inside: avoid;
      margin-bottom: 16px;
      /* ... */
  }

Or for maximum compatibility, include both:

fieldset {
    page-break-inside: avoid; /* Legacy fallback */
    break-inside: avoid;      /* Modern standard */
}
🤖 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/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`
around lines 362 - 398, The CSS uses deprecated page-break-* properties (e.g.,
page-break-after in h2/h3/h4/h5 and page-break-inside in fieldset); update these
to the modern break-* equivalents while retaining the legacy properties as
fallbacks for older browsers: add break-after for h2/h3/h4/h5 alongside
page-break-after and add break-inside for fieldset alongside page-break-inside,
ensuring you update the selectors (h2, h3, h4, h5, and fieldset) where these
rules appear so print fragmentation behavior is preserved across browsers.
🤖 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/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`:
- Around line 234-238: Replace the deprecated CSS property in
doctor-diagnosis-case-sheet.component.css: locate the rule that currently uses
"word-wrap: break-word;" (inside the styles for the Doctor Diagnosis case sheet)
and change it to "overflow-wrap: break-word;" so modern browsers use the
standard property while keeping the same behavior and leaving the other
declarations (color, white-space, font-family) unchanged.

In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts`:
- Around line 772-782: The isAbnormalSPO2/isCriticalSPO2 boundary handling is
inconsistent with the comment: isAbnormalSPO2 currently uses `spo2Value < 95 &&
spo2Value >= 90` which excludes 95%; either change the abnormal check to include
95 (e.g., use `spo2Value <= 95 && spo2Value >= 90`) so 95% is highlighted as
abnormal, or keep the current operators and update the comment to "Abnormal:
90-94%" so it matches the implementation; update whichever you choose in the
isAbnormalSPO2 function and ensure isCriticalSPO2 (`spo2Value < 90`) remains
correct.

---

Nitpick comments:
In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`:
- Around line 362-398: The CSS uses deprecated page-break-* properties (e.g.,
page-break-after in h2/h3/h4/h5 and page-break-inside in fieldset); update these
to the modern break-* equivalents while retaining the legacy properties as
fallbacks for older browsers: add break-after for h2/h3/h4/h5 alongside
page-break-after and add break-inside for fieldset alongside page-break-inside,
ensuring you update the selectors (h2, h3, h4, h5, and fieldset) where these
rules appear so print fragmentation behavior is preserved across browsers.

In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.html`:
- Around line 613-615: The div in doctor-diagnosis-case-sheet.component.html
uses an inline style for spacing; remove the inline style="margin-bottom: 12px;"
and instead apply a CSS utility class (either reuse .m-b-10 or add a new .m-b-12
rule in the component stylesheet) to the element with class "col-xs-12" that
wraps the <h4> (current_language_set?.casesheet?.chiefComplaint); update the
component CSS to include .m-b-12 { margin-bottom: 12px !important; } if you need
that exact spacing and then replace the inline style with the new utility class.

In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts`:
- Around line 760-763: Replace the redundant null/undefined guard in
isAbnormalTemp (and the other five similar validation methods) by checking for
falsy input and invalid numbers succinctly: return false if the input is falsy
or parseFloat yields NaN, then compare the numeric value to the normal range;
specifically, call parseFloat(temp) into tempValue, if (!temp ||
isNaN(tempValue)) return false, otherwise return tempValue < 36.1 || tempValue >
37.2. This simplifies the checks while preserving behavior and clarifies intent
with an explicit isNaN check.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9886a8f and 513b949.

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

@ananyaa0518
Copy link
Author

@drtechie this pr is regarding issue PSMRI/AMRIT#116

@drtechie
Copy link
Member

drtechie commented Mar 2, 2026

@ananyaa0518 please attach screenshots of how you have tested this.

Copy link
Contributor

@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

♻️ Duplicate comments (1)
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css (1)

231-231: ⚠️ Potential issue | 🟡 Minor

Replace deprecated word-wrap with overflow-wrap.

Line 231 still uses a deprecated property and keeps failing modern lint rules.

🔧 Proposed fix
-    word-wrap: break-word;
+    overflow-wrap: break-word;
#!/bin/bash
# Verify deprecated word-wrap is no longer used in CSS files
rg -n --type=css '\bword-wrap\s*:'
# Expected: no matches
🤖 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/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`
at line 231, Replace the deprecated CSS property "word-wrap: break-word;" with
the modern "overflow-wrap: break-word;" in
doctor-diagnosis-case-sheet.component.css by locating the occurrence of the
"word-wrap" declaration and updating it to "overflow-wrap" so lint rules pass
and behavior remains the same.
🧹 Nitpick comments (1)
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css (1)

16-16: Remove unnecessary quotes from single-word font names.

The font-family declaration incorrectly quotes single-word names ('Inter', 'Roboto'). Per the default stylelint rule font-family-name-quotes: "always-where-required", quotes are needed only for multi-word names like 'Helvetica Neue'.

Proposed fix
-    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
+    font-family: Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
🤖 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/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`
at line 16, The font-family declaration in
doctor-diagnosis-case-sheet.component.css is quoting single-word font names;
update the font-family property (the font-family declaration in
doctor-diagnosis-case-sheet.component.css used for the
doctor-diagnosis-case-sheet styles) to remove quotes around single-word names
like Inter and Roboto while keeping quotes for multi-word names such as
"Helvetica Neue" so it conforms to the font-family-name-quotes stylelint rule.
🤖 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/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`:
- Around line 344-349: Replace deprecated CSS Fragmentation Module properties in
this file: change all occurrences of page-break-after to break-after and
page-break-inside to break-inside (e.g., the rule that currently has
"page-break-after: avoid;" and the fieldset rule using "page-break-inside:
avoid"); also convert any "page-break-after: always" usages to "break-after:
page" so rules like the page-break-after on container/fieldset follow modern CSS
fragmentation syntax.

---

Duplicate comments:
In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`:
- Line 231: Replace the deprecated CSS property "word-wrap: break-word;" with
the modern "overflow-wrap: break-word;" in
doctor-diagnosis-case-sheet.component.css by locating the occurrence of the
"word-wrap" declaration and updating it to "overflow-wrap" so lint rules pass
and behavior remains the same.

---

Nitpick comments:
In
`@src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css`:
- Line 16: The font-family declaration in
doctor-diagnosis-case-sheet.component.css is quoting single-word font names;
update the font-family property (the font-family declaration in
doctor-diagnosis-case-sheet.component.css used for the
doctor-diagnosis-case-sheet styles) to remove quotes around single-word names
like Inter and Roboto while keeping quotes for multi-word names such as
"Helvetica Neue" so it conforms to the font-family-name-quotes stylelint rule.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 513b949 and 0ba7b3a.

📒 Files selected for processing (2)
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.css
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.html
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.html

@ananyaa0518
Copy link
Author

Screenshot 2026-03-02 232836 Screenshot 2026-03-02 232857 Screenshot 2026-03-02 232932 Screenshot 2026-03-02 232945 Screenshot 2026-03-02 232954

@drtechie
Copy link
Member

drtechie commented Mar 3, 2026

Hi @ananyaa0518 Thank you for this. Were you able to run the HWC web application?
Did you face any roadblocks? I can see that the HTML is loaded as file rather than from the application.

PS: It looks much better.

@drtechie drtechie requested a review from snehar-nd March 3, 2026 07:01
}

/* Vitals Abnormal Detection Methods */
isAbnormalTemp(temp: any): boolean {
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure about handling this client-side.
This is only a small subset. What about abnormal values for all the investigations test suite present in the system.

Copy link
Author

Choose a reason for hiding this comment

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

This PR is intentionally scoped to UI/UX cleanup and client-side highlighting for standardized vitals only.
Full abnormal detection for investigations should ideally be backend-driven using test-specific reference ranges.
To avoid scope expansion into backend changes, I’ve limited this implementation to vitals. We can plan a separate enhancement for investigation-level abnormal flagging if needed.

@ananyaa0518
Copy link
Author

The codebase is quite large, and after initially loading it, I started encountering runtime errors. To isolate the issue, I created a separate copy of the Doctor Case Sheet folder and implemented changes there. For testing purposes, I also created test.html and test.css to validate it.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

Copy link
Contributor

@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/styles.css`:
- Line 6: The `@import` line uses url(...) which violates the Stylelint
import-notation rule; update the stylesheet's `@import` statement (the `@import`
declaration that loads the Inter font) to use string notation by replacing the
url(...) form with a quoted string (e.g., `@import`
'https://fonts.googleapis.com/…') so the import-notation rule is satisfied and
linting will pass.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ba7b3a and 0e6ca0c.

📒 Files selected for processing (1)
  • src/styles.css

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