Evidence-claim contradiction review¶
openmed.clinical.claim_conflicts provides a deterministic, local-only review boundary for summary claims. A claim cites synthetic or caller-owned evidence IDs; assertion, temporal, and source-integrity records are joined by those IDs and incompatible evidence is routed to human review. The module never chooses which clinical statement is true.
from openmed.clinical import review_claim_conflicts
report = review_claim_conflicts(
claims=[
{
"claim_id": "claim-1",
"expected_assertion": "affirmed",
"evidence_ids": ["evidence-a", "evidence-b"],
}
],
assertion_records=[
{"record_id": "evidence-a", "assertion": "affirmed"},
{"record_id": "evidence-b", "assertion": "negated"},
],
temporal_records=[
{
"record_id": "evidence-a",
"interval": {"start": "2026-01-01", "end": "2026-01-02"},
},
{
"record_id": "evidence-b",
"interval": {"start": "2026-03-01", "end": "2026-03-02"},
},
],
source_integrity_records=[
{"record_id": "evidence-a", "status": "verified"},
{"record_id": "evidence-b", "status": "mismatch"},
],
)
assert report.review_state == "review_required"
assert "assertion_conflict" in report.claims[0].review_routes
The report exposes deterministic SHA-256 identifiers, counts, fixed review routes, and SHA-256/HMAC-SHA-256 fingerprints. Caller-supplied IDs are hashed before they enter typed records because IDs can contain patient values. to_dict() and to_json() omit source text, excerpts, and temporal values, so they are suitable for an audit queue or counts-only operational summary. Unknown assertion and integrity strings become the fixed unknown state; private interval values are also excluded from record representations. Missing records, unverified sources, hash mismatches, incompatible assertion states, and disjoint intervals all require review. A clear result means only that these local consistency checks found no contradiction in the supplied, enabled evidence lanes; it is not a clinical conclusion or proof that unchecked lanes are valid. Claims with no enabled evidence checks, or unknown assertion records in an enabled lane, require review. Each reference is compared with its own expected interval (falling back to the claim expectation); inverted intervals are rejected, not reordered. Hypothetical and uncertain assertion axes cannot become affirmed solely because their negation axis is affirmative. Conflicting source-integrity status aliases are rejected rather than accepting whichever appears first.
The function performs no mandatory network call, reads no environment state, and emits no logs. Callers remain responsible for supplying synthetic or otherwise authorized records and for qualified clinical review before any use.