diff --git a/src/main/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtil.java b/src/main/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtil.java index b0afadb..b719309 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtil.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtil.java @@ -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) { diff --git a/src/test/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtilTest.java b/src/test/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtilTest.java index fde5463..51fff6c 100644 --- a/src/test/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtilTest.java +++ b/src/test/java/gov/cms/madie/madiefhirservice/utils/ExportFileNamesUtilTest.java @@ -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; @@ -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(