From 4036ef9b9b8b83a3fbf83d874508d4cc523fcbea Mon Sep 17 00:00:00 2001 From: Joseph Kotanchik Date: Thu, 21 Nov 2024 10:31:50 -0500 Subject: [PATCH 1/3] MAT-7926: Refactor common class to base qicore package. --- .../{qicore411 => qicore}/ResourceUtils.java | 2 +- .../utils/qicore411/PackagingUtilityImpl.java | 1 + .../utils/ResourceUtilityFactoryTest.java | 21 +++++++++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) rename src/main/java/gov/cms/madie/packaging/utils/{qicore411 => qicore}/ResourceUtils.java (97%) diff --git a/src/main/java/gov/cms/madie/packaging/utils/qicore411/ResourceUtils.java b/src/main/java/gov/cms/madie/packaging/utils/qicore/ResourceUtils.java similarity index 97% rename from src/main/java/gov/cms/madie/packaging/utils/qicore411/ResourceUtils.java rename to src/main/java/gov/cms/madie/packaging/utils/qicore/ResourceUtils.java index 3842fed..bc5b79e 100644 --- a/src/main/java/gov/cms/madie/packaging/utils/qicore411/ResourceUtils.java +++ b/src/main/java/gov/cms/madie/packaging/utils/qicore/ResourceUtils.java @@ -1,4 +1,4 @@ -package gov.cms.madie.packaging.utils.qicore411; +package gov.cms.madie.packaging.utils.qicore; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.r4.model.Bundle; diff --git a/src/main/java/gov/cms/madie/packaging/utils/qicore411/PackagingUtilityImpl.java b/src/main/java/gov/cms/madie/packaging/utils/qicore411/PackagingUtilityImpl.java index 5feea7a..ecaa57c 100644 --- a/src/main/java/gov/cms/madie/packaging/utils/qicore411/PackagingUtilityImpl.java +++ b/src/main/java/gov/cms/madie/packaging/utils/qicore411/PackagingUtilityImpl.java @@ -20,6 +20,7 @@ import gov.cms.madie.packaging.exceptions.InternalServerException; import gov.cms.madie.packaging.utils.PackagingUtility; import gov.cms.madie.packaging.utils.ZipUtility; +import gov.cms.madie.packaging.utils.qicore.ResourceUtils; import lombok.extern.slf4j.Slf4j; import org.hl7.fhir.r4.model.Measure; diff --git a/src/test/java/gov/cms/madie/packaging/utils/ResourceUtilityFactoryTest.java b/src/test/java/gov/cms/madie/packaging/utils/ResourceUtilityFactoryTest.java index b5ea689..4014763 100644 --- a/src/test/java/gov/cms/madie/packaging/utils/ResourceUtilityFactoryTest.java +++ b/src/test/java/gov/cms/madie/packaging/utils/ResourceUtilityFactoryTest.java @@ -12,7 +12,7 @@ class ResourceUtilityFactoryTest { void testGetInstance_fails() { try { PackagingUtility utility = PackagingUtilityFactory.getInstance("QI-Core"); - fail("Should not be set " + utility.toString()); + fail("Should not be set " + utility); } catch (InstantiationException | IllegalAccessException @@ -26,7 +26,7 @@ void testGetInstance_fails() { } @Test - void testGetInstance() { + void testGetQiCore411Instance() { try { PackagingUtility utility = PackagingUtilityFactory.getInstance("QI-Core v4.1.1"); assertNotNull(utility); @@ -41,4 +41,21 @@ void testGetInstance() { fail(e); } } + + @Test + void testGetQiCore6Instance() { + try { + PackagingUtility utility = PackagingUtilityFactory.getInstance("QI-Core v6.0.0"); + assertNotNull(utility); + + } catch (InstantiationException + | IllegalAccessException + | IllegalArgumentException + | InvocationTargetException + | NoSuchMethodException + | SecurityException + | ClassNotFoundException e) { + fail(e); + } + } } From 6e5af6062082da8fb8935543f98a129a4f2670ab Mon Sep 17 00:00:00 2001 From: Joseph Kotanchik Date: Thu, 21 Nov 2024 10:32:20 -0500 Subject: [PATCH 2/3] MAT-7926: Add support for packaging QI-Core 6.0.0 --- .../cms/madie/packaging/utils/PackagingUtilityFactory.java | 1 + .../packaging/utils/qicore6/PackagingUtilityImpl.java | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 src/main/java/gov/cms/madie/packaging/utils/qicore6/PackagingUtilityImpl.java diff --git a/src/main/java/gov/cms/madie/packaging/utils/PackagingUtilityFactory.java b/src/main/java/gov/cms/madie/packaging/utils/PackagingUtilityFactory.java index aa71d80..7d4c0d8 100644 --- a/src/main/java/gov/cms/madie/packaging/utils/PackagingUtilityFactory.java +++ b/src/main/java/gov/cms/madie/packaging/utils/PackagingUtilityFactory.java @@ -18,6 +18,7 @@ public static PackagingUtility getInstance(String model) new HashMap<>() { { put("QI-Core v4.1.1", "qicore411"); + put("QI-Core v6.0.0", "qicore6"); } }; diff --git a/src/main/java/gov/cms/madie/packaging/utils/qicore6/PackagingUtilityImpl.java b/src/main/java/gov/cms/madie/packaging/utils/qicore6/PackagingUtilityImpl.java new file mode 100644 index 0000000..14cb9c8 --- /dev/null +++ b/src/main/java/gov/cms/madie/packaging/utils/qicore6/PackagingUtilityImpl.java @@ -0,0 +1,7 @@ +package gov.cms.madie.packaging.utils.qicore6; + +/** + * QI-Core 6.0.0 matches packaging requirements of QICore v4.1.1 + */ +public class PackagingUtilityImpl + extends gov.cms.madie.packaging.utils.qicore411.PackagingUtilityImpl {} From e1b5ce63429c700e9533aa75c4864b38ce293814 Mon Sep 17 00:00:00 2001 From: Joseph Kotanchik Date: Thu, 21 Nov 2024 10:32:33 -0500 Subject: [PATCH 3/3] MAT-7926: Bump version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 91d1ed3..cb66423 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 gov.cms.madie.packaging packaging-utility - 0.2.4 + 0.2.5 packaging-utility A simple packaging-utility.