-
Notifications
You must be signed in to change notification settings - Fork 649
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
Location Prefill with current location #10719
Conversation
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant LQ as LocationQuestion
participant RQ as useQuery
participant API as Encounter API
LQ->>RQ: Initiate query using encounterId
RQ->>API: Fetch encounter data
API-->>RQ: Return encounter details (location, start_datetime)
RQ-->>LQ: Provide encounter data
LQ->>LQ: Update selectedLocation with fetched data
Note over LQ: User triggers association update
LQ->>LQ: Run handleUpdateAssociation (set start_datetime from data or current date)
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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 (
|
Deploying care-fe with
|
Latest commit: |
10706a9
|
Status: | ✅ Deploy successful! |
Preview URL: | https://47312833.care-fe.pages.dev |
Branch Preview URL: | https://location-minor-fix.care-fe.pages.dev |
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/components/Questionnaire/QuestionTypes/LocationQuestion.tsx (1)
41-47
: Consider adding error/loading fallback.
At present, there's no UI feedback for loading or error states. Incorporating optional loading and error handling leads to a better user experience and more resilient UI.Below is an example diff illustrating how to handle loading and error states with React Query:
- const { data: encounter } = useQuery<Encounter>({ + const { data: encounter, isLoading, isError } = useQuery<Encounter>({ queryKey: ["encounter", encounterId], queryFn: query(api.encounter.get, { pathParams: { id: encounterId }, queryParams: { facility: facilityId }, }), }); + if (isLoading) { + return <div>Loading encounter data...</div>; + } + + if (isError) { + return <div>Failed to load encounter data.</div>; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/Questionnaire/QuestionTypes/LocationQuestion.tsx
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: cypress-run (1)
🔇 Additional comments (2)
src/components/Questionnaire/QuestionTypes/LocationQuestion.tsx (2)
1-1
: No concerns with this new import.
The usage of@tanstack/react-query
here looks appropriate.
9-11
: Imports look good.
No issues identified with the newly introduced imports fromapi
,query
, orEncounter
types.
src/components/Questionnaire/QuestionTypes/LocationQuestion.tsx
Outdated
Show resolved
Hide resolved
CARE
|
Project |
CARE
|
Branch Review |
location-minor-fix
|
Run status |
|
Run duration | 06m 38s |
Commit |
|
Committer | Amjith Titus |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
11
|
View all changes introduced in this branch ↗︎ |
@amjithtitus09 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! 🙌 |
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit