From 11af22e7af7eb2bf27222953f112fd9f68fba17a Mon Sep 17 00:00:00 2001 From: Angie-540 Date: Wed, 20 Sep 2023 17:07:45 +0300 Subject: [PATCH] pre-appointment visit --- programs/scope-builder.service.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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; } }