Skip to content

Commit

Permalink
Merge pull request #272 from MeasureAuthoringTool/feature/mat-7961-tr…
Browse files Browse the repository at this point in the history
…im-ecqm-abbr-title-in-filenames

MAT-7961: Trim the eCQM Abbr Title when used in an export filename.
  • Loading branch information
jkotanchik-SB authored Dec 17, 2024
2 parents 70ffde2 + 702e8db commit c4cbd58
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class ExportFileNamesUtil {

public static String getExportFileName(Measure measure) {
if (measure.getModel().startsWith("QI-Core")) {
return measure.getEcqmTitle() + "-v" + measure.getVersion() + "-FHIR";
return measure.getEcqmTitle().trim() + "-v" + measure.getVersion() + "-FHIR";
}
return measure.getEcqmTitle() + "-v" + measure.getVersion() + "-" + measure.getModel();
return measure.getEcqmTitle().trim() + "-v" + measure.getVersion() + "-" + measure.getModel();
}

public static String getTestCaseExportFileName(Measure measure, TestCase testCase) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gov.cms.madie.madiefhirservice.utils;

import gov.cms.madie.models.common.ModelType;
import gov.cms.madie.models.common.Version;
import gov.cms.madie.models.measure.Measure;
import gov.cms.madie.models.measure.TestCase;
Expand All @@ -18,10 +19,21 @@ public class ExportFileNamesUtilTest {

@BeforeEach
void setup() {
measure = Measure.builder().ecqmTitle("ecqm").version(Version.parse("1.0.000")).build();
measure =
Measure.builder()
.model(ModelType.QI_CORE.getValue())
.ecqmTitle("ecqm")
.version(Version.parse("1.0.000"))
.build();
testCase = TestCase.builder().patientId(uuid).series("group").title("test").build();
}

@Test
void trimMeasureFileName() {
Measure msr = measure.toBuilder().ecqmTitle(" ecqm ").build();
assertEquals("ecqm-v1.0.000-FHIR", ExportFileNamesUtil.getExportFileName(msr));
}

@Test
void getTestCaseExportFileNameTest() {
assertEquals(
Expand Down

0 comments on commit c4cbd58

Please sign in to comment.