From 21c0bea5602ee75d0f973e1509ed13e321d7a1a2 Mon Sep 17 00:00:00 2001 From: sb-cecilialiu Date: Thu, 9 Jan 2025 07:45:24 -0600 Subject: [PATCH 1/2] MAT-8065 update export URLs to reference THO for measure identifiers --- .../gov/cms/madie/madiefhirservice/constants/UriConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java b/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java index 4ff5819..e7926db 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java @@ -51,7 +51,7 @@ public static final class CqfMeasures { "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"; + "http://terminology.hl7.org/CodeSystem/artifact-identifier-type"; public static final String SUPPLEMENTAL_DATA_GUIDANCE_URI = "http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-supplementalDataGuidance"; From 8aedc3f61a07afdf7015ae6474253ddaa5df7cbf Mon Sep 17 00:00:00 2001 From: sb-cecilialiu Date: Thu, 9 Jan 2025 11:42:26 -0600 Subject: [PATCH 2/2] MAT-8065 put code system urls in a new class --- .../constants/UriConstants.java | 36 ++++++++++--------- .../services/LibraryTranslatorService.java | 2 +- .../services/MeasureTranslatorService.java | 19 +++++----- .../services/TestCaseBundleService.java | 2 +- .../utils/FhirResourceHelpers.java | 2 +- .../MeasureTranslatorServiceTest.java | 18 +++++----- 6 files changed, 41 insertions(+), 38 deletions(-) diff --git a/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java b/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java index e7926db..8984200 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/constants/UriConstants.java @@ -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"; @@ -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://terminology.hl7.org/CodeSystem/artifact-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"; @@ -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 { @@ -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"; } diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java index 77aa08b..33551a5 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java @@ -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()); diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java index e7fa09b..d3b0686 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java @@ -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; } @@ -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); } } @@ -334,7 +335,7 @@ private List buildPopulations(Group madieGroup) .setCode( buildCodeableConcept( populationCode, - UriConstants.POPULATION_SYSTEM_URI, + UriConstants.CodeSystem.POPULATION_SYSTEM_URI, populationDisplay)) .setCriteria( buildExpression("text/cql-identifier", population.getDefinition())) @@ -360,7 +361,7 @@ private List buildObservations(Group madieGroup .setCode( buildCodeableConcept( PopulationType.MEASURE_OBSERVATION.toCode(), - UriConstants.POPULATION_SYSTEM_URI, + UriConstants.CodeSystem.POPULATION_SYSTEM_URI, PopulationType.MEASURE_OBSERVATION.getDisplay())) .setCriteria( buildExpression( @@ -404,7 +405,7 @@ private List 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(); }) @@ -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) { @@ -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); @@ -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); diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java index 3c8da71..bdc2d87 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java @@ -257,7 +257,7 @@ private List buildMeasureReportGroupC .setCode( FhirResourceHelpers.buildCodeableConcept( testCasePopulationValue.getName().toCode(), - UriConstants.POPULATION_SYSTEM_URI, + UriConstants.CodeSystem.POPULATION_SYSTEM_URI, testCasePopulationValue.getName().getDisplay())) .setCount( FhirResourceHelpers.getExpectedValue( diff --git a/src/main/java/gov/cms/madie/madiefhirservice/utils/FhirResourceHelpers.java b/src/main/java/gov/cms/madie/madiefhirservice/utils/FhirResourceHelpers.java index 21a1f32..3ce4b67 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/utils/FhirResourceHelpers.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/utils/FhirResourceHelpers.java @@ -100,7 +100,7 @@ public static List buildStratu stratifierGroupPopulationComponent.setCode( buildCodeableConcept( populationValue.getName().toCode(), - UriConstants.POPULATION_SYSTEM_URI, + UriConstants.CodeSystem.POPULATION_SYSTEM_URI, populationValue.getName().getDisplay())); stratifierGroupPopulationComponent.setCount( diff --git a/src/test/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorServiceTest.java b/src/test/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorServiceTest.java index 73f8a96..a0e92fc 100644 --- a/src/test/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorServiceTest.java +++ b/src/test/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorServiceTest.java @@ -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; @@ -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(), @@ -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 groupTypes = @@ -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))); @@ -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 @@ -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); @@ -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"))); @@ -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()))); @@ -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())));