diff --git a/packages/openchs-android/src/service/RuleEvaluationService.js b/packages/openchs-android/src/service/RuleEvaluationService.js index 3fb199ae2..d4ead055f 100644 --- a/packages/openchs-android/src/service/RuleEvaluationService.js +++ b/packages/openchs-android/src/service/RuleEvaluationService.js @@ -489,8 +489,8 @@ class RuleEvaluationService extends BaseService { } checkIfScheduledVisitsAreValid(nextVisits) { - if (nextVisits.map(visit => _.isNil(visit.earliestVisitDateTime)).length > 0) { - throw new Error("Visit(s) scheduled without earliestVisitDateTime"); + if (_.some(nextVisits, visit => _.isNil(visit.earliestDate))) { + throw new Error("Visit(s) scheduled without earliestDate"); } }