Skip to content

Commit

Permalink
MAT-7652 CQL Validation - Multiple Using Statements
Browse files Browse the repository at this point in the history
  • Loading branch information
adongare committed Dec 5, 2024
1 parent 04cb868 commit cfe7f0b
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 there is only one using model 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 cfe7f0b

Please sign in to comment.