def METHOD_NAME(study: FileStudy, adq_patch_config: JSON) -> Dict[str, bool]:
    area_to_turn_on: List[str] = [transform_name_to_id(area_id) for area_id in adq_patch_config.get("areas", [])]
    original_area_enabled: Dict[str, bool] = {}
    original_link_enabled: Dict[str, bool] = {}
    year_by_year_active = study.tree.get(["settings", "generaldata", "general", "year-by-year"])
    study.tree.save(True, ["settings", "generaldata", "general", "year-by-year"])
    for area_id, area in study.config.areas.items():
        # areas
        original_area_enabled[area_id] = "hourly" in area.filters_year
        if not original_area_enabled[area_id] and area_id in area_to_turn_on:
            study.tree.save(
                ", ".join([*area.filters_year, "hourly"]),
                [
                    "input",
                    "areas",
                    area_id,
                    "optimization",
                    "filtering",
                    "filter-year-by-year",
                ],
            )
        # links
        for area_2, link in area.links.items():
            link_id = f"{area_id} - {area_2}"
            original_link_enabled[link_id] = "hourly" in link.filters_year
            if not original_link_enabled[link_id] and (area_id in area_to_turn_on or area_2 in area_to_turn_on):
                study.tree.save(
                    ", ".join([*link.filters_year, "hourly"]),
                    [
                        "input",
                        "links",
                        area_id,
                        "properties",
                        area_2,
                        "filter-year-by-year",
                    ],
                )
    with db():
        with open(
            study.config.study_path / "user" / "adequacypatch" / "hourly-areas.yml",
            "w",
        ) as fh:
            yaml.dump(original_area_enabled, fh)
        with open(
            study.config.study_path / "user" / "adequacypatch" / "hourly-links.yml",
            "w",
        ) as fh:
            yaml.dump(original_link_enabled, fh)
        if year_by_year_active:
            with open(
                study.config.study_path / "user" / "adequacypatch" / "year-by-year-active",
                "w",
            ) as fh:
                fh.write("True")
    return original_area_enabled