diff --git a/programs/scope-builder.service.js b/programs/scope-builder.service.js index 1d243e8e4..0fb9857c0 100755 --- a/programs/scope-builder.service.js +++ b/programs/scope-builder.service.js @@ -12,7 +12,6 @@ function buildScope(dataDictionary) { isPatientTransferredOut: false, isFirstAMPATHHIVVisit: true, qualifiesForStandardVisit: false, - isStandardDcVisit: false, qualifiesMedicationRefillVisit: false, lastCovidScreeningDate: '', retroSpective: false, @@ -20,6 +19,8 @@ function buildScope(dataDictionary) { inPrediction: false }; + let isStandardDcVisit = false; + if ( dataDictionary.weeklyPredictedPatients && dataDictionary.weeklyPredictedPatients.length > 0 @@ -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; } }