Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAT-7652 CQL Validation - Multiple Using Statements #400

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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 Expand Up @@ -470,7 +477,7 @@
console.warn("Editor is not set! Cannot set annotations!", editor);
}
}
}, [parserAnnotations, inboundAnnotations, editor]);

Check warning on line 480 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

React Hook useEffect has missing dependencies: 'customSetAnnotations' and 'validationsEnabled'. Either include them or remove the dependency array
const toggleSearchBox = () => {
// given the searchBox has not been instantiated we execCommand which also triggers show
//@ts-ignore
Expand Down Expand Up @@ -512,7 +519,7 @@
toggleSearchBox as EventListener
);
};
}, [editor, parseErrorMarkers, inboundErrorMarkers]);

Check warning on line 522 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

React Hook useEffect has missing dependencies: 'toggleSearchBox' and 'validationsEnabled'. Either include them or remove the dependency array

useEffect(() => {
const cqlMode = new CqlMode();
Expand All @@ -524,14 +531,14 @@
debouncedParse.cancel();
}
};
}, [debouncedParse]);

Check warning on line 534 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

React Hook useEffect has a missing dependency: 'validationsEnabled'. Either include it or remove the dependency array

useEffect(() => {
if (!_.isNil(value) && editor && validationsEnabled) {
setParsing(true);
debouncedParse(value, editor);
}
}, [value, editor, debouncedParse]);

Check warning on line 541 in src/AceEditor/madie-ace-editor.tsx

View workflow job for this annotation

GitHub Actions / Checkout, install, lint, build and test with coverage

React Hook useEffect has a missing dependency: 'validationsEnabled'. Either include it or remove the dependency array

useEffect(() => {
// This is to set aria-label on textarea for accessibility
Expand Down
Loading