A TypeScript library and CLI tool (v2.2.0) for loading FHIR R4 resources into Microsoft SQL Server and transpiling SQL on FHIR v2 ViewDefinitions into T-SQL queries. It uses JSON_VALUE, JSON_QUERY, and OPENJSON for efficient query generation, supports FHIRPath expressions, array flattening via CROSS APPLY, and unionAll for polymorphic fields. Includes a bulk NDJSON loader with options for batching, parallel processing, and connection configuration via environment variables. Compatible with Node.js >=18.0.0 and ships TypeScript declarations.
npm install sof-mssqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Transpile a ViewDefinition object to a T-SQL query string using the transpile function.
Upgrade Node.js to version 18+ or use version 1.x
Use import syntax or dynamic import() instead of require()
Use --user and --password (current) or update to latest syntax
Rename files to follow the pattern (e.g., Patient.ndjson)
Increase batch size using --batch-size (e.g., 5000) for better throughput
Change to import statement or use dynamic import()
Install tedious: npm install tedious
Use import { transpile } from 'sof-mssql'Ensure the JSON includes a 'resource' property with "Patient" etc.