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

Fix patient import from external result #5908

Merged
merged 8 commits into from
Aug 2, 2023
Merged

Fix patient import from external result #5908

merged 8 commits into from
Aug 2, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Jul 24, 2023

WHAT

🤖 Generated by Copilot at 297a584

This pull request enables importing external results data for patients based on their name. It refactors the PatientRegister component to use the form context API and improves the rendering logic.

Proposed Changes

image

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

HOW

🤖 Generated by Copilot at 297a584

  • Modify the showImport state variable to store the form context value of the name field, and update its usage accordingly (link, link, link, link, link)
  • Pass the form context value of the name field to the fetchExtResultData function, and use the field.onChange method to update the form values with the data from external results (link, link, link)
  • Move the Form component outside the conditional rendering of the showImport state variable, and hide it with a div element with a hidden class name based on the showImport.show property (link, link)
  • Add a formField state variable and a setFormField call to store the form context value of the name field (link)
  • Add the optional chaining operator ?. to the res.data expression, to avoid potential errors if res is undefined or null (link)
  • Remove the redundant setIsLoading(false) call from the setShowImport call (link)
  • Move the ButtonV2 component that triggers the import inside a div element with a border, to make it visually consistent with the rest of the form fields (link)
  • Import the FormContextValue type from ../Form/FormContext.js to use it later in the code (link)

@Ashesh3 Ashesh3 requested a review from a team July 24, 2023 08:23
@Ashesh3 Ashesh3 requested a review from a team as a code owner July 24, 2023 08:23
@Ashesh3 Ashesh3 requested a review from vigneshhari July 24, 2023 08:23
@vercel
Copy link

vercel bot commented Jul 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2023 1:57pm

@netlify
Copy link

netlify bot commented Jul 24, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit e56d19d
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/64c90ee85a4b630008ae5412
😎 Deploy Preview https://deploy-preview-5908--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.

@github-actions github-actions bot added the cypress failed pull request with cypress test failure label Jul 24, 2023
@github-actions
Copy link

👋 Hi, @Ashesh3,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Jul 25, 2023
@nihal467
Copy link
Member

@Ashesh3 clear the merge conflict

@Ashesh3 Ashesh3 removed the merge conflict pull requests with merge conflict label Jul 25, 2023
@github-actions github-actions bot added cypress passed and removed cypress failed pull request with cypress test failure labels Jul 26, 2023
@github-actions
Copy link

👋 Hi, @Ashesh3,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Jul 27, 2023
@github-actions github-actions bot added cypress failed pull request with cypress test failure and removed cypress passed labels Jul 31, 2023
@github-actions github-actions bot added cypress passed and removed cypress failed pull request with cypress test failure labels Aug 1, 2023
@nihal467
Copy link
Member

nihal467 commented Aug 1, 2023

LGTM

@khavinshankar khavinshankar merged commit 2e3a279 into develop Aug 2, 2023
28 of 29 checks passed
@khavinshankar khavinshankar deleted the fix-5895 branch August 2, 2023 03:01
@github-actions
Copy link

github-actions bot commented Aug 2, 2023

@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

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.

patient creation by External Result import is not working
3 participants