-
Notifications
You must be signed in to change notification settings - Fork 607
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
Fixed : Newly Added Patient Is Not Instantly Visible in the patient-switcher #10819
base: develop
Are you sure you want to change the base?
Conversation
…lected patient in localStorage
WalkthroughThis change enhances the patient registration process by ensuring that after a patient is created, the system invalidates cached patient data and updates local storage with the new patient’s information. These modifications improve data consistency and state management without altering any exported or public entity declarations. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as PatientRegistration
participant API as Server
participant QueryCache as QueryClient
participant Storage as localStorage
UI->>API: createPatient(data)
API-->>UI: success(responseData)
UI->>QueryCache: invalidateQueries(["patients"])
UI->>Storage: setItem("selectedPatient", JSON.stringify(responseData))
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (2)
✨ Finishing Touches
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. |
publish("patient:upsert", data); | ||
localStorage.setItem("selectedPatient", JSON.stringify(data)); |
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.
Why should we store the patient data in localstorage? @Jacobjeevan @rithviknishad ?
If its for the ID we should probably add patient id to the routes. The data would be avilable in the context right 🤔
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.
I assumed this was a requirement, since I've been seeing caching things to local storage for all public patient related workflow since the beginning 😬
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.
We can remove this local storage.
@Mahendar0701 go ahead and do that here, patient-switcher and in PatientUserProvider.
@rithviknishad is it ready for review, seem like a discussion going on ! |
@rithviknishad let me know if I need to modify anything in this PR |
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit