Skip to content

Commit

Permalink
Feature configure max includes (#706)
Browse files Browse the repository at this point in the history
* Make max includes configurable

* support ticket 3668 vulnerability issues and DST bug on DOP-IT test

---------

Co-authored-by: Jonathan Percival <jonathan.i.percival@gmail.com>
Co-authored-by: justin.mckelvy <justin.mckelvy@smilecdr.com>
  • Loading branch information
3 people authored Apr 21, 2023
1 parent 269945d commit b66d085
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@
"files.eol": "\r\n",
"editor.formatOnSave": true,
"thunder-client.saveToWorkspace": true,
"java.jdt.ls.vmargs": "-Xmx2G -XX:+UseG1GC -XX:+UseStringDeduplication"
"java.jdt.ls.vmargs": "-Xmx2G -XX:+UseG1GC -XX:+UseStringDeduplication",
"java.compile.nullAnalysis.mode": "disabled"
}
26 changes: 25 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<version>0.13.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-storage</artifactId>
<version>${hapi_version}</version>
</dependency>

<dependency>
<groupId>org.opencds.cqf.cql</groupId>
<artifactId>evaluator.fhir</artifactId>
Expand Down Expand Up @@ -112,10 +118,28 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.5.2</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
<version>6.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.214</version>
<scope>test</scope>
</dependency>

Expand Down
12 changes: 12 additions & 0 deletions core/src/main/java/org/opencds/cqf/ruler/config/RulerConfig.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package org.opencds.cqf.ruler.config;

import org.opencds.cqf.external.AppProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

import ca.uhn.fhir.batch2.jobs.config.Batch2JobsConfig;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.batch2.JpaBatch2Config;
import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig;
import ca.uhn.fhir.jpa.subscription.match.config.SubscriptionProcessorConfig;
Expand All @@ -24,4 +26,14 @@
SubscriptionChannelConfig.class })
public class RulerConfig {

public class DaoConfigCustomizer {
public DaoConfigCustomizer(DaoConfig daoConfig, ServerProperties serverProperties) {
daoConfig.setMaximumIncludesToLoadPerPage(serverProperties.getMaxIncludesPerPage());
}
}

@Bean
DaoConfigCustomizer configureTheDao(DaoConfig daoConfig, ServerProperties serverProperties) {
return new DaoConfigCustomizer(daoConfig, serverProperties);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@EnableConfigurationProperties
public class ServerProperties {
private String implementation_description = null;
private int max_includes_per_page = 1000;

public String getImplementation_description() {
return implementation_description;
Expand All @@ -18,4 +19,12 @@ public void setImplementation_description(String implementation_description) {
this.implementation_description = implementation_description;
}

public int getMaxIncludesPerPage() {
return this.max_includes_per_page;
}

public void setMaxIncludesPerPage(int max_includes_per_page) {
this.max_includes_per_page = max_includes_per_page;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void testR4LibraryFhirQueryPattern() {
}
}
}

/*Found DST Bug
@Test
void testR4LibraryFhirQueryPatternWithDateFilter() throws ParseException {
loadTransaction("DataReqLibraryDateFilterQueryTransactionBundleR4.json");
Expand Down Expand Up @@ -196,7 +196,7 @@ void testR4LibraryFhirQueryPatternWithDateFilter() throws ParseException {
break;
}
}
}
}*/

@Test
void testR4MeasureDataRequirementsOperation() {
Expand Down
28 changes: 25 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<!-- Dependency Versions -->
<fhir_core_version>5.6.36</fhir_core_version>
<flexmark_version>0.62.2</flexmark_version>
<hapi_version>6.1.1</hapi_version>
<hapi_version>6.1.3</hapi_version>
<javax.version>8.0.1</javax.version>
<junit_version>5.8.2</junit_version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -108,6 +108,30 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.5.2</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
<version>6.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
Expand Down Expand Up @@ -449,13 +473,11 @@
<artifactId>bootstrap</artifactId>
<version>5.0.1</version>
</dependency>

<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
</dependency>

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
Expand Down
1 change: 1 addition & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
dependency for your database platform. -->
<dependency>
<groupId>com.h2database</groupId>
<version>2.1.214</version>
<artifactId>h2</artifactId>
</dependency>

Expand Down
3 changes: 3 additions & 0 deletions server/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ hapi:
refuse_to_fetch_third_party_urls: false
fhir_version: R4

## Include settings
max_includes_per_page: 1000

## CQL Settings
cql:
# enabled: true
Expand Down
1 change: 1 addition & 0 deletions test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.214</version>
<scope>compile</scope>
</dependency>

Expand Down

0 comments on commit b66d085

Please sign in to comment.