ICTatRTI / coconut-analytics

Browserified & backboned version of coconut-reports
Other
2 stars 3 forks source link

Broken Weekly Facility Report #265

Closed scloo closed 7 years ago

scloo commented 7 years ago

HTMLHelpers.coffee:37 Uncaught (in promise) TypeError: Cannot read property 'length' of undefined(…)

scloo commented 7 years ago

There is no "Facility Followed-Up Positive Cases" attribute in data, and hence passing undefined to the createDisaggregatableCaseGroup function. Which broke the code.

Fixed by testing if there is a "Facility Followed-Up Positive Cases" field in data before passing to the createDisaggregatableCaseGroup function.

There doesn't seem to be any "Facility Followed-Up Positive Cases" field in data. Why this is so, needs to be checked into. Is it because there is no calculated value or none was calculated?

scloo commented 7 years ago

@mikeymckay Need you to verify the above comments.

scloo commented 7 years ago

There is only "Facility Followed-Up Positive Cases" if the report aggregation is by Facility. Hence the fix applied took care of the Error thrown.