Skip to content

Commit

Permalink
Merge pull request #448 from MeasureAuthoringTool/feature/feature/MAT…
Browse files Browse the repository at this point in the history
…-6383

MAT-6383 bug fix for saving QDM population Criteria
  • Loading branch information
RohitKandimalla authored Nov 3, 2023
2 parents 12b2e56 + 67d752d commit 9892f33
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Population,
MeasureObservation,
Stratification,
MeasureScoring,
} from "@madie/madie-models";
import { MenuItem as MuiMenuItem, Typography, Divider } from "@mui/material";
import { CqlAntlr } from "@madie/cql-antlr-parser/dist/src";
Expand Down Expand Up @@ -515,7 +516,9 @@ const MeasureGroups = (props: MeasureGroupProps) => {
return;
}
}
group.measureObservations = orderingMeasureGroupObservations(group);
if (group.scoring === MeasureScoring.RATIO) {
group.measureObservations = sortObservations(group);
}
if (measure?.groups && !(measureGroupNumber >= measure?.groups?.length)) {
group.id = measure?.groups[measureGroupNumber].id;
measureServiceApi
Expand Down Expand Up @@ -577,10 +580,11 @@ const MeasureGroups = (props: MeasureGroupProps) => {
}
};

const orderingMeasureGroupObservations = (group: Group) => {
// sort observations to follow [denom observation, numer observation] order
const sortObservations = (group: Group) => {
return group.populations
.map((population) => {
return group.measureObservations.find(
return group.measureObservations?.find(
(observation) => population.id === observation.criteriaReference
);
})
Expand Down

0 comments on commit 9892f33

Please sign in to comment.