Skip to content

Commit dfb75c2

Browse files
committed
Fixed rootDir parameter being passed on each test case, rather than operation level
1 parent 282aa69 commit dfb75c2

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/executeCql.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ export async function executeCQLFile(uri: Uri): Promise<void> {
5656
p.path,
5757
terminologyPath,
5858
p.name,
59-
measurementPeriod,
60-
rootDir
59+
measurementPeriod
6160
),
6261
);
6362
}
@@ -81,7 +80,7 @@ export async function executeCQLFile(uri: Uri): Promise<void> {
8180
await insertLineAtEnd(textEditor, `${terminologyMessage}`);
8281
await insertLineAtEnd(textEditor, `${testMessage}`);
8382

84-
let operationArgs = getCqlCommandArgs(fhirVersion, optionsPath);
83+
let operationArgs = getCqlCommandArgs(fhirVersion, optionsPath, rootDir);
8584
operationArgs.push(...testCasesArgs);
8685
await executeCQL(textEditor, operationArgs);
8786
}
@@ -157,7 +156,7 @@ async function executeCQL(textEditor: TextEditor, operationArgs: string[]) {
157156
);
158157
}
159158

160-
function getCqlCommandArgs(fhirVersion: string, optionsPath: Uri): string[] {
159+
function getCqlCommandArgs(fhirVersion: string, optionsPath: Uri, rootDir: Uri): string[] {
161160
const args = ['cql'];
162161

163162
args.push(`-fv=${fhirVersion}`);
@@ -166,6 +165,10 @@ function getCqlCommandArgs(fhirVersion: string, optionsPath: Uri): string[] {
166165
args.push(`-op=${optionsPath}`);
167166
}
168167

168+
if (rootDir) {
169+
args.push(`-rd=${rootDir}`);
170+
}
171+
169172
return args;
170173
}
171174

@@ -175,8 +178,7 @@ function getExecArgs(
175178
modelPath: Uri | null,
176179
terminologyPath: Uri | null,
177180
contextValue: string | null,
178-
measurementPeriod: string,
179-
rootDir: Uri,
181+
measurementPeriod: string
180182
): string[] {
181183
// TODO: One day we might support other models and contexts
182184
const modelType = 'FHIR';
@@ -205,9 +207,5 @@ function getExecArgs(
205207
args.push(`-pv=${measurementPeriod}`);
206208
}
207209

208-
if (rootDir) {
209-
args.push(`-rd=${rootDir}`);
210-
}
211-
212210
return args;
213211
}

0 commit comments

Comments
 (0)