Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mat 6502 #186

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading