Skip to content

Commit

Permalink
Merge pull request #186 from MeasureAuthoringTool/feature/MAT-6502
Browse files Browse the repository at this point in the history
Feature/mat 6502
  • Loading branch information
RohitKandimalla authored Dec 11, 2023
2 parents 36f4a85 + 81f2d25 commit 3725b24
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public static final class CqfMeasures {

public static final String RATE_AGGREGATION_URI =
"http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-rateAggregation";

public static final String IMPROVEMENT_NOTATION_URI =
"http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-improvementNotation";

public static final String IMPROVEMENT_NOTATION_CODE_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/measure-improvement-notation";
}

public static final class CqfTestCases {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,29 @@ public MeasureGroupComponent buildGroup(Group madieGroup) {
UriConstants.CqfMeasures.RATE_AGGREGATION_URI,
new CodeType(madieGroup.getRateAggregation())));
}
if (StringUtils.isNotBlank(madieGroup.getImprovementNotation())) {
element.addExtension(
new Extension(
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_URI,
buildImprovementNotation(madieGroup.getImprovementNotation())));
}
return (MeasureGroupComponent) element;
}

private CodeableConcept buildImprovementNotation(String improvementNotation) {
if ("Increased score indicates improvement".equalsIgnoreCase(improvementNotation)) {
return buildCodeableConcept(
"increase",
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
improvementNotation);
} else {
return buildCodeableConcept(
"decrease",
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
improvementNotation);
}
}

private List<CodeableConcept> getMeasureTypes(List<MeasureGroupTypes> measureGroupTypes) {
if (CollectionUtils.isEmpty(measureGroupTypes)) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/Measure.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -1016,4 +1016,4 @@
{% endif %}

</table>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,19 @@ public void testCreateFhirMeasureForMadieMeasure() {
.getExtensionByUrl(UriConstants.CqfMeasures.RATE_AGGREGATION_URI)
.getValue()
.primitiveValue());

Extension improvementNotationExt =
group1.getExtensionByUrl(UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_URI);
CodeableConcept improvementNotation =
improvementNotationExt.getValue().castToCodeableConcept(improvementNotationExt.getValue());
assertEquals(
madieMeasure.getGroups().get(0).getImprovementNotation(),
improvementNotation.getCoding().get(0).getDisplay());
assertEquals("increase", improvementNotation.getCoding().get(0).getCode());
assertEquals(
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
improvementNotation.getCoding().get(0).getSystem());

Extension scoringUnitExt1 = group1.getExtensionByUrl(UriConstants.CqfMeasures.SCORING_UNIT_URI);
assertThat(scoringUnitExt1, is(notNullValue()));
assertThat(scoringUnitExt1.getValue(), is(notNullValue()));
Expand Down Expand Up @@ -237,6 +250,20 @@ public void testCreateFhirMeasureForMadieMeasure() {
.getValue()
.primitiveValue(),
is(equalTo("boolean")));
assertNull(group2.getExtensionByUrl(UriConstants.CqfMeasures.RATE_AGGREGATION_URI));
Extension improvementNotationExt1 =
group2.getExtensionByUrl(UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_URI);
CodeableConcept improvementNotation1 =
improvementNotationExt1
.getValue()
.castToCodeableConcept(improvementNotationExt1.getValue());
assertEquals(
madieMeasure.getGroups().get(1).getImprovementNotation(),
improvementNotation1.getCoding().get(0).getDisplay());
assertEquals("decrease", improvementNotation1.getCoding().get(0).getCode());
assertEquals(
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
improvementNotation1.getCoding().get(0).getSystem());
Extension group2Ex = group2.getExtension().get(0);
assertThat(group2Ex.getUrl(), is(equalTo(UriConstants.CqfMeasures.SCORING_URI)));
CodeableConcept group2CodeableConcept = group2Ex.castToCodeableConcept(group2Ex.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
],
"measureObservations":null,
"groupDescription":"test 4495 group 1",
"improvementNotation":"",
"improvementNotation":"Increased score indicates improvement",
"rateAggregation":"Rate Aggregation Example",
"scoringUnit":{
"label":"kg kilogram",
Expand Down Expand Up @@ -222,7 +222,7 @@
],
"measureObservations":null,
"groupDescription":"group2",
"improvementNotation":"",
"improvementNotation":"Decreased score indicates improvement",
"rateAggregation":"",
"measureGroupTypes":[
"Outcome"
Expand Down

0 comments on commit 3725b24

Please sign in to comment.