Skip to content

Commit

Permalink
pre-appointment visit
Browse files Browse the repository at this point in the history
  • Loading branch information
Angie-540 committed Sep 20, 2023
1 parent 4811f99 commit 11af22e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions programs/scope-builder.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ function buildScope(dataDictionary) {
isPatientTransferredOut: false,
isFirstAMPATHHIVVisit: true,
qualifiesForStandardVisit: false,
isStandardDcVisit: false,
qualifiesMedicationRefillVisit: false,
lastCovidScreeningDate: '',
retroSpective: false,
screenedForCovidToday: false,
inPrediction: false
};

let isStandardDcVisit = false;

if (
dataDictionary.weeklyPredictedPatients &&
dataDictionary.weeklyPredictedPatients.length > 0
Expand Down Expand Up @@ -74,10 +75,16 @@ function buildScope(dataDictionary) {
if (result) {
isStandardDcVisit = true;
}
if (dataDictionary.dcQualifedVisits.qualifies_for_standard_visit === 1) {
if (
dataDictionary.dcQualifedVisits.qualifies_for_standard_visit === 1 ||
isStandardDcVisit
) {
scope.qualifiesForStandardVisit = true;
}
if (dataDictionary.dcQualifedVisits.qualifies_for_medication_refill === 1) {
if (
dataDictionary.dcQualifedVisits.qualifies_for_medication_refill === 1 &&
!isStandardDcVisit
) {
scope.qualifiesMedicationRefillVisit = true;
}
}
Expand Down

0 comments on commit 11af22e

Please sign in to comment.