Sathiyamoorthi Madhesh
2026Compliance & Validation

NEMSIS Engine 

A validation and remediation engine that tells an EMS agency exactly why its NEMSIS submission failed — and then fixes it with them.

NEMSIS Engine — project preview
Role
Backend & Validation Engine
Timeline
Jun — Aug 2026
Stack
  • Python
  • Flask
  • MongoDB
  • lxml
  • Schematron
  • Pydantic

A NEMSIS v3.5.0 file has to satisfy the national schema and whatever the state adds on top of it, and the usual failure mode is a validator that says “invalid” and stops there. This engine runs three stages in sequence — XSD structure, Schematron business rules, then state-custom checks — and every violation comes back as a typed record with a location, a plain explanation and a remediation path, rather than a stack trace.

State packs ship Schematron that binds to XSLT 2.0, which lxml alone will not execute, so the pipeline runs Saxon for those rules and falls back to lxml for XPath 1.0 rules. Rulesets are not vendored by hand either: a sync layer scrapes state assets — custom data elements, required elements, certification levels, permitted procedures, medications and protocols, agency and facility registries — into MongoDB, with a changelog and diff so an agency can see what a state changed between releases.

The validation core is deliberately framework-free and Pydantic-typed, so it can run under the web app, a batch job or a test suite without dragging Flask along. On top of it sits the operator surface: an interactive fixer with live revalidation, batch validation, reports, and RBAC across five roles from viewer up to superadmin.

3
Validation stages
38K lines
Engine + app
v3.5.0
NEMSIS spec