Skip to content

Commit

Permalink
MAT-6746 cms id cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adongare committed Apr 5, 2024
1 parent 23d6742 commit 46a1827
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<dependency>
<groupId>gov.cms.madie</groupId>
<artifactId>madie-java-models</artifactId>
<version>0.6.8</version>
<version>0.6.30-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public ResponseEntity<String> getMeasureBundle(
.contentType(MediaType.APPLICATION_JSON)
.body(fhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
} catch (Exception ex) {
log.error("An error occurred while creating measure bundle for measure [{}]", measure.getId(), ex);
log.error(
"An error occurred while creating measure bundle for measure [{}]", measure.getId(), ex);
throw ex;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public Bundle createMeasureBundle(
measureTranslatorService.createFhirMeasureForMadieMeasure(madieMeasure);
Set<String> expressions = getExpressions(measure);

log.info("Mapping of MADiE measure to FHIR measure completed successfully {}", madieMeasure.getId());
log.info(
"Mapping of MADiE measure to FHIR measure completed successfully {}", madieMeasure.getId());
// Bundle entry for Measure resource
Bundle.BundleEntryComponent measureEntryComponent =
FhirResourceHelpers.getBundleEntryComponent(measure, "Transaction");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ public List<Identifier> buildMeasureIdentifiers(Measure madieMeasure) {
buildDisplayReference(
madieMeasure.getMeasureMetaData().getEndorsements().get(0).getEndorser())));
}
if (StringUtils.isNotBlank(madieMeasure.getCmsId())) {
MeasureSet measureSet = madieMeasure.getMeasureSet();
if (measureSet != null && measureSet.getCmsId() != null) {
identifiers.add(
buildIdentifier(
IdentifierUse.OFFICIAL,
UriConstants.MadieMeasure.CMS_ID,
madieMeasure.getCmsId(),
madieMeasure.getMeasureSet().getCmsId() + "FHIR",
ValueConstants.CODE_PUBLISHER)
.setAssigner(buildDisplayReference("CMS")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import gov.cms.madie.models.measure.Measure;
import gov.cms.madie.models.measure.MeasureMetaData;
import gov.cms.madie.models.measure.MeasureScoring;
import gov.cms.madie.models.measure.MeasureSet;
import gov.cms.madie.models.measure.Population;
import gov.cms.madie.models.measure.PopulationType;
import gov.cms.madie.models.measure.Stratification;
Expand Down Expand Up @@ -733,7 +734,7 @@ public void testBuildMeasureIdentifiersReturnsIdentifiersForMeasure() {
.versionId("UUID_1")
.measureSetId("MEASURE_SET_ID_99")
.ecqmTitle("ECQM_TITLE")
.cmsId("REAL_CMS_ID")
.measureSet(MeasureSet.builder().measureSetId("MEASURE_SET_ID_99").cmsId(986).build())
.measureMetaData(
MeasureMetaData.builder()
.endorsements(
Expand Down Expand Up @@ -793,7 +794,7 @@ public void testBuildMeasureIdentifiersReturnsIdentifiersForMeasure() {
assertThat(output.get(4), is(notNullValue()));
assertThat(output.get(4).getUse(), is(equalTo(Identifier.IdentifierUse.OFFICIAL)));
assertThat(output.get(4).getSystem(), is(equalTo(UriConstants.MadieMeasure.CMS_ID)));
assertThat(output.get(4).getValue(), is(equalTo("REAL_CMS_ID")));
assertThat(output.get(4).getValue(), is(equalTo("986FHIR")));
assertThat(output.get(4).getType(), is(notNullValue()));
assertThat(
output.get(4).getType().getCodingFirstRep().getSystem(),
Expand All @@ -811,7 +812,7 @@ public void testBuildMeasureIdentifiersReturnsIdentifiersWithCmsIdWithoutCbeForM
.versionId("UUID_1")
.measureSetId("MEASURE_SET_ID_99")
.ecqmTitle("ECQM_TITLE")
.cmsId("REAL_CMS_ID")
.measureSet(MeasureSet.builder().cmsId(22).measureSetId("MEASURE_SET_ID_99").build())
.build();
List<Identifier> output = measureTranslatorService.buildMeasureIdentifiers(madieMeasure);
assertThat(output, is(notNullValue()));
Expand All @@ -827,7 +828,7 @@ public void testBuildMeasureIdentifiersReturnsIdentifiersWithCmsIdWithoutCbeForM
assertThat(output.get(2).getValue(), is(equalTo(URN_UUID_PREFIX + "UUID_1")));
// CMS ID
assertThat(output.get(3), is(notNullValue()));
assertThat(output.get(3).getValue(), is(equalTo("REAL_CMS_ID")));
assertThat(output.get(3).getValue(), is(equalTo("22FHIR")));
}

@Test
Expand All @@ -844,6 +845,7 @@ public void testBuildMeasureIdentifiersReturnsIdentifiersWithoutCmsIdWithCbeForM
List.of(
Endorsement.builder().endorsementId("CBE1234").endorser("CBE").build()))
.build())
.measureSet(MeasureSet.builder().measureSetId("MEASURE_SET_ID_99").build())
.build();
List<Identifier> output = measureTranslatorService.buildMeasureIdentifiers(madieMeasure);
assertThat(output, is(notNullValue()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@
"guidance":"test guidance",
"clinicalRecommendation": "testClinical"
},
"versionId": "492e7385-7d16-4e33-878b-17d97101a12f",
"cmsId": null
"versionId": "492e7385-7d16-4e33-878b-17d97101a12f"
}
Original file line number Diff line number Diff line change
Expand Up @@ -283,5 +283,8 @@
"reviewMetaData" : {
"approvalDate" : "2023-01-13T16:21:27.014+0000",
"lastReviewDate" : "2023-02-13T16:21:27.014+0000"
},
"measureSet": {
"measureSetId": "testMeasureSetId"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version":{"major":1, "minor":2, "revisionNumber":3},
"cqlLibraryName": "SimpleFhirMeasureLib",
"measureName": "SimpleFhirMeasure",
"measureSetId": "1-1-1-1",
"cql": "library SimpleFhirMeasureLib version '0.0.004'\n\nusing FHIR version '4.0.1'\n\ninclude FHIRHelpers version '4.0.001' called FHIRHelpers\n\nparameter \"Measurement Period\" Interval<DateTime>\n\ncontext Patient\n\ndefine \"ipp\":\n exists [\"Encounter\"] E where E.period.start during \"Measurement Period\"\n\ndefine \"denom\":\n \"ipp\"\n\ndefine \"num\":\n exists [\"Encounter\"] E where E.status ~ 'finished'",
"elmJson": "{\"library\":{\"identifier\":{\"id\":\"SimpleFhirMeasureLib\",\"version\":\"0.0.004\"},\"schemaIdentifier\":{\"id\":\"urn:hl7-org:elm\",\"version\":\"r1\"},\"usings\":{\"def\":[{\"localIdentifier\":\"System\",\"uri\":\"urn:hl7-org:elm-types:r1\"},{\"localId\":\"1\",\"locator\":\"3:1-3:26\",\"localIdentifier\":\"FHIR\",\"uri\":\"http://hl7.org/fhir\",\"version\":\"4.0.1\",\"annotation\":[{\"type\":\"Annotation\",\"s\":{\"r\":\"1\",\"s\":[{\"value\":[\"\",\"using \"]},{\"s\":[{\"value\":[\"FHIR\"]}]},{\"value\":[\" version \",\"'4.0.1'\"]}]}}]}]},\"includes\":{\"def\":[{\"localId\":\"2\",\"locator\":\"5:1-5:56\",\"localIdentifier\":\"FHIRHelpers\",\"path\":\"FHIRHelpers\",\"version\":\"4.0.001\",\"annotation\":[{\"type\":\"Annotation\",\"s\":{\"r\":\"2\",\"s\":[{\"value\":[\"\",\"include \"]},{\"s\":[{\"value\":[\"FHIRHelpers\"]}]},{\"value\":[\" version \",\"'4.0.001'\",\" called \",\"FHIRHelpers\"]}]}}]}]},\"parameters\":{\"def\":[{\"localId\":\"5\",\"locator\":\"7:1-7:49\",\"name\":\"Measurement Period\",\"accessLevel\":\"Public\",\"annotation\":[{\"type\":\"Annotation\",\"s\":{\"r\":\"5\",\"s\":[{\"value\":[\"\",\"parameter \",\"\\\"Measurement Period\\\"\",\" \"]},{\"r\":\"4\",\"s\":[{\"value\":[\"Interval<\"]},{\"r\":\"3\",\"s\":[{\"value\":[\"DateTime\"]}]},{\"value\":[\">\"]}]}]}}],\"parameterTypeSpecifier\":{\"localId\":\"4\",\"locator\":\"7:32-7:49\",\"type\":\"IntervalTypeSpecifier\",\"pointType\":{\"localId\":\"3\",\"locator\":\"7:41-7:48\",\"name\":\"{urn:hl7-org:elm-types:r1}DateTime\",\"type\":\"NamedTypeSpecifier\"}}}]},\"contexts\":{\"def\":[{\"locator\":\"9:1-9:15\",\"name\":\"Patient\"}]},\"statements\":{\"def\":[{\"locator\":\"9:1-9:15\",\"name\":\"Patient\",\"context\":\"Patient\",\"expression\":{\"type\":\"SingletonFrom\",\"operand\":{\"locator\":\"9:1-9:15\",\"dataType\":\"{http://hl7.org/fhir}Patient\",\"templateId\":\"http://hl7.org/fhir/StructureDefinition/Patient\",\"type\":\"Retrieve\"}}},{\"localId\":\"15\",\"locator\":\"11:1-12:73\",\"name\":\"ipp\",\"context\":\"Patient\",\"accessLevel\":\"Public\",\"annotation\":[{\"type\":\"Annotation\",\"s\":{\"r\":\"15\",\"s\":[{\"value\":[\"\",\"define \",\"\\\"ipp\\\"\",\":\\n \"]},{\"r\":\"14\",\"s\":[{\"value\":[\"exists \"]},{\"r\":\"13\",\"s\":[{\"s\":[{\"r\":\"7\",\"s\":[{\"r\":\"6\",\"s\":[{\"r\":\"6\",\"s\":[{\"value\":[\"[\",\"\\\"Encounter\\\"\",\"]\"]}]}]},{\"value\":[\" \",\"E\"]}]}]},{\"value\":[\" \"]},{\"r\":\"12\",\"s\":[{\"value\":[\"where \"]},{\"r\":\"12\",\"s\":[{\"r\":\"10\",\"s\":[{\"r\":\"9\",\"s\":[{\"r\":\"8\",\"s\":[{\"value\":[\"E\"]}]},{\"value\":[\".\"]},{\"r\":\"9\",\"s\":[{\"value\":[\"period\"]}]}]},{\"value\":[\".\"]},{\"r\":\"10\",\"s\":[{\"value\":[\"start\"]}]}]},{\"r\":\"12\",\"value\":[\" \",\"during\",\" \"]},{\"r\":\"11\",\"s\":[{\"value\":[\"\\\"Measurement Period\\\"\"]}]}]}]}]}]}]}}],\"expression\":{\"localId\":\"14\",\"locator\":\"12:3-12:73\",\"type\":\"Exists\",\"operand\":{\"localId\":\"13\",\"locator\":\"12:10-12:73\",\"type\":\"Query\",\"source\":[{\"localId\":\"7\",\"locator\":\"12:10-12:24\",\"alias\":\"E\",\"expression\":{\"localId\":\"6\",\"locator\":\"12:10-12:22\",\"dataType\":\"{http://hl7.org/fhir}Encounter\",\"templateId\":\"http://hl7.org/fhir/StructureDefinition/Encounter\",\"type\":\"Retrieve\"}}],\"relationship\":[],\"where\":{\"localId\":\"12\",\"locator\":\"12:26-12:73\",\"type\":\"In\",\"operand\":[{\"name\":\"ToDateTime\",\"libraryName\":\"FHIRHelpers\",\"type\":\"FunctionRef\",\"operand\":[{\"localId\":\"10\",\"locator\":\"12:32-12:45\",\"path\":\"start\",\"type\":\"Property\",\"source\":{\"localId\":\"9\",\"locator\":\"12:32-12:39\",\"path\":\"period\",\"scope\":\"E\",\"type\":\"Property\"}}]},{\"localId\":\"11\",\"locator\":\"12:54-12:73\",\"name\":\"Measurement Period\",\"type\":\"ParameterRef\"}]}}}},{\"localId\":\"17\",\"locator\":\"14:1-15:7\",\"name\":\"denom\",\"context\":\"Patient\",\"accessLevel\":\"Public\",\"annotation\":[{\"type\":\"Annotation\",\"s\":{\"r\":\"17\",\"s\":[{\"value\":[\"\",\"define \",\"\\\"denom\\\"\",\":\\n \"]},{\"r\":\"16\",\"s\":[{\"value\":[\"\\\"ipp\\\"\"]}]}]}}],\"expression\":{\"localId\":\"16\",\"locator\":\"15:3-15:7\",\"name\":\"ipp\",\"type\":\"ExpressionRef\"}},{\"localId\":\"26\",\"locator\":\"17:1-18:52\",\"name\":\"num\",\"context\":\"Patient\",\"accessLevel\":\"Public\",\"annotation\":[{\"type\":\"Annotation\",\"s\":{\"r\":\"26\",\"s\":[{\"value\":[\"\",\"define \",\"\\\"num\\\"\",\":\\n \"]},{\"r\":\"25\",\"s\":[{\"value\":[\"exists \"]},{\"r\":\"24\",\"s\":[{\"s\":[{\"r\":\"19\",\"s\":[{\"r\":\"18\",\"s\":[{\"r\":\"18\",\"s\":[{\"value\":[\"[\",\"\\\"Encounter\\\"\",\"]\"]}]}]},{\"value\":[\" \",\"E\"]}]}]},{\"value\":[\" \"]},{\"r\":\"23\",\"s\":[{\"value\":[\"where \"]},{\"r\":\"23\",\"s\":[{\"r\":\"21\",\"s\":[{\"r\":\"20\",\"s\":[{\"value\":[\"E\"]}]},{\"value\":[\".\"]},{\"r\":\"21\",\"s\":[{\"value\":[\"status\"]}]}]},{\"value\":[\" \",\"~\",\" \"]},{\"r\":\"22\",\"s\":[{\"value\":[\"'finished'\"]}]}]}]}]}]}]}}],\"expression\":{\"localId\":\"25\",\"locator\":\"18:3-18:52\",\"type\":\"Exists\",\"operand\":{\"localId\":\"24\",\"locator\":\"18:10-18:52\",\"type\":\"Query\",\"source\":[{\"localId\":\"19\",\"locator\":\"18:10-18:24\",\"alias\":\"E\",\"expression\":{\"localId\":\"18\",\"locator\":\"18:10-18:22\",\"dataType\":\"{http://hl7.org/fhir}Encounter\",\"templateId\":\"http://hl7.org/fhir/StructureDefinition/Encounter\",\"type\":\"Retrieve\"}}],\"relationship\":[],\"where\":{\"localId\":\"23\",\"locator\":\"18:26-18:52\",\"type\":\"Equivalent\",\"operand\":[{\"name\":\"ToString\",\"libraryName\":\"FHIRHelpers\",\"type\":\"FunctionRef\",\"operand\":[{\"localId\":\"21\",\"locator\":\"18:32-18:39\",\"path\":\"status\",\"scope\":\"E\",\"type\":\"Property\"}]},{\"localId\":\"22\",\"locator\":\"18:43-18:52\",\"valueType\":\"{urn:hl7-org:elm-types:r1}String\",\"value\":\"finished\",\"type\":\"Literal\"}]}}}}]}},\"externalErrors\":[]}",
"groups": [
Expand Down Expand Up @@ -81,5 +82,8 @@
"approvalDate" : "2023-01-13T16:21:27.014+0000",
"lastReviewDate" : "2023-02-13T16:21:27.014+0000"
},
"supplementalData": []
"supplementalData": [],
"measureSet": {
"measureSetId": "1-1-1-1"
}
}

0 comments on commit 46a1827

Please sign in to comment.