@scripturahealth/sme-schemas
v2.0.0
Published
Sequence Method Engine — canonical JSON schemas and TypeScript types for compound monographs, protocols, regulatory records, and review queue items. Consumed by Scriptura SaaS and any other SME wrapper.
Maintainers
Readme
@scripturahealth/sme-schemas
Canonical JSON Schemas and TypeScript types for the Sequence Method Engine (SME) — the core clinical-decision engine behind Scriptura Health.
This package is consumed by:
- Scriptura SaaS (Next.js / TypeScript) — clinician-facing platform
- private-protocol-engine (Python, internal) — personal-use wrapper
- Any future SME consumer
Install
npm install @scripturahealth/sme-schemasUsage
import { SCHEMAS, SCHEMA_VERSION } from "@scripturahealth/sme-schemas";
import type { Compound, RegulatoryStatusResponse } from "@scripturahealth/sme-schemas";
import Ajv2020 from "ajv/dist/2020.js";
import addFormats from "ajv-formats";
const ajv = new Ajv2020({ strict: false });
addFormats(ajv);
const validateCompound = ajv.compile(SCHEMAS.compound);
const monograph: Compound = { /* ... */ };
if (!validateCompound(monograph)) {
console.error(validateCompound.errors);
}Schema bundle
| Schema | Purpose |
|--------|---------|
| _common | Shared definitions: citation, regulatory_tier, claim, review_queue_item |
| compound | Compound monograph (drug, peptide, hormone, supplement) |
| condition | Clinical condition / protocol case |
| biomarker | Lab / wearable / functional biomarker definition |
| gene | Pharmacogenomic / ancestry gene reference |
| herb | Botanical / TCM / Ayurvedic / Kampo monograph |
| regulatoryStatusResponse | GET /v1/regulatory-status response shape |
Versioning
Semver tied to engine schema_version. Major schema changes bump the major version. Minor additions bump the minor. Patch versions are bug fixes that do not change the schema shape.
Current: 1.1.0 — adds regulatory_tier, saas_v1_exposed, clinician_review_framing, 30-day staleness threshold, and review_queue_item type.
Development
npm install
npm run lint:schemas # validates every JSON schema compiles
npm run generate-types # regenerates TypeScript types from JSON schemas
npm test # smoke tests
npm run build # full buildPublishing is gated on the GitHub Actions publish-npm job, triggered by a v*.*.* tag on the sequence-method-engine repo.
License
UNLICENSED — internal to Scriptura Health.
