Templates/Healthtech/Symptom-triage classifier (CDS)
Symptom-triage classifier (CDS)
Urgency-level classification per symptom-presentation. Always-human reviewer-gate on high-acuity outputs. Deterministic fallback to highest-risk default to prevent false-low-urgency triage.
What this template is
Pattern: classification of patient-reported symptoms into urgency tiers. Always-human reviewer-gate ensures any high-acuity classification reaches a clinician before downstream action. Closed-enum urgency + recommended-next-step output prevents free-text drift. Deterministic fallback to highest-risk urgency on failure — patient-safety conservatism. specHash + reviewerVerdict per L12 entry feed MDR Art. 83 post-market surveillance + AI Act Art. 14 oversight evidence.
The template
TypeScript · BSL-1.1 · License
import { RuntimeAISpec } from '@promethean/runtime-ai';
export const symptomTriageSpec: RuntimeAISpec = {
specId: 'symptom-triage-v1',
displayName: 'Symptom-triage classifier (CDS)',
description:
'Urgency-tier classification from patient-reported symptoms.',
category: 'classifier',
schemaVersion: 'promethean-runtime-ai-spec-1.0',
canonicalForm: 'v1',
inputSchema: {
fields: [
{ name: 'caseId', type: 'string', required: true,
redaction: 'hash-only' },
{ name: 'patientAgeBand', type: 'enum', required: true,
enumValues: ['under-18', '18-64', '65-plus'] },
// Symptom text never enters the chain raw — only its hash.
{ name: 'symptomNarrative', type: 'string', required: true,
maxLength: 2000, redaction: 'hash-only' },
{ name: 'vitalsAvailable', type: 'boolean', required: true },
{ name: 'priorConditionsCount', type: 'number', required: false,
min: 0, max: 50 },
],
},
outputSchema: {
fields: [
{ name: 'urgency', type: 'enum', required: true,
enumValues: [
'emergency-immediate',
'urgent-within-2h',
'same-day',
'routine-1-3d',
'self-care',
] },
{ name: 'recommendedNext', type: 'enum', required: true,
enumValues: [
'emergency-services',
'urgent-care',
'gp-same-day',
'gp-routine',
'self-care-guidance',
] },
{ name: 'redFlagsIdentified', type: 'string-list', required: false,
maxItems: 6, maxLength: 80 },
{ name: 'confidence', type: 'number', required: true,
min: 0, max: 1 },
],
},
promptTemplate: {
system:
'You are a clinical-triage decision-support assistant. ' +
'A clinician will review your output. ' +
'Default to higher urgency on uncertainty. ' +
'Flag red-flag symptoms (chest pain, sudden weakness, severe bleeding, etc.).',
user:
'Patient age band: {{patientAgeBand}}. ' +
'Vitals captured: {{vitalsAvailable}}. ' +
'Prior conditions: {{priorConditionsCount}}. ' +
'Symptom narrative: {{symptomNarrative}}.',
},
modelIdentity: {
provider: 'anthropic',
model: 'claude-sonnet-4-5',
version: '20250929',
},
reviewerGate: 'always-human',
maxLatencyMs: 4000,
fallbackBehavior: 'deterministic-default',
deterministicDefault: {
urgency: 'urgent-within-2h',
recommendedNext: 'urgent-care',
confidence: 0,
},
};
Regulations addressed
This template's configuration choices map to specific regulatory obligations. The substrate doesn't certify compliance — but the spec hash + reviewer-verdict + modelIdentity per L12 entry give you the evidence layer for these citations:
- ·MDR Annex VIII rule 11 — Class IIa+ CDS software
- ·EU AI Act Art. 6(1) — high-risk via MDR pathway
- ·AI Act Annex III §5(d) — emergency-triage AI
- ·HIPAA §164.312(b) — audit controls
Installation + usage
- Create a free Dev-tier workspace — API key + Ed25519 signing key issued instantly.
- Install the SDK:
npm install https://promethean.software/runtime-ai/latest.tgz. - Paste the template above into your codebase. Adjust
modelIdentity+ prompt for your context. - Call
runConstrainedAI(spec, input, { client, receiptLogPath, productId, signingKey })from your service code. For local testing passcreateMockRuntimeAIClient(spec); for production, an Anthropic / OpenAI / Azure adapter. - Verify the chain with the Apache-2.0 verifier.