def get_latest_analysis(case, analysis_type):
    """Get the latest analysis of anaöysis_type from one case"""

    all_analysis = case.get(analysis_type)
    if all_analysis:
        latest_analysis = all_analysis[0]
        for analysis in all_analysis:
            # analysis allways contains the key 'added'
            if analysis.get('added') > latest_analysis.get('added'):
                latest_analysis = analysis
        return latest_analysis
    return {}