Skip to content

Commit

Permalink
Merge pull request #23 from MeasureAuthoringTool/MAT-6929
Browse files Browse the repository at this point in the history
MAT-6929 QDM Measure Export: Text value that is required when Improvement Notation value is "other" does not appear in HQMF
  • Loading branch information
adongare authored Mar 15, 2024
2 parents c134430 + 8c19b7d commit d076cf3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/gov/cms/madie/services/MeasureMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public interface MeasureMapper {
@Mapping(target = "aggregation", source = "rateAggregation")
@Mapping(target = "rationale", source = "measure.measureMetaData.rationale")
@Mapping(target = "recommendations", source = "measure.measureMetaData.clinicalRecommendation")
@Mapping(target = "improvementNotations", source = "measure.improvementNotation")
@Mapping(target = "improvementNotations", expression = "java(getImprovementNotations(measure))")
@Mapping(target = "references", source = "measure.measureMetaData.references")
@Mapping(target = "definitions", source = "measure.measureMetaData.definition")
@Mapping(target = "guidance", source = "measure.measureMetaData.guidance")
Expand Down Expand Up @@ -143,6 +143,13 @@ public interface MeasureMapper {
@Mapping(target = "uuid", source = "measureSetId")
QualityMeasureSetType measureToQualityMeasureSet(QdmMeasure measure);

default String getImprovementNotations(QdmMeasure measure) {
if ("Other".equals(measure.getImprovementNotation())) {
return measure.getImprovementNotationOther();
}
return measure.getImprovementNotation();
}

// measureGrouping mappings
default MeasureGroupingType measureToMeasureGroupingType(
QdmMeasure measure, CqlLookups cqlLookups) {
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/gov/cms/madie/services/MeasureMapperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1022,4 +1022,23 @@ void testCqlDefinitionsToFunctionsType() {
assertThat(argumentTypes.get(0).getQdmDataType(), is(equalTo(arg1.getQdmDataType())));
assertThat(argumentTypes.get(0).getArgumentName(), is(equalTo(arg1.getArgumentName())));
}

@Test
void testGetImprovementNotationsForOther() {
String customNotation = "Custom improvement notation";
QdmMeasure measure =
QdmMeasure.builder()
.improvementNotation("Other")
.improvementNotationOther(customNotation)
.build();
assertThat(measureMapper.getImprovementNotations(measure), is(equalTo(customNotation)));
}

@Test
void testGetImprovementNotationsForIncreaseScore() {
String notation = "Increased score indicates improvement";
QdmMeasure measure =
QdmMeasure.builder().improvementNotation(notation).improvementNotationOther("").build();
assertThat(measureMapper.getImprovementNotations(measure), is(equalTo(notation)));
}
}

0 comments on commit d076cf3

Please sign in to comment.