Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a pluggable to show abha details #10417

Conversation

khavinshankar
Copy link
Member

@khavinshankar khavinshankar commented Feb 5, 2025

Proposed Changes

Summary by CodeRabbit

  • New Features

    • Integrated a new component into the patient demographics section for enhanced information display.
  • Refactor

    • Improved observation displays with refined value formatting and consistent loading messaging.
    • Adjusted the facility dropdown behavior to provide a smoother interaction.
    • Updated date/time input handling to focus on the current selection.
    • Enhanced encounter note presentations with dynamic relative timestamps and updated user metadata.
    • Extended message details with clear creation and modification timestamps.

@khavinshankar khavinshankar requested a review from a team as a code owner February 5, 2025 12:49
Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

Walkthrough

The pull request makes several UI and functional adjustments across components. In the Facility consultation details, observation value formatting is improved by using an exported formatValue function. The Facility home now explicitly sets the dropdown as non-modal. In the patient demography and plugin types, a new plugin component and type definition are introduced. The questionnaire’s date-time handling is simplified and encounter notes now display dynamically formatted dates. Additionally, minor comment updates and modifications to the Message interface add extra metadata.

Changes

File(s) Change Summary
src/components/Facility/ConsultationDetails/ObservationsList.tsx
src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx
Updated the formatting of observation values by importing and using the now-exported formatValue function.
src/components/Facility/FacilityHome.tsx Modified the DropdownMenu instantiation by adding modal={false} to adjust its UI behavior.
src/components/Patient/PatientDetailsTab/Demography.tsx
src/pluginTypes.ts
Integrated a new <PLUGIN_Component> into the patient demography details and introduced a new type (PatientDetailsTabDemographyGeneralInfoComponentType) for plugin components.
src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx
src/pages/Encounters/tabs/EncounterNotesTab.tsx
src/types/notes/messages.ts
Revised date-time handling by removing value spreading, added dynamic relative date formatting in encounter notes, and enhanced the Message type with new properties and a Markdown comment.
src/index.tsx Updated a comment to clarify that an environment variable is exposed on the window object for plugins.

Sequence Diagram(s)

sequenceDiagram
    participant ObservationsList
    participant formatValue
    ObservationsList->>formatValue: Call formatValue(rawValue, valueType)
    formatValue-->>ObservationsList: Return formattedValue
Loading
sequenceDiagram
    participant EncounterNotesTab
    participant dateFns
    EncounterNotesTab->>dateFns: Call formatRelative(messageDate)
    dateFns-->>EncounterNotesTab: Return formattedRelativeDate
    EncounterNotesTab->>User: Display message with dynamic date
Loading

Assessment against linked issues

Objective Addressed Explanation
Patient registration form autofill and linking behavior (e.g., showing ABHA ID post-linking) [#5] No changes related to the patient registration form or linking logic.
HF ID handling and error messaging (e.g., adding HF ID to a facility, error display when missing) [#5] The PR does not modify HF ID functionality or its error handling.

Possibly related PRs

Suggested labels

needs review, tested, changes required

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

I hop through code with a skip and a jump,
Carrots of changes lined up in a bump.
Format functions shine like moonlit dew,
Dropdowns and dates now fresh and new.
With whiskers twitching, I code anew!

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa7fad8 and 374e73d.

📒 Files selected for processing (9)
  • src/components/Facility/ConsultationDetails/ObservationsList.tsx (3 hunks)
  • src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx (1 hunks)
  • src/components/Facility/FacilityHome.tsx (1 hunks)
  • src/components/Patient/PatientDetailsTab/Demography.tsx (2 hunks)
  • src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx (0 hunks)
  • src/index.tsx (1 hunks)
  • src/pages/Encounters/tabs/EncounterNotesTab.tsx (3 hunks)
  • src/pluginTypes.ts (2 hunks)
  • src/types/notes/messages.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/components/Questionnaire/QuestionTypes/DateTimeQuestion.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: cypress-run (1)
🔇 Additional comments (10)
src/types/notes/messages.ts (1)

5-5: LGTM! Good improvements to the Message interface.

The addition of timestamps and the Markdown comment enhances the interface's clarity and functionality.

Also applies to: 9-10

src/pages/Encounters/tabs/EncounterNotesTab.tsx (1)

159-170: Great improvements to the message timestamp display!

The implementation uses semantic HTML with the <time> element and provides both relative and absolute timestamps, enhancing user experience.

src/pluginTypes.ts (1)

44-48: LGTM! Well-structured plugin component type.

The new type definition and its integration into SupportedPluginComponents follow the established patterns and provide the necessary props for displaying patient demographic information.

Also applies to: 58-58

src/components/Patient/PatientDetailsTab/Demography.tsx (2)

143-147: LGTM! Well-integrated plugin component.

The plugin component is properly integrated with a descriptive key and correct props.


234-248: Verify if commented ABHA section can be removed.

Since we're adding a plugin component for ABHA details, can we remove this commented section? If it's kept for reference, consider adding a comment explaining why or create a ticket to clean it up later.

src/components/Facility/ConsultationDetails/ObservationsList.tsx (3)

10-10: LGTM! Good reuse of existing functionality.

Importing the formatValue function promotes code reuse and maintains consistent value formatting across components.


100-102: LGTM! Enhanced value formatting.

The use of formatValue improves the display of observation values by considering the value type.


113-113: LGTM! Consistent loading state message.

Using the same "loading" text for both initial and subsequent loading states improves UX consistency.

src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx (1)

56-59: LGTM! Good modularization.

Making formatValue exportable promotes code reuse and maintains consistent value formatting across the application.

src/components/Facility/FacilityHome.tsx (1)

254-254: LGTM! Improved dropdown behavior.

Setting modal={false} prevents the dropdown from being treated as a modal dialog, which can improve interaction when the dropdown needs to stay open during other interactions.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Feb 5, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 374e73d
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/67a35e6a355e1900081c3b78
😎 Deploy Preview https://deploy-preview-10417--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@khavinshankar
Copy link
Member Author

Closing this infavor of #10418

@khavinshankar khavinshankar reopened this Feb 5, 2025
@khavinshankar khavinshankar changed the base branch from develop to staging February 5, 2025 13:53
Copy link

cypress bot commented Feb 5, 2025

CARE    Run #4626

Run Properties:  status check passed Passed #4626  •  git commit 374e73da69: Added a pluggable to show abha details
Project CARE
Branch Review khavinshankar/fix/added-pluggable-to-show-abha-details
Run status status check passed Passed #4626
Run duration 06m 05s
Commit git commit 374e73da69: Added a pluggable to show abha details
Committer Khavin Shankar
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 10
View all changes introduced in this branch ↗︎

@rithviknishad rithviknishad merged commit 787ca06 into staging Feb 5, 2025
35 of 36 checks passed
@rithviknishad rithviknishad deleted the khavinshankar/fix/added-pluggable-to-show-abha-details branch February 5, 2025 14:06
Copy link

github-actions bot commented Feb 5, 2025

@khavinshankar Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

rithviknishad added a commit that referenced this pull request Feb 6, 2025
* Fix Content-type header in Scribe.tsx (#7631) (#7634)

Co-authored-by: Ashesh <[email protected]>

* Merge develop to staging v24.16.0 (#7667)

* flaky test (#7657)

* Fix round type display and qr field (#7666)

* Revert "Merge develop to staging v24.16.0 (#7667)" (#7669)

This reverts commit a91230a.

* Fixes neurological tab from crashing in older browsers (patch to `staging`)

* Sainak/fix/pdf-worker-mime-type (#8513)

* Fixes file upload missing pagination component

* Plausible: Track applied filters (#8641)

* disable abha number linking when health facility id is not present

* Revert "disable abha number linking when health facility id is not present"

This reverts commit 63a28a5.

* include icons used in enabled apps while treeshaking the icons

* Fix min date for discharge (#9082)

* replicated the PR 9139

* User creation form bug fix (#9406)

* fixed critical care update redirection

* expose env variables to plugins via window

* Staging Patch: Fix setting time on datetime question causing duplicates (#10370)

* remove hardcoded date encounter notes (#10382)

* added PatientDetailsTabDemographyGeneralInfo plaggable (#10417)

* Staging Patch: Remove appointment type section from patient details page (#10432)

---------

Co-authored-by: Gigin George <[email protected]>
Co-authored-by: Mohammed Nihal <[email protected]>
Co-authored-by: Ashesh <[email protected]>
Co-authored-by: Khavin Shankar <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>
Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: Shivank Kacker <[email protected]>
Co-authored-by: Jacob John Jeevan <[email protected]>
@khavinshankar khavinshankar self-assigned this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

CARE Patient registration form autofill need to be refactored
2 participants