def process_case_hierarchy(case_output, get_case_url, type_info):
    current_case = case_output['case']
    submit_url_root = reverse('receiver_post', args=[current_case.domain])
    form_url_root = reverse('cloudcare_main', args=[current_case.domain, ''])

    def process_output(case_output, depth=0):
        for c in case_output['child_cases']:
            process_output(c, depth=depth + 1)

        case = case_output['case']
        common_data = {
            'indent_px': depth * TREETABLE_INDENT_PX,
            'submit_url_root': submit_url_root,
            'form_url_root': form_url_root,
            'view_url': get_case_url(case.case_id),
            'session_data': get_session_data(case, current_case, type_info)
        }
        data = type_info.get(case.type, {})
        if data in 'description_property':
            data['description'] = getattr(
                    case, data['description_property'], None)
        if 'edit_session_data' in data:
            data['session_data'].update(data['edit_session_data'])
        data.update(common_data)

        case.edit_data = data

        if 'child_type' in data and not case.closed:
            child_type = data['child_type']
            child_data = type_info.get(child_type, {})
            child_data.update(common_data)
            child_data.update({
                "link_text": _("Add %(case_type)s") % {
                    'case_type': child_data.get('type_name', child_type)
                },
                "parent_node_id": case.case_id,
            })

            if 'create_session_data' in child_data:
                child_data['session_data'].update(child_data['create_session_data'])
            case.add_child_data = child_data

    process_output(case_output)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/casexml/apps/case/templatetags/case_tags.py/process_case_hierarchy/swapped operands of `in`