Skip to content

feat(healthcare): coherent patient, drug-interaction check, contraindication gate#55

Merged
imran-siddique merged 2 commits into
mainfrom
feat/healthcare-clinical-realism
Jul 21, 2026
Merged

feat(healthcare): coherent patient, drug-interaction check, contraindication gate#55
imran-siddique merged 2 commits into
mainfrom
feat/healthcare-clinical-realism

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

What

Deepens the clinical realism of the healthcare example. Third of three per-example realism PRs (financial-services #53, multi-tenant-saas #54). The FDA/NHS/MOH jurisdiction variants are left untouched (they're self-contained policy/doc variants).

Why

The mock EHR returned generic canned data and the differential didn't relate to the record. A clinician would not recognise it as a real case.

Changes

  • One coherent patient. A 54-year-old with type 2 diabetes + hypertension: ICD-10-coded diagnoses (E11.9, I10, E78.5), medications with dosing, documented allergies (penicillin, sulfonamides) and labs (HbA1c 8.1%, eGFR, BP). The clinical_decision_support differential now matches the record.
  • New ehr.drug_interaction_check screens a proposed treatment against the patient's current medications and allergies, and the agent feeds its result into the write call.
  • New medication-contraindication guardrail. A severe interaction or allergy contraindication blocks the treatment-plan write, alongside the existing EU AI Act Art. 14 high-risk human-oversight rule.
  • Three scenarios (--scenario standard|high-risk|contraindication), each with a signed TRACE record regenerated from a real run.
  • Tests + CI. New clinical_engine.py module, tests/test_clinical_engine.py, and a CI job.

Verification

  • python -m unittest discover -s tests -v → 6 pass
  • All three scenarios run end-to-end; cmcp verify passes schema, signature and audit chain on each record (hardware attestation fails in software-only dev mode, as expected)
  • standard: 4/0; high-risk: 3 allowed / 1 denied (Art. 14); contraindication: 3 allowed / 1 denied (medication safety)
  • Default (standard) scenario exits 0, so the smoke (healthcare) job stays green
  • Catalog definition_hash values recomputed and self-checked

🤖 Generated with Claude Code

Comment thread healthcare/agent/clinical_decision_agent.py Fixed
…ication gate

Deepen the clinical realism of the healthcare example while keeping the
FDA/NHS/MOH jurisdiction variants untouched.

- Replace the thin canned EHR data with one coherent patient: ICD-10-coded
  diagnoses, medications with dosing, documented allergies and labs. The
  clinical_decision_support differential now matches the record.
- Add ehr.drug_interaction_check, which screens a proposed treatment against
  the patient's current medications and allergies. The agent passes its result
  into the write call.
- Add a medication-contraindication forbid: a severe interaction or allergy
  contraindication blocks the treatment-plan write, alongside the existing
  EU AI Act Art. 14 high-risk human-oversight rule.
- Three scenarios (standard / high-risk / contraindication), each with a
  signed TRACE record regenerated from a real run.
- New clinical_engine module + unit tests and a CI job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@imran-siddique
imran-siddique force-pushed the feat/healthcare-clinical-realism branch from 565ff57 to 09bcd1b Compare July 21, 2026 18:10
CodeQL py/clear-text-logging-sensitive-data flagged the patient id printed in
the agent banner. For a PHI-handling demo the identifier should not be written
to stdout in clear text anyway; it travels in the tool arguments and the signed
TRACE record. Redact it in the banner and align the README output sample.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit eb65794 into main Jul 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants