Skip to content

Commit aa2c6a0

Browse files
committed
dpc-5162 - removing attribution db references
1 parent 272c87b commit aa2c6a0

File tree

5 files changed

+6
-35
lines changed

5 files changed

+6
-35
lines changed

dpc-aggregation/src/main/java/gov/cms/dpc/aggregation/AggregationAppModule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
import gov.cms.dpc.aggregation.engine.JobBatchProcessor;
99
import gov.cms.dpc.aggregation.engine.OperationsConfig;
1010
import gov.cms.dpc.aggregation.health.AggregationEngineHealthCheck;
11-
import gov.cms.dpc.common.jdbi.ConsentDAO;
1211
import gov.cms.dpc.aggregation.service.*;
1312
import gov.cms.dpc.aggregation.tasks.TruncateDatabase;
1413
import gov.cms.dpc.common.annotations.ExportPath;
1514
import gov.cms.dpc.common.annotations.JobTimeout;
16-
import gov.cms.dpc.common.hibernate.attribution.DPCManagedSessionFactory;
1715
import gov.cms.dpc.common.hibernate.consent.DPCConsentManagedSessionFactory;
16+
import gov.cms.dpc.common.hibernate.queue.DPCQueueManagedSessionFactory;
17+
import gov.cms.dpc.common.jdbi.ConsentDAO;
1818
import gov.cms.dpc.fhir.hapi.ContextUtils;
1919
import gov.cms.dpc.queue.models.JobQueueBatch;
2020
import jakarta.inject.Named;
@@ -113,7 +113,7 @@ public int provideJobTimeoutInSeconds() {
113113
}
114114

115115
@Provides
116-
LookBackService provideLookBackService(DPCManagedSessionFactory sessionFactory, OperationsConfig operationsConfig) {
116+
LookBackService provideLookBackService(DPCQueueManagedSessionFactory sessionFactory, OperationsConfig operationsConfig) {
117117
//Configuring to skip look back when look back months is less than 0
118118
if (operationsConfig.getLookBackMonths() < 0) {
119119
return new EveryoneGetsDataLookBackServiceImpl();

dpc-aggregation/src/main/java/gov/cms/dpc/aggregation/DPCAggregationConfiguration.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.fasterxml.jackson.annotation.JsonProperty;
44
import gov.cms.dpc.bluebutton.config.BBClientConfiguration;
55
import gov.cms.dpc.bluebutton.config.BlueButtonBundleConfiguration;
6-
import gov.cms.dpc.common.hibernate.attribution.IDPCDatabase;
76
import gov.cms.dpc.common.hibernate.consent.IDPCConsentDatabase;
87
import gov.cms.dpc.common.hibernate.queue.IDPCQueueDatabase;
98
import gov.cms.dpc.queue.config.DPCAwsQueueConfiguration;
@@ -18,12 +17,7 @@
1817

1918
import java.util.List;
2019

21-
public class DPCAggregationConfiguration extends Configuration implements BlueButtonBundleConfiguration, IDPCDatabase, IDPCConsentDatabase, IDPCQueueDatabase, DPCQueueConfig {
22-
23-
@Valid
24-
@NotNull
25-
@JsonProperty("database")
26-
private final DataSourceFactory database = new DataSourceFactory();
20+
public class DPCAggregationConfiguration extends Configuration implements BlueButtonBundleConfiguration, IDPCConsentDatabase, IDPCQueueDatabase, DPCQueueConfig {
2721

2822
@Valid
2923
@NotNull
@@ -78,11 +72,6 @@ public class DPCAggregationConfiguration extends Configuration implements BlueBu
7872
@NotEmpty
7973
private String fhirReferenceURL;
8074

81-
@Override
82-
public DataSourceFactory getDatabase() {
83-
return this.database;
84-
}
85-
8675
@Override
8776
public DataSourceFactory getQueueDatabase() {
8877
return queueDatabase;

dpc-aggregation/src/main/java/gov/cms/dpc/aggregation/DPCAggregationService.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class DPCAggregationService extends Application<DPCAggregationConfigurati
2323

2424
private final DPCQueueHibernateBundle<DPCAggregationConfiguration> queueHibernateBundle = new DPCQueueHibernateBundle<>();
2525
private final DPCConsentHibernateBundle<DPCAggregationConfiguration> consentHibernateBundle = new DPCConsentHibernateBundle<>();
26-
private final DPCHibernateBundle<DPCAggregationConfiguration> hibernateBundle = new DPCHibernateBundle<>();
2726

2827
public static void main(final String[] args) throws Exception {
2928
new DPCAggregationService().run(args);
@@ -51,7 +50,6 @@ public void initialize(Bootstrap<DPCAggregationConfiguration> bootstrap) {
5150
.modules(new DPCQueueHibernateModule<>(queueHibernateBundle),
5251
new DPCConsentHibernateModule<>(consentHibernateBundle),
5352
new AggregationAppModule(),
54-
new DPCHibernateModule<>(hibernateBundle),
5553
new JobQueueModule<DPCAggregationConfiguration>(),
5654
new BlueButtonClientModule<DPCAggregationConfiguration>())
5755
.build();
@@ -61,7 +59,6 @@ public void initialize(Bootstrap<DPCAggregationConfiguration> bootstrap) {
6159
// so Dropwizard needs to initialize the HibernateBundle first to create the SessionFactory.
6260
bootstrap.addBundle(queueHibernateBundle);
6361
bootstrap.addBundle(consentHibernateBundle);
64-
bootstrap.addBundle(hibernateBundle);
6562

6663
bootstrap.addBundle(guiceBundle);
6764
bootstrap.addBundle(new MigrationsBundle<>() {

dpc-aggregation/src/main/java/gov/cms/dpc/aggregation/service/LookBackServiceImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.google.common.base.Joiner;
44
import gov.cms.dpc.aggregation.engine.OperationsConfig;
5+
import gov.cms.dpc.common.hibernate.auth.DPCAuthHibernateBundle;
56
import gov.cms.dpc.fhir.DPCIdentifierSystem;
67
import io.dropwizard.hibernate.UnitOfWork;
78
import jakarta.inject.Inject;
@@ -35,7 +36,7 @@ public LookBackServiceImpl(OperationsConfig operationsConfig) {
3536
}
3637

3738
@Override
38-
@UnitOfWork(readOnly = true)
39+
@UnitOfWork(value = DPCAuthHibernateBundle.BUNDLE_NAME, readOnly = true)
3940
@SuppressWarnings("JdkObsolete") // Date class used by FHIR stu3 Period model
4041
public LookBackAnswer getLookBackAnswer(ExplanationOfBenefit explanationOfBenefit, String organizationNPI, String practitionerNPI) {
4142
MDC.put(EOB_ID, explanationOfBenefit.getId());

dpc-aggregation/src/main/resources/application.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
database:
2-
driverClass: ${DB_DRIVER_CLASS:-"org.postgresql.Driver"}
3-
url: ${ATTRIBUTION_DB_URL:-"jdbc:postgresql://db:5432/dpc_attribution"}
4-
user: "${ATTRIBUTION_DB_USER:-postgres}"
5-
password: "${ATTRIBUTION_DB_PASS:-dpc-safe}" # Ignored in AWS, needed to run locally
6-
initialSize: 5
7-
minSize: 5
8-
maxSize: 10
9-
properties:
10-
charSet: UTF-8
11-
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
12-
wrapperPlugins: iam,failover,efm2
13-
iamRegion: us-east-1
14-
sslmode: ${DB_SSL_MODE:-"prefer"}
15-
sslrootcert: /awscert/global-bundle.pem
16-
171
queuedb:
182
driverClass: ${DB_DRIVER_CLASS:-"org.postgresql.Driver"}
193
url: ${QUEUE_DB_URL:-"jdbc:postgresql://db:5432/dpc_queue"}

0 commit comments

Comments
 (0)