diff --git a/backend/scripts/mdm_pass.py b/backend/scripts/mdm_pass.py index 046604b..1a448c5 100644 --- a/backend/scripts/mdm_pass.py +++ b/backend/scripts/mdm_pass.py @@ -257,12 +257,24 @@ def cmd_check(args) -> int: print(f" in medical-decision-making shape: {len(good)}") print(f" still free-form : {len(with_clinical) - len(good)}") if len(good) < len(with_clinical): - from collections import Counter titles = Counter(s.get("title") for a in with_clinical if not conforms(a) for s in clinical_of(a)) print("\n commonest titles still in use:") for title, count in titles.most_common(8): print(f" {count:4d} {title}") + + # A section that says nothing is worse than a missing one: the shape + # promises an answer and then does not give it. Reported so an editor + # can find them, not refused — a one-line prognosis is often the whole + # honest answer. + placeholder = re.compile(r"^(no |none|not available|not specified|unavailable)", re.I) + thin = [(a.title, s["title"], (s.get("content") or "").strip()) + for a in good for s in clinical_of(a) + if placeholder.match((s.get("content") or "").strip())] + if thin: + print(f"\n sections with nothing in them ({len(thin)}) — for an editor:") + for title, section, body in thin[:12]: + print(f" {title} / {section}: {body[:60]}") finally: db.close() return 0