Skip to content

Conversation

@rahu1ramesh
Copy link
Contributor

@rahu1ramesh rahu1ramesh commented Jun 2, 2025

JIRABN-69

Description

This PR implements allergy management functionality in the consultation pad, allowing healthcare providers to record and manage patient allergies. The implementation includes a searchable allergen form with severity and reaction selection, following FHIR standards for allergy data management.

The configurations are added as part of this PR -> https://github.com/bahnew/standard-config/pull/1/files


Key Features

  • Added allergy form with searchable allergen selection
  • Implemented severity selection (Mild/Moderate/Severe)
  • Added multi-select filterable reactions picker
  • Integrated with FHIR AllergyIntolerance resource
  • Added validation for required fields
  • Implemented i18n support for English and Spanish
  • Added comprehensive test coverage
  • Loads Allergy Concept UUIDs from Config

Implementation Details

  • UI Components

    • Added AllergiesForm component with ComboBox for allergen search
    • Added SelectedAllergyItem component for managing individual allergies
    • Implemented severity dropdown using Carbon's Dropdown component
    • Added reactions selector using Carbon's FilterableMultiSelect
    • Integrated with ConsultationPad for seamless workflow
    • Moved forms to dedicated directories for better organization
  • State Management

    • Added allergyStore for managing selected allergies
    • Implemented validation logic for required fields
    • Added support for adding/removing allergies
    • Integrated with consultation bundle for FHIR resource creation
  • Custom Hooks

    • Added useAllergenSearch hook for allergen concept search
    • Implemented debounced search functionality
    • Added error handling and loading states
    • Added unmounting tests for hooks
  • API Integration

    • Integrated with FHIR ValueSet endpoints for allergen concepts
    • Added allergy resource creation in consultation bundle
    • Implemented FHIR-compliant allergy resource mapping
    • Added error handling for API failures
  • Performance & Optimization

    • Implemented debounced search to prevent excessive API calls
    • Added memoization for filtered search results
    • Improved component organization for better maintainability
  • Internationalisation

    • Added translations for allergy-related labels
    • Supported both English and Spanish locales
    • Added translations for validation messages
    • Added translations for allergen types and severity levels
  • Accessibility

    • Added ARIA labels for form controls
    • Implemented keyboard navigation
    • Added screen reader support
    • Added validation feedback
  • Limitations

    • Retired concepts may appear in ValueSet responses (tracked in comments)
    • UUIDs currently hardcoded, pending proper search endpoint
    • Pagination not implemented (marked as out of scope)
    • Updating/deleting allergies not implemented (marked as out of scope)

Testing & Type Definitions

  • Unit Tests

    • Added comprehensive tests for AllergiesForm
    • Added tests for SelectedAllergyItem
    • Added tests for allergyStore
    • Added tests for useAllergenSearch hook
    • Added unmounting tests for hooks
  • Integration Tests

    • Added tests for form interactions
    • Added tests for API integration
    • Added tests for FHIR resource creation
    • Added tests for validation scenarios
  • Type Definitions

    • Added types for allergy-related interfaces
    • Added FHIR resource types
    • Added store types
    • Maintained strict TypeScript compliance

Screenshots

Search Allergens Add Allergen Add Severity and Reaction Add Duplicate Allergen Missing Severity and Reaction Save Success
Screenshot 2025-06-02 at 7 27 55 PM Screenshot 2025-06-02 at 7 28 01 PM Screenshot 2025-06-02 at 7 28 09 PM Screenshot 2025-06-02 at 7 28 27 PM Screenshot 2025-06-02 at 7 28 18 PM Screenshot 2025-06-02 at 7 29 32 PM

Next Steps

  • Implement proper search endpoint to replace UUIDs from configuration
  • Add support for filtering retired concepts in ValueSet responses
  • Consider implementing pagination for large datasets
  • Plan implementation of allergy updates and deletions

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 requested a review from mohan-13 June 2, 2025 15:40
@rahu1ramesh rahu1ramesh merged commit aa431dc into main Jun 3, 2025
2 checks passed
@rahu1ramesh rahu1ramesh deleted the BN-69 branch June 3, 2025 09:17
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