@aehrc/ecl-core 1.0.3 → 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 +21 -18
- package/dist/index.mjs +21 -18
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -55643,28 +55643,31 @@ async function getCompletionItemsWithSearch(inExpression, textBeforeCursor, curr
|
|
|
55643
55643
|
if (!inExpression || !terminologyService) {
|
|
55644
55644
|
return baseItems;
|
|
55645
55645
|
}
|
|
55646
|
-
|
|
55647
|
-
|
|
55648
|
-
|
|
55649
|
-
|
|
55650
|
-
|
|
55651
|
-
|
|
55652
|
-
|
|
55653
|
-
|
|
55654
|
-
|
|
55655
|
-
|
|
55646
|
+
try {
|
|
55647
|
+
const filterCtx = detectFilterContext(textBeforeCursor);
|
|
55648
|
+
if ((filterCtx == null ? void 0 : filterCtx.kind) === "filter-block") {
|
|
55649
|
+
const sub = filterCtx.subContext;
|
|
55650
|
+
if (typeof sub === "object" && sub.keyword) {
|
|
55651
|
+
const keyword = sub.keyword.toLowerCase();
|
|
55652
|
+
if (keyword in FILTER_ECL_CONSTRAINTS) {
|
|
55653
|
+
const fhirItems = await getFhirFilterCompletions(keyword, terminologyService);
|
|
55654
|
+
if (fhirItems.length > 0) {
|
|
55655
|
+
const staticCodes = new Set(
|
|
55656
|
+
baseItems.map((item) => {
|
|
55657
|
+
const codeMatch = /^(\d{6,18})\s/.exec(typeof item.label === "string" ? item.label : "");
|
|
55658
|
+
return codeMatch ? codeMatch[1] : null;
|
|
55659
|
+
}).filter((code) => code !== null)
|
|
55660
|
+
);
|
|
55661
|
+
const uniqueFhirItems = fhirItems.filter((item) => {
|
|
55656
55662
|
const codeMatch = /^(\d{6,18})\s/.exec(typeof item.label === "string" ? item.label : "");
|
|
55657
|
-
return codeMatch ? codeMatch[1] :
|
|
55658
|
-
})
|
|
55659
|
-
|
|
55660
|
-
|
|
55661
|
-
const codeMatch = /^(\d{6,18})\s/.exec(typeof item.label === "string" ? item.label : "");
|
|
55662
|
-
return codeMatch ? !staticCodes.has(codeMatch[1]) : true;
|
|
55663
|
-
});
|
|
55664
|
-
return [...baseItems, ...uniqueFhirItems];
|
|
55663
|
+
return codeMatch ? !staticCodes.has(codeMatch[1]) : true;
|
|
55664
|
+
});
|
|
55665
|
+
return [...baseItems, ...uniqueFhirItems];
|
|
55666
|
+
}
|
|
55665
55667
|
}
|
|
55666
55668
|
}
|
|
55667
55669
|
}
|
|
55670
|
+
} catch {
|
|
55668
55671
|
}
|
|
55669
55672
|
const searchResult = extractConceptSearchQuery(currentLine.substring(0, cursorColumn));
|
|
55670
55673
|
if (!searchResult) {
|
package/dist/index.mjs
CHANGED
|
@@ -55641,28 +55641,31 @@ async function getCompletionItemsWithSearch(inExpression, textBeforeCursor, curr
|
|
|
55641
55641
|
if (!inExpression || !terminologyService) {
|
|
55642
55642
|
return baseItems;
|
|
55643
55643
|
}
|
|
55644
|
-
|
|
55645
|
-
|
|
55646
|
-
|
|
55647
|
-
|
|
55648
|
-
|
|
55649
|
-
|
|
55650
|
-
|
|
55651
|
-
|
|
55652
|
-
|
|
55653
|
-
|
|
55644
|
+
try {
|
|
55645
|
+
const filterCtx = detectFilterContext(textBeforeCursor);
|
|
55646
|
+
if ((filterCtx == null ? void 0 : filterCtx.kind) === "filter-block") {
|
|
55647
|
+
const sub = filterCtx.subContext;
|
|
55648
|
+
if (typeof sub === "object" && sub.keyword) {
|
|
55649
|
+
const keyword = sub.keyword.toLowerCase();
|
|
55650
|
+
if (keyword in FILTER_ECL_CONSTRAINTS) {
|
|
55651
|
+
const fhirItems = await getFhirFilterCompletions(keyword, terminologyService);
|
|
55652
|
+
if (fhirItems.length > 0) {
|
|
55653
|
+
const staticCodes = new Set(
|
|
55654
|
+
baseItems.map((item) => {
|
|
55655
|
+
const codeMatch = /^(\d{6,18})\s/.exec(typeof item.label === "string" ? item.label : "");
|
|
55656
|
+
return codeMatch ? codeMatch[1] : null;
|
|
55657
|
+
}).filter((code) => code !== null)
|
|
55658
|
+
);
|
|
55659
|
+
const uniqueFhirItems = fhirItems.filter((item) => {
|
|
55654
55660
|
const codeMatch = /^(\d{6,18})\s/.exec(typeof item.label === "string" ? item.label : "");
|
|
55655
|
-
return codeMatch ? codeMatch[1] :
|
|
55656
|
-
})
|
|
55657
|
-
|
|
55658
|
-
|
|
55659
|
-
const codeMatch = /^(\d{6,18})\s/.exec(typeof item.label === "string" ? item.label : "");
|
|
55660
|
-
return codeMatch ? !staticCodes.has(codeMatch[1]) : true;
|
|
55661
|
-
});
|
|
55662
|
-
return [...baseItems, ...uniqueFhirItems];
|
|
55661
|
+
return codeMatch ? !staticCodes.has(codeMatch[1]) : true;
|
|
55662
|
+
});
|
|
55663
|
+
return [...baseItems, ...uniqueFhirItems];
|
|
55664
|
+
}
|
|
55663
55665
|
}
|
|
55664
55666
|
}
|
|
55665
55667
|
}
|
|
55668
|
+
} catch {
|
|
55666
55669
|
}
|
|
55667
55670
|
const searchResult = extractConceptSearchQuery(currentLine.substring(0, cursorColumn));
|
|
55668
55671
|
if (!searchResult) {
|