Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

feat(diagnoses): adds ability to view a diagnosis #2504

Merged

Conversation

anthonyaperez
Copy link
Contributor

Fixes #2129.

Changes proposed in this pull request:

  • Added a diagnosis table component, where each row/diagnosis has a "view" button that leads to the corresponding form
  • Added a new react-query handler for the diagnosis routing
  • Changed Diagnoses and ViewPatient tests
  • Added new tests for the components and routing
  • Added asynchronous data loading for diagnoses (similar to care plans)

Newly added dependencies with Bundlephobia links:

  • No dependencies added.

@gitpod-io
Copy link

gitpod-io bot commented Dec 7, 2020

@vercel
Copy link

vercel bot commented Dec 7, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/A8LC6wUSrZEyJNa3KZ6BA8zodRgR
✅ Preview: https://hospitalrun-frontend-git-fork-codethechange-9888ac-hospitalrun.vercel.app

@jackcmeyer jackcmeyer added patients issue/pull request that interacts with patients module 🚀enhancement an issue/pull request that adds a feature to the application labels Dec 9, 2020
@jackcmeyer jackcmeyer added this to In progress in Version 2.0 via automation Dec 9, 2020
@jackcmeyer jackcmeyer added this to the v2.0 milestone Dec 9, 2020
src/patients/hooks/useDiagnosis.tsx Show resolved Hide resolved
src/patients/view/ImportantPatientInfo.tsx Show resolved Hide resolved
src/patients/diagnoses/ViewDiagnosis.tsx Outdated Show resolved Hide resolved
src/__tests__/patients/diagnoses/ViewDiagnosis.test.tsx Outdated Show resolved Hide resolved
src/patients/diagnoses/ViewDiagnoses.tsx Outdated Show resolved Hide resolved
@jackcmeyer
Copy link
Member

One bug that I noticed: the diagnosis tab does not highlight when viewing a diagnosis.

Copy link
Contributor

@blestab blestab left a comment

Choose a reason for hiding this comment

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

Should be all set if you address the comments made by @jackcmeyer

@anthonyaperez
Copy link
Contributor Author

@jackcmeyer All of the changes that you requested were addressed. One issue that I noticed with similar tests for react-query hooks like useAllergy and useCarePlan is that they don't correctly test their respective error handlers, but they pass anyway. Maybe this is related to #2287?

@CLAassistant
Copy link

CLAassistant commented Jan 30, 2021

CLA assistant check
All committers have signed the CLA.

@anthonyaperez
Copy link
Contributor Author

This PR has been updated to resolve merge conflicts with RTL @jackcmeyer @blestab

@matteovivona matteovivona requested review from a team, morrme and cpondoc and removed request for blestab and a team September 14, 2021 20:49
@matteovivona matteovivona added the in progress indicates that issue/pull request is currently being worked on label Oct 2, 2021
matteovivona
matteovivona previously approved these changes Nov 25, 2021
@matteovivona
Copy link
Contributor

@anthonyaperez sorry about delay, but the project is unfortunately back in a "frozen state". can you align your PR with the master?

In the Diagnoses tab, the diagnosis list was replaced with a table containing
the name and dates for the diagnoses, along with a button that allows a
read-permission user to view each diagnosis form in its entirety. The same
routing is also applied to the smaller diagnosis table above all of the patient
tabs. Some of the corresponding test files were added or changed to accommodate
for this new feature.
Removes a header tag that appears in the Diagnoses component if a
diagnosis form attempts to be viewed but its content is not found.
New tests were added to test the behavior of the useDiagnosis hook, the routing
of the onRowClick event handler, and the loading component for viewing a
diagnosis. Some code was also refactored to simplify the logic of the rendering.
Lastly, a bug that prevented the Diagnoses tab from being highlighted when
viewing a diagnosis was also fixed.
Due to the refactor from Enzyme to React Testing Library that occurred across
HospitalRun's entire front-end codebase, this commit ensures that the new tests
are also updated accordingly.
@anthonyaperez
Copy link
Contributor Author

@tehkapa Done!

@matteovivona matteovivona merged commit 828d63d into HospitalRun:master Nov 29, 2021
Version 2.0 automation moved this from In progress to Done Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on patients issue/pull request that interacts with patients module
Projects
Version 2.0
  
Done
Development

Successfully merging this pull request may close these issues.

Ability to view a diagnosis
5 participants