fhir-persistence 0.7.0 → 0.8.0

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,32 @@ 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.8.0] - 2025-03-20
9
+
10
+ ### Fixed
11
+
12
+ #### Bug-1 + Bug-2: Token-column WHERE clause column name mismatch (P0)
13
+
14
+ - **`buildTokenColumnFragment()`** (v1, PostgreSQL `$N` placeholders) — changed `__${columnName}Text` → `__${columnName}` to match DDL column name
15
+ - **`buildTokenColumnFragmentV2()`** (v2, SQLite `?` placeholders) — same fix, aligning with DDL `__<name>` column
16
+ - **Root cause**: WHERE clause referenced a non-existent `__genderText` column while DDL only creates `__gender` (TEXT, JSON array of `system|code` strings) and `__genderSort` (TEXT, display)
17
+ - **Impact**: All token search queries (`GET /Patient?gender=male`) previously failed with `no such column: __genderText`
18
+ - DDL / INSERT / WHERE column names now fully aligned: `__<name>` for token array, `__<name>Sort` for display text
19
+
20
+ ### Changed
21
+
22
+ - **`search-parameter-registry.ts`** — Corrected `SearchStrategy` documentation: token-column uses 2 columns (not 3)
23
+
24
+ ### Confirmed
25
+
26
+ - **Enh-1**: R4 standard SP loading (`name`, `identifier`, etc.) depends on external `DefinitionProvider` — not a persistence-layer issue
27
+ - **Enh-2**: `ifMatch` optimistic locking is fully implemented in both `FhirStore` and `FhirPersistence` with test coverage
28
+
29
+ ### Test Coverage
30
+
31
+ - **1062 total tests** (1054 passing, 8 skipped) across 63 test files — no regressions
32
+ - **1 new regression test** for Bug-1: verifies token column references `__<name>` not `__<name>Text`
33
+
8
34
  ## [0.7.0] - 2025-03-18
9
35
 
10
36
  ### Added
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.7.0** — Conformance storage module for IG Explorer: 6 repos + import orchestrator
8
+ > **v0.8.0** — Token search bug fix: DDL/INSERT/WHERE column name alignment
9
9
 
10
10
  ## Features
11
11
 
@@ -5339,7 +5339,7 @@ function buildUriFragmentV2(impl, param, dialect) {
5339
5339
  return buildOrFragmentV2(col, "=", param.values);
5340
5340
  }
5341
5341
  function buildTokenColumnFragmentV2(impl, param, dialect) {
5342
- const textCol = quoteColumn(`__${impl.columnName}Text`);
5342
+ const textCol = quoteColumn(`__${impl.columnName}`);
5343
5343
  const sortCol = quoteColumn(`__${impl.columnName}Sort`);
5344
5344
  if (param.modifier === "text") {
5345
5345
  return buildLikeFragmentV2(sortCol, param.values, "", "%");