Skip to content

Commit

Permalink
Merge branch 'develop' into MAT-6401_noContextError
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-cecilialiu authored Dec 6, 2024
2 parents b78d568 + c954fdc commit d2fa073
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/AceEditor/madie-ace-editor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ describe("synching the cql", () => {
expect(updatedContent.isUsingStatementChanged).toEqual(true);
});

test("replacing the error containing using content line to actual using content with FHIR", async () => {
const expectValue = "using QICore version '4.1.1'";
test("Not to replace the using FHIR statement for QICore measure if it is the only using statement", async () => {
const expectValue = "using FHIR version '4.0.1'";
const updatedContent = await updateEditorContent(
"using FHIR version '4.0.1'",
"",
Expand Down
13 changes: 10 additions & 3 deletions src/AceEditor/madie-ace-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,16 @@ export const updateUsingStatements = (
measureModel !== name ||
modelVersion !== version.replace(/["']/g, "")
) {
parsedEditorCqlCopy.cqlArrayToBeFiltered[
start.line - 1
] = `using ${measureModel} version '${modelVersion}'`;
// we want to keep FHIR if that's the only using model present for QICore.
if (measureModel === "QICore" && name === "FHIR") {
parsedEditorCqlCopy.cqlArrayToBeFiltered[
start.line - 1
] = `using FHIR version '4.0.1'`;
} else {
parsedEditorCqlCopy.cqlArrayToBeFiltered[
start.line - 1
] = `using ${measureModel} version '${modelVersion}'`;
}
isCqlUpdated = true;
}
} else if (usingStatements?.length > 1) {
Expand Down

0 comments on commit d2fa073

Please sign in to comment.