Skip to content

Commit

Permalink
MAT-7909: Fixed when alias is malformed
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-akins committed Dec 9, 2024
1 parent 419886b commit 376db8f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/AceEditor/madie-ace-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,18 @@ const updateCql = (
parsedEditorCql.parsedCql.includes.forEach((include) => {
if (include.name === "FHIRHelpers" && include.called != "FHIRHelpers") {
//then modify and return .. also set cqlUpdates.isFhirHelpersAliasModified = true
const fhirHelpersIncludeLine =
parsedEditorCql.cqlArrayToBeFiltered[include.start.line - 1];
const fhirHelpersIncludeLine: string[] =
parsedEditorCql.cqlArrayToBeFiltered[include.start.line - 1].split(
" "
);
if (fhirHelpersIncludeLine[4].toLowerCase() === "called") {
fhirHelpersIncludeLine[5] = "FHIRHelpers";
} else {
console.error("FHIRHelpers include statement was malformed");
throw new Error("FHIRHelpers include statement was malformed");
}
parsedEditorCql.cqlArrayToBeFiltered[include.start.line - 1] =
fhirHelpersIncludeLine.replace(include.called, "FHIRHelpers");
fhirHelpersIncludeLine.join(" ");
cqlUpdates.isFhirHelpersAliasChanged = true;
}
});
Expand Down

0 comments on commit 376db8f

Please sign in to comment.