case type checks and update
Merge pull request #2014 from dimagi/cp-case-type

case type checks and update