From 4973d34a0e8a8026c00eed19409abe06bb52bf43 Mon Sep 17 00:00:00 2001 From: c-schuler Date: Tue, 16 Aug 2022 10:42:42 -0600 Subject: [PATCH 1/2] cleanup in cds hooks config from #593 --- .../java/org/opencds/cqf/ruler/cdshooks/CdsHooksConfig.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/CdsHooksConfig.java b/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/CdsHooksConfig.java index b10e6f702..95bfbbc42 100644 --- a/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/CdsHooksConfig.java +++ b/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/CdsHooksConfig.java @@ -4,7 +4,6 @@ import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import org.opencds.cqf.ruler.cdshooks.providers.ProviderConfiguration; -import org.opencds.cqf.ruler.cpg.r4.provider.CqlExecutionProvider; import org.opencds.cqf.ruler.cql.CqlProperties; import org.opencds.cqf.ruler.external.annotations.OnDSTU3Condition; import org.opencds.cqf.ruler.external.annotations.OnR4Condition; @@ -13,14 +12,12 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; @Configuration @ConditionalOnProperty(prefix = "hapi.fhir.cdshooks", name = "enabled", havingValue = "true", matchIfMissing = true) -@ComponentScan(basePackageClasses = {CqlExecutionProvider.class}) public class CdsHooksConfig { @Autowired From e3d1da3a12f4798412e1761fa56dc9fa6b9e37c5 Mon Sep 17 00:00:00 2001 From: c-schuler Date: Tue, 16 Aug 2022 13:59:54 -0600 Subject: [PATCH 2/2] Added extension to response deserialization ... updated test --- .../opencds/cqf/ruler/cdshooks/request/CdsHooksRequest.java | 3 +++ plugin/cds-hooks/src/test/resources/opioidcds-01-request.json | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/request/CdsHooksRequest.java b/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/request/CdsHooksRequest.java index 2da108929..bfe07989e 100644 --- a/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/request/CdsHooksRequest.java +++ b/plugin/cds-hooks/src/main/java/org/opencds/cqf/ruler/cdshooks/request/CdsHooksRequest.java @@ -1,5 +1,6 @@ package org.opencds.cqf.ruler.cdshooks.request; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonProperty; @@ -35,6 +36,8 @@ public class CdsHooksRequest { public Context context; @JsonProperty public Prefetch prefetch; + @JsonIgnore + public Object extension; public static class FhirAuthorization { @JsonProperty(value = "access_token", required = true) diff --git a/plugin/cds-hooks/src/test/resources/opioidcds-01-request.json b/plugin/cds-hooks/src/test/resources/opioidcds-01-request.json index f8312f4cb..1c3f34af4 100644 --- a/plugin/cds-hooks/src/test/resources/opioidcds-01-request.json +++ b/plugin/cds-hooks/src/test/resources/opioidcds-01-request.json @@ -96,5 +96,9 @@ } ] } + }, + "extension": { + "com.example.timestamp": "2022-08-16T22:13:25Z", + "com.cds-hooks.sandbox.myextension-practitionerspecialty": "gastroenterology" } } \ No newline at end of file