Skip to content

Commit

Permalink
MAT-7652 do not replace FHIR model if thats the only using model for …
Browse files Browse the repository at this point in the history
…QICore measure/library
  • Loading branch information
adongare committed Dec 9, 2024
1 parent 9a67d42 commit f01ebbd
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/AceEditor/madie-ace-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,22 @@ export const updateUsingStatements = (
let isCqlUpdated = false;
if (usingStatements?.length === 1) {
const { name, version, start } = usingStatements[0];
if (
measureModel !== name ||
modelVersion !== version.replace(/["']/g, "")
) {
// we want to keep FHIR if that's the only using model present for QICore.
const cleanedVersion = version.replace(/["']/g, "");
if (measureModel !== name || modelVersion !== cleanedVersion) {
// keep FHIR if that's the only using model present for QICore but update version if it was incorrect.
if (measureModel === "QICore" && name === "FHIR") {
parsedEditorCqlCopy.cqlArrayToBeFiltered[
start.line - 1
] = `using FHIR version '4.0.1'`;
if (cleanedVersion !== "4.0.1") {
parsedEditorCqlCopy.cqlArrayToBeFiltered[
start.line - 1
] = `using FHIR version '4.0.1'`;
isCqlUpdated = true;
}
} else {
parsedEditorCqlCopy.cqlArrayToBeFiltered[
start.line - 1
] = `using ${measureModel} version '${modelVersion}'`;
isCqlUpdated = true;
}
isCqlUpdated = true;
}
} else if (usingStatements?.length > 1) {
// to track if the usings statement was verified or not
Expand Down

0 comments on commit f01ebbd

Please sign in to comment.