properly cast case types in helper functions and add helper + test
Merge pull request #963 from dimagi/commtrack-reqs

properly cast case types in helper functions and add helper + test