From 6ecf459056a0e41720428d43c24307e92900c8fe Mon Sep 17 00:00:00 2001 From: Josh Mandel Date: Sat, 7 Feb 2026 23:15:16 -0600 Subject: [PATCH] Fix contentMode() not being called as a function in expand/validate/related Six places referenced `cs.contentMode` (the function object) instead of `cs.contentMode()` (calling it). This caused: - Error messages containing the stringified function body instead of the content mode value (e.g., "is a contentMode() { return ... }") - `addParamUri` receiving a function instead of a string - Content mode comparisons silently failing (function !== 'complete') Co-Authored-By: Claude Opus 4.6 --- tx/workers/expand.js | 4 ++-- tx/workers/related.js | 4 ++-- tx/workers/validate.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tx/workers/expand.js b/tx/workers/expand.js index dee4f84..9de549f 100644 --- a/tx/workers/expand.js +++ b/tx/workers/expand.js @@ -626,9 +626,9 @@ class ValueSetExpander { } else if (cs.contentMode() === 'supplement') { throw new Issue('error', 'business-rule', null, null, 'The code system definition for ' + cset.system + ' defines a supplement, so this expansion cannot be performed', 'invalid'); } else if (this.params.incompleteOK) { - this.addParamUri(cs.contentMode, cs.system + '|' + cs.version); + this.addParamUri(cs.contentMode(), cs.system + '|' + cs.version); } else { - throw new Issue('error', 'business-rule', null, null, 'The code system definition for ' + cset.system + ' is a ' + cs.contentMode + ', so this expansion is not permitted unless the expansion parameter "incomplete-ok" has a value of "true"', 'invalid'); + throw new Issue('error', 'business-rule', null, null, 'The code system definition for ' + cset.system + ' is a ' + cs.contentMode() + ', so this expansion is not permitted unless the expansion parameter "incomplete-ok" has a value of "true"', 'invalid'); } } diff --git a/tx/workers/related.js b/tx/workers/related.js index 5fcc646..005b264 100644 --- a/tx/workers/related.js +++ b/tx/workers/related.js @@ -626,9 +626,9 @@ class ValueSetExpander { } else if (cs.contentMode() === 'supplement') { throw new Issue('error', 'business-rule', null, null, 'The code system definition for ' + cset.system + ' defines a supplement, so this expansion cannot be performed', 'invalid'); } else if (this.params.incompleteOK) { - exp.addParamUri(cs.contentMode, cs.system + '|' + cs.version); + exp.addParamUri(cs.contentMode(), cs.system + '|' + cs.version); } else { - throw new Issue('error', 'business-rule', null, null, 'The code system definition for ' + cset.system + ' is a ' + cs.contentMode + ', so this expansion is not permitted unless the expansion parameter "incomplete-ok" has a value of "true"', 'invalid'); + throw new Issue('error', 'business-rule', null, null, 'The code system definition for ' + cset.system + ' is a ' + cs.contentMode() + ', so this expansion is not permitted unless the expansion parameter "incomplete-ok" has a value of "true"', 'invalid'); } } diff --git a/tx/workers/validate.js b/tx/workers/validate.js index 959cf84..ae66249 100644 --- a/tx/workers/validate.js +++ b/tx/workers/validate.js @@ -597,11 +597,11 @@ class ValueSetChecker { defLang.value = cs.defLang(); this.checkCanonicalStatus(path, op, cs, this.valueSet); ver.value = cs.version(); - contentMode.value = cs.contentMode; + contentMode.value = cs.contentMode(); let ctxt = cs.locate(code); if (ctxt.context === null) { unkCodes.push(system + '|' + version + '#' + code); - if (cs.contentMode !== 'complete') { + if (cs.contentMode() !== 'complete') { result = true; cause.value = 'code-invalid'; this.worker.opContext.addNote(this.valueSet, 'Not found in Incomplete Code System', this.indentCount);