-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose hapi-fhir-storage-cr config to downstream modules for testing (#…
…6272) * Ensure IRepositoryFactory returns a Repository, and not a HapiFhirRepository. * Rename test so that it will run from Maven and the pipeline since it didn't before. Fix small bug that made the test error out. * Move TestCrConfig and TestCrR4Config to main source folder. Extract TestHapiFhirCrPartitionConfig as separate test config to be used only in the test source folder. Add Maven compile dependency to hapi-fhir-jpaserver-base in order to ensure that moved Config classes will compile. * Add possible code change to RequestDetailsClone to clone partition info. * Introduce separate factory interface for Repository to preserve backward compatibility. * Remove IRepositoryFactoryForInterface. * Spotless * Add javadoc. * Get rid of TODO. * Restore RepositoryConfig to master. * Move test config to different packages. * Leverage use of new RepositoryFactoryForRepositoryInterface for CrR4Config and RepositoryFactoryForRepositoryInterface. * Ensure CrR4Config and RepositoryConfig make use of new RepositoryFactoryForRepositoryInterface. * Add copyright header * Add @FunctionalInterface to factory.
- Loading branch information
1 parent
1fad912
commit fb93c3d
Showing
11 changed files
with
149 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...orage-cr/src/main/java/ca/uhn/fhir/cr/common/RepositoryFactoryForRepositoryInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/*- | ||
* #%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.common; | ||
|
||
import ca.uhn.fhir.rest.api.server.RequestDetails; | ||
import org.opencds.cqf.fhir.api.Repository; | ||
|
||
/** | ||
* Factory interface to return a {@link Repository} from a {@link RequestDetails} | ||
*/ | ||
@FunctionalInterface | ||
public interface RepositoryFactoryForRepositoryInterface { | ||
Repository create(RequestDetails theRequestDetails); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
hapi-fhir-storage-cr/src/test/java/ca/uhn/fhir/cr/TestHapiFhirCrPartitionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ca.uhn.fhir.cr; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
|
||
public class TestHapiFhirCrPartitionConfig { | ||
@Bean | ||
public PartitionHelper partitionHelper() { | ||
return new PartitionHelper(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters