{"skill":{"slug":"medical-priority-scorer","displayName":"Medical Priority Scorer","summary":"Score medical messages using urgency, sentiment, and patient context to produce priority rankings (P1/P2/P3).","description":"---\nname: medical-priority-scorer\ndescription: Score medical messages using urgency, sentiment, and patient context to produce priority rankings (P1/P2/P3).\nlicense: MIT\nmetadata:\n  author: \"NAPSTER AI\"\n  maintainer: \"NAPSTER AI\"\n  openclaw:\n    requires:\n      bins: []\n---\n\n# Medical Priority Scorer\n\nProduce deterministic priority scores for medical messages without mutating any state.\n\n## Quick Triggers\n\n- Rank messages by medical urgency for callback priority\n- Classify messages into P1/P2/P3 queue\n- Score follow-up priority from triaged messages\n\n## Recommended Chain\n\n`medical-triage -> medical-priority-scorer -> medical-entity-extractor`\n\n## Execute Workflow\n\n1. Accept input from medical-triage containing triaged messages\n2. Score each message with:\n   - `urgency_score` in range `[0, 1]` (based on triage category)\n   - `sentiment_score` in range `[-1, 1]` (anxiety, distress, frustration)\n   - `recency_score` in range `[0, 1]` (how recent the message is)\n   - `patient_context_score` in range `[0, 1]` (chronic conditions, known patient)\n3. Compute `priority_score` on a 0-100 scale:\n   - `priority_score = 100 * (0.50*urgency_score + 0.25*sentiment_score_risk + 0.15*recency_score + 0.10*patient_context_score)`\n   - `sentiment_score_risk = max(0, -sentiment_score)` (negative sentiment = higher risk)\n4. Assign buckets:\n   - `P1` for `priority_score >= 75` (immediate attention)\n   - `P2` for `priority_score >= 50 and < 75` (same-day)\n   - `P3` for `< 50` (routine)\n5. Produce plain-language `evidence` tokens that explain the score\n\n## Input Format\n\n```json\n[\n  {\n    \"id\": \"msg-123\",\n    \"category\": \"urgent\",\n    \"subject\": \"Medication side effects\",\n    \"from\": \"patient@example.com\",\n    \"date\": \"2026-02-27T10:30:00Z\",\n    \"body\": \"I've been feeling dizzy since starting the new medication...\"\n  }\n]\n```\n\n## Output Format\n\n```json\n[\n  {\n    \"id\": \"msg-123\",\n    \"priority_score\": 78,\n    \"priority_bucket\": \"P1\",\n    \"urgency_score\": 0.8,\n    \"sentiment_score\": -0.4,\n    \"recency_score\": 1.0,\n    \"patient_context_score\": 0.6,\n    \"evidence\": \"Urgent triage category + negative sentiment (concern) + very recent message + known patient\"\n  }\n]\n```\n\n## Enforce Boundaries\n\n- Never write to databases or files\n- Never send messages or trigger outbound channels\n- Never create reminders or execute actions\n- Never bypass routing or approvals\n\n## Handle Errors\n\n1. Reject schema-invalid inputs\n2. Return field-level reasons when scoring cannot be computed\n3. Fail closed if required scoring features are missing\n\n## Integration\n\nThis skill can be invoked via the OpenClaw CLI:\n\n```bash\nopenclaw skill run medical-priority-scorer --input '[{\"id\":\"msg-1\",\"category\":\"urgent\",...}]' --json\n```\n\nOr programmatically:\n\n```typescript\nconst result = await execFileAsync('openclaw', [\n  'skill', 'run', 'medical-priority-scorer',\n  '--input', JSON.stringify(triagedMessages),\n  '--json'\n]);\n```\n\n**Recommended Model**: Claude Sonnet 4.5 (`openclaw models set anthropic/claude-sonnet-4-5`)\n\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":205,"installsAllTime":8,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1772193413717,"updatedAt":1778491660149},"latestVersion":{"version":"1.0.0","createdAt":1772193413717,"changelog":"Initial release of medical-priority-scorer.\n\n- Scores medical messages by urgency, sentiment, recency, and patient context to produce deterministic priority rankings (P1/P2/P3).\n- Calculates a composite priority_score (0–100) using weighted input features.\n- Outputs detailed evidence tokens to justify each ranking.\n- Enforces strong safety boundaries: no state mutation, messaging, or external actions.\n- Provides robust input validation and error handling.\n- Designed for quick integration into medical triage and callback workflows.","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"binubmuse","userId":"s17f8hmqkefr6avrxvkpe22dvd8851fe","displayName":"binubmuse","image":"https://avatars.githubusercontent.com/u/90269022?v=4"},"moderation":null}