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

ANC Review - requirements changes #1352

Merged
merged 3 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions client/src/elm/Backend/Measurement/Model.elm
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,17 @@ type MedicalHistorySign
| HypertensionBeforePregnancy
| RenalDisease
| NoMedicalHistorySigns
-- Sign is kept as legacy value, to preserve data recorded during encounters,
-- before it was split into 2 signs at MedicalHistoryPhysicalCondition.
| UterineMyoma
-- Sign is kept as legacy value, to preserve data recorded during encounters,
-- before it was replaced by MedicalHistoryMentalHealthIssue signs.
| MentalHealthHistory
-- @todo: Below signs are deprecated. Can be removed around January 2025.
| BowedLegs
| UterineMyoma
| HIV
| TuberculosisPast
| TuberculosisPresent
| MentalHealthHistory


type MedicalHistoryPhysicalCondition
Expand Down
28 changes: 18 additions & 10 deletions client/src/elm/Pages/Prenatal/Encounter/Utils.elm
Original file line number Diff line number Diff line change
Expand Up @@ -934,10 +934,14 @@ generateMedicalDiagnosisAlertData language currentDate measurements diagnosis =
in
case diagnosis of
DiagnosisUterineMyoma ->
generateAlertForDiagnosis .physicalConditions
[ Backend.Measurement.Model.PhysicalConditionUterineMyomaCurrent
, Backend.Measurement.Model.PhysicalConditionUterineMyomaSurgicalResection
]
Maybe.Extra.or
(generateAlertForDiagnosis .physicalConditions
[ Backend.Measurement.Model.PhysicalConditionUterineMyomaCurrent
, Backend.Measurement.Model.PhysicalConditionUterineMyomaSurgicalResection
]
)
-- Support for legacy value.
(generateAlertForDiagnosis .signs [ Backend.Measurement.Model.UterineMyoma ])

Backend.PrenatalActivity.Model.DiagnosisDiabetes ->
generateAlertForDiagnosis .signs [ Backend.Measurement.Model.Diabetes ]
Expand Down Expand Up @@ -967,12 +971,16 @@ generateMedicalDiagnosisAlertData language currentDate measurements diagnosis =
generateAlertForDiagnosis .infectiousDiseases [ Backend.Measurement.Model.InfectiousDiseasesHIV ]

DiagnosisMentalHealthHistory ->
generateAlertForDiagnosis .mentalHealthIssues
[ Backend.Measurement.Model.MentalHealthIssueGeneralDepression
, Backend.Measurement.Model.MentalHealthIssuePerinatalDepression
, Backend.Measurement.Model.MentalHealthIssueSchizophrenia
, Backend.Measurement.Model.MentalHealthIssueTrauma
]
Maybe.Extra.or
(generateAlertForDiagnosis .mentalHealthIssues
[ Backend.Measurement.Model.MentalHealthIssueGeneralDepression
, Backend.Measurement.Model.MentalHealthIssuePerinatalDepression
, Backend.Measurement.Model.MentalHealthIssueSchizophrenia
, Backend.Measurement.Model.MentalHealthIssueTrauma
]
)
-- Support for legacy value.
(generateAlertForDiagnosis .signs [ Backend.Measurement.Model.MentalHealthHistory ])


calculateBmi : Maybe Float -> Maybe Float -> Maybe Float
Expand Down
37 changes: 36 additions & 1 deletion client/src/elm/Pages/Prenatal/ProgressReport/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,43 @@ viewObstetricHistoryPane language currentDate measurements =
)
|> Maybe.withDefault []

obsetricHistoryStep2 =
Copy link
Collaborator

@AronNovak AronNovak Oct 11, 2024

Choose a reason for hiding this comment

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

Suggested change
obsetricHistoryStep2 =
obstetricHistoryStep2 =

For the sake of well written English names.
image

I guess it appears like this at a few places.

getMeasurementValueFunc measurements.obstetricHistoryStep2
|> Maybe.map
(\value ->
if EverySet.member Backend.Measurement.Model.CSectionInPast value.previousDelivery then
Maybe.andThen (EverySet.toList >> List.head) value.cSectionReason
|> Maybe.map
(\cSectionReason ->
let
previousDeliveryMethod =
if EverySet.member Backend.Measurement.Model.CSectionInPreviousDelivery value.previousDelivery then
translate language Translate.CSection

else
translate language Translate.VaginalDeliveryLabel
in
[ translate language Translate.CSectionFor
++ " "
++ String.toLower (translate language <| Translate.CSectionReasons cSectionReason)
++ " "
++ translate language Translate.WithMostRecentDeliveryBy
++ " "
++ String.toLower previousDeliveryMethod
++ "."
]
)
|> Maybe.withDefault []

else
[]
)
|> Maybe.withDefault []

content =
List.map (\alert -> li [] [ text alert ]) obsetricHistory
obsetricHistory
++ obsetricHistoryStep2
|> List.map (\alert -> li [] [ text alert ])
|> ul []
|> List.singleton
in
Expand Down
14 changes: 14 additions & 0 deletions client/src/elm/Translate.elm
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ type TranslationId
| ConvulsionsAndUnconsciousPreviousDelivery
| ConvulsionsPreviousDelivery
| CSection
| CSectionFor
| CSectionScar CSectionScar
| CurrentMedication
| Dashboard Dashboard
Expand Down Expand Up @@ -1895,6 +1896,7 @@ type TranslationId
| WhatWasTheirResponse
| WhoCaresForTheChildDuringTheDay
| WhoInFamilyHasCondition
| WithMostRecentDeliveryBy
| WhyNot
| WrittenProtocolsFollowed
| Year
Expand Down Expand Up @@ -4414,6 +4416,12 @@ translationSet trans =
, kirundi = Nothing
}

CSectionFor ->
{ english = "C-Section for"
, kinyarwanda = Nothing
, kirundi = Nothing
}

CSectionScar scar ->
case scar of
Vertical ->
Expand Down Expand Up @@ -23649,6 +23657,12 @@ translationSet trans =
, kirundi = Just "Ninde mu muryango iwanyu ameze uku/afise ingorane nk'iyi/afise ikibazo nk'iki"
}

WithMostRecentDeliveryBy ->
{ english = "with most recent delivery by"
, kinyarwanda = Nothing
, kirundi = Nothing
}

WhyNot ->
{ english = "Why not"
, kinyarwanda = Just "Kubera iki"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ function hedley_prenatal_migrate_medical_history($node) {

$migrated_values_physical_condition = [];
$physical_condition_migration = [
'uterine-myonma',
'bowed-legs',
];

Expand All @@ -132,21 +131,13 @@ function hedley_prenatal_migrate_medical_history($node) {

foreach ($node->field_medical_history[LANGUAGE_NONE] as $index => $item) {
if (in_array($item['value'], $physical_condition_migration)) {
if ($item['value'] == 'uterine-myonma') {
$migrated_values_physical_condition[] = ['value' => 'uterine-myonma-current'];
}
else {
$migrated_values_physical_condition[] = $item;
}
$migrated_values_physical_condition[] = $item;
unset($node->field_medical_history[LANGUAGE_NONE][$index]);
}
elseif (in_array($item['value'], $infectious_disease_migration)) {
$migrated_values_infectious_disease[] = $item;
unset($node->field_medical_history[LANGUAGE_NONE][$index]);
}
elseif ($item['value'] == 'mental-health-history') {
unset($node->field_medical_history[LANGUAGE_NONE][$index]);
}
}
if (empty($node->field_medical_history[LANGUAGE_NONE])) {
$node->field_medical_history[LANGUAGE_NONE][0]['value'] = 'none';
Expand Down