Skip to content

Commit

Permalink
Fix Discordant Couple status logic
Browse files Browse the repository at this point in the history
  • Loading branch information
anvmn committed Oct 21, 2024
1 parent added61 commit 7b6dac9
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions client/src/elm/Pages/Prenatal/ProgressReport/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -933,17 +933,31 @@ viewMedicalDiagnosisPane language currentDate isChw firstNurseEncounterMeasureme
in
if patientHIVNegative then
getMeasurementValueFunc encounterData.measurements.partnerHIVTest
|> Maybe.andThen .hivSigns
|> Maybe.map
(\hivSigns ->
|> Maybe.andThen
(\value ->
let
takingARV =
EverySet.member PartnerTakingARV hivSigns

surpressedViralLoad =
EverySet.member PartnerSurpressedViralLoad hivSigns
partnerHIVPositive =
(value.executionNote == TestNoteKnownAsPositive)
|| (List.member value.executionNote [ TestNoteRunToday, TestNoteRunPreviously ]
&& (value.testResult == Just TestPositive)
)
in
Translate.DiscordantCoupleStatus takingARV surpressedViralLoad
if partnerHIVPositive then
Maybe.map
(\hivSigns ->
let
takingARV =
EverySet.member PartnerTakingARV hivSigns

surpressedViralLoad =
EverySet.member PartnerSurpressedViralLoad hivSigns
in
Translate.DiscordantCoupleStatus takingARV surpressedViralLoad
)
value.hivSigns

else
Nothing
)

else
Expand Down

0 comments on commit 7b6dac9

Please sign in to comment.