-
Notifications
You must be signed in to change notification settings - Fork 515
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
Disable encounter create during save #9795
Disable encounter create during save #9795
Conversation
…tiple components - Added `encounterId` prop to `ObservationChart`, `ObservationHistoryTable`, `ObservationsList`, `QuestionnaireResponsesList`, and `StructuredResponseView` components to improve data fetching and display related to specific encounters. - Updated query parameters in API calls to include `encounterId` for better data context. - Refactored `EncounterPlotsTab` and `EncounterUpdatesTab` to pass the new `encounterId` prop, ensuring consistent data handling across the application. This change improves the overall functionality and user experience by ensuring that encounter-specific data is accurately retrieved and displayed.
WalkthroughThe pull request introduces comprehensive changes to encounter-related components across multiple files. The primary focus is on integrating Changes
Sequence DiagramsequenceDiagram
participant User
participant CreateEncounterForm
participant API
participant ObservationVisualizer
User->>CreateEncounterForm: Submit encounter
CreateEncounterForm->>API: Create encounter
API-->>CreateEncounterForm: Return encounter ID
CreateEncounterForm->>ObservationVisualizer: Pass encounter ID
ObservationVisualizer->>API: Fetch observations with encounter ID
API-->>ObservationVisualizer: Return encounter-specific observations
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (20)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
CARE Run #4168
Run Properties:
|
Project |
CARE
|
Branch Review |
fix/9794-disable-encounter-create-during-save
|
Run status |
Failed #4168
|
Run duration | 01m 46s |
Commit |
7ffc0bd035: Disable encounter create during save
|
Committer | Bodhish Thomas |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
1
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
3
|
View all changes introduced in this branch ↗︎ |
Tests for review
cypress/e2e/patient_spec/patient_search.cy.ts • 1 failed test
Test | Artifacts | |
---|---|---|
Patient Search > search patient with phone number and verifies details |
Test Replay
Screenshots
|
@bodhish 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! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.
Actionable comments posted: 1
🧹 Nitpick comments (9)
src/pages/Encounters/tabs/EncounterUpdatesTab.tsx (2)
23-25
: Align naming with domain.
The naming here is consistent with the concept of Diagnoses. If expansions or additional domain concepts are introduced, ensure it remains well-organized (e.g., separate sections or tabs).
32-36
: Observation viewing block.
This column-based layout is a good approach for separating observation rendering from other sections. Keep an eye on performance if the ObservationsList grows large, and consider lazy loading or virtualization if needed.src/components/Facility/ConsultationDetails/StructuredResponseView.tsx (1)
57-58
: Broad query key usage.
The query key uses[type, id]
, plus path/queryParams. This is typically fine, but be aware that ifencounterId
changes whiletype
andid
remain the same, you may need to invalidate or refetch.src/components/Facility/ConsultationDetails/ObservationsList.tsx (4)
18-19
: Hard-coded paging limit.
LIMIT = 20
is clear, but consider externalizing it or making it configurable, so it can be more easily adjusted based on performance or design needs.
30-50
: Comprehensive concurrency and error handling.
The infinite query approach is well-configured. Just ensure you handle partial loads or re-fetch logic after errors (e.g., if an error occurs mid-fetch).Would you like help creating a more robust error recovery flow in case the query fails?
52-56
: fetchNextPage trigger.
This effect properly checksinView
andhasNextPage
. This is a good location-based approach. Consider a small margin threshold if you have tall items and want early pre-loading.
58-66
: Dedicated loading state.
Clear and user-friendly. That said, if you handle partial loads, you might want to differentiate initial load from subsequent fetches.src/components/Common/Charts/ObservationHistoryTable.tsx (1)
62-62
: Filter observations by encounter.Including
encounter
inqueryParams
is a clear, flexible way to fetch encounter-scoped observations. Verify that downstream logic handles scenarios where the specified encounter might not exist or return no data.src/components/Common/Charts/ObservationChart.tsx (1)
113-113
: AddencounterId
toqueryKey
.Inserting
encounterId
into the query key is consistent with the approach to ensure a unique cache entry per encounter. Confirm that this does not inadvertently invalidate caches used elsewhere.
🛑 Comments failed to post (1)
src/components/Facility/ConsultationDetails/ObservationsList.tsx (1)
81-118: 🛠️ Refactor suggestion
Infinite scroll rendering.
Displaying observations in an auto-scrolling container is well-structured. For large data sets, consider virtualization strategies to further optimize performance (e.g., React Window or similar).
This pull request includes changes to the
CreateEncounterForm
component to improve the user experience by providing feedback during form submission.User experience improvements:
src/components/Encounter/CreateEncounterForm.tsx
: AddedisPending
state to theuseMutation
hook to track the submission status.src/components/Encounter/CreateEncounterForm.tsx
: Updated the submit button to display "Creating..." and disable the button while the form submission is pending.