@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 CHANGED
@@ -55643,28 +55643,31 @@ async function getCompletionItemsWithSearch(inExpression, textBeforeCursor, curr
55643
55643
  if (!inExpression || !terminologyService) {
55644
55644
  return baseItems;
55645
55645
  }
55646
- const filterCtx = detectFilterContext(textBeforeCursor);
55647
- if ((filterCtx == null ? void 0 : filterCtx.kind) === "filter-block") {
55648
- const sub = filterCtx.subContext;
55649
- if (typeof sub === "object" && sub.keyword) {
55650
- const keyword = sub.keyword.toLowerCase();
55651
- if (keyword in FILTER_ECL_CONSTRAINTS) {
55652
- const fhirItems = await getFhirFilterCompletions(keyword, terminologyService);
55653
- if (fhirItems.length > 0) {
55654
- const staticCodes = new Set(
55655
- baseItems.map((item) => {
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] : null;
55658
- }).filter((code) => code !== null)
55659
- );
55660
- const uniqueFhirItems = fhirItems.filter((item) => {
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
- const filterCtx = detectFilterContext(textBeforeCursor);
55645
- if ((filterCtx == null ? void 0 : filterCtx.kind) === "filter-block") {
55646
- const sub = filterCtx.subContext;
55647
- if (typeof sub === "object" && sub.keyword) {
55648
- const keyword = sub.keyword.toLowerCase();
55649
- if (keyword in FILTER_ECL_CONSTRAINTS) {
55650
- const fhirItems = await getFhirFilterCompletions(keyword, terminologyService);
55651
- if (fhirItems.length > 0) {
55652
- const staticCodes = new Set(
55653
- baseItems.map((item) => {
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] : null;
55656
- }).filter((code) => code !== null)
55657
- );
55658
- const uniqueFhirItems = fhirItems.filter((item) => {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aehrc/ecl-core",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },