Pure JavaScript/TypeScript compiler and runtime evaluator for the Picorules clinical decision support language. Compiles ruleblocks to optimized SQL (Oracle, SQL Server, PostgreSQL) or evaluates directly in JavaScript for single-patient use (browser, Node.js, edge). v1.1.1 – production-ready, zero runtime dependencies (Zod only for input validation), full type safety, tree-shakeable ESM/CJS, 406 tests. Unique: dual execution mode (SQL batch vs in-memory), pluggable data adapters (EADV built-in), automatic cross-ruleblock dependency resolution.
npm install picorules-compiler-js-coreNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a Picorules ruleblock, loads EADV patient data, and evaluates the rule in JavaScript (no SQL required).
Access result.sql[index] instead of result.sql[ruleblockName].
Upgrade Node.js to >= 16.
Wrap data with `new EadvDataAdapter(data)` before passing to `evaluate`.
Ensure each ruleblock has a distinct `name` field.
Use `compile()` for non-EADV databases.
Always import and use the `Dialect` enum.
Ensure EadvDataAdapter receives an array of EADV observations. At minimum: [{ eid: 1, att: 'some_att', dt: '2024-01-01', val: 123 }]Check that all referenced ruleblocks are included in the array passed to `parse()` and that spelling matches.
Read the .prb file as a string (e.g., using fs.readFileSync) and pass the text to `parse()`.
Run `npm install picorules-compiler-js-core`. Ensure your bundler resolves ESM (set `"type": "module"` in package.json or use `.mjs` extension).