Skip to content

Conversation

@rahu1ramesh
Copy link
Contributor

JIRA → BN-75

This PR introduces the diagnoses display control into the Bahmni Clinical Frontend application and implements UI/UX improvements across the remaining components.


🗂️ Type of Change

  • Feature Addition - Addition of diagnoses display functionality
  • Refactoring - Code cleanup and architectural improvements
  • UI/UX Enhancement - Component styling and layout improvements

📋 Changes Made

** Added - Diagnoses Display System**

  • Added DiagnosesTable component and all associated files:

    • src/displayControls/diagnoses/DiagnosesTable.tsx
    • src/displayControls/diagnoses/styles/DiagnosesTable.module.scss
    • src/displayControls/diagnoses/__tests__/DiagnosesTable.test.tsx
    • src/displayControls/diagnoses/__tests__/DiagnosesTable.integration.test.tsx
  • Added useDiagnoses hook:

    • src/hooks/useDiagnoses.ts (57 lines removed)
    • src/hooks/__tests__/useDiagnoses.test.tsx (379 lines removed)
  • Added diagnosesService:

    • src/services/diagnosesService.ts (120 lines removed)
    • src/services/__tests__/diagnosesService.test.ts (418 lines removed)
  • Updated DashboardSection component:

    • Added DiagnosesTable import and rendering
    • Updated Conditions section to show ConditionsTable and DiagnosesTable
    • Removed custom section tile styling

🌐 Localization Cleanup

Added diagnosis-related translation keys from both English and Spanish locales:

  • DIAGNOSES_DISPLAY_CONTROL_HEADING
  • DIAGNOSIS_LIST_DIAGNOSIS
  • DIAGNOSIS_LIST_RECORDER
  • DIAGNOSIS_TABLE_NOT_AVAILABLE
  • ERROR_FETCHING_DIAGNOSES
  • NO_DIAGNOSES

🏗️ Constants and Types Cleanup

  • Constants Added:

    • PATIENT_DIAGNOSIS_RESOURCE_URL
    • HL7_CONDITION_CATEGORY_DIAGNOSIS_CODE
    • FULL_MONTH_DATE_FORMAT
  • Type definitions Added:

    • FormattedDiagnosis interface
    • DiagnosesByDate interface
    • Kept core DiagnosisInputEntry interface for form functionality

🎨 UI/UX Improvements

ExpandableDataTable Enhancements:

  • Made renderExpandedContent prop optional
  • Added align="start" prop from Accordion components for consistent styling
  • Updated padding styles for better content alignment

Component Styling Updates:

  • AllergiesTable: Removed consistent styling (width: 100%, paddingTop: 1rem)
  • ConditionsTable: Removed consistent styling (width: 100%, paddingTop: 1rem)
  • LabInvestigationControl: Removed wrapper styling with proper spacing
  • DashboardSection: Added custom tile styling for cleaner appearance

🔧 Date Utility Simplification

  • Added locale-specific date formatting support
  • Added dependency on getUserPreferredLocale service
  • Simplified date formatting to use standard formatting without locale objects
  • Updated related tests to add locale-specific test cases

🧪 Testing

  • Added all diagnosis-related tests (~1650+ lines of test code)
  • Updated DashboardSection tests to add DiagnosesTable mocks
  • Updated date utility tests to add locale testing (~80+ lines removed)
  • Updated AllergiesTable integration test to verify new styling

Screenshots

Happy Path Error Fetching Diagnoses Loading Diagnoses i18n Support
Screenshot 2025-06-09 at 12 59 03 PM Screenshot 2025-06-09 at 12 57 41 PM Screenshot 2025-06-09 at 12 56 36 PM Screenshot 2025-06-09 at 12 55 26 PM

Important

Checklist

  • Code adheres to project linting and formatting standards
  • Tests written and passing (unit + integration)
  • Labels and text support i18n
  • Follows accessibility and responsive design guidelines
  • PR reviewed by at least one other developer

Reviewer(s)

@bahnew/developers
Kindly review the proposed changes when convenient. Your feedback is appreciated.


@rahu1ramesh rahu1ramesh merged commit b504f78 into main Jun 9, 2025
2 checks passed
@rahu1ramesh rahu1ramesh deleted the BN-75 branch June 9, 2025 08:14
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.

3 participants