From 7267179d2d1156e370a0b7865bdda05230bf5c8f Mon Sep 17 00:00:00 2001 From: Bryn Rhodes Date: Tue, 4 Feb 2025 11:12:35 -0700 Subject: [PATCH] #80: Fixed support for CQL namespace resolution in Npm packages --- src/executeCql.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/executeCql.ts b/src/executeCql.ts index 979b46f..d7bc696 100644 --- a/src/executeCql.ts +++ b/src/executeCql.ts @@ -28,6 +28,7 @@ export async function executeCQLFile(uri: Uri): Promise { window.showInformationMessage('Unable to determine version of FHIR used. Defaulting to R4.'); } + const rootDir = Utils.resolvePath(projectPath); const optionsPath = Utils.resolvePath(libraryDirectory, 'cql-options.json'); const measurementPeriod = ''; const testPath = Utils.resolvePath(projectPath, 'input', 'tests'); @@ -56,6 +57,7 @@ export async function executeCQLFile(uri: Uri): Promise { terminologyPath, p.name, measurementPeriod, + rootDir ), ); } @@ -174,6 +176,7 @@ function getExecArgs( terminologyPath: Uri | null, contextValue: string | null, measurementPeriod: string, + rootDir: Uri, ): string[] { // TODO: One day we might support other models and contexts const modelType = 'FHIR'; @@ -202,5 +205,9 @@ function getExecArgs( args.push(`-pv=${measurementPeriod}`); } + if (rootDir) { + args.push(`-rd=${rootDir}`); + } + return args; }