@aehrc/ecl-core 1.0.2 → 1.0.4
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/dist/index.cjs +57091 -0
- package/dist/index.d.ts +900 -38
- package/dist/index.mjs +57091 -0
- package/package.json +17 -6
- package/dist/completion/context-detector.d.ts +0 -51
- package/dist/completion/context-detector.d.ts.map +0 -1
- package/dist/completion/context-detector.js +0 -286
- package/dist/completion/context-detector.js.map +0 -1
- package/dist/completion/context-items.d.ts +0 -50
- package/dist/completion/context-items.d.ts.map +0 -1
- package/dist/completion/context-items.js +0 -526
- package/dist/completion/context-items.js.map +0 -1
- package/dist/completion/filter-cache.d.ts +0 -14
- package/dist/completion/filter-cache.d.ts.map +0 -1
- package/dist/completion/filter-cache.js +0 -55
- package/dist/completion/filter-cache.js.map +0 -1
- package/dist/completion/provider.d.ts +0 -38
- package/dist/completion/provider.d.ts.map +0 -1
- package/dist/completion/provider.js +0 -273
- package/dist/completion/provider.js.map +0 -1
- package/dist/completion/snippets.d.ts +0 -11
- package/dist/completion/snippets.d.ts.map +0 -1
- package/dist/completion/snippets.js +0 -80
- package/dist/completion/snippets.js.map +0 -1
- package/dist/formatter/ast-printer.d.ts +0 -12
- package/dist/formatter/ast-printer.d.ts.map +0 -1
- package/dist/formatter/ast-printer.js +0 -251
- package/dist/formatter/ast-printer.js.map +0 -1
- package/dist/formatter/comments.d.ts +0 -14
- package/dist/formatter/comments.d.ts.map +0 -1
- package/dist/formatter/comments.js +0 -232
- package/dist/formatter/comments.js.map +0 -1
- package/dist/formatter/config.d.ts +0 -5
- package/dist/formatter/config.d.ts.map +0 -1
- package/dist/formatter/config.js +0 -45
- package/dist/formatter/config.js.map +0 -1
- package/dist/formatter/formatter.d.ts +0 -3
- package/dist/formatter/formatter.d.ts.map +0 -1
- package/dist/formatter/formatter.js +0 -368
- package/dist/formatter/formatter.js.map +0 -1
- package/dist/formatter/index.d.ts +0 -6
- package/dist/formatter/index.d.ts.map +0 -1
- package/dist/formatter/index.js +0 -19
- package/dist/formatter/index.js.map +0 -1
- package/dist/formatter/options.d.ts +0 -31
- package/dist/formatter/options.d.ts.map +0 -1
- package/dist/formatter/options.js +0 -17
- package/dist/formatter/options.js.map +0 -1
- package/dist/formatter/range.d.ts +0 -16
- package/dist/formatter/range.d.ts.map +0 -1
- package/dist/formatter/range.js +0 -129
- package/dist/formatter/range.js.map +0 -1
- package/dist/formatter/rules.d.ts +0 -8
- package/dist/formatter/rules.d.ts.map +0 -1
- package/dist/formatter/rules.js +0 -42
- package/dist/formatter/rules.js.map +0 -1
- package/dist/grammar/ECLLexer.d.ts +0 -122
- package/dist/grammar/ECLLexer.d.ts.map +0 -1
- package/dist/grammar/ECLLexer.js +0 -399
- package/dist/grammar/ECLLexer.js.map +0 -1
- package/dist/grammar/ECLParser.d.ts +0 -2905
- package/dist/grammar/ECLParser.d.ts.map +0 -1
- package/dist/grammar/ECLParser.js +0 -24911
- package/dist/grammar/ECLParser.js.map +0 -1
- package/dist/grammar/ECLVisitor.d.ts +0 -1208
- package/dist/grammar/ECLVisitor.d.ts.map +0 -1
- package/dist/grammar/ECLVisitor.js +0 -4
- package/dist/grammar/ECLVisitor.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -107
- package/dist/index.js.map +0 -1
- package/dist/knowledge/filters.d.ts +0 -6
- package/dist/knowledge/filters.d.ts.map +0 -1
- package/dist/knowledge/filters.js +0 -99
- package/dist/knowledge/filters.js.map +0 -1
- package/dist/knowledge/grammar.d.ts +0 -7
- package/dist/knowledge/grammar.d.ts.map +0 -1
- package/dist/knowledge/grammar.js +0 -217
- package/dist/knowledge/grammar.js.map +0 -1
- package/dist/knowledge/index.d.ts +0 -24
- package/dist/knowledge/index.d.ts.map +0 -1
- package/dist/knowledge/index.js +0 -101
- package/dist/knowledge/index.js.map +0 -1
- package/dist/knowledge/operators.d.ts +0 -10
- package/dist/knowledge/operators.d.ts.map +0 -1
- package/dist/knowledge/operators.js +0 -324
- package/dist/knowledge/operators.js.map +0 -1
- package/dist/knowledge/patterns.d.ts +0 -6
- package/dist/knowledge/patterns.d.ts.map +0 -1
- package/dist/knowledge/patterns.js +0 -172
- package/dist/knowledge/patterns.js.map +0 -1
- package/dist/knowledge/refinements.d.ts +0 -6
- package/dist/knowledge/refinements.d.ts.map +0 -1
- package/dist/knowledge/refinements.js +0 -134
- package/dist/knowledge/refinements.js.map +0 -1
- package/dist/knowledge/types.d.ts +0 -41
- package/dist/knowledge/types.d.ts.map +0 -1
- package/dist/knowledge/types.js +0 -5
- package/dist/knowledge/types.js.map +0 -1
- package/dist/parser/ast.d.ts +0 -111
- package/dist/parser/ast.d.ts.map +0 -1
- package/dist/parser/ast.js +0 -25
- package/dist/parser/ast.js.map +0 -1
- package/dist/parser/concept-extractor.d.ts +0 -21
- package/dist/parser/concept-extractor.d.ts.map +0 -1
- package/dist/parser/concept-extractor.js +0 -126
- package/dist/parser/concept-extractor.js.map +0 -1
- package/dist/parser/error-analysis.d.ts +0 -54
- package/dist/parser/error-analysis.d.ts.map +0 -1
- package/dist/parser/error-analysis.js +0 -260
- package/dist/parser/error-analysis.js.map +0 -1
- package/dist/parser/error-listener.d.ts +0 -14
- package/dist/parser/error-listener.d.ts.map +0 -1
- package/dist/parser/error-listener.js +0 -24
- package/dist/parser/error-listener.js.map +0 -1
- package/dist/parser/expression-grouper.d.ts +0 -20
- package/dist/parser/expression-grouper.d.ts.map +0 -1
- package/dist/parser/expression-grouper.js +0 -99
- package/dist/parser/expression-grouper.js.map +0 -1
- package/dist/parser/generated/grammar/ECLLexer.d.ts +0 -122
- package/dist/parser/generated/grammar/ECLLexer.d.ts.map +0 -1
- package/dist/parser/generated/grammar/ECLLexer.js +0 -399
- package/dist/parser/generated/grammar/ECLLexer.js.map +0 -1
- package/dist/parser/generated/grammar/ECLParser.d.ts +0 -2905
- package/dist/parser/generated/grammar/ECLParser.d.ts.map +0 -1
- package/dist/parser/generated/grammar/ECLParser.js +0 -24911
- package/dist/parser/generated/grammar/ECLParser.js.map +0 -1
- package/dist/parser/generated/grammar/ECLVisitor.d.ts +0 -1208
- package/dist/parser/generated/grammar/ECLVisitor.d.ts.map +0 -1
- package/dist/parser/generated/grammar/ECLVisitor.js +0 -4
- package/dist/parser/generated/grammar/ECLVisitor.js.map +0 -1
- package/dist/parser/index.d.ts +0 -26
- package/dist/parser/index.d.ts.map +0 -1
- package/dist/parser/index.js +0 -202
- package/dist/parser/index.js.map +0 -1
- package/dist/parser/position-detector.d.ts +0 -45
- package/dist/parser/position-detector.d.ts.map +0 -1
- package/dist/parser/position-detector.js +0 -149
- package/dist/parser/position-detector.js.map +0 -1
- package/dist/parser/refinement-check.d.ts +0 -22
- package/dist/parser/refinement-check.d.ts.map +0 -1
- package/dist/parser/refinement-check.js +0 -194
- package/dist/parser/refinement-check.js.map +0 -1
- package/dist/parser/visitor.d.ts +0 -40
- package/dist/parser/visitor.d.ts.map +0 -1
- package/dist/parser/visitor.js +0 -587
- package/dist/parser/visitor.js.map +0 -1
- package/dist/refactoring/add-description-filter.d.ts +0 -8
- package/dist/refactoring/add-description-filter.d.ts.map +0 -1
- package/dist/refactoring/add-description-filter.js +0 -73
- package/dist/refactoring/add-description-filter.js.map +0 -1
- package/dist/refactoring/add-display-terms.d.ts +0 -20
- package/dist/refactoring/add-display-terms.d.ts.map +0 -1
- package/dist/refactoring/add-display-terms.js +0 -104
- package/dist/refactoring/add-display-terms.js.map +0 -1
- package/dist/refactoring/add-history-supplement.d.ts +0 -13
- package/dist/refactoring/add-history-supplement.d.ts.map +0 -1
- package/dist/refactoring/add-history-supplement.js +0 -80
- package/dist/refactoring/add-history-supplement.js.map +0 -1
- package/dist/refactoring/add-parentheses.d.ts +0 -14
- package/dist/refactoring/add-parentheses.d.ts.map +0 -1
- package/dist/refactoring/add-parentheses.js +0 -341
- package/dist/refactoring/add-parentheses.js.map +0 -1
- package/dist/refactoring/index.d.ts +0 -27
- package/dist/refactoring/index.d.ts.map +0 -1
- package/dist/refactoring/index.js +0 -237
- package/dist/refactoring/index.js.map +0 -1
- package/dist/refactoring/remove-parentheses.d.ts +0 -8
- package/dist/refactoring/remove-parentheses.d.ts.map +0 -1
- package/dist/refactoring/remove-parentheses.js +0 -162
- package/dist/refactoring/remove-parentheses.js.map +0 -1
- package/dist/refactoring/simplify-expression.d.ts +0 -15
- package/dist/refactoring/simplify-expression.d.ts.map +0 -1
- package/dist/refactoring/simplify-expression.js +0 -435
- package/dist/refactoring/simplify-expression.js.map +0 -1
- package/dist/refactoring/strip-display-terms.d.ts +0 -8
- package/dist/refactoring/strip-display-terms.d.ts.map +0 -1
- package/dist/refactoring/strip-display-terms.js +0 -27
- package/dist/refactoring/strip-display-terms.js.map +0 -1
- package/dist/semantic/ecl-text.d.ts +0 -35
- package/dist/semantic/ecl-text.d.ts.map +0 -1
- package/dist/semantic/ecl-text.js +0 -54
- package/dist/semantic/ecl-text.js.map +0 -1
- package/dist/semantic/validator.d.ts +0 -14
- package/dist/semantic/validator.d.ts.map +0 -1
- package/dist/semantic/validator.js +0 -183
- package/dist/semantic/validator.js.map +0 -1
- package/dist/semantic-tokens.d.ts +0 -12
- package/dist/semantic-tokens.d.ts.map +0 -1
- package/dist/semantic-tokens.js +0 -362
- package/dist/semantic-tokens.js.map +0 -1
- package/dist/terminology/fetch-compat-browser.d.ts +0 -3
- package/dist/terminology/fetch-compat-browser.d.ts.map +0 -1
- package/dist/terminology/fetch-compat-browser.js +0 -7
- package/dist/terminology/fetch-compat-browser.js.map +0 -1
- package/dist/terminology/fetch-compat.d.ts +0 -4
- package/dist/terminology/fetch-compat.d.ts.map +0 -1
- package/dist/terminology/fetch-compat.js +0 -18
- package/dist/terminology/fetch-compat.js.map +0 -1
- package/dist/terminology/fhir-service.d.ts +0 -65
- package/dist/terminology/fhir-service.d.ts.map +0 -1
- package/dist/terminology/fhir-service.js +0 -456
- package/dist/terminology/fhir-service.js.map +0 -1
- package/dist/terminology/index.d.ts +0 -4
- package/dist/terminology/index.d.ts.map +0 -1
- package/dist/terminology/index.js +0 -22
- package/dist/terminology/index.js.map +0 -1
- package/dist/terminology/mock-service.d.ts +0 -11
- package/dist/terminology/mock-service.d.ts.map +0 -1
- package/dist/terminology/mock-service.js +0 -108
- package/dist/terminology/mock-service.js.map +0 -1
- package/dist/terminology/types.d.ts +0 -31
- package/dist/terminology/types.d.ts.map +0 -1
- package/dist/terminology/types.js +0 -5
- package/dist/terminology/types.js.map +0 -1
- package/dist/terminology/verhoeff.d.ts +0 -38
- package/dist/terminology/verhoeff.d.ts.map +0 -1
- package/dist/terminology/verhoeff.js +0 -118
- package/dist/terminology/verhoeff.js.map +0 -1
- package/dist/text-utils.d.ts +0 -17
- package/dist/text-utils.d.ts.map +0 -1
- package/dist/text-utils.js +0 -49
- package/dist/text-utils.js.map +0 -1
- package/dist/types.d.ts +0 -64
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -15
- package/dist/types.js.map +0 -1
- package/dist/validation/error-refinement.d.ts +0 -31
- package/dist/validation/error-refinement.d.ts.map +0 -1
- package/dist/validation/error-refinement.js +0 -173
- package/dist/validation/error-refinement.js.map +0 -1
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2026 Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
|
3
|
-
// ABN 41 687 119 230. SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getAddDescriptionFilterAction = getAddDescriptionFilterAction;
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const ast_1 = require("../parser/ast");
|
|
8
|
-
/**
|
|
9
|
-
* Collects all SubExpressionNodes reachable from an ExpressionNode so we
|
|
10
|
-
* can inspect their filter lists.
|
|
11
|
-
*/
|
|
12
|
-
function collectSubExpressions(ast) {
|
|
13
|
-
const result = [];
|
|
14
|
-
function visit(node) {
|
|
15
|
-
switch (node.type) {
|
|
16
|
-
case ast_1.NodeType.SubExpressionConstraint:
|
|
17
|
-
result.push(node);
|
|
18
|
-
// If the focus is a nested expression, recurse into it
|
|
19
|
-
if (node.focus.type === ast_1.NodeType.ExpressionConstraint) {
|
|
20
|
-
const nested = node.focus;
|
|
21
|
-
visit(nested.expression);
|
|
22
|
-
}
|
|
23
|
-
break;
|
|
24
|
-
case ast_1.NodeType.CompoundExpression:
|
|
25
|
-
for (const operand of node.operands) {
|
|
26
|
-
visit(operand);
|
|
27
|
-
}
|
|
28
|
-
break;
|
|
29
|
-
case ast_1.NodeType.RefinedExpression:
|
|
30
|
-
visit(node.expression);
|
|
31
|
-
break;
|
|
32
|
-
case ast_1.NodeType.DottedExpression:
|
|
33
|
-
visit(node.source);
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
visit(ast.expression);
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Returns true if any SubExpressionNode in the AST already has a description
|
|
42
|
-
* filter attached.
|
|
43
|
-
*/
|
|
44
|
-
function hasDescriptionFilterInAST(ast) {
|
|
45
|
-
const subs = collectSubExpressions(ast);
|
|
46
|
-
return subs.some((sub) => sub.filters?.some((f) => f.filterType === 'description') ?? false);
|
|
47
|
-
}
|
|
48
|
-
/** Quick text-level check for an existing description filter block. */
|
|
49
|
-
function hasDescriptionFilterInText(text) {
|
|
50
|
-
return /\{\{\s*D/.test(text);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Returns an "Add description filter" code action when the expression does
|
|
54
|
-
* not already contain a description filter. Returns null otherwise.
|
|
55
|
-
*/
|
|
56
|
-
function getAddDescriptionFilterAction(ctx) {
|
|
57
|
-
// Fast text-based check first
|
|
58
|
-
if (hasDescriptionFilterInText(ctx.expressionText)) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
// AST-based check for robustness
|
|
62
|
-
if (ctx.ast?.expression && hasDescriptionFilterInAST(ctx.ast)) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
const insertPosition = ctx.expressionRange.end;
|
|
66
|
-
return {
|
|
67
|
-
title: 'Add description filter',
|
|
68
|
-
kind: 'refactor',
|
|
69
|
-
documentUri: ctx.documentUri,
|
|
70
|
-
edits: [(0, types_1.coreInsert)(insertPosition, ' {{ D term = "" }}')],
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=add-description-filter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-description-filter.js","sourceRoot":"","sources":["../../src/refactoring/add-description-filter.ts"],"names":[],"mappings":";AAAA,sFAAsF;AACtF,0DAA0D;;AA8E1D,sEAmBC;AAzFD,oCAAsC;AAEtC,uCAQuB;AAEvB;;;GAGG;AACH,SAAS,qBAAqB,CAAC,GAAmB;IAChD,MAAM,MAAM,GAAwB,EAAE,CAAC;IAEvC,SAAS,KAAK,CACZ,IAA+F;QAE/F,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,cAAQ,CAAC,uBAAuB;gBACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,uDAAuD;gBACvD,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,cAAQ,CAAC,oBAAoB,EAAE,CAAC;oBACtD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;oBAC1B,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAC3B,CAAC;gBACD,MAAM;YAER,KAAK,cAAQ,CAAC,kBAAkB;gBAC9B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACjB,CAAC;gBACD,MAAM;YAER,KAAK,cAAQ,CAAC,iBAAiB;gBAC7B,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACvB,MAAM;YAER,KAAK,cAAQ,CAAC,gBAAg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
|
-
import type { ITerminologyService } from '../terminology/types';
|
|
3
|
-
import type { RefactoringContext } from './index';
|
|
4
|
-
/**
|
|
5
|
-
* Returns an "Add display terms" code action if the expression contains
|
|
6
|
-
* at least one concept ID without a pipe-delimited display term.
|
|
7
|
-
* The action does NOT include an edit — it will be resolved asynchronously
|
|
8
|
-
* via {@link resolveAddDisplayTerms}.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getAddDisplayTermsAction(ctx: RefactoringContext): CoreCodeAction | null;
|
|
11
|
-
/**
|
|
12
|
-
* Resolves an "Add display terms" code action by performing FHIR lookups
|
|
13
|
-
* for each bare concept ID and inserting display terms into the expression.
|
|
14
|
-
*
|
|
15
|
-
* @param codeAction - The unresolved code action (with data attached)
|
|
16
|
-
* @param terminologyService - FHIR terminology service for concept lookups
|
|
17
|
-
* @returns The code action with an edit applied, or unchanged on failure
|
|
18
|
-
*/
|
|
19
|
-
export declare function resolveAddDisplayTerms(codeAction: CoreCodeAction, terminologyService: ITerminologyService): Promise<CoreCodeAction>;
|
|
20
|
-
//# sourceMappingURL=add-display-terms.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-display-terms.d.ts","sourceRoot":"","sources":["../../src/refactoring/add-display-terms.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAelD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,kBAAkB,GAAG,cAAc,GAAG,IAAI,CAmCvF;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,cAAc,EAC1B,kBAAkB,EAAE,mBAAmB,GACtC,OAAO,CAAC,cAAc,CAAC,CAyDzB"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2026 Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
|
3
|
-
// ABN 41 687 119 230. SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getAddDisplayTermsAction = getAddDisplayTermsAction;
|
|
6
|
-
exports.resolveAddDisplayTerms = resolveAddDisplayTerms;
|
|
7
|
-
const types_1 = require("../types");
|
|
8
|
-
const concept_extractor_1 = require("../parser/concept-extractor");
|
|
9
|
-
/**
|
|
10
|
-
* Returns an "Add display terms" code action if the expression contains
|
|
11
|
-
* at least one concept ID without a pipe-delimited display term.
|
|
12
|
-
* The action does NOT include an edit — it will be resolved asynchronously
|
|
13
|
-
* via {@link resolveAddDisplayTerms}.
|
|
14
|
-
*/
|
|
15
|
-
function getAddDisplayTermsAction(ctx) {
|
|
16
|
-
if (!ctx.ast) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
// Get ALL concept references (including duplicates) so every occurrence gets a term
|
|
20
|
-
const concepts = (0, concept_extractor_1.extractConceptIds)(ctx.ast, { deduplicate: false });
|
|
21
|
-
// Find concepts that don't already have a display term
|
|
22
|
-
const bareConcepts = concepts.filter((c) => !c.term || c.term.trim() === '');
|
|
23
|
-
if (bareConcepts.length === 0) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
const bareConceptIds = bareConcepts.map((c) => ({
|
|
27
|
-
id: c.id,
|
|
28
|
-
offset: c.range.start.offset,
|
|
29
|
-
}));
|
|
30
|
-
const data = {
|
|
31
|
-
kind: 'ecl.refactoring.resolve',
|
|
32
|
-
action: 'addDisplayTerms',
|
|
33
|
-
uri: ctx.documentUri,
|
|
34
|
-
expressionText: ctx.expressionText,
|
|
35
|
-
expressionRange: ctx.expressionRange,
|
|
36
|
-
bareConceptIds,
|
|
37
|
-
};
|
|
38
|
-
return {
|
|
39
|
-
title: 'Add display terms',
|
|
40
|
-
kind: 'refactor',
|
|
41
|
-
documentUri: ctx.documentUri,
|
|
42
|
-
data,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Resolves an "Add display terms" code action by performing FHIR lookups
|
|
47
|
-
* for each bare concept ID and inserting display terms into the expression.
|
|
48
|
-
*
|
|
49
|
-
* @param codeAction - The unresolved code action (with data attached)
|
|
50
|
-
* @param terminologyService - FHIR terminology service for concept lookups
|
|
51
|
-
* @returns The code action with an edit applied, or unchanged on failure
|
|
52
|
-
*/
|
|
53
|
-
async function resolveAddDisplayTerms(codeAction, terminologyService) {
|
|
54
|
-
const data = codeAction.data;
|
|
55
|
-
if (data?.action !== 'addDisplayTerms') {
|
|
56
|
-
return codeAction;
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
// Look up all bare concepts in parallel
|
|
60
|
-
const lookupResults = await Promise.all(data.bareConceptIds.map(async (entry) => {
|
|
61
|
-
const info = await terminologyService.getConceptInfo(entry.id);
|
|
62
|
-
return { ...entry, info };
|
|
63
|
-
}));
|
|
64
|
-
// Filter to only concepts we got a term for
|
|
65
|
-
const resolved = lookupResults.filter((r) => r.info !== null);
|
|
66
|
-
if (resolved.length === 0) {
|
|
67
|
-
return codeAction;
|
|
68
|
-
}
|
|
69
|
-
// Sort by offset descending so replacements don't shift earlier positions
|
|
70
|
-
resolved.sort((a, b) => b.offset - a.offset);
|
|
71
|
-
// Build the new expression text by inserting display terms
|
|
72
|
-
let newText = data.expressionText;
|
|
73
|
-
for (const entry of resolved) {
|
|
74
|
-
const term = entry.info?.pt ?? entry.info?.fsn;
|
|
75
|
-
if (!term)
|
|
76
|
-
continue;
|
|
77
|
-
// Find the concept ID at the expected offset and verify it's bare
|
|
78
|
-
// (not already followed by optional whitespace and a pipe)
|
|
79
|
-
const idStr = entry.id;
|
|
80
|
-
const candidate = newText.substring(entry.offset, entry.offset + idStr.length);
|
|
81
|
-
if (candidate !== idStr)
|
|
82
|
-
continue;
|
|
83
|
-
// Check that the ID is not already followed by a display term
|
|
84
|
-
const afterId = newText.substring(entry.offset + idStr.length);
|
|
85
|
-
if (/^\s*\|/.test(afterId))
|
|
86
|
-
continue;
|
|
87
|
-
// Insert the display term after the concept ID
|
|
88
|
-
newText =
|
|
89
|
-
newText.substring(0, entry.offset + idStr.length) +
|
|
90
|
-
` |${term}|` +
|
|
91
|
-
newText.substring(entry.offset + idStr.length);
|
|
92
|
-
}
|
|
93
|
-
// Only apply the edit if the text actually changed
|
|
94
|
-
if (newText !== data.expressionText) {
|
|
95
|
-
codeAction.edits = [(0, types_1.coreReplace)(data.expressionRange, newText)];
|
|
96
|
-
codeAction.documentUri = data.uri;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
// Graceful degradation — return the action unchanged if FHIR fails
|
|
101
|
-
}
|
|
102
|
-
return codeAction;
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=add-display-terms.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-display-terms.js","sourceRoot":"","sources":["../../src/refactoring/add-display-terms.ts"],"names":[],"mappings":";AAAA,sFAAsF;AACtF,0DAA0D;;AAgC1D,4DAmCC;AAUD,wDA4DC;AAjID,oCAAuC;AACvC,mEAAgE;AAiBhE;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,GAAuB;IAC9D,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oFAAoF;IACpF,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC,GAAG,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;IAEpE,uDAAuD;IACvD,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,C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,CAAC;QACnD,CAAC;QAED,mDAAmD;QACnD,IAAI,OAAO,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;YACpC,UAAU,CAAC,KAAK,GAAG,CAAC,IAAA,mBAAW,EAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;YAChE,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC;QACpC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;IACrE,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CoreCodeAction } from '../types';
|
|
2
|
-
import type { RefactoringContext } from './index';
|
|
3
|
-
/**
|
|
4
|
-
* Returns code actions to add a history supplement with each profile.
|
|
5
|
-
* Returns an empty array if the expression already has a history supplement.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getAddHistorySupplementAction(ctx: RefactoringContext): CoreCodeAction | null;
|
|
8
|
-
/**
|
|
9
|
-
* Returns 4 code actions (one per history profile) if the expression
|
|
10
|
-
* does not already contain a history supplement. Returns empty array otherwise.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getAddHistorySupplementActions(ctx: RefactoringContext): CoreCodeAction[];
|
|
13
|
-
//# sourceMappingURL=add-history-supplement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-history-supplement.d.ts","sourceRoot":"","sources":["../../src/refactoring/add-history-supplement.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA2ClD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,kBAAkB,GAAG,cAAc,GAAG,IAAI,CAAC;AA6B9F;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,kBAAkB,GAAG,cAAc,EAAE,CAwBxF"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2026 Commonwealth Scientific and Industrial Research Organisation (CSIRO)
|
|
3
|
-
// ABN 41 687 119 230. SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getAddHistorySupplementAction = getAddHistorySupplementAction;
|
|
6
|
-
exports.getAddHistorySupplementActions = getAddHistorySupplementActions;
|
|
7
|
-
const types_1 = require("../types");
|
|
8
|
-
const ast_1 = require("../parser/ast");
|
|
9
|
-
const HISTORY_SUPPLEMENT_PATTERN = /\{\{\s*\+/;
|
|
10
|
-
/**
|
|
11
|
-
* Returns true if any SubExpressionNode in the AST already has a historySupplement.
|
|
12
|
-
*/
|
|
13
|
-
function astHasHistorySupplement(expr) {
|
|
14
|
-
switch (expr.type) {
|
|
15
|
-
case ast_1.NodeType.SubExpressionConstraint:
|
|
16
|
-
return !!expr.historySupplement;
|
|
17
|
-
case ast_1.NodeType.CompoundExpression:
|
|
18
|
-
return expr.operands.some((op) => !!op.historySupplement);
|
|
19
|
-
case ast_1.NodeType.RefinedExpression:
|
|
20
|
-
return !!expr.expression.historySupplement;
|
|
21
|
-
case ast_1.NodeType.DottedExpression:
|
|
22
|
-
return !!expr.source.historySupplement;
|
|
23
|
-
default:
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/** History supplement profiles with their display labels. */
|
|
28
|
-
const HISTORY_PROFILES = [
|
|
29
|
-
{ profile: 'HISTORY-MIN', label: 'Minimal (SAME-AS, REPLACED-BY, MOVED-TO)' },
|
|
30
|
-
{ profile: 'HISTORY-MOD', label: 'Moderate (min + POSSIBLY-EQUIVALENT-TO)' },
|
|
31
|
-
{ profile: 'HISTORY-MAX', label: 'Maximum (all association types)' },
|
|
32
|
-
{ profile: 'HISTORY', label: 'All historical associations' },
|
|
33
|
-
];
|
|
34
|
-
function getAddHistorySupplementAction(ctx) {
|
|
35
|
-
// Quick text-based check
|
|
36
|
-
if (HISTORY_SUPPLEMENT_PATTERN.test(ctx.expressionText)) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
// AST-based check if available
|
|
40
|
-
if (ctx.ast?.expression) {
|
|
41
|
-
if (astHasHistorySupplement(ctx.ast.expression)) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// Return the first (HISTORY-MIN) as the primary action — the rest are
|
|
46
|
-
// collected by getAddHistorySupplementActions() for the full list.
|
|
47
|
-
return {
|
|
48
|
-
title: 'Add history supplement (HISTORY-MIN)',
|
|
49
|
-
kind: 'refactor',
|
|
50
|
-
documentUri: ctx.documentUri,
|
|
51
|
-
edits: [
|
|
52
|
-
(0, types_1.coreInsert)({ line: ctx.expressionRange.end.line, character: ctx.expressionRange.end.character }, ' {{ + HISTORY-MIN }}'),
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Returns 4 code actions (one per history profile) if the expression
|
|
58
|
-
* does not already contain a history supplement. Returns empty array otherwise.
|
|
59
|
-
*/
|
|
60
|
-
function getAddHistorySupplementActions(ctx) {
|
|
61
|
-
// Quick text-based check
|
|
62
|
-
if (HISTORY_SUPPLEMENT_PATTERN.test(ctx.expressionText)) {
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
// AST-based check if available
|
|
66
|
-
if (ctx.ast?.expression) {
|
|
67
|
-
if (astHasHistorySupplement(ctx.ast.expression)) {
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return HISTORY_PROFILES.map(({ profile }) => ({
|
|
72
|
-
title: `Add history supplement (${profile})`,
|
|
73
|
-
kind: 'refactor',
|
|
74
|
-
documentUri: ctx.documentUri,
|
|
75
|
-
edits: [
|
|
76
|
-
(0, types_1.coreInsert)({ line: ctx.expressionRange.end.line, character: ctx.expressionRange.end.character }, ` {{ + ${profile} }}`),
|
|
77
|
-
],
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=add-history-supplement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-history-supplement.js","sourceRoot":"","sources":["../../src/refactoring/add-history-supplement.ts"],"names":[],"mappings":";AAAA,sFAAsF;AACtF,0DAA0D;;AAyD1D,sEA0BC;AAMD,wEAwBC;AAzGD,oCAAsC;AAEtC,uCAAyC;AAQzC,MAAM,0BAA0B,GAAG,WAAW,CAAC;AAE/C;;GAEG;AACH,SAAS,uBAAuB,CAC9B,IAA+F;IAE/F,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,cAAQ,CAAC,uBAAuB;YACnC,OAAO,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAElC,KAAK,cAAQ,CAAC,kBAAkB;YAC9B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;QAE5D,KAAK,cAAQ,CAAC,iBAAiB;YAC7B,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;QAE7C,KAAK,cAAQ,CAAC,gBAAgB;YAC5B,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;QAEzC;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAED,6DAA6D;AAC7D,MAAM,gBAAgB,GAAG;IACvB,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,0CAA0C,EAAE;IAC7E,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,yCAAyC,EAAE;IAC5E,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,iCAAiC,EAAE;IACpE,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,6BAA6B,EAAE;CACpD,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AG,CAAC,WAAW;QAC5B,KAAK,EAAE;YACL,IAAA,kBAAU,EACR,EAAE,IAAI,EAAE,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,SAAS,EAAE,EACpF,SAAS,OAAO,KAAK,CACtB;SACF;KACF,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { CoreCodeAction } from '../types';
|
|
2
|
-
import type { RefactoringContext } from './index';
|
|
3
|
-
/**
|
|
4
|
-
* Returns an "Add explicit parentheses" code action when the expression
|
|
5
|
-
* has ambiguity that requires brackets:
|
|
6
|
-
*
|
|
7
|
-
* 1. Mixed operators (AND/OR/MINUS) at the top level
|
|
8
|
-
* 2. Multiple refined sub-expressions without brackets
|
|
9
|
-
*
|
|
10
|
-
* Splits on the lowest-precedence operator and wraps segments that
|
|
11
|
-
* contain different operators. One level of grouping per invocation.
|
|
12
|
-
*/
|
|
13
|
-
export declare function getAddParenthesesAction(ctx: RefactoringContext): CoreCodeAction | null;
|
|
14
|
-
//# sourceMappingURL=add-parentheses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-parentheses.d.ts","sourceRoot":"","sources":["../../src/refactoring/add-parentheses.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA6VlD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,kBAAkB,GAAG,cAAc,GAAG,IAAI,CAmCtF"}
|