def getProfileElementDesc(profileResources,resourceName,element):
    """
    Find the description of an element given the resource and element
    """
    try:
        # first extract topLevel resource name EX: Patient.Gender -> Patient
        topLevelResourceName = resourceName.split(".")[0]
        # get the block related to the topLevel resource name
        toplevel = [entry['resource']['snapshot']['element'] for entry in profileResources['entry'] if entry['resource']['name'].lower() == topLevelResourceName.lower()][0]
        # get the description from the topLevel block given the resource+element combination
        description = [entry['short'] for entry in toplevel if entry['id'].lower()==resourceName.lower()+"."+element.lower()][0]
    except Exception as e:
        # If no key matches the resource+element combination, setting description to the following:
        description = "UNABLE TO FIND RESOURCE/ELEMENT NAME"
    return description