Skip to content

Commit

Permalink
Merge pull request #274 from MeasureAuthoringTool/MAT-8065_updateUrls…
Browse files Browse the repository at this point in the history
…ToTHO

MAT-8065 update export URLs to reference THO for measure identifiers
  • Loading branch information
sb-cecilialiu authored Jan 14, 2025
2 parents 9f86f7e + 8aedc3f commit 165df27
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,31 @@
public final class UriConstants {
public static final String URN_UUID_PREFIX = "urn:uuid:";
public static final String URN_IETF_RFC_3986 = "urn:ietf:rfc:3986";
public static final String POPULATION_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/measure-population";
public static final String SCORING_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/measure-scoring";
public static final String LIBRARY_SYSTEM_TYPE_URI =
"http://terminology.hl7.org/CodeSystem/library-type";

public static final class FhirStructureDefinitions {
public static final String CATEGORY_URI =
"http://hl7.org/fhir/StructureDefinition/structuredefinition-category";
}

public static final class CodeSystem {
public static final String POPULATION_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/measure-population";
public static final String SCORING_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/measure-scoring";
public static final String LIBRARY_SYSTEM_TYPE_URI =
"http://terminology.hl7.org/CodeSystem/library-type";

public static final String CODE_SYSTEM_IDENTIFIER_TYPE_URI =
"http://terminology.hl7.org/CodeSystem/artifact-identifier-type";
public static final String CODE_SYSTEM_MEASURE_DATA_USAGE_URI =
"http://terminology.hl7.org/CodeSystem/measure-data-usage";
public static final String IMPROVEMENT_NOTATION_CODE_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/measure-improvement-notation";

public static final String CODE_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/usage-context-type";
}

public static final class CqfMeasures {
public static final String EFFECTIVE_DATA_REQUIREMENT_URL =
"http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-effectiveDataRequirements";
Expand Down Expand Up @@ -50,18 +63,12 @@ public static final class CqfMeasures {
public static final String EXECUTABLE_MEASURE_PROFILE_URI =
"http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/executable-measure-cqfm";

public static final String CODE_SYSTEM_IDENTIFIER_TYPE_URI =
"http://hl7.org/fhir/us/cqfmeasures/CodeSystem/identifier-type";

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

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

public static final String CODE_SYSTEM_MEASURE_DATA_USAGE_URI =
"http://terminology.hl7.org/CodeSystem/measure-data-usage";

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

Expand All @@ -73,9 +80,6 @@ public static final class CqfMeasures {

public static final String IMPROVEMENT_NOTATION_GUIDANCE_URI =
"http://hl7.org/fhir/StructureDefinition/cqf-improvementNotationGuidance";

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

public static final class CqfTestCases {
Expand All @@ -90,8 +94,6 @@ public static final class CqfTestCases {
}

public static final class UseContext {
public static final String CODE_SYSTEM_URI =
"http://terminology.hl7.org/CodeSystem/usage-context-type";
public static final String VALUE_CODABLE_CONTEXT_CODING_SYSTEM_URI =
"http://hl7.org/fhir/us/cqfmeasures/CodeSystem/quality-programs";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Library convertToFhirLibrary(CqlLibrary cqlLibrary) {
library.setExperimental(cqlLibrary.isExperimental());
library.setContent(
createContent(cqlLibrary.getCql(), cqlLibrary.getElmJson(), cqlLibrary.getElmXml()));
library.setType(createType(UriConstants.LIBRARY_SYSTEM_TYPE_URI, SYSTEM_CODE));
library.setType(createType(UriConstants.CodeSystem.LIBRARY_SYSTEM_TYPE_URI, SYSTEM_CODE));
library.setUrl(
FhirResourceHelpers.buildResourceFullUrl("Library", cqlLibrary.getCqlLibraryName()));
library.getExtension().addAll(visitor.getDrcExtensions());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ public Identifier buildIdentifier(
identifier.setType(
buildCodeableConcept(
identifierType.getCode(),
UriConstants.CqfMeasures.CODE_SYSTEM_IDENTIFIER_TYPE_URI,
UriConstants.CodeSystem.CODE_SYSTEM_IDENTIFIER_TYPE_URI,
identifierType.getDisplay()));
log.info("\nbuildIdentifier: identifier = " + identifier.toString());
return identifier;
}

Expand Down Expand Up @@ -293,12 +294,12 @@ private CodeableConcept buildImprovementNotation(String improvementNotation) {
if ("Increased score indicates improvement".equalsIgnoreCase(improvementNotation)) {
return buildCodeableConcept(
"increase",
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
UriConstants.CodeSystem.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
improvementNotation);
} else {
return buildCodeableConcept(
"decrease",
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
UriConstants.CodeSystem.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
improvementNotation);
}
}
Expand Down Expand Up @@ -334,7 +335,7 @@ private List<MeasureGroupPopulationComponent> buildPopulations(Group madieGroup)
.setCode(
buildCodeableConcept(
populationCode,
UriConstants.POPULATION_SYSTEM_URI,
UriConstants.CodeSystem.POPULATION_SYSTEM_URI,
populationDisplay))
.setCriteria(
buildExpression("text/cql-identifier", population.getDefinition()))
Expand All @@ -360,7 +361,7 @@ private List<MeasureGroupPopulationComponent> buildObservations(Group madieGroup
.setCode(
buildCodeableConcept(
PopulationType.MEASURE_OBSERVATION.toCode(),
UriConstants.POPULATION_SYSTEM_URI,
UriConstants.CodeSystem.POPULATION_SYSTEM_URI,
PopulationType.MEASURE_OBSERVATION.getDisplay()))
.setCriteria(
buildExpression(
Expand Down Expand Up @@ -404,7 +405,7 @@ private List<MeasureGroupStratifierComponent> buildStratifications(Group madieGr
UriConstants.CqfMeasures.APPLIES_TO_URI,
buildCodeableConcept(
associationPopulation.toCode(),
UriConstants.POPULATION_SYSTEM_URI,
UriConstants.CodeSystem.POPULATION_SYSTEM_URI,
associationPopulation.getDisplay())));
return extension.get();
})
Expand Down Expand Up @@ -478,7 +479,7 @@ public CodeableConcept buildScoringConcept(String scoring) {
if ("continuous variable".equals(code)) {
code = "continuous-variable";
}
return buildCodeableConcept(code, UriConstants.SCORING_SYSTEM_URI, scoring);
return buildCodeableConcept(code, UriConstants.CodeSystem.SCORING_SYSTEM_URI, scoring);
}

private CodeableConcept buildCodeableConcept(String code, String system, String display) {
Expand Down Expand Up @@ -557,7 +558,7 @@ public Extension buildSupplementalDataGuidanceExt(Measure madieMeasure) {
.add(
buildCoding(
"supplemental-data",
UriConstants.CqfMeasures.CODE_SYSTEM_MEASURE_DATA_USAGE_URI,
UriConstants.CodeSystem.CODE_SYSTEM_MEASURE_DATA_USAGE_URI,
"Supplemental Data"));
codeableConcept.setText("Supplemental Data Guidance");
Extension ext = new Extension(UriConstants.CqfMeasures.SUPPLEMENTAL_DATA_GUIDANCE_URI);
Expand Down Expand Up @@ -588,7 +589,7 @@ public Extension buildRiskAdjustmentGuidanceExt(Measure madieMeasure) {
.add(
buildCoding(
"risk-adjustment-factor",
UriConstants.CqfMeasures.CODE_SYSTEM_MEASURE_DATA_USAGE_URI,
UriConstants.CodeSystem.CODE_SYSTEM_MEASURE_DATA_USAGE_URI,
"Risk Adjustment Factor"));
codeableConcept.setText("Risk Adjustment Variable Guidance");
Extension ext = new Extension(UriConstants.CqfMeasures.SUPPLEMENTAL_DATA_GUIDANCE_URI);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private List<MeasureReport.MeasureReportGroupComponent> buildMeasureReportGroupC
.setCode(
FhirResourceHelpers.buildCodeableConcept(
testCasePopulationValue.getName().toCode(),
UriConstants.POPULATION_SYSTEM_URI,
UriConstants.CodeSystem.POPULATION_SYSTEM_URI,
testCasePopulationValue.getName().getDisplay()))
.setCount(
FhirResourceHelpers.getExpectedValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static List<MeasureReport.StratifierGroupPopulationComponent> buildStratu
stratifierGroupPopulationComponent.setCode(
buildCodeableConcept(
populationValue.getName().toCode(),
UriConstants.POPULATION_SYSTEM_URI,
UriConstants.CodeSystem.POPULATION_SYSTEM_URI,
populationValue.getName().getDisplay()));

stratifierGroupPopulationComponent.setCount(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package gov.cms.madie.madiefhirservice.services;

import static gov.cms.madie.madiefhirservice.constants.UriConstants.CqfMeasures.CODE_SYSTEM_IDENTIFIER_TYPE_URI;
import static gov.cms.madie.madiefhirservice.constants.UriConstants.CodeSystem.CODE_SYSTEM_IDENTIFIER_TYPE_URI;
import static gov.cms.madie.madiefhirservice.constants.UriConstants.MadieMeasure.SHORT_NAME;
import static gov.cms.madie.madiefhirservice.constants.IdentifierType.CODE_ENDORSER;
import static gov.cms.madie.madiefhirservice.constants.IdentifierType.CODE_PUBLISHER;
Expand Down Expand Up @@ -179,7 +179,7 @@ public void testCreateFhirMeasureForMadieMeasure() {
improvementNotation.getCoding().get(0).getDisplay());
assertEquals("increase", improvementNotation.getCoding().get(0).getCode());
assertEquals(
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
UriConstants.CodeSystem.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
improvementNotation.getCoding().get(0).getSystem());
assertEquals(
improvementNotationGudianceExt.getUrl(),
Expand All @@ -206,7 +206,7 @@ public void testCreateFhirMeasureForMadieMeasure() {
assertThat(group1CodeableConcept.getCoding().get(0), is(notNullValue()));
assertThat(
group1CodeableConcept.getCoding().get(0).getSystem(),
is(equalTo(UriConstants.SCORING_SYSTEM_URI)));
is(equalTo(UriConstants.CodeSystem.SCORING_SYSTEM_URI)));
assertThat(group1CodeableConcept.getCoding().get(0).getCode(), is(equalTo("ratio")));

List<Extension> groupTypes =
Expand Down Expand Up @@ -266,7 +266,7 @@ public void testCreateFhirMeasureForMadieMeasure() {
improvementNotation1.getCoding().get(0).getDisplay());
assertEquals("decrease", improvementNotation1.getCoding().get(0).getCode());
assertEquals(
UriConstants.CqfMeasures.IMPROVEMENT_NOTATION_CODE_SYSTEM_URI,
UriConstants.CodeSystem.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)));
Expand All @@ -276,7 +276,7 @@ public void testCreateFhirMeasureForMadieMeasure() {
assertThat(group2CodeableConcept.getCoding().get(0), is(notNullValue()));
assertThat(
group2CodeableConcept.getCoding().get(0).getSystem(),
is(equalTo(UriConstants.SCORING_SYSTEM_URI)));
is(equalTo(UriConstants.CodeSystem.SCORING_SYSTEM_URI)));
assertThat(group2CodeableConcept.getCoding().get(0).getCode(), is(equalTo("ratio")));

// verifies if SupplemenntalData is populated, it includes both SDE and RiskAdjustmentFators
Expand Down Expand Up @@ -486,7 +486,7 @@ public void testCreateFhirMeasureForMadieRatioMeasure() {
assertThat(group1CodeableConcept.getCoding().get(0), is(notNullValue()));
assertThat(
group1CodeableConcept.getCoding().get(0).getSystem(),
is(equalTo(UriConstants.SCORING_SYSTEM_URI)));
is(equalTo(UriConstants.CodeSystem.SCORING_SYSTEM_URI)));
assertThat(group1CodeableConcept.getCoding().get(0).getCode(), is(equalTo("ratio")));

MeasureGroupPopulationComponent groupPopComponent = group1.getPopulation().get(0);
Expand Down Expand Up @@ -611,7 +611,7 @@ public void testCreateFhirMeasureForMadieCVMeasure() {
assertThat(group1CodeableConcept.getCoding().get(0), is(notNullValue()));
assertThat(
group1CodeableConcept.getCoding().get(0).getSystem(),
is(equalTo(UriConstants.SCORING_SYSTEM_URI)));
is(equalTo(UriConstants.CodeSystem.SCORING_SYSTEM_URI)));
assertThat(
group1CodeableConcept.getCoding().get(0).getCode(), is(equalTo("continuous-variable")));

Expand Down Expand Up @@ -812,7 +812,7 @@ public void testBuildFhirPopulationGroupsWithStratifications() {
assertThat(codeableConcept.getCodingFirstRep(), is(notNullValue()));
assertThat(
codeableConcept.getCodingFirstRep().getSystem(),
is(equalTo(UriConstants.POPULATION_SYSTEM_URI)));
is(equalTo(UriConstants.CodeSystem.POPULATION_SYSTEM_URI)));
assertThat(
codeableConcept.getCodingFirstRep().getCode(),
is(equalTo(PopulationType.INITIAL_POPULATION.toCode())));
Expand Down Expand Up @@ -882,7 +882,7 @@ public void testBuildFhirPopulationGroupsWithStratificationsOfMultipleAssociatio
assertThat(codeableConcept.getCodingFirstRep(), is(notNullValue()));
assertThat(
codeableConcept.getCodingFirstRep().getSystem(),
is(equalTo(UriConstants.POPULATION_SYSTEM_URI)));
is(equalTo(UriConstants.CodeSystem.POPULATION_SYSTEM_URI)));
assertThat(
codeableConcept.getCodingFirstRep().getCode(),
is(equalTo(PopulationType.MEASURE_POPULATION.toCode())));
Expand Down

0 comments on commit 165df27

Please sign in to comment.