-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
Describe the bug
Rule build using the rule builder is failing with error: "Cannot read property 'findObservation' of undefined". The issue occurs because in RuleCondition, an individual object is being passed to the context instead of a programEncounter object while trying to write Program Encounter Eligibility Rule.
To Reproduce
- Go to the Program Encounte Eligibility.
- Create a rule using the rule builder on the Program Enrolment.
- Save and test the rule.
- Rule fails with the error message.
Expected behavior
Rule should build successfully and execure.
Root Cause Analysis
- The rule appears to be failing while trying to execute
_obsFromEnrolmentmethod in RuleCondition.js file - In
_obsFromEnrolmentmethod enrolment is undefined and it is trying to callfindObservationon this undefined object. - The enrolment object is undefined because The
_getEnrolmentis returning undefined. - Because of this the rule is failing, by stating "Cannot read property 'findObservation' of undefined".
Screenshots
- Eligibility Rule:
2. Rule Failure Telemetry:

Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Triaged