From 0b69c5bf7dfb17fed67efd886079d42cf38785f8 Mon Sep 17 00:00:00 2001 From: Joseph Kotanchik Date: Thu, 21 Nov 2024 11:54:24 -0500 Subject: [PATCH] MAT-7926: Add support for exporting versioned QI-Core 6 measures, includes model validation and packaging. QI-Core 6 export is equivalent to QI-Core 4.1.1. Signed-off-by: Joseph Kotanchik --- pom.xml | 2 +- .../madie/measure/services/QiCore6ModelValidator.java | 10 ++++++++++ .../madie/measure/services/Qicore6PackageService.java | 11 +++++++++++ .../gov/madie/measure/services/ServiceConstants.java | 1 + .../gov/madie/measure/services/BundleServiceTest.java | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/main/java/cms/gov/madie/measure/services/QiCore6ModelValidator.java create mode 100644 src/main/java/cms/gov/madie/measure/services/Qicore6PackageService.java diff --git a/pom.xml b/pom.xml index 3b5d22abe..cd848f280 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ gov.cms.madie.packaging packaging-utility - 0.2.2 + 0.2.5 org.springdoc diff --git a/src/main/java/cms/gov/madie/measure/services/QiCore6ModelValidator.java b/src/main/java/cms/gov/madie/measure/services/QiCore6ModelValidator.java new file mode 100644 index 000000000..eda2ee3ad --- /dev/null +++ b/src/main/java/cms/gov/madie/measure/services/QiCore6ModelValidator.java @@ -0,0 +1,10 @@ +package cms.gov.madie.measure.services; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service(ServiceConstants.QICORE_6_VALIDATOR) +public class QiCore6ModelValidator extends QiCoreModelValidator { + // Intentionally empty class. QI-Core 6 validation is the same as QI-Core 4.1.1. +} diff --git a/src/main/java/cms/gov/madie/measure/services/Qicore6PackageService.java b/src/main/java/cms/gov/madie/measure/services/Qicore6PackageService.java new file mode 100644 index 000000000..8166b23ba --- /dev/null +++ b/src/main/java/cms/gov/madie/measure/services/Qicore6PackageService.java @@ -0,0 +1,11 @@ +package cms.gov.madie.measure.services; + +import org.springframework.stereotype.Service; + +/** Intentionally empty class. QI-Core 6 packaging is the same as QI-Core 4.1.1. */ +@Service +public class Qicore6PackageService extends QicorePackageService { + public Qicore6PackageService(BundleService bundleService) { + super(bundleService); + } +} diff --git a/src/main/java/cms/gov/madie/measure/services/ServiceConstants.java b/src/main/java/cms/gov/madie/measure/services/ServiceConstants.java index 6b8ba4969..c4c269ad9 100644 --- a/src/main/java/cms/gov/madie/measure/services/ServiceConstants.java +++ b/src/main/java/cms/gov/madie/measure/services/ServiceConstants.java @@ -3,6 +3,7 @@ public final class ServiceConstants { public static final String QDM_VALIDATOR = "qdmModelValidator"; public static final String QICORE_VALIDATOR = "qicoreModelValidator"; + public static final String QICORE_6_VALIDATOR = "qicore6ModelValidator"; private ServiceConstants() {} } diff --git a/src/test/java/cms/gov/madie/measure/services/BundleServiceTest.java b/src/test/java/cms/gov/madie/measure/services/BundleServiceTest.java index a48a8fc6e..9a95a8e0f 100644 --- a/src/test/java/cms/gov/madie/measure/services/BundleServiceTest.java +++ b/src/test/java/cms/gov/madie/measure/services/BundleServiceTest.java @@ -213,7 +213,7 @@ void testExportBundleMeasureForVersionedMeasure() throws IOException { ZipInputStream z = new ZipInputStream(new ByteArrayInputStream(output.getExportPackage())); ZipEntry entry = z.getNextEntry(); String fileName = entry.getName(); - assertEquals(fileName, "resources/TestCreateNewLibrary-1.0.000.xml"); + assertEquals("resources/measure-TestCreateNewLibrary-1.0.000.json", fileName); } @Test