-
Notifications
You must be signed in to change notification settings - Fork 53
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
Conversation
855c6a1
to
f97e6cd
Compare
@@ -295,12 +295,13 @@ type TestResult { | |||
symptomOnset: LocalDate | |||
genderOfSexualPartners: [String] | |||
deviceType: DeviceType | |||
results: [MultiplexResult] | |||
results: [MultiplexResult!] |
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.
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 = { |
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.
type QueriedTestResult = NonNullable<GetTestResultDetailsQuery>["testResult"];
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.
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]} |
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.
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) && ( |
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.
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.
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; |
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.
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!] |
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.
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.
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.
frontend/src/app/testResults/viewResults/actionMenuModals/TestResultDetailsModal.test.tsx
Outdated
Show resolved
Hide resolved
@@ -24,33 +27,6 @@ import "./TestResultPrintModal.scss"; | |||
import { MULTIPLEX_DISEASES } from "../../constants"; | |||
import { formatGenderOfSexualPartnersForDisplay } from "../../../utils/gender"; | |||
|
|||
type Result = { |
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.
ooo nice! I prefer getting the types directly than defining/maintaining our own again!
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!
Quality Gate passedIssues Measures |
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! Thank you!!!
BACKEND AND FRONTEND PULL REQUEST
Related Issue
Changes Proposed
GetTestResultDetails
queryAdditional Information
surveyData
object. A follow up PR will clean up the query to remove the loose AOE responses at the top level.Testing
Screenshots