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

Consultation Form Enhancement: No home facility docs #7914

Merged

Conversation

Jacobjeevan
Copy link
Contributor

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

	- Added "no home facility doctors" as text for no results in  User
autocomplete field in Consultation Form.
- Display extra notification when there are no results for Assigned docs
field (Consultation Form)
	- Only applicable to ConsultationForm
@Jacobjeevan Jacobjeevan requested a review from a team as a code owner May 27, 2024 14:31
Copy link

vercel bot commented May 27, 2024

@Jacobjeevan is attempting to deploy a commit to the Open Healthcare Network Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

netlify bot commented May 27, 2024

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 45e16ff
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/66aa52f3d3588400080f0d86
😎 Deploy Preview https://deploy-preview-7914--care-egov-staging.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.

@nihal467
Copy link
Member

nihal467 commented May 28, 2024

image

@Jacobjeevan

  • As per the issue, when we click on the component, it should pre-fetch the data, not just when we start typing in the component.

image

  • If there is no home doctor and an error notification is thrown multiple times when we type, with the number of errors being equal to the number of characters we type, it is not a good behavior. I suggest not throwing that error.

@Jacobjeevan
Copy link
Contributor Author

* [ ]  As per the issue, when we click on the component, it should pre-fetch the data, not just when we start typing in the component.

I've been able to use useQuery to prefetch the data, however I haven't had much success in displaying the results as a dropdown (trying to tie to onClick event in Autocomplete component). Any pointers on how to achieve that?

Alternatively I could use the prefetched data and just disable the component and display placeholder text, as you had originally envisioned (and remove the notifications as well).

@Jacobjeevan
Copy link
Contributor Author

* [ ]  As per the issue, when we click on the component, it should pre-fetch the data, not just when we start typing in the component.

I've been able to use useQuery to prefetch the data, however I haven't had much success in displaying the results as a dropdown (trying to tie to onClick event in Autocomplete component). Any pointers on how to achieve that?

Alternatively I could use the prefetched data and just disable the component and display placeholder text, as you had originally envisioned (and remove the notifications as well).

@nihal467 Pinging for followup, thanks.

@khavinshankar
Copy link
Member

@Jacobjeevan can you explain what is the blocker in prefeching the data on click

@Jacobjeevan
Copy link
Contributor Author

@khavinshankar Sure, I haven't had much success with triggering/displaying the drop down results. My approach has been to call fetchOptions under onClick (which I added as prop added to UserAutocompleteFormField.Autocomplete and called under Combobox.Input).

image image

Alternatively, I have been able to prefetch results using useQuery in UserAutocompleteFormField, although I'm unsure on how to attach that to options and trigger the dropdown.

Copy link

Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 18, 2024
Copy link

Hi, @coronasafe/care-frontend-maintainers, This PR has been automatically closed due to inactivity. Thank you for your contributions. Feel free to re-open the PR.

@github-actions github-actions bot closed this Jun 26, 2024
@nihal467 nihal467 reopened this Jul 28, 2024
@gigincg gigincg added the help wanted Extra attention is needed label Jul 29, 2024
@gigincg
Copy link
Member

gigincg commented Jul 29, 2024

@rithviknishad Can you help?

@rithviknishad rithviknishad removed help wanted Extra attention is needed test failed labels Jul 29, 2024
@rithviknishad rithviknishad force-pushed the issues/7854/no-linked-doctors branch from 64550bc to 60e1f1a Compare July 29, 2024 06:14
@rithviknishad rithviknishad force-pushed the issues/7854/no-linked-doctors branch from 60e1f1a to e09fa5f Compare July 29, 2024 06:15
Copy link
Member

@shivankacker shivankacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but rather than a notification maybe a banner on the top of the consultation form with a link that takes you to the add user page would be better.

@nihal467
Copy link
Member

@rithviknishad
image

  • declared dead patient won't have a treating physician field, so when the user enters the create consultation page, showing the error message "No home facility ...." won't make sense. A better approach would be to disable the treating physician field, and just below the field show the error message, there is no home facility or some proper one

@nihal467
Copy link
Member

nihal467 commented Jul 31, 2024

image

@rithviknishad

  • When someone open the form itself, the red error message is shown, it shouldn't be the case, initially when a user opens a new create consultation form, only shows the error in the disabled field
  • Now, after user try to click the create consultation button, throw the error message, Mention something specific this is a required field or something more alerting the user

@nihal467
Copy link
Member

LGTM

Copy link
Member

@khavinshankar khavinshankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jacobjeevan, good work, just a minor change

src/Components/Facility/ConsultationForm.tsx Outdated Show resolved Hide resolved
@khavinshankar khavinshankar merged commit 24ab250 into ohcnetwork:develop Aug 1, 2024
28 of 30 checks passed
Copy link

github-actions bot commented Aug 1, 2024

@Jacobjeevan 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! 🙌

@Jacobjeevan Jacobjeevan deleted the issues/7854/no-linked-doctors branch October 9, 2024 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance the treating doctor field in the consultation form
6 participants