Clinical knowledge engineering
Turning Clinical Guidelines into Computable Rules: Where LLMs Help and Where They Should Not Decide
Why guidelines are hard to compute
A guideline recommendation reads like a rule, but it carries context: the population it applies to, the evidence level, exceptions, timing and sometimes deliberate ambiguity. Two guidelines may disagree. A local consensus may adapt both. Turning this into software that evaluates real patients requires decisions that are clinical, not technical.
A workable division of labour
| Task | Language model | Explicit rules and people |
|---|---|---|
| Find recommendations in a long document | Drafting assistance | Expert confirms completeness |
| Draft a structured rule from a sentence | Useful first draft | Expert approves wording and conditions |
| Map terms to codes (e.g. SNOMED CT, LOINC) | Useful suggestions | Terminology owner confirms |
| Evaluate a patient against the rule | Not as the decision-maker | Versioned rule engine with tests |
| Explain the result in plain language | Draft an explanation grounded in the rule trace | Reviewer checks the trace |
In this pattern the model accelerates knowledge engineering and explanation; the evaluation itself is deterministic and auditable. This is one practical form of a neuro-symbolic architecture.
Properties every computable rule should have
- Source link to the exact recommendation text and document version.
- Population and conditions stated as explicit inputs, with units and time windows.
- Behaviour for missing or stale inputs, returning "cannot evaluate" rather than a default.
- Version and owner, with a change log reviewed by a clinical owner.
- Test cases that cover typical patients, edge cases and missing data.
Representations that work
Teams succeed with different formats. Decision tables are readable by clinicians. Rule code with unit tests is easy for engineers. Ontology-based approaches (OWL for concepts, SHACL for constraints, SWRL or similar for rules) make relationships and terminology explicit and support consistency checking across many rules. A longitudinal patient model, which tracks how states change over time, is often needed for rules that depend on sequences of events.
Choose the representation your team can review and maintain. The worst choice is the implicit one: rules hidden in prompts or in model weights.
Keep the reasoning trace
When a rule fires, store which inputs it used, their states and sources, which rule version ran and what it concluded. A reviewer should be able to read this trace. A language model can turn it into a short explanation, but the trace remains the record. See how missing is not zero for how input states should flow into these traces.
Validation stays clinical
Engineering can show that rules behave as specified on agreed cases. Whether those rules are appropriate for a population, and whether the software can be used in care, are questions for qualified clinical owners and, where applicable, regulatory processes. Good engineering makes those reviews easier by keeping everything explicit.
If you are turning guidelines or consensus documents into product logic and want to discuss the knowledge model, send us a short description.
Technical reference
W3C SHACL defines constraints for RDF data validation. Constraint validation alone does not establish clinical applicability or validate a clinical recommendation.
Questions & answers
Can a language model read a guideline and apply it to patients directly?
It can produce plausible output, but it is hard to test, version or audit, and it may blend recommendations from different contexts. Use it to draft structured rules that experts review, then run the reviewed rules.
What format should computable rules use?
Whatever your team can test and maintain: decision tables, rule code with unit tests, or ontology-based representations such as OWL with SHACL or SWRL. The key properties are explicit conditions, versions and source links.
How do you handle conflicting guidelines?
Represent each source and its applicability explicitly, and surface the conflict to the reviewer rather than resolving it silently. Resolution rules, if any, are clinical decisions that need owners.
What about patients with missing data?
Each rule should declare which inputs it needs and return 'cannot evaluate' when they are missing or stale, so the gap is visible.
