Skip to content

Commit

Permalink
Merge pull request #1230 from TIP-Global-Health/develop
Browse files Browse the repository at this point in the history
WIP: Developments starting June 20, 2024
  • Loading branch information
anvmn authored Jul 28, 2024
2 parents 2f83c89 + 3c52a77 commit b03f1cb
Show file tree
Hide file tree
Showing 90 changed files with 39,003 additions and 23,783 deletions.
31 changes: 18 additions & 13 deletions .ddev/web-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@ FROM $BASE_IMAGE
RUN apt-get update || true
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests inotify-tools build-essential mime-support

# Download and install Python 2.7 and dependencies from Debian 11 (Bullseye)
ADD https://deb.debian.org/debian/pool/main/libf/libffi/libffi7_3.3-6_amd64.deb /tmp/
ADD https://deb.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_amd64.deb /tmp/
ADD https://deb.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_amd64.deb /tmp/
ADD https://deb.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_amd64.deb /tmp/
ADD https://deb.debian.org/debian/pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8+deb11u1_amd64.deb /tmp/
ADD https://deb.debian.org/debian/pool/main/p/python2.7/python2.7_2.7.18-8+deb11u1_amd64.deb /tmp/

# Install the downloaded packages
RUN dpkg -i /tmp/*.deb && rm /tmp/*.deb
RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then \
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests autoconf autotools-dev automake; \
wget https://deb.debian.org/debian/pool/main/libf/libffi/libffi7_3.3-6_arm64.deb -O /tmp/libffi7_arm64.deb && \
wget https://deb.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_arm64.deb -O /tmp/libssl1.1_arm64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_arm64.deb -O /tmp/libpython2.7-minimal_arm64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_arm64.deb -O /tmp/python2.7-minimal_arm64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8+deb11u1_arm64.deb -O /tmp/libpython2.7-stdlib_arm64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/python2.7_2.7.18-8+deb11u1_arm64.deb -O /tmp/python2.7_arm64.deb && \
dpkg -i /tmp/*.deb && rm /tmp/*.deb; \
else \
wget https://deb.debian.org/debian/pool/main/libf/libffi/libffi7_3.3-6_amd64.deb -O /tmp/libffi7_amd64.deb && \
wget https://deb.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_amd64.deb -O /tmp/libssl1.1_amd64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_amd64.deb -O /tmp/libpython2.7-minimal_amd64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_amd64.deb -O /tmp/python2.7-minimal_amd64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8+deb11u1_amd64.deb -O /tmp/libpython2.7-stdlib_amd64.deb && \
wget https://deb.debian.org/debian/pool/main/p/python2.7/python2.7_2.7.18-8+deb11u1_amd64.deb -O /tmp/python2.7_amd64.deb && \
dpkg -i /tmp/*.deb && rm /tmp/*.deb; \
fi

RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
# Elm - directly downloading the binary.
Expand All @@ -28,6 +36,3 @@ RUN npm -g config set user root
RUN npm install -g [email protected]
# Install svg2elm.
RUN npm install -g svg2elm
RUN if [ "$(uname -m)" = "aarch64" ]; then \
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests autoconf autotools-dev automake; \
fi
176 changes: 79 additions & 97 deletions client/src/assets/scss/_date-selector.scss
Original file line number Diff line number Diff line change
@@ -1,101 +1,83 @@
/*
DateSelector
*/

.date-selector-popup,
.ui.form .date-selector-popup {
background: $color-primary;
height: 100%;
padding: 40px 70px;
width: 100%;

p {
color: $color-white;
font-size: 22px;
font-weight: bold;
margin-bottom: 0;
text-align: center;
text-transform: uppercase;
}

select {
background-color: $color-white;
border-radius: 10px;
color: $color-text;
font-size: 2.5rem;
border: 2px solid $color-gray;
padding: 0 0.5em;
line-height: 0.5;
text-align: left;
height: 70px;
width: 100%;
}

.year {
float: left;
width: 35%;
margin-right: 110px;
}

.month {
float: left;
width: 45%;
}

.days {
padding-top: 120px;

table {
text-align: center;
width: 100%;

th {
color: $color-white;
text-transform: uppercase;
}

td {
background-color: $color-white;
border: 10px solid $color-primary;
border-radius: 24px;
color: $color-text;
font-size: 24px;
font-weight: bold;
height: 80px;
width: 80px;
}

td.date-selector--dimmed,
td.date-selector--disabled {
background-color: $color-lighter-gray;
color: $color-white;
}

td.date-selector--selected {
background-color: $color-black;
color: $color-white;

p {
border: 3px solid $color-white;
border-radius: 6px;
line-height: 64px;
}
}

}

}

.ui.button {
background: $color-white;
border-radius: 5px;
color: $color-text;
display: block;
margin-left: 30px;
margin-top: 30px;
width: 90%;
}
/* DateSelector */
.date-selector-popup, .ui.form .date-selector-popup {
background: #06b9ff;
height: 100%;
padding: 40px 70px;
width: 100%;
}
.date-selector-popup p, .ui.form .date-selector-popup p {
color: #fff;
font-size: 22px;
font-weight: bold;
margin-bottom: 0;
text-align: center;
text-transform: uppercase;
}
.date-selector-popup select, .ui.form .date-selector-popup select {
background-color: #fff;
border-radius: 10px;
color: #808080;
font-size: 2.5rem;
border: 2px solid #b1b1b1;
padding: 0 0.5em;
line-height: 0.5;
text-align: left;
height: 70px;
width: 100%;
}
.date-selector-popup .year, .ui.form .date-selector-popup .year {
float: left;
width: 35%;
margin-right: 110px;
}
.date-selector-popup .month, .ui.form .date-selector-popup .month {
float: left;
width: 45%;
}
.date-selector-popup .days, .ui.form .date-selector-popup .days {
padding-top: 120px;
}
.date-selector-popup .days table, .ui.form .date-selector-popup .days table {
text-align: center;
width: 100%;
}
.date-selector-popup .days table th, .ui.form .date-selector-popup .days table th {
color: #fff;
text-transform: uppercase;
}
.date-selector-popup .days table td, .ui.form .date-selector-popup .days table td {
background-color: #fff;
border: 10px solid #06b9ff;
border-radius: 24px;
color: #808080;
font-size: 24px;
font-weight: bold;
height: 80px;
width: 80px;
}
.date-selector-popup .days table td.date-selector--dimmed, .ui.form .date-selector-popup .days table td.date-selector--dimmed, .date-selector-popup .days table td.date-selector--disabled, .ui.form .date-selector-popup .days table td.date-selector--disabled {
background-color: #e6e6e6;
color: #fff;
}
.date-selector-popup .days table td.date-selector--selected, .ui.form .date-selector-popup .days table td.date-selector--selected {
background-color: #000;
color: #fff;
}
.date-selector-popup .days table td.date-selector--selected p, .ui.form .date-selector-popup .days table td.date-selector--selected p {
border: 3px solid #fff;
border-radius: 6px;
line-height: 64px;
}
.date-selector-popup .ui.button, .ui.form .date-selector-popup .ui.button {
background: #fff;
border-radius: 5px;
color: #808080;
display: block;
margin-left: 30px;
margin-top: 30px;
width: 90%;
}


.date-selector { font-size: 1em; width: 27em; height: 20em; line-height: 1em; background: #eeeeee; color: #333333; cursor: default; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }

Expand Down
3 changes: 1 addition & 2 deletions client/src/elm/App/Update.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1489,8 +1489,7 @@ subscriptions model =
let
checkDataWanted =
if model.scheduleDataWantedCheck then
[ Time.every 50 (always CheckDataWanted)
]
[ Time.every 50 (always CheckDataWanted) ]

else
[]
Expand Down
2 changes: 1 addition & 1 deletion client/src/elm/Backend/Measurement/Decoder.elm
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ decodeTuberculosisMeasurements =
succeed TuberculosisMeasurements
|> optional "tuberculosis_diagnostics" (decodeHead decodeTuberculosisDiagnostics) Nothing
|> optional "tuberculosis_dot" (decodeHead decodeTuberculosisDOT) Nothing
|> optional "tuberculosis_followUp" (decodeHead decodeTuberculosisFollowUp) Nothing
|> optional "tuberculosis_follow_up" (decodeHead decodeTuberculosisFollowUp) Nothing
|> optional "tuberculosis_health_education" (decodeHead decodeTuberculosisHealthEducation) Nothing
|> optional "tuberculosis_medication" (decodeHead decodeTuberculosisMedication) Nothing
|> optional "tuberculosis_referral" (decodeHead decodeTuberculosisReferral) Nothing
Expand Down
103 changes: 60 additions & 43 deletions client/src/elm/Backend/Update.elm
Original file line number Diff line number Diff line change
Expand Up @@ -6933,53 +6933,62 @@ generatePrenatalLabsTestAddedMsgs currentDate after test executionNote id =
|> RemoteData.toMaybe
|> Maybe.map
(\assembled ->
let
testExecuted =
testPerformedByExecutionNote executionNote
in
Maybe.map
(\( resultsId, measurement ) ->
let
updatedValue =
(\value ->
{ value
| performedTests =
if testExecuted then
EverySet.insert test value.performedTests
if
-- We allow Vitals recheck only during initial encounter.
-- At subsequent encounter, no need to retake blood preasure.
(test == Backend.Measurement.Model.TestVitalsRecheck)
&& (not <| List.isEmpty assembled.nursePreviousEncountersData)
then
[]

else
EverySet.remove test value.performedTests

-- When we have universal form, it's possible to change if test is performed
-- at lab, or at point of care.
-- Therefore, we need to make sure that test does not appear as completed,
-- which can happen, when nurse switches from point of care to lab.
, completedTests = EverySet.remove test value.completedTests
, resolutionDate = Date.add Days labExpirationPeriod currentDate
}
)
measurement.value
in
[ savePrenatalLabsResultsMsg id assembled.participant.person (Just resultsId) updatedValue ]
)
assembled.measurements.labsResults
|> Maybe.withDefault
(if testExecuted then
else
let
testExecuted =
testPerformedByExecutionNote executionNote
in
Maybe.map
(\( resultsId, measurement ) ->
let
resultsValue =
Backend.Measurement.Model.LabsResultsValue
(EverySet.singleton test)
EverySet.empty
(Date.add Days labExpirationPeriod currentDate)
False
Nothing
Nothing
in
[ savePrenatalLabsResultsMsg id assembled.participant.person Nothing resultsValue ]
updatedValue =
(\value ->
{ value
| performedTests =
if testExecuted then
EverySet.insert test value.performedTests

else
[]
else
EverySet.remove test value.performedTests

-- When we have universal form, it's possible to change if test is performed
-- at lab, or at point of care.
-- Therefore, we need to make sure that test does not appear as completed,
-- which can happen, when nurse switches from point of care to lab.
, completedTests = EverySet.remove test value.completedTests
, resolutionDate = Date.add Days labExpirationPeriod currentDate
}
)
measurement.value
in
[ savePrenatalLabsResultsMsg id assembled.participant.person (Just resultsId) updatedValue ]
)
assembled.measurements.labsResults
|> Maybe.withDefault
(if testExecuted then
let
resultsValue =
Backend.Measurement.Model.LabsResultsValue
(EverySet.singleton test)
EverySet.empty
(Date.add Days labExpirationPeriod currentDate)
False
Nothing
Nothing
in
[ savePrenatalLabsResultsMsg id assembled.participant.person Nothing resultsValue ]

else
[]
)
)
|> Maybe.withDefault []

Expand Down Expand Up @@ -7042,12 +7051,20 @@ generatePrenatalLabsResultsAddedMsgs currentDate isLabTech after test testPrereq

else
value.reviewState

resolutionDate =
if not isLabTech && allLabsCompleted then
currentDate

else
value.resolutionDate
in
{ value
| performedTests = updatedPerformedTests
, completedTests = updatedCompletedTests
, testsWithFollowUp = updatedTestsWithFollowUp
, reviewState = reviewState
, resolutionDate = resolutionDate
}
)
results.value
Expand Down
11 changes: 6 additions & 5 deletions client/src/elm/Pages/AcuteIllness/Activity/Utils.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2304,10 +2304,11 @@ covid19SuspectDiagnosed measurements =
)
|> Maybe.withDefault 0

excludesGeneral =
[ SymptomGeneralFever, NoSymptomsGeneral ] ++ symptomsGeneralDangerSigns

generalSymptomsCount =
let
excludesGeneral =
[ SymptomGeneralFever, NoSymptomsGeneral ] ++ symptomsGeneralDangerSigns
in
countGeneralSymptoms measurements excludesGeneral

respiratorySymptomsCount =
Expand Down Expand Up @@ -2356,9 +2357,9 @@ covid19DiagnosisPath : NominalDate -> Person -> Bool -> AcuteIllnessMeasurements
covid19DiagnosisPath currentDate person isChw measurements =
if
(not <| covid19SuspectDiagnosed measurements)
|| -- In case we have cought symptom for more than 2 weeks,
|| -- In case we have cough symptom for more than 2 weeks,
-- we must diagnose Tuberculosis suspect.
-- Therefore, we need to exit COVID19 path/
-- Therefore, we need to exit COVID19 path.
coughForMoreThan2Weeks measurements
then
Nothing
Expand Down
Loading

0 comments on commit b03f1cb

Please sign in to comment.