def process_covid_json_data(local_json: dict, national_json: dict) -> dict:
    """Returns a dictionary of specified metrics based on the JSON files of local and national COVID data

    The specified metrics are: total cumulative deaths, current hospital cases, the 7-day infection rate for the
    national data set, and the 7-day infection rate for the local data set
    """

    deaths_total = None
    hospitalCases = None
    national_7day_infections = 0
    local_7day_infections = 0

    counter = 0
    skipped_first_day = False
    for date in national_json.keys():
        current_data = national_json[date]

        # For cumDeaths and hospitalCases, find the first non-empty cells and use these values
        if current_data["cumDeaths"] is not None and deaths_total is None:
            deaths_total = current_data["cumDeaths"]

        if current_data["hospitalCases"] is not None and hospitalCases is None:
            hospitalCases = current_data["hospitalCases"]

        # Add up all the non-empty rows of 'newCases' until we have 7 (ie a week's worth of data)
        if current_data["newCases"] is not None and counter < 7:
            # Skip first day of COVID data as it is incomplete
            if skipped_first_day:
                national_7day_infections += current_data["newCases"]
                counter += 1
            else:
                skipped_first_day = True

    counter = 0
    skipped_first_day = False
    for date in local_json.keys():
        current_data = local_json[date]

        if current_data["newCases"] is not None and counter < 7:
            if skipped_first_day:
                local_7day_infections += current_data["newCases"]
                counter += 1
            else:
                skipped_first_day = True

    covid_data_dictionary = {
        "local_7day_infections": local_7day_infections,  # local case total in the last 7 days

        "national_7day_infections": national_7day_infections,  # national case total in the last 7 days
        "hospitalCases": hospitalCases,  # current amount of hospitalised cases
        "deaths_total": deaths_total,  # current amount of cumulative deaths
    }

    return covid_data_dictionary