fhir-persistence 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,48 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.1] - 2025-03-18
9
+
10
+ ### Changed
11
+
12
+ - **`fhir-runtime` dependency** — Upgraded from `^0.8.1` to `^0.10.0` to align with fhir-runtime v0.10.0 (STAGE-7: Profile Slicing & Choice Type utilities)
13
+ - No code changes required — `FhirRuntimeProvider` uses structural typing and is fully compatible with the new fhir-runtime API surface
14
+
15
+ ### Notes
16
+
17
+ - fhir-runtime v0.10.0 adds: Slicing API (`matchSlice`, `countSliceInstances`, `generateSliceSkeleton`), Choice Type utilities, BackboneElement helpers, and `inferComplexType` bug fix
18
+ - These new APIs are available to consumers via fhir-runtime but do not affect fhir-persistence internals
19
+
20
+ ## [0.6.0] - 2025-03-17
21
+
22
+ ### Added
23
+
24
+ #### Full-Text Search (SQLite FTS5 + PostgreSQL tsvector/GIN)
25
+
26
+ - **`table-schema-builder.ts`** — HumanName and Address lookup tables now include tsvector GIN expression indexes (`to_tsvector('simple'::regconfig, column)`) for PostgreSQL full-text search
27
+ - **`where-builder.ts`** — Lookup table string search supports FTS query paths: SQLite FTS5 MATCH and PostgreSQL `to_tsvector @@ plainto_tsquery` with automatic fallback to LIKE
28
+ - **`fhir-system.ts`** — `FhirSystemConfig.features.fullTextSearch` option to enable FTS query paths (default: `false` for backward compatibility)
29
+ - SQLite FTS5 virtual tables generated via `MigrationGenerator` for HumanName/Address lookup columns
30
+
31
+ #### Reindex Progress Callbacks
32
+
33
+ - **`cli/reindex.ts`** — `ReindexProgressCallbackV2` type with `onProgress` callback reporting `{ resourceType, processed, total }` per batch
34
+ - **`reindexResourceTypeV2`** and **`reindexAllV2`** accept optional `onProgress` parameter for CLI and UI progress display
35
+
36
+ #### Conditional Operations API
37
+
38
+ - **`store/conditional-service.ts`** — `ConditionalService` class with full FHIR R4 conditional semantics:
39
+ - `conditionalCreate`: 0 match → create, 1 match → return existing, 2+ → `PreconditionFailedError`
40
+ - `conditionalUpdate`: 0 match → create, 1 match → update, 2+ → `PreconditionFailedError`
41
+ - `conditionalDelete`: delete all matching resources, return count
42
+ - **`repo/errors.ts`** — `PreconditionFailedError` (HTTP 412) for multiple-match conditional operations
43
+ - All conditional operations execute within transactions (TOCTOU protection)
44
+
45
+ ### Changed
46
+
47
+ - **`table-schema-builder.ts`** — HumanName lookup table adds `pg_trgm` GIN indexes (`gin_trgm_ops`) alongside tsvector indexes for trigram fuzzy matching
48
+ - **`migration-generator.ts`** — Automatically creates `pg_trgm` and `btree_gin` extensions on PostgreSQL before GIN index generation
49
+
8
50
  ## [0.5.0] - 2025-03-16
9
51
 
10
52
  ### Fixed
package/README.md CHANGED
@@ -5,7 +5,7 @@ Embedded FHIR R4 persistence layer — CRUD, search, indexing, and schema migrat
5
5
  [![npm version](https://img.shields.io/npm/v/fhir-persistence)](https://www.npmjs.com/package/fhir-persistence)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
7
7
 
8
- > **v0.5.0** — PostgreSQL migration path complete: GIN extensions + lookup table fixes
8
+ > **v0.6.1** — Dependency upgrade: fhir-runtime ^0.10.0 (Profile Slicing & Choice Type support)
9
9
 
10
10
  ## Features
11
11
 
@@ -21,7 +21,9 @@ Embedded FHIR R4 persistence layer — CRUD, search, indexing, and schema migrat
21
21
  - **Two-phase SQL** — id-first query for large table performance
22
22
  - **IG-driven schema** — StructureDefinition + SearchParameter → DDL (SQLite + PostgreSQL dialects)
23
23
  - **Migration engine** — SchemaDiff → MigrationGenerator → MigrationRunnerV2
24
- - **Conditional operations** — conditionalCreate / conditionalUpdate / conditionalDelete
24
+ - **Full-text search** — SQLite FTS5 + PostgreSQL tsvector/GIN for string search parameters
25
+ - **Conditional operations** — conditionalCreate / conditionalUpdate / conditionalDelete via `ConditionalService`
26
+ - **Reindex progress** — `onProgress` callback for CLI and UI progress reporting
25
27
  - **Bundle processing** — transaction and batch bundle support
26
28
  - **Terminology** — TerminologyCodeRepo + ValueSetRepo
27
29
  - **FhirSystem orchestrator** — end-to-end startup flow for `fhir-engine` integration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fhir-persistence",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Embedded FHIR R4 persistence layer — CRUD, search, indexing, schema migration over SQLite and PostgreSQL",
5
5
  "homepage": "https://github.com/medxaidev/fhir-persistence#readme",
6
6
  "license": "MIT",
@@ -67,7 +67,7 @@
67
67
  "dependencies": {
68
68
  "better-sqlite3": "^12.6.2",
69
69
  "fhir-definition": "^0.5.0",
70
- "fhir-runtime": "^0.8.1"
70
+ "fhir-runtime": "^0.10.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@microsoft/api-extractor": "^7.57.7",