chore: mdm_pass check reports sections that say nothing
A section that promises an answer and then says 'No presentation details are available' is worse than a missing one. Reported rather than refused: a one-line prognosis is often the whole honest answer, so the length alone cannot decide it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
This commit is contained in:
parent
9b7ab72038
commit
d78a8b7ee8
1 changed files with 13 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue