make subcase reference correct parent
Merge pull request #4469 from dimagi/advanced_parent_ref

make subcase reference correct parent