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

Add syphilis AOE data on result View Details #8150

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

mpbrown
Copy link
Collaborator

@mpbrown mpbrown commented Sep 24, 2024

BACKEND AND FRONTEND PULL REQUEST

Related Issue

Changes Proposed

  • Adds AOE survey data as an object on the response from GetTestResultDetails query
  • Shows syphilis AOE responses on the View Details modal

Additional Information

  • The GraphQL change is backwards compatible for any old cached frontends since the AOE data will still be available from that query at the top level as well as within the new surveyData object. A follow up PR will clean up the query to remove the loose AOE responses at the top level.

Testing

  • Deployed on dev6

Screenshots

image

@@ -295,12 +295,13 @@ type TestResult {
symptomOnset: LocalDate
genderOfSexualPartners: [String]
deviceType: DeviceType
results: [MultiplexResult]
results: [MultiplexResult!]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ This is so that the TestResult type plays well with getResultForDisease without having to break too much further down with how MultiplexResults aka MultiplexResult[] is defined. I think this is safe to say that even if we already allow results to be null or undefined, if we have a defined, non-null list for results, the members of that list should not be null or undefined. If there are any null safety concerns here I can opt for the other route of updating MultiplexResults to handle a list with nullable entries

@@ -24,33 +27,6 @@ import "./TestResultPrintModal.scss";
import { MULTIPLEX_DISEASES } from "../../constants";
import { formatGenderOfSexualPartnersForDisplay } from "../../../utils/gender";

type Result = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ Removing this loose type in favor of getting the type directly from the query below.

type QueriedTestResult = NonNullable<GetTestResultDetailsQuery>["testResult"];

Copy link
Collaborator

Choose a reason for hiding this comment

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

ooo nice! I prefer getting the types directly than defining/maintaining our own again!

@@ -199,11 +184,11 @@ export const DetachedTestResultDetailsModal = ({
)}
<DetailsRow
label="Pregnant?"
value={pregnancy && pregnancyMap[pregnancy]}
value={pregnancy && pregnancyMap[pregnancy as keyof Pregnancy]}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ Since we are now using the type from the query rather than the loose Result type previously defined, this as keyof is necessary so that it handles us using the string value as the key

removed={removed}
aria-describedby="result-detail-title"
/>
{isHIVResult && (
{(isHIVResult || isSyphilisResult) && (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ There will come a day where we need to update how we handle the display logic for which diseases should show which AOE options, but today is not that day (prioritizing getting syphilis feature out)

Copy link
Collaborator

Choose a reason for hiding this comment

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

This approach makes sense to me. Maybe we should make note that this is something we will have to scale differently for n diseases somewhere in the adding a disease doc that you've written?

firstName: OptionalString;
middleName: OptionalString;
lastName: OptionalString;
firstName?: OptionalString;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ Also a side effect of us using the type directly from the query - handling the possibility of one of the names in createdBy being null or undefined, but these are defined as OptionalString anyway so they can already have a value of null or undefined

@@ -314,7 +315,7 @@ type AskOnEntrySurvey {
symptoms: String
symptomOnset: LocalDate
noSymptoms: Boolean
genderOfSexualPartners: [String]
genderOfSexualPartners: [String!]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ similar to this comment

@mpbrown mpbrown marked this pull request as ready for review September 24, 2024 16:06
@mpbrown mpbrown changed the title Mike/8099 aoe on result detail Add syphilis AOE data on result View Details Sep 24, 2024
emyl3
emyl3 previously approved these changes Sep 24, 2024
Copy link
Collaborator

@emyl3 emyl3 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Tested on dev6!
Thank you for cleaning up types that we are using and making a decision not to refactor the aoe display logic in favor of getting this out quicker! I agree! 🙌

Left one non-blocking nit.

@@ -24,33 +27,6 @@ import "./TestResultPrintModal.scss";
import { MULTIPLEX_DISEASES } from "../../constants";
import { formatGenderOfSexualPartnersForDisplay } from "../../../utils/gender";

type Result = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ooo nice! I prefer getting the types directly than defining/maintaining our own again!

bobbywells52
bobbywells52 previously approved these changes Sep 25, 2024
Copy link
Collaborator

@bobbywells52 bobbywells52 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mpbrown mpbrown dismissed stale reviews from bobbywells52 and emyl3 via bbb2641 September 25, 2024 15:52
Copy link

sonarcloud bot commented Sep 25, 2024

Copy link
Collaborator

@emyl3 emyl3 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!!!

@mpbrown mpbrown added this pull request to the merge queue Sep 26, 2024
Merged via the queue into main with commit e5c2ccc Sep 26, 2024
36 checks passed
@mpbrown mpbrown deleted the mike/8099-aoe-on-result-detail branch September 26, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Syphilis] Add condition and new AOE questions to Results screen
3 participants