fhirsmith 0.13.0 → 0.13.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,7 +5,17 @@ All notable changes to the Health Intersections Node Server will be documented i
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.13.0] - 2026-09-04
8
+ ## [v0.13.1] - 2026-09-05
9
+
10
+ ### Fixed
11
+
12
+ - Error in ICD-11 provider that made the version page not show
13
+
14
+ ### Tx Conformance Statement
15
+
16
+ FHIRsmith passed all 3489 HL7 terminology service tests (modes tx.fhir.org+omop+general+snomed+mimetypes+icd-11, tests v1.9.4, runner v6.10.4)
17
+
18
+ ## [v0.13.0] - 2026-09-04
9
19
 
10
20
  ### Added
11
21
 
@@ -75,7 +85,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
75
85
  the tx-issue-type in `txIssueType`. Every catch block now goes through
76
86
  `outcomeFromError()`, which is the one place that knows about both
77
87
 
78
- ## [0.12.0] - 2026-08-27
88
+ ### Tx Conformance Statement
89
+
90
+ FHIRsmith passed all 3489 HL7 terminology service tests (modes tx.fhir.org+omop+general+snomed+mimetypes+icd-11, tests v1.9.4, runner v6.10.4)
91
+
92
+ ## [v0.12.0] - 2026-08-27
79
93
 
80
94
  ### Added
81
95
 
@@ -380,7 +394,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
380
394
 
381
395
  FHIRsmith passed all 2822 HL7 terminology service tests (modes tx.fhir.org+omop+general+snomed, tests v1.9.3, runner v6.10.3)
382
396
 
383
- ## [0.11.2] - 2026-08-12
397
+ ## [v0.11.2] - 2026-08-12
384
398
 
385
399
  ### Fixed
386
400
 
@@ -395,7 +409,7 @@ FHIRsmith passed all 2822 HL7 terminology service tests (modes tx.fhir.org+omop+
395
409
 
396
410
  FHIRsmith passed all 2729 HL7 terminology service tests (modes tx.fhir.org+omop+general+snomed, tests v1.9.3, runner v6.10.1)
397
411
 
398
- ## [0.11.1] - 2026-07-30
412
+ ## [v0.11.1] - 2026-07-30
399
413
 
400
414
  ### Added
401
415
 
@@ -429,7 +443,7 @@ FHIRsmith passed all 2729 HL7 terminology service tests (modes tx.fhir.org+omop+
429
443
 
430
444
  FHIRsmith passed all 2729 HL7 terminology service tests (modes tx.fhir.org+omop+general+snomed, tests v1.9.2, runner v6.9.12)
431
445
 
432
- ## [0.11.0] - 2026-mm-dd
446
+ ## [v0.11.0] - 2026-mm-dd
433
447
 
434
448
  ### Added
435
449
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fhirsmith",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "txVersion": "1.9.4",
5
5
  "description": "A Node.js server that provides a collection of tools to serve the FHIR ecosystem",
6
6
  "main": "server.js",
package/tx/cs/cs-cs.js CHANGED
@@ -1695,6 +1695,19 @@ class FhirCodeSystemFactory extends CodeSystemFactoryProvider {
1695
1695
  return "cs";
1696
1696
  }
1697
1697
 
1698
+ /**
1699
+ * This factory wraps whatever CodeSystem it is handed at build() time, so it has no
1700
+ * system or version of its own. It is never registered in codeSystemFactories (which
1701
+ * is keyed on system()); these answer for the abstract contract, not for a lookup.
1702
+ */
1703
+ system() {
1704
+ return null;
1705
+ }
1706
+
1707
+ version() {
1708
+ return null;
1709
+ }
1710
+
1698
1711
  }
1699
1712
 
1700
1713
  module.exports = {
package/tx/cs/cs-icd11.js CHANGED
@@ -6,11 +6,11 @@
6
6
  * Foundation -- so the factory is constructed per system and several factories share one
7
7
  * file. `tx/library.js` registers one per system found in the database.
8
8
  *
9
- * STATUS: stage 1. Metadata, code location, displays, definitions, designations,
10
- * properties and extendLookup work. Filters, iteration, subsumption and postcoordinated
11
- * expressions are still to come; each returns the safe empty answer and is marked below.
12
9
  * The tx-ecosystem `icd-11` test suite is the specification -- it was written to assert
13
- * correct behaviour, so the definition of done is that its 51 tests go green.
10
+ * correct behaviour, and it is what these are tested against; there is no unit test file
11
+ * of their own. Metadata, code location, displays, definitions, designations, properties,
12
+ * extendLookup, filters, iteration, subsumption and postcoordinated expressions are all
13
+ * implemented.
14
14
  */
15
15
 
16
16
  const sqlite3 = require('sqlite3').verbose();
@@ -119,6 +119,25 @@ class ICD11Services extends BaseCSServices {
119
119
  totalCount() { return this.shared.count; }
120
120
  defLang() { return 'en'; }
121
121
 
122
+ /**
123
+ * WHO publishes the classification in the languages the database was crawled with, so
124
+ * the base class's English-only assumption is wrong here: it decides whether a failed
125
+ * display check says "no display in that language" or "none at all".
126
+ */
127
+ hasAnyDisplays(languages) {
128
+ const langs = this._ensureLanguages(languages);
129
+ for (const l of langs) {
130
+ const base = l.language || String(l.code || '').split('-')[0];
131
+ if (base && this.shared.languages.includes(base)) {
132
+ return true;
133
+ }
134
+ }
135
+ return super.hasAnyDisplays(langs);
136
+ }
137
+
138
+ /** Versions are WHO release ids -- '2026-01'. */
139
+ versionAlgorithm() { return 'date'; }
140
+
122
141
  /**
123
142
  * The WHO CodeSystem says caseSensitive: false, but its own $validate-code rejects
124
143
  * '1a00'. The codes are case-sensitive tokens; the declaration is the part that is
@@ -285,13 +304,17 @@ class ICD11Services extends BaseCSServices {
285
304
  return row ? (row.code || row.uri) : null;
286
305
  }
287
306
 
288
- /** The best language for display, given what the request asked for. */
307
+ /**
308
+ * The best language for display, given what the request asked for. Languages is an
309
+ * iterable of Language, in quality order; the database holds translations keyed on the
310
+ * primary subtag, so that is what is matched.
311
+ */
289
312
  #displayLang() {
290
313
  const langs = this.opContext?.langs;
291
314
  if (langs) {
292
- for (const l of (langs.codes ? langs.codes() : [])) {
293
- const base = String(l).split('-')[0];
294
- if (this.shared.languages.includes(base)) return base;
315
+ for (const l of langs) {
316
+ const base = l.language || String(l.code || '').split('-')[0];
317
+ if (base && this.shared.languages.includes(base)) return base;
295
318
  }
296
319
  }
297
320
  return this.defLang();
@@ -698,6 +721,22 @@ class ICD11ServicesFactory extends CodeSystemFactoryProvider {
698
721
  version() { return this._shared?.version; }
699
722
  defaultVersion() { return this._shared?.version; }
700
723
 
724
+ /**
725
+ * Short label for the home page and for code system links. Deliberately not the WHO
726
+ * title from the database (which the provider uses): this has to answer before load(),
727
+ * since the home page sorts factories by name.
728
+ */
729
+ name() {
730
+ switch (this.systemCode) {
731
+ case 'mms': return 'ICD-11 MMS';
732
+ case 'icf': return 'ICD-11 ICF';
733
+ case 'foundation': return 'ICD-11 Foundation';
734
+ default: return `ICD-11 ${this.systemCode}`;
735
+ }
736
+ }
737
+
738
+ id() { return `icd11-${this.systemCode}`; }
739
+
701
740
  async load() {
702
741
  if (this._loaded) return;
703
742
  const db = new sqlite3.Database(this.dbPath, sqlite3.OPEN_READONLY);
package/tx/provider.js CHANGED
@@ -461,7 +461,7 @@ class Provider {
461
461
  }
462
462
  }
463
463
  return false;
464
- }x
464
+ }
465
465
 
466
466
  async updateCodeSystemList() {
467
467
  for (let csp of this.codeSystemProviders) {