From 2b5ae2037e97160ecfdc5900661e3dcd8576bdd4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 04:32:07 +0000 Subject: [PATCH] Cache PMID:20301328 and keep PMID:31909928 exempt after a re-fetch Lesch-Nyhan_Syndrome cites PMID:20301328 (GeneReviews, HPRT1 Disorders) three times, but its cache file was never committed, so a fresh checkout fetched it over the network on every validation run. PMID:31909928 is a NICE guideline with no personal authors. The cache check exempts it on the 'National Institute for Health and Care Excellence: Guidelines.' line in its body, but the current fetcher no longer writes that line, so a forced re-fetch would fail the check with no body marker left to match. Add a short vetted list of corporate-author monographs, checked by hand, that pass regardless of body format. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UDqeWsdcTfKeW7LriK6a9f --- references_cache/PMID_20301328.md | 28 +++++++++++++++ src/dismech/reference_cache_frontmatter.py | 15 ++++++++ tests/test_reference_cache_frontmatter.py | 41 ++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 references_cache/PMID_20301328.md diff --git a/references_cache/PMID_20301328.md b/references_cache/PMID_20301328.md new file mode 100644 index 00000000000..b8a8d83ea8b --- /dev/null +++ b/references_cache/PMID_20301328.md @@ -0,0 +1,28 @@ +--- +reference_id: PMID:20301328 +extractor_version: 1 +title: HPRT1 Disorders. +authors: +- Adam MP +- Bick S +- Mirzaa GM +- Wallace SE +- Amemiya A +- Jinnah HA +year: '1993' +content_type: abstract_only +full_text_declined: bookshelf_archive_not_configured +--- + +# HPRT1 Disorders. +**Authors:** Adam MP, Bick S, Mirzaa GM, Wallace SE, Amemiya A, Jinnah HA + +## Content + +CLINICAL CHARACTERISTICS: HPRT1 disorders, caused by deficiency of the enzyme hypoxanthine-guanine phosphoribosyltransferase (HGprt), are typically associated with clinical evidence for overproduction of uric acid (hyperuricemia, nephrolithiasis, and/or gouty arthritis) and varying degrees of neurologic and/or behavioral problems. Historically, three phenotypes were identified in the spectrum of HPRT1 disorders: Lesch-Nyhan disease (LND) at the most severe end with motor dysfunction resembling severe cerebral palsy, intellectual disability, and self-injurious behavior; HPRT1-related neurologic dysfunction (HND) in the intermediate range with similar but fewer severe neurologic findings than LND and no self-injurious behavior; and HPRT1-related hyperuricemia (HRH) at the mild end without overt neurologic deficits. It is now recognized that these neurobehavioral phenotypes cluster along a continuum from severe to mild. + +DIAGNOSIS/TESTING: The diagnosis of an HPRT1 disorder is established in a male proband with suggestive clinical and laboratory findings and a hemizygous pathogenic variant in HPRT1 identified by molecular genetic testing and/or low HGprt enzyme activity identified on biochemical testing. + +MANAGEMENT: Treatment of manifestations: Hyperuricemia is most commonly treated with the xanthine oxidase inhibitor allopurinol to reduce the risk for nephropathy, gouty arthritis, and tophi. Febuxostat may be used in case of allopurinol hypersensitivity. Multidisciplinary specialists may be needed to manage the neurologic manifestations. Depending on needs, specialists in medical genetics, neurology, behavioral management, developmental pediatrics, physical medicine and rehabilitation, physical therapy, occupational therapy, speech-language pathology, dentistry, and nephrology may be required. Surveillance: HPRT1 disorders are not clinically progressive; however, surveillance is important for all HPRT1 disorders. While overproduction of uric acid does not get worse with time, chronic overproduction of uric acid – especially if not well controlled – may lead to cumulative pathology in the kidneys and/or joints. Similarly, new or worsening neurologic problems are not expected over time; however, some evolution of the neurologic problems occurs in the first few years of life, which reflects development of the nervous system in response to a static insult. Agents/circumstances to avoid: Probenecid and other drugs that increase the risk for precipitation of uric acid in the urinary system and may cause acute renal failure; certain chemotherapy agents, such as methotrexate, that block synthesis or use of purines; periods of relative dehydration because they increase the risk for renal stones or urate nephropathy. Evaluation of relatives at risk: It is appropriate to clarify the status of males at risk for HPRT1 disorders immediately after birth in order to identify as early as possible those who would benefit from prompt initiation of xanthine oxidase inhibitors and anticipation of future needs. + +GENETIC COUNSELING: HPRT1 disorders are X linked. The risk to sibs of a male proband depends on the genetic status of the mother. If the mother of the proband has an HPRT1 variant, the chance of transmitting it in each pregnancy is 50%: males who inherit a pathogenic HPRT1 variant will be affected. Females who inherit the pathogenic variant will be heterozygotes and will virtually always be clinically normal. If the proband represents a simplex case (i.e., a single occurrence in a family) and if the proband has a known HPRT1 variant that cannot be detected in his mother’s leukocyte DNA, the risk to sibs is low but greater than that of the general population because of the possibility of maternal mosaicism. Once an HPRT1 pathogenic variant has been identified in an affected family member, heterozygote testing for females and prenatal/preimplantation genetic testing are possible. \ No newline at end of file diff --git a/src/dismech/reference_cache_frontmatter.py b/src/dismech/reference_cache_frontmatter.py index 4e49ee4e790..4123d78d913 100644 --- a/src/dismech/reference_cache_frontmatter.py +++ b/src/dismech/reference_cache_frontmatter.py @@ -63,6 +63,19 @@ # trips the contract. See issue #6607 (PMID:31909928, a NICE guideline, was a # false-positive fabrication flag). _AGENCY_GUIDELINE_RE = re.compile(r"(?m)^.{2,120}:[ \t]*Guidelines\.[ \t]*$") +# Corporate-author monographs whose current fetcher output carries no marker at +# all. linkml-reference-validator's newer body format writes only the title and +# abstract, dropping the publisher and collection lines the two patterns above +# match, and a corporate author is not written to ``authors:``. So a forced +# re-fetch of one of these records turns it into a #1737 false positive that no +# body pattern can recognise. Each entry was checked by hand against PubMed as a +# real agency monograph with no personal authors; add one only after the same +# check. A record cached in the older format still passes on its body marker. +_VETTED_CORPORATE_MONOGRAPHS = frozenset( + { + "PMID:31909928", # NICE NG144, Cannabis-based medicinal products (#6607) + } +) class SupplementaryFileFrontmatter(BaseModel): @@ -263,6 +276,8 @@ def check_cache_file(path: Path) -> Finding | None: ) except OSError: is_monograph = False + if str(data.get("reference_id", "")).strip() in _VETTED_CORPORATE_MONOGRAPHS: + is_monograph = True reasons = _validate_contract(path, data, is_monograph=is_monograph) if not reasons: return None diff --git a/tests/test_reference_cache_frontmatter.py b/tests/test_reference_cache_frontmatter.py index 18815fbcf76..c0d71f15b19 100644 --- a/tests/test_reference_cache_frontmatter.py +++ b/tests/test_reference_cache_frontmatter.py @@ -290,6 +290,47 @@ def test_pmid_cache_agency_guideline_monograph_is_accepted(tmp_path: Path): assert check_cache_file(good) is None +def test_vetted_monograph_in_the_current_fetcher_format_is_accepted(tmp_path: Path): + """The current fetcher writes PMID:31909928 with a title and abstract only: + no publisher line, no collection line, no authors, no journal. It is on the + vetted list, so a forced re-fetch does not turn it into a false positive.""" + good = tmp_path / "PMID_31909928.md" + good.write_text( + "---\n" + "reference_id: PMID:31909928\n" + "extractor_version: 1\n" + "title: Cannabis-based medicinal products\n" + "year: '2021'\n" + "content_type: abstract_only\n" + "---\n\n" + "# Cannabis-based medicinal products\n\n" + "## Content\n\n" + "UNLABELLED: This guideline covers prescribing of cannabis-based " + "medicinal products.\n", + encoding="utf-8", + ) + assert check_cache_file(good) is None + + +def test_unvetted_record_in_the_same_format_still_fails(tmp_path: Path): + """The vetted list names records; it does not exempt the format.""" + bad = tmp_path / "PMID_99999999.md" + bad.write_text( + "---\n" + "reference_id: PMID:99999999\n" + "extractor_version: 1\n" + "title: Some guideline\n" + "year: '2021'\n" + "content_type: abstract_only\n" + "---\n\n" + "# Some guideline\n\n## Content\n\nText.\n", + encoding="utf-8", + ) + finding = check_cache_file(bad) + assert finding is not None + assert any("fabrication fingerprint" in r for r in finding.reasons) + + def test_pmid_cache_with_only_journal_is_accepted(tmp_path: Path): """Pre-abstract-era and brief PubMed records often carry ``journal`` and ``year`` but no ``authors``. They are legitimate and must pass."""