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

feat(viewpatient): added labs tab to ViewPatient #1987

Merged
merged 11 commits into from
May 3, 2020

Conversation

rubencgt
Copy link
Contributor

@rubencgt rubencgt commented Apr 14, 2020

A patient can see all his requests for labs in the Labs tab

fix #1972

@vercel
Copy link

vercel bot commented Apr 14, 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/bcb6xwod2
✅ Preview: https://hospitalrun-frontend-git-fork-rubencgt-feature-labstab.hospitalrun.now.sh

Copy link
Member

@jackcmeyer jackcmeyer left a comment

Choose a reason for hiding this comment

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

@rubencgt let me know if you need any help getting the feedback addressed!

src/clients/db/LabRepository.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,63 @@
import React, { useEffect } from 'react'
Copy link
Member

@jackcmeyer jackcmeyer Apr 17, 2020

Choose a reason for hiding this comment

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

Need tests for this component:

  • test that the table renders with the correct labs
  • test that the content of the table is correct
  • test that when no labs are returned, the warning message appears


interface LabsState {
isLoading: boolean
labs: Lab[]
Copy link
Member

Choose a reason for hiding this comment

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

I think that this should be added as part of the patient slice. It seems like this functionality is part of the patient module, so therefore it makes sense to have the patient slice own this state update. @fox1t any thoughts here?

I imagine the patient slice getting a new state field called labs, and then a thunk function called findLabsPatientId and the corresponding reducers.

@@ -0,0 +1,42 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
Copy link
Member

@jackcmeyer jackcmeyer Apr 17, 2020

Choose a reason for hiding this comment

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

Need to add tests for this functionality. Of course the test implementation might change a little if we move it to the patient slice, however, the test concepts shouldn't.

  • test for the fetchPatientLabs thunk dispatching fetchLabsStart
  • test that it calls the LabRepository correctly
  • test that it dispatches fetchLabsSuccesss with the correct data
  • test that the fetchLabsStart reducer update updates the is loading state correctly
  • test that the fetchLabsSuccess reducer updates the labs list and loading state correctly

@@ -6,6 +6,18 @@ export class LabRepository extends Repository<Lab> {
constructor() {
super(labs)
}

async searchPatientLabs(patientId: string): Promise<Lab[]> {
Copy link
Member

Choose a reason for hiding this comment

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

Need to add tests to show that this is working correctly.

@rubencgt rubencgt changed the title feat(viewpatient): added labs tab to ViewPatient WIP feat(viewpatient): added labs tab to ViewPatient Apr 17, 2020
@rubencgt rubencgt changed the title WIP feat(viewpatient): added labs tab to ViewPatient WIP: feat(viewpatient): added labs tab to ViewPatient Apr 17, 2020
@rubencgt rubencgt changed the title WIP: feat(viewpatient): added labs tab to ViewPatient feat(viewpatient): added labs tab to ViewPatient Apr 21, 2020
@matteovivona matteovivona added this to the v2.0 milestone Apr 24, 2020
@vercel vercel bot temporarily deployed to Preview May 2, 2020 13:09 Inactive
@jackcmeyer
Copy link
Member

@rubencgt the MacOS build is failing. I'm guessing due to a missing mock somewhere. Let me know if you need help resolving it.

@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 May 2, 2020
@matteovivona matteovivona added the in progress indicates that issue/pull request is currently being worked on label May 3, 2020
@rubencgt
Copy link
Contributor Author

rubencgt commented May 3, 2020

@jackcmeyer for some reason I can't reproduce the issue locally (I use MacOS 10.15.4),
but I added the mock in the test where it seemed to be it was missing, NewAppointment.test.tsx.

@jackcmeyer
Copy link
Member

@jackcmeyer for some reason I can't reproduce the issue locally (I use MacOS 10.15.4),
but I added the mock in the test where it seemed to be it was missing, NewAppointment.test.tsx.

I was able to reproduce (I also use a Mac). I'll investigate a fix.

jackcmeyer
jackcmeyer previously approved these changes May 3, 2020
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
None yet
Development

Successfully merging this pull request may close these issues.

Create labs tab in view patient screen
3 participants