Skip to content

Commit cb6fa7d

Browse files
committed
Merge remote-tracking branch 'origin/master' into rel_7_3_tracking
2 parents ab02bfe + 6b98988 commit cb6fa7d

27 files changed

+1729
-662
lines changed

.vscode/launch.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@
77
"cwd": "${workspaceFolder}",
88
"mainClass": "ca.uhn.fhir.jpa.starter.Application",
99
"projectName": "hapi-fhir-jpaserver-starter",
10-
"args": "",
10+
"vmArgs": [
11+
"-XX:TieredStopAtLevel=1",
12+
// "-Ddebug=true",
13+
// "-Dloader.debug=true",
14+
"-Dhapi.fhir.bulk_export_enabled=false",
15+
"-Dspring.batch.job.enabled=false",
16+
"-Dspring.main.allow-bean-definition-overriding=true",
17+
"-Dhapi.fhir.cdshooks.enabled=true",
18+
"-Dhapi.fhir.cr.enabled=true",
19+
"-Dspring.main.allow-bean-definition-overriding=true"
20+
21+
],
1122
"envFile": "${workspaceFolder}/.env"
1223
}
1324
]

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"**/.settings": true,
66
"**/.factorypath": true
77
},
8-
"java.compile.nullAnalysis.mode": "disabled"
8+
"java.compile.nullAnalysis.mode": "disabled",
9+
"java.configuration.updateBuildConfiguration": "automatic"
910
}

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,11 @@ The server may be configured with subscription support by enabling properties in
483483

484484
## Enabling Clinical Reasoning
485485

486-
Set `hapi.fhir.cr_enabled=true` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file to enable [Clinical Quality Language](https://cql.hl7.org/) on this server.
486+
Set `hapi.fhir.cr_enabled=true` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file to enable [Clinical Quality Language](https://cql.hl7.org/) on this server. An alternate settings file, [cds.application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/cds.application.yaml), exists with the Clinical Reasoning module enabled and default settings that have been found to work with most CDS and dQM test cases.
487+
488+
## Enabling CDS Hooks
489+
490+
Set `hapi.fhir.cdshooks.enabled=true` in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file to enable [CDS Hooks](https://cds-hooks.org/) on this server. The Clinical Reasoning module must also be enabled because this implementation of CDS Hooks includes [CDS on FHIR](https://build.fhir.org/clinicalreasoning-cds-on-fhir.html). An example CDS Service using CDS on FHIR is available in the CdsHooksServletIT test class.
487491

488492
## Enabling MDM (EMPI)
489493

pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242

4343
<dependencyManagement>
4444
<dependencies>
45+
46+
<!-- Temporarily override CR depedencies for debugging -->
47+
<!-- <dependency>-->
48+
<!-- <groupId>org.opencds.cqf.fhir</groupId>-->
49+
<!-- <artifactId>cqf-fhir-bom</artifactId>-->
50+
<!-- <version>3.4.0</version>-->
51+
<!-- <type>pom</type>-->
52+
<!-- <scope>import</scope>-->
53+
<!-- </dependency>-->
4554
<dependency>
4655
<groupId>org.glassfish.jaxb</groupId>
4756
<artifactId>jaxb-runtime</artifactId>

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/ModuleConfigurationPrefetchSvc.java

Lines changed: 155 additions & 0 deletions
Large diffs are not rendered by default.

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/ProviderConfiguration.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
import ca.uhn.fhir.jpa.starter.cr.CrProperties;
44

55
public class ProviderConfiguration {
6-
7-
public static final ProviderConfiguration DEFAULT_PROVIDER_CONFIGURATION =
8-
new ProviderConfiguration(false, "client_id");
9-
106
private final String clientIdHeaderName;
117
private final boolean cqlLoggingEnabled;
128

@@ -16,8 +12,7 @@ public ProviderConfiguration(boolean cqlLoggingEnabled, String clientIdHeaderNam
1612
}
1713

1814
public ProviderConfiguration(CdsHooksProperties cdsProperties, CrProperties crProperties) {
19-
this.clientIdHeaderName = cdsProperties.getClientIdHeaderName();
20-
this.cqlLoggingEnabled = crProperties.isCqlRuntimeDebugLoggingEnabled();
15+
this(crProperties.getCql().getRuntime().isDebugLoggingEnabled(), cdsProperties.getClientIdHeaderName());
2116
}
2217

2318
public String getClientIdHeaderName() {

src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/StarterCdsHooksConfig.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
package ca.uhn.fhir.jpa.starter.cdshooks;
22

3+
import ca.uhn.fhir.jpa.starter.cr.CrCommonConfig;
34
import ca.uhn.fhir.jpa.starter.cr.CrConfigCondition;
45
import ca.uhn.fhir.jpa.starter.cr.CrProperties;
56
import ca.uhn.hapi.fhir.cdshooks.api.ICdsHooksDaoAuthorizationSvc;
67
import ca.uhn.hapi.fhir.cdshooks.config.CdsHooksConfig;
78
import ca.uhn.hapi.fhir.cdshooks.svc.CdsHooksContextBooter;
89
import ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrSettings;
10+
import ca.uhn.fhir.context.FhirVersionEnum;
11+
import ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrServiceRegistry;
12+
import ca.uhn.hapi.fhir.cdshooks.svc.cr.ICdsCrServiceRegistry;
13+
import ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery.CdsCrDiscoveryServiceRegistry;
14+
import ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery.ICdsCrDiscoveryServiceRegistry;
15+
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchDaoSvc;
16+
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchFhirClientSvc;
17+
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc;
18+
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsResolutionStrategySvc;
919
import org.hl7.fhir.instance.model.api.IBaseResource;
1020
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
1121
import org.springframework.boot.web.servlet.ServletRegistrationBean;
@@ -16,8 +26,38 @@
1626

1727
@Configuration
1828
@Conditional({CdsHooksConfigCondition.class, CrConfigCondition.class})
19-
@Import(CdsHooksConfig.class)
29+
@Import({CdsHooksConfig.class, CrCommonConfig.class})
2030
public class StarterCdsHooksConfig {
31+
32+
// @Bean
33+
// CdsPrefetchSvc cdsPrefetchSvc(
34+
// CdsResolutionStrategySvc theCdsResolutionStrategySvc,
35+
// CdsPrefetchDaoSvc theResourcePrefetchDao,
36+
// CdsPrefetchFhirClientSvc theResourcePrefetchFhirClient,
37+
// ICdsHooksDaoAuthorizationSvc theCdsHooksDaoAuthorizationSvc) {
38+
// return new ModuleConfigurationPrefetchSvc(
39+
// theCdsResolutionStrategySvc,
40+
// theResourcePrefetchDao,
41+
// theResourcePrefetchFhirClient,
42+
// theCdsHooksDaoAuthorizationSvc);
43+
// }
44+
45+
@Bean
46+
public ICdsCrDiscoveryServiceRegistry cdsCrDiscoveryServiceRegistry() {
47+
CdsCrDiscoveryServiceRegistry registry = new CdsCrDiscoveryServiceRegistry();
48+
registry.unregister(FhirVersionEnum.R4);
49+
registry.register(FhirVersionEnum.R4, UpdatedCrDiscoveryServiceR4.class);
50+
return registry;
51+
}
52+
53+
@Bean
54+
public ICdsCrServiceRegistry cdsCrServiceRegistry() {
55+
CdsCrServiceRegistry registry = new CdsCrServiceRegistry();
56+
registry.unregister(FhirVersionEnum.R4);
57+
registry.register(FhirVersionEnum.R4, UpdatedCdsCrServiceR4.class);
58+
return registry;
59+
}
60+
2161
@Bean
2262
public CdsHooksProperties cdsHooksProperties() {
2363
return new CdsHooksProperties();
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package ca.uhn.fhir.jpa.starter.cdshooks;
2+
3+
import ca.uhn.fhir.rest.api.server.RequestDetails;
4+
import ca.uhn.hapi.fhir.cdshooks.api.ICdsConfigService;
5+
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
6+
import ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrServiceR4;
7+
import org.hl7.fhir.r4.model.BooleanType;
8+
import org.hl7.fhir.r4.model.Parameters;
9+
import org.opencds.cqf.fhir.api.Repository;
10+
11+
import java.util.stream.Collectors;
12+
13+
import static ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrConstants.APPLY_PARAMETER_DATA;
14+
import static ca.uhn.hapi.fhir.cdshooks.svc.cr.CdsCrConstants.APPLY_PARAMETER_DATA_ENDPOINT;
15+
import static org.opencds.cqf.fhir.utility.r4.Parameters.part;
16+
17+
public class UpdatedCdsCrServiceR4 extends CdsCrServiceR4 {
18+
public UpdatedCdsCrServiceR4(RequestDetails theRequestDetails, Repository theRepository, ICdsConfigService theCdsConfigService) {
19+
super(theRequestDetails, theRepository, theCdsConfigService);
20+
}
21+
22+
@Override
23+
public Parameters encodeParams(CdsServiceRequestJson theJson) {
24+
Parameters parameters = super.encodeParams(theJson);
25+
if (parameters.hasParameter(APPLY_PARAMETER_DATA)) {
26+
parameters.addParameter(part("useServerData", new BooleanType(false)));
27+
}
28+
return parameters;
29+
}
30+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package ca.uhn.fhir.jpa.starter.cdshooks;
2+
3+
import ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery.CrDiscoveryServiceR4;
4+
import org.hl7.fhir.instance.model.api.IIdType;
5+
import org.opencds.cqf.fhir.api.Repository;
6+
7+
public class UpdatedCrDiscoveryServiceR4 extends CrDiscoveryServiceR4 {
8+
public UpdatedCrDiscoveryServiceR4(IIdType thePlanDefinitionId, Repository theRepository) {
9+
super(thePlanDefinitionId, theRepository);
10+
myMaxUriLength = 6000;
11+
}
12+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package ca.uhn.fhir.jpa.starter.cr;
2+
3+
public class CareGapsProperties {
4+
private String reporter = "default";
5+
private String section_author = "default";
6+
7+
public String getReporter() {
8+
return reporter;
9+
}
10+
11+
public void setReporter(String reporter) {
12+
this.reporter = reporter;
13+
}
14+
15+
public String getSection_author() {
16+
return section_author;
17+
}
18+
19+
public void setSection_author(String section_author) {
20+
this.section_author = section_author;
21+
}
22+
}

0 commit comments

Comments
 (0)