-
Notifications
You must be signed in to change notification settings - Fork 54
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
Change includeArchived to archivedStatus param #6128
Conversation
78b1f70
to
2dce9bd
Compare
@@ -452,11 +466,10 @@ export const DetachedTestResultsList = ({ | |||
setStartDateError(""); | |||
setEndDateError(""); | |||
}} | |||
disabled={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB for reviewers: "b2daabe8-11c8-4006-aa5f-0163869d369b" is a facility Id you can used with archived (5 total) / unarchived (4 total) patients |
@@ -145,12 +146,18 @@ void roundTrip() { | |||
"French", | |||
null); | |||
List<Person> all = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to point me to it if it's existing already, but could we add a test specifically to verify that the ArchivedStatus.Archived
case is covered (ie it doesn't also return the other states?). Think I see most of the existing tests just being convered over to the UNARCHIVED/ALL states but not a new one for the new state we're introducing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Nice catch! I forgot to push up that change 😶🌫️ Will tag you in some comments on this PR 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm overall! left one suggestion.
ed8fabc
to
3c27b01
Compare
assertPatientList(patients, GALE, JANNELLE, KACEY, ELIZABETH, HEINRICK); | ||
// all facilities, deleted | ||
List<Person> deletedPatients = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fzhao99 -- testing patients for "ARCHIVED" status here, all facilities
assertPatientList(patients, JANNELLE, KACEY); | ||
// site2, deleted, "fran" | ||
deletedPatients = _service.getPatients(site2Id, 0, 100, ArchivedStatus.ARCHIVED, "fran", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fzhao99 -- testing patients for "ARCHIVED" status here from a specific facility with text "fran"
assertEquals(7, _service.getPatientsCount(site2Id, true, null, false)); | ||
assertEquals(10, _service.getPatientsCount(null, ArchivedStatus.UNARCHIVED, null, false)); | ||
assertEquals(12, _service.getPatientsCount(null, ArchivedStatus.ALL, null, false)); | ||
assertEquals(2, _service.getPatientsCount(null, ArchivedStatus.ARCHIVED, null, false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fzhao99 -- testing patients count for "ARCHIVED" status here, all facilities
assertEquals(2, _service.getPatientsCount(null, ArchivedStatus.ARCHIVED, null, false)); | ||
assertEquals(6, _service.getPatientsCount(site2Id, ArchivedStatus.UNARCHIVED, null, false)); | ||
assertEquals(7, _service.getPatientsCount(site2Id, ArchivedStatus.ALL, null, false)); | ||
assertEquals(1, _service.getPatientsCount(site2Id, ArchivedStatus.ARCHIVED, null, false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fzhao99 -- testing patients for "ARCHIVED" status here, at a particular facility
assertEquals(0, _service.getPatientsCount(null, ArchivedStatus.UNARCHIVED, "M", false)); | ||
assertEquals(0, _service.getPatientsCount(null, ArchivedStatus.UNARCHIVED, "", false)); | ||
|
||
assertEquals(1, _service.getPatientsCount(null, ArchivedStatus.ARCHIVED, "fra", false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fzhao99 -- testing patient count for "ARCHIVED" status here, all facilities or particular facility with text "fra" or "charles"
Thank you @fzhao99 for flagging that. Let me know what you think! 😸 |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks awesome overall. The only question that I have is whether or not this will be backwards compatible with the UI (as the UI changes are going in the same PR).
How will the two graphql operations behave for requests that are still relying on the old parameter? (case when the UI is running old code)
OOO that is a very good point. Thank you for bringing this up. This change will definitely break some views for the X number of mins a user has the old frontend. I will put up two separate PRs and probably close this one:
Let me know if this sounds good to you, @johanna-skylight! Thank you! 😸 |
closed in favor of #6156 |
BACKEND & FRONTEND PULL REQUEST
Related Issue
Resolves #6062
Changes Proposed
Update
getPatients
andpatientsCount
to accept a parameter that can return deleted users, undeleted users, or all users.Additional Information
Test the new
archivedStatus
parameter!Update the values below as you see fit.
patients
patientsCount
Testing
Deployed on dev4 for testing