diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/CrBaseConfig.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/CrBaseConfig.java new file mode 100644 index 00000000000..c76d6683612 --- /dev/null +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/CrBaseConfig.java @@ -0,0 +1,35 @@ +/*- + * #%L + * HAPI FHIR - Clinical Reasoning + * %% + * Copyright (C) 2014 - 2024 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package ca.uhn.fhir.cr.config; + +import ca.uhn.fhir.cr.r4.measure.MeasureReportPeriodRequestValidatorAndConverter; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.time.ZoneOffset; + +@Configuration +public class CrBaseConfig { + + @Bean + MeasureReportPeriodRequestValidatorAndConverter measureReportPeriodService() { + return new MeasureReportPeriodRequestValidatorAndConverter(ZoneOffset.UTC); + } +} diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/dstu3/CrDstu3Config.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/dstu3/CrDstu3Config.java index 733d469ba04..c1d4a483449 100644 --- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/dstu3/CrDstu3Config.java +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/dstu3/CrDstu3Config.java @@ -22,6 +22,7 @@ package ca.uhn.fhir.cr.config.dstu3; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.cr.common.IRepositoryFactory; +import ca.uhn.fhir.cr.config.CrBaseConfig; import ca.uhn.fhir.cr.config.ProviderLoader; import ca.uhn.fhir.cr.config.ProviderSelector; import ca.uhn.fhir.cr.config.RepositoryConfig; @@ -39,7 +40,7 @@ import java.util.Arrays; import java.util.Map; @Configuration -@Import({RepositoryConfig.class}) +@Import({RepositoryConfig.class, CrBaseConfig.class}) public class CrDstu3Config { @Bean diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/r4/CrR4Config.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/r4/CrR4Config.java index 072e3a088d2..1049fddf35f 100644 --- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/r4/CrR4Config.java +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/config/r4/CrR4Config.java @@ -23,6 +23,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.cr.common.IRepositoryFactory; import ca.uhn.fhir.cr.common.RepositoryFactoryForRepositoryInterface; +import ca.uhn.fhir.cr.config.CrBaseConfig; import ca.uhn.fhir.cr.config.ProviderLoader; import ca.uhn.fhir.cr.config.ProviderSelector; import ca.uhn.fhir.cr.config.RepositoryConfig; @@ -39,7 +40,7 @@ import ca.uhn.fhir.cr.r4.measure.CareGapsOperationProvider; import ca.uhn.fhir.cr.r4.measure.CollectDataOperationProvider; import ca.uhn.fhir.cr.r4.measure.DataRequirementsOperationProvider; import ca.uhn.fhir.cr.r4.measure.MeasureOperationsProvider; -import ca.uhn.fhir.cr.r4.measure.MeasureReportPeriodRequestProcessingService; +import ca.uhn.fhir.cr.r4.measure.MeasureReportPeriodRequestValidatorAndConverter; import ca.uhn.fhir.cr.r4.measure.SubmitDataProvider; import ca.uhn.fhir.rest.server.RestfulServer; import org.opencds.cqf.fhir.cql.EvaluationSettings; @@ -58,13 +59,12 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import java.time.ZoneOffset; import java.util.Arrays; import java.util.Map; import java.util.concurrent.Executor; @Configuration -@Import({RepositoryConfig.class}) +@Import({RepositoryConfig.class, CrBaseConfig.class}) public class CrR4Config { @Bean @@ -149,9 +149,9 @@ public class CrR4Config { @Bean MeasureOperationsProvider r4MeasureOperationsProvider( IMeasureServiceFactory theR4MeasureServiceFactory, - MeasureReportPeriodRequestProcessingService theMeasureReportPeriodRequestProcessingService) { + MeasureReportPeriodRequestValidatorAndConverter theMeasureReportPeriodRequestValidatorAndConverter) { return new MeasureOperationsProvider( - theR4MeasureServiceFactory, theMeasureReportPeriodRequestProcessingService); + theR4MeasureServiceFactory, theMeasureReportPeriodRequestValidatorAndConverter); } @Bean @@ -173,9 +173,4 @@ public class CrR4Config { return new ProviderLoader(theRestfulServer, theApplicationContext, selector); } - - @Bean - MeasureReportPeriodRequestProcessingService measureReportPeriodService() { - return new MeasureReportPeriodRequestProcessingService(ZoneOffset.UTC); - } } diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureOperationsProvider.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureOperationsProvider.java index 27eaa8eb594..cd9806c1ec9 100644 --- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureOperationsProvider.java +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureOperationsProvider.java @@ -37,13 +37,13 @@ import org.opencds.cqf.fhir.utility.monad.Eithers; public class MeasureOperationsProvider { private final IMeasureServiceFactory myR4MeasureServiceFactory; - private final MeasureReportPeriodRequestProcessingService myMeasureReportPeriodRequestProcessingService; + private final MeasureReportPeriodRequestValidatorAndConverter myMeasureReportPeriodRequestProcessingService; public MeasureOperationsProvider( IMeasureServiceFactory theR4MeasureServiceFactory, - MeasureReportPeriodRequestProcessingService theMeasureReportPeriodRequestProcessingService) { + MeasureReportPeriodRequestValidatorAndConverter theMeasureReportPeriodRequestValidatorAndConverter) { myR4MeasureServiceFactory = theR4MeasureServiceFactory; - myMeasureReportPeriodRequestProcessingService = theMeasureReportPeriodRequestProcessingService; + myMeasureReportPeriodRequestProcessingService = theMeasureReportPeriodRequestValidatorAndConverter; } /** diff --git a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureReportPeriodRequestProcessingService.java b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureReportPeriodRequestValidatorAndConverter.java similarity index 97% rename from hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureReportPeriodRequestProcessingService.java rename to hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureReportPeriodRequestValidatorAndConverter.java index 20cf556f0e7..ac53d1a1163 100644 --- a/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureReportPeriodRequestProcessingService.java +++ b/hapi-fhir-storage-cr/src/main/java/ca/uhn/fhir/cr/r4/measure/MeasureReportPeriodRequestValidatorAndConverter.java @@ -53,8 +53,8 @@ import java.util.function.Function; *