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

Support for self-healing Consultation URL #6857

Conversation

konavivekramakrishna
Copy link
Contributor

@konavivekramakrishna konavivekramakrishna commented Dec 13, 2023

WHAT

🤖[deprecated] Generated by Copilot at 8ae6d43

Removed the dependency of facilityId and patientId from the consultation details page and related components. This allows the user to access the consultation details directly from the /consultation/:consultationId route, and simplifies the data fetching and routing logic. Updated the ConsultationRoutes component and the patientUrl and consultationUrl variables accordingly.

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

HOW

🤖[deprecated] Generated by Copilot at 8ae6d43

  • Remove facilityId and patientId props from ConsultationTabProps interface and ConsultationDetails component, as they are no longer needed to render the consultation tabs and fetch the consultation and patient data (link, link, link)
  • Add navigate function to ConsultationDetails component to redirect the user to the last consultation of the patient, if the consultationId prop is not provided or invalid (link)
  • Change facilityId parameter for triggerGoal function to use patientData?.facility_object?.id value, to track the analytics of the consultation view event with the correct facility id (link)
  • Update crumbsReplacements object for BreadCrumb component to use patientData?.facility_object?.id and patientData?.id values, to display the correct names of the facility and patient in the breadcrumb navigation (link)
  • Update navigate function for patient notes button to use patientData?.facility_object?.id and patientData?.id values, to redirect the user to the patient notes page with the correct facility and patient ids (link)
  • Update href attribute for consultation tab buttons to use patientData?.facility_object?.id and patientData?.id values, to link the user to the correct consultation tab page with the correct facility and patient ids (link)
  • Update facilityId prop for DoctorVideoSlideover component to use String(patientData?.facility_object?.id) value, to render the doctor video slideover with the correct facility id (link)
  • Update patientId and facilityId props for PatientNotesSlideover component to use String(patientData?.id) and String(patientData?.facility_object?.id) values, to render the patient notes slideover with the correct patient and facility ids (link)
  • Remove facilityId and patientId variables from DailyRoundsList component, and update consultationUrl variable to use /consultation/:consultationId route, to render the daily rounds list without the facility and patient ids (link)
  • Update patientUrl variable for PatientManager component to use /consultation/:consultationId route, if the patient has a last consultation that is not discharged and active, to link the user to the consultation details page without the facility and patient ids (link)
  • Add /consultation/:consultationId route to ConsultationRoutes component, to render the ConsultationDetails component with the consultationId and updates props, to enable the user to access the consultation details page directly (link)

@konavivekramakrishna konavivekramakrishna requested a review from a team as a code owner December 13, 2023 07:23
Copy link

vercel bot commented Dec 13, 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 Dec 20, 2023 8:36am

Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for care-egov-staging ready!

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

@konavivekramakrishna
Copy link
Contributor Author

konavivekramakrishna commented Dec 13, 2023

@rithviknishad

can you please review it

@rithviknishad
Copy link
Member

Rest LGTM

@@ -139,6 +140,6 @@ export default {
/>
),
"/consultation/:consultationId": ({ consultationId }: any) => (
<ConsultationDetails consultationId={consultationId} tab={"updates"} />
<Redirect to={`/facility/id/patient/id/consultation/${consultationId}/`} />
Copy link
Contributor Author

@konavivekramakrishna konavivekramakrishna Dec 13, 2023

Choose a reason for hiding this comment

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

id is placeholder as we don't know the facility id and patient id

Copy link
Member

@rithviknishad rithviknishad Dec 13, 2023

Choose a reason for hiding this comment

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

Why? We could keep it as <ConsultationDetails consultationId={consultationId} tab={"updates"} /> itself right? ConsultationDetails component would correct the URL for us right? (correct me if I am wrong)

Copy link
Member

Choose a reason for hiding this comment

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

This causes two redirects now:

  • /consultation/<valid_id> goes to
  • /facility/id/patient/id/consultation/<valid_id> goes to
  • /facility/<valid_id>/patient/<valid_id>/consultation/<valid_id>

AppHistory stack would have unnecessary redirects + Back Button no longer works properly this way

@konavivekramakrishna
Copy link
Contributor Author

konavivekramakrishna commented Dec 20, 2023

image

@rithviknishad

is this expected behavior or should I create an issue in backend
the status code should be 404 instead it is 500

@rithviknishad
Copy link
Member

you can create an issue

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Dec 20, 2023
Copy link

👋 Hi, @konavivekramakrishna,
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required merge conflict pull requests with merge conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for self-healing Consultation URL and redirecting /consultation/:id to the actual route
2 participants