From 6c013013e2e2ef490651f52a7504038f4d0d265b Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 5 Jun 2026 14:07:28 +1000 Subject: [PATCH 1/4] #220 - fix missing Expression when validating --- tx/workers/validate.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tx/workers/validate.js b/tx/workers/validate.js index 40c5210e..8391df0e 100644 --- a/tx/workers/validate.js +++ b/tx/workers/validate.js @@ -1350,14 +1350,18 @@ class ValueSetChecker { if (vstatus.value && vstatus.value !== 'inactive') { result.addParamCode('status', vstatus.value); } + let mpath = inactive.path; + if (!mpath) { + mpath = 'code'; + } if (!['inactive', 'DISCOURAGED'].includes(vstatus.value)) { let m = this.worker.i18n.translate('INACTIVE_CONCEPT_FOUND', this.params.HTTPLanguages, ['inactive', tcode]); msg(m); - op.addIssue(new Issue('warning', 'business-rule', inactive.path, 'INACTIVE_CONCEPT_FOUND', m, 'code-comment')); + op.addIssue(new Issue('warning', 'business-rule', mpath, 'INACTIVE_CONCEPT_FOUND', m, 'code-comment')); } let m = this.worker.i18n.translate('INACTIVE_CONCEPT_FOUND', this.params.HTTPLanguages, [vstatus.value, tcode]); msg(m); - op.addIssue(new Issue('warning', 'business-rule', inactive.path, 'INACTIVE_CONCEPT_FOUND', m, 'code-comment')); + op.addIssue(new Issue('warning', 'business-rule', mpath, 'INACTIVE_CONCEPT_FOUND', m, 'code-comment')); } else if (vstatus.value && vstatus.value.toLowerCase() === 'deprecated') { result.addParamCode('status', 'deprecated'); let m = this.worker.i18n.translate('DEPRECATED_CONCEPT_FOUND', this.params.HTTPLanguages, [vstatus.value, tcode]); From 45977a4d1811a3f5d9774e13922a3675f71999c7 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 5 Jun 2026 16:03:06 +1000 Subject: [PATCH 2/4] prefer active designations when picking the display --- tx/library/designations.js | 45 ++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/tx/library/designations.js b/tx/library/designations.js index ccdc1e56..8d4bbb41 100644 --- a/tx/library/designations.js +++ b/tx/library/designations.js @@ -610,35 +610,42 @@ class Designations { const matchTypes = [LangMatchType.FULL, LangMatchType.LANG_REGION, LangMatchType.LANG]; - for (const matchType of matchTypes) { - for (const cd of this.designations) { - if (this._langMatches(lang, cd.language, matchType) && this.isDisplay(cd)) { - if (supplements && cd.source) { - supplements.add(cd.source); + for (const activeOnly of [true, false]) { + for (const matchType of matchTypes) { + for (const cd of this.designations) { + if (this._langMatches(lang, cd.language, matchType) && this.isDisplay(cd) && (!activeOnly || cd.isActive())) { + if (supplements && cd.source) { + supplements.add(cd.source); + } + return cd; } - return cd; } - } - for (const cd of this.designations) { - if (this._langMatches(lang, cd.language, matchType) && this._isPreferred(cd)) { - if (supplements && cd.source) { - supplements.add(cd.source); + for (const cd of this.designations) { + if (this._langMatches(lang, cd.language, matchType) && this._isPreferred(cd)&& (!activeOnly || cd.isActive())) { + if (supplements && cd.source) { + supplements.add(cd.source); + } + return cd; } - return cd; } - } - for (const cd of this.designations) { - if (this._langMatches(lang, cd.language, matchType)) { - if (supplements && cd.source) { - supplements.add(cd.source); + for (const cd of this.designations) { + if (this._langMatches(lang, cd.language, matchType) && (!activeOnly || cd.isActive())) { + if (supplements && cd.source) { + supplements.add(cd.source); + } + return cd; } - return cd; } } } } for (const cd of this.designations) { - if (!cd.language && this.isDisplay(cd)) { + if (!cd.language && this.isDisplay(cd) && cd.isActive()) { + if (supplements && cd.source) { + supplements.add(cd.source); + } + return cd; + } if (!cd.language && this.isDisplay(cd)) { if (supplements && cd.source) { supplements.add(cd.source); } From 0bec0c4fa7c570a1601697e591eb0b526ae8741a Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 5 Jun 2026 16:03:28 +1000 Subject: [PATCH 3/4] add designation status to $lookup results --- tx/workers/lookup.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tx/workers/lookup.js b/tx/workers/lookup.js index 6d52a4d6..6766a0ed 100644 --- a/tx/workers/lookup.js +++ b/tx/workers/lookup.js @@ -374,6 +374,12 @@ class LookupWorker extends TerminologyWorker { }); } + if (designation.status && designation.status !== 'active') { + designationParts.push({ + name: 'status', + valueCode: designation.status + }); + } designationParts.push({ name: 'value', valueString: designation.value From 6da7b1c816b58240963936e7f4d7758db00dc318 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 5 Jun 2026 17:39:51 +1000 Subject: [PATCH 4/4] ix designations tests --- tests/tx/designations.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tx/designations.test.js b/tests/tx/designations.test.js index d8861b51..c459a354 100644 --- a/tests/tx/designations.test.js +++ b/tests/tx/designations.test.js @@ -165,6 +165,7 @@ describe('Designations', () => { test('should respect quality values', () => { const langList = Languages.fromAcceptLanguage('fr;q=0.1,en;q=0.9'); + designations.designations[0].status = 'active'; const preferred = designations.preferredDesignation(langList); // Should prefer English due to higher quality @@ -289,6 +290,8 @@ describe('Designations', () => { test('should prefer base over display for exact match', () => { const langList = Languages.fromAcceptLanguage('en-US'); + designations.designations[0].status = 'active'; + designations.designations[2].status = 'active'; const preferred = designations.preferredDesignation(langList); expect(preferred.display).toBe('Base US English'); @@ -297,6 +300,7 @@ describe('Designations', () => { test('should fall back to language-region match', () => { const langList = Languages.fromAcceptLanguage('en-AU'); // Australian English not in designations + designations.designations[0].status = 'active'; const preferred = designations.preferredDesignation(langList); // Should fall back to base English