Merge branch 'master' into 6285-value-set-expansion-issues
This commit is contained in:
commit
5b50545a50
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir-bom</artifactId>
|
<artifactId>hapi-fhir-bom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>HAPI FHIR BOM</name>
|
<name>HAPI FHIR BOM</name>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir-cli</artifactId>
|
<artifactId>hapi-fhir-cli</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
type: fix
|
||||||
|
issue: 6262
|
||||||
|
title: "Previously, when a `extension` was passed in as a part of the CDS hooks request, it would result in a `400 service not found`. This behaviour has now been fixed."
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
type: remove
|
||||||
|
issue: 6283
|
||||||
|
title: "Hibernate Search Fulltext fields which were unused
|
||||||
|
have been removed from indexing.
|
||||||
|
This will reduce storage usage in Lucene and Elasticsearch.
|
||||||
|
The fields that were removed are: `myNarrativeTextEdgeNGram`,
|
||||||
|
`myNarrativeTextNGram`, `myNarrativeTextPhonetic`, `myContentTextEdgeNGram`,
|
||||||
|
`myContentTextNGram`, `myContentTextPhonetic`.
|
||||||
|
"
|
|
@ -11,7 +11,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -119,21 +119,6 @@ public class ResourceTable extends BaseHasResource implements Serializable, IBas
|
||||||
searchable = Searchable.YES,
|
searchable = Searchable.YES,
|
||||||
projectable = Projectable.YES,
|
projectable = Projectable.YES,
|
||||||
analyzer = "standardAnalyzer")
|
analyzer = "standardAnalyzer")
|
||||||
@FullTextField(
|
|
||||||
name = "myContentTextEdgeNGram",
|
|
||||||
searchable = Searchable.YES,
|
|
||||||
projectable = Projectable.NO,
|
|
||||||
analyzer = "autocompleteEdgeAnalyzer")
|
|
||||||
@FullTextField(
|
|
||||||
name = "myContentTextNGram",
|
|
||||||
searchable = Searchable.YES,
|
|
||||||
projectable = Projectable.NO,
|
|
||||||
analyzer = "autocompleteNGramAnalyzer")
|
|
||||||
@FullTextField(
|
|
||||||
name = "myContentTextPhonetic",
|
|
||||||
searchable = Searchable.YES,
|
|
||||||
projectable = Projectable.NO,
|
|
||||||
analyzer = "autocompletePhoneticAnalyzer")
|
|
||||||
@OptimisticLock(excluded = true)
|
@OptimisticLock(excluded = true)
|
||||||
@IndexingDependency(derivedFrom = @ObjectPath(@PropertyValue(propertyName = "myVersion")))
|
@IndexingDependency(derivedFrom = @ObjectPath(@PropertyValue(propertyName = "myVersion")))
|
||||||
private String myContentText;
|
private String myContentText;
|
||||||
|
@ -171,21 +156,6 @@ public class ResourceTable extends BaseHasResource implements Serializable, IBas
|
||||||
searchable = Searchable.YES,
|
searchable = Searchable.YES,
|
||||||
projectable = Projectable.YES,
|
projectable = Projectable.YES,
|
||||||
analyzer = "standardAnalyzer")
|
analyzer = "standardAnalyzer")
|
||||||
@FullTextField(
|
|
||||||
name = "myNarrativeTextEdgeNGram",
|
|
||||||
searchable = Searchable.YES,
|
|
||||||
projectable = Projectable.NO,
|
|
||||||
analyzer = "autocompleteEdgeAnalyzer")
|
|
||||||
@FullTextField(
|
|
||||||
name = "myNarrativeTextNGram",
|
|
||||||
searchable = Searchable.YES,
|
|
||||||
projectable = Projectable.NO,
|
|
||||||
analyzer = "autocompleteNGramAnalyzer")
|
|
||||||
@FullTextField(
|
|
||||||
name = "myNarrativeTextPhonetic",
|
|
||||||
searchable = Searchable.YES,
|
|
||||||
projectable = Projectable.NO,
|
|
||||||
analyzer = "autocompletePhoneticAnalyzer")
|
|
||||||
@OptimisticLock(excluded = true)
|
@OptimisticLock(excluded = true)
|
||||||
@IndexingDependency(derivedFrom = @ObjectPath(@PropertyValue(propertyName = "myVersion")))
|
@IndexingDependency(derivedFrom = @ObjectPath(@PropertyValue(propertyName = "myVersion")))
|
||||||
private String myNarrativeText;
|
private String myNarrativeText;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -44,13 +44,13 @@ public interface ISearchParamExtractor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant for the {@literal theSearchParamFilter} parameters on this interface
|
* Constant for the {@literal theSearchParamFilter} parameters on this interface
|
||||||
* indicating that all search parameters should be indexed.
|
* indicating that all search parameters should be extracted.
|
||||||
*/
|
*/
|
||||||
ISearchParamFilter ALL_PARAMS = t -> t;
|
ISearchParamFilter ALL_PARAMS = t -> t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant for the {@literal theSearchParamFilter} parameters on this interface
|
* Constant for the {@literal theSearchParamFilter} parameters on this interface
|
||||||
* indicating that no search parameters should be indexed.
|
* indicating that no search parameters should be extracted.
|
||||||
*/
|
*/
|
||||||
ISearchParamFilter NO_PARAMS = t -> Collections.emptyList();
|
ISearchParamFilter NO_PARAMS = t -> Collections.emptyList();
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ public interface ISearchParamExtractor {
|
||||||
interface ISearchParamFilter {
|
interface ISearchParamFilter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given the list of search parameters for indexing, an implementation of this
|
* Given the list of search parameters for extracting, an implementation of this
|
||||||
* interface may selectively remove any that it wants to remove (or can add if desired).
|
* interface may selectively remove any that it wants to remove (or can add if desired).
|
||||||
* <p>
|
* <p>
|
||||||
* Implementations must not modify the list that is passed in. If changes are
|
* Implementations must not modify the list that is passed in. If changes are
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -45,7 +45,7 @@ public interface ICdsServiceRegistry {
|
||||||
* @param theCdsServiceRequestJson the service request
|
* @param theCdsServiceRequestJson the service request
|
||||||
* @return the service response
|
* @return the service response
|
||||||
*/
|
*/
|
||||||
CdsServiceResponseJson callService(String theServiceId, CdsServiceRequestJson theCdsServiceRequestJson);
|
CdsServiceResponseJson callService(String theServiceId, Object theCdsServiceRequestJson);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the REST method available at https://example.com/cds-services/{theServiceId}/feedback
|
* This is the REST method available at https://example.com/cds-services/{theServiceId}/feedback
|
||||||
|
|
|
@ -20,9 +20,11 @@
|
||||||
package ca.uhn.hapi.fhir.cdshooks.api.json;
|
package ca.uhn.hapi.fhir.cdshooks.api.json;
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.IModelJson;
|
import ca.uhn.fhir.model.api.IModelJson;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Users can define CDS Hooks extensions by extending this class.
|
* Users can define CDS Hooks extensions by extending this class.
|
||||||
* Implementors can extend this class for defining their custom extensions.
|
* Implementors can extend this class for defining their custom extensions.
|
||||||
*/
|
*/
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class CdsHooksExtension implements IModelJson {}
|
public class CdsHooksExtension implements IModelJson {}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package ca.uhn.hapi.fhir.cdshooks.api.json;
|
||||||
|
|
||||||
import ca.uhn.fhir.model.api.IModelJson;
|
import ca.uhn.fhir.model.api.IModelJson;
|
||||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -29,6 +30,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class CdsServiceRequestContextJson extends BaseCdsServiceJson implements IModelJson {
|
public class CdsServiceRequestContextJson extends BaseCdsServiceJson implements IModelJson {
|
||||||
|
|
||||||
@JsonAnyGetter
|
@JsonAnyGetter
|
||||||
|
|
|
@ -31,6 +31,7 @@ import ca.uhn.hapi.fhir.cdshooks.api.ICdsConfigService;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.ICdsHooksDaoAuthorizationSvc;
|
import ca.uhn.hapi.fhir.cdshooks.api.ICdsHooksDaoAuthorizationSvc;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceRegistry;
|
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceRegistry;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.module.CdsHooksObjectMapperFactory;
|
import ca.uhn.hapi.fhir.cdshooks.module.CdsHooksObjectMapperFactory;
|
||||||
|
import ca.uhn.hapi.fhir.cdshooks.serializer.CdsServiceRequestJsonDeserializer;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.CdsConfigServiceImpl;
|
import ca.uhn.hapi.fhir.cdshooks.svc.CdsConfigServiceImpl;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.CdsHooksContextBooter;
|
import ca.uhn.hapi.fhir.cdshooks.svc.CdsHooksContextBooter;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.CdsServiceRegistryImpl;
|
import ca.uhn.hapi.fhir.cdshooks.svc.CdsServiceRegistryImpl;
|
||||||
|
@ -100,13 +101,15 @@ public class CdsHooksConfig {
|
||||||
ICdsCrServiceFactory theCdsCrServiceFactory,
|
ICdsCrServiceFactory theCdsCrServiceFactory,
|
||||||
ICrDiscoveryServiceFactory theCrDiscoveryServiceFactory,
|
ICrDiscoveryServiceFactory theCrDiscoveryServiceFactory,
|
||||||
FhirContext theFhirContext) {
|
FhirContext theFhirContext) {
|
||||||
|
final CdsServiceRequestJsonDeserializer cdsServiceRequestJsonDeserializer =
|
||||||
|
new CdsServiceRequestJsonDeserializer(theFhirContext, theObjectMapper);
|
||||||
return new CdsServiceRegistryImpl(
|
return new CdsServiceRegistryImpl(
|
||||||
theCdsHooksContextBooter,
|
theCdsHooksContextBooter,
|
||||||
theCdsPrefetchSvc,
|
theCdsPrefetchSvc,
|
||||||
theObjectMapper,
|
theObjectMapper,
|
||||||
theCdsCrServiceFactory,
|
theCdsCrServiceFactory,
|
||||||
theCrDiscoveryServiceFactory,
|
theCrDiscoveryServiceFactory,
|
||||||
theFhirContext);
|
cdsServiceRequestJsonDeserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
|
@ -21,7 +21,6 @@ package ca.uhn.hapi.fhir.cdshooks.controller;
|
||||||
|
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceRegistry;
|
import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceRegistry;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeedbackJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeedbackJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
|
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServicesJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServicesJson;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
@ -73,7 +72,7 @@ public class CdsHooksController {
|
||||||
method = {RequestMethod.POST},
|
method = {RequestMethod.POST},
|
||||||
consumes = {MediaType.APPLICATION_JSON_VALUE})
|
consumes = {MediaType.APPLICATION_JSON_VALUE})
|
||||||
public ResponseEntity<CdsServiceResponseJson> cdsServiceRequest(
|
public ResponseEntity<CdsServiceResponseJson> cdsServiceRequest(
|
||||||
@PathVariable("cds_hook") String theCdsHook, @RequestBody CdsServiceRequestJson theCdsServiceRequestJson) {
|
@PathVariable("cds_hook") String theCdsHook, @RequestBody Object theCdsServiceRequestJson) {
|
||||||
CdsServiceResponseJson response = myCdsServiceRegistry.callService(theCdsHook, theCdsServiceRequestJson);
|
CdsServiceResponseJson response = myCdsServiceRegistry.callService(theCdsHook, theCdsServiceRequestJson);
|
||||||
return ResponseEntity.status(200)
|
return ResponseEntity.status(200)
|
||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
|
|
|
@ -20,84 +20,60 @@
|
||||||
package ca.uhn.hapi.fhir.cdshooks.serializer;
|
package ca.uhn.hapi.fhir.cdshooks.serializer;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
import ca.uhn.fhir.i18n.Msg;
|
||||||
import ca.uhn.fhir.parser.IParser;
|
import ca.uhn.fhir.parser.IParser;
|
||||||
import ca.uhn.fhir.serializer.FhirResourceDeserializer;
|
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsHooksExtension;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsHooksExtension;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestContextJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestContextJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.CdsServiceRegistryImpl;
|
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
import jakarta.annotation.Nonnull;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class CdsServiceRequestJsonDeserializer extends StdDeserializer<CdsServiceRequestJson> {
|
public class CdsServiceRequestJsonDeserializer {
|
||||||
|
|
||||||
private final CdsServiceRegistryImpl myCdsServiceRegistry;
|
|
||||||
private final ObjectMapper myObjectMapper;
|
private final ObjectMapper myObjectMapper;
|
||||||
private final FhirContext myFhirContext;
|
private final FhirContext myFhirContext;
|
||||||
private final IParser myParser;
|
private final IParser myParser;
|
||||||
|
|
||||||
public CdsServiceRequestJsonDeserializer(CdsServiceRegistryImpl theCdsServiceRegistry, FhirContext theFhirContext) {
|
public CdsServiceRequestJsonDeserializer(
|
||||||
super(CdsServiceRequestJson.class);
|
@Nonnull FhirContext theFhirContext, @Nonnull ObjectMapper theObjectMapper) {
|
||||||
myCdsServiceRegistry = theCdsServiceRegistry;
|
|
||||||
myFhirContext = theFhirContext;
|
myFhirContext = theFhirContext;
|
||||||
myParser = myFhirContext.newJsonParser().setPrettyPrint(true);
|
myParser = myFhirContext.newJsonParser().setPrettyPrint(true);
|
||||||
// We create a new ObjectMapper instead of using the one from the ApplicationContext to avoid an infinite loop
|
myObjectMapper = theObjectMapper;
|
||||||
// during deserialization.
|
|
||||||
myObjectMapper = new ObjectMapper();
|
|
||||||
configureObjectMapper(myObjectMapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public CdsServiceRequestJson deserialize(
|
||||||
public CdsServiceRequestJson deserialize(JsonParser theJsonParser, DeserializationContext theDeserializationContext)
|
@Nonnull CdsServiceJson theCdsServiceJson, @Nonnull Object theCdsServiceRequestJson) {
|
||||||
throws IOException {
|
final JsonNode cdsServiceRequestJsonNode =
|
||||||
final JsonNode cdsServiceRequestJsonNode = theJsonParser.getCodec().readTree(theJsonParser);
|
myObjectMapper.convertValue(theCdsServiceRequestJson, JsonNode.class);
|
||||||
final JsonNode hookNode = cdsServiceRequestJsonNode.get("hook");
|
final JsonNode contextNode = cdsServiceRequestJsonNode.get("context");
|
||||||
final JsonNode extensionNode = cdsServiceRequestJsonNode.get("extension");
|
validateHookInstance(cdsServiceRequestJsonNode.get("hookInstance"));
|
||||||
final JsonNode requestContext = cdsServiceRequestJsonNode.get("context");
|
validateHook(cdsServiceRequestJsonNode.get("hook"));
|
||||||
final CdsServiceRequestJson cdsServiceRequestJson =
|
validateContext(contextNode);
|
||||||
myObjectMapper.treeToValue(cdsServiceRequestJsonNode, CdsServiceRequestJson.class);
|
try {
|
||||||
if (extensionNode != null) {
|
final JsonNode extensionNode = cdsServiceRequestJsonNode.get("extension");
|
||||||
CdsHooksExtension myRequestExtension = deserializeExtension(hookNode.textValue(), extensionNode.toString());
|
final CdsServiceRequestJson cdsServiceRequestJson =
|
||||||
cdsServiceRequestJson.setExtension(myRequestExtension);
|
myObjectMapper.convertValue(cdsServiceRequestJsonNode, CdsServiceRequestJson.class);
|
||||||
|
LinkedHashMap<String, Object> map = myObjectMapper.readValue(contextNode.toString(), LinkedHashMap.class);
|
||||||
|
cdsServiceRequestJson.setContext(deserializeContext(map));
|
||||||
|
if (extensionNode != null) {
|
||||||
|
CdsHooksExtension myRequestExtension =
|
||||||
|
deserializeExtension(theCdsServiceJson, extensionNode.toString());
|
||||||
|
cdsServiceRequestJson.setExtension(myRequestExtension);
|
||||||
|
}
|
||||||
|
return cdsServiceRequestJson;
|
||||||
|
} catch (JsonProcessingException | IllegalArgumentException theEx) {
|
||||||
|
throw new InvalidRequestException(Msg.code(2551) + "Invalid CdsServiceRequest received. " + theEx);
|
||||||
}
|
}
|
||||||
if (requestContext != null) {
|
|
||||||
LinkedHashMap<String, Object> map =
|
|
||||||
myObjectMapper.readValue(requestContext.toString(), LinkedHashMap.class);
|
|
||||||
cdsServiceRequestJson.setContext(deserializeRequestContext(map));
|
|
||||||
}
|
|
||||||
return cdsServiceRequestJson;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void configureObjectMapper(ObjectMapper theObjectMapper) {
|
CdsServiceRequestContextJson deserializeContext(LinkedHashMap<String, Object> theMap)
|
||||||
SimpleModule module = new SimpleModule();
|
|
||||||
module.addDeserializer(IBaseResource.class, new FhirResourceDeserializer(myFhirContext));
|
|
||||||
theObjectMapper.registerModule(module);
|
|
||||||
// set this as we will need to ignore properties which are not defined by specific implementation.
|
|
||||||
theObjectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
CdsHooksExtension deserializeExtension(String theServiceId, String theExtension) throws JsonProcessingException {
|
|
||||||
final CdsServiceJson cdsServicesJson = myCdsServiceRegistry.getCdsServiceJson(theServiceId);
|
|
||||||
Class<? extends CdsHooksExtension> extensionClass = cdsServicesJson.getExtensionClass();
|
|
||||||
if (extensionClass == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return myObjectMapper.readValue(theExtension, extensionClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
CdsServiceRequestContextJson deserializeRequestContext(LinkedHashMap<String, Object> theMap)
|
|
||||||
throws JsonProcessingException {
|
throws JsonProcessingException {
|
||||||
final CdsServiceRequestContextJson cdsServiceRequestContextJson = new CdsServiceRequestContextJson();
|
final CdsServiceRequestContextJson cdsServiceRequestContextJson = new CdsServiceRequestContextJson();
|
||||||
for (Map.Entry<String, Object> entry : theMap.entrySet()) {
|
for (Map.Entry<String, Object> entry : theMap.entrySet()) {
|
||||||
|
@ -114,4 +90,31 @@ public class CdsServiceRequestJsonDeserializer extends StdDeserializer<CdsServic
|
||||||
}
|
}
|
||||||
return cdsServiceRequestContextJson;
|
return cdsServiceRequestContextJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CdsHooksExtension deserializeExtension(
|
||||||
|
@Nonnull CdsServiceJson theCdsServiceJson, @Nonnull String theExtension) throws JsonProcessingException {
|
||||||
|
Class<? extends CdsHooksExtension> extensionClass = theCdsServiceJson.getExtensionClass();
|
||||||
|
if (extensionClass == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return myObjectMapper.readValue(theExtension, extensionClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateHook(JsonNode hookIdNode) {
|
||||||
|
if (hookIdNode == null) {
|
||||||
|
throw new InvalidRequestException(Msg.code(2549) + "hook cannot be null for a CdsServiceRequest.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateHookInstance(JsonNode hookInstanceNode) {
|
||||||
|
if (hookInstanceNode == null) {
|
||||||
|
throw new InvalidRequestException(Msg.code(2548) + "hookInstance cannot be null for a CdsServiceRequest.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateContext(JsonNode requestContextNode) {
|
||||||
|
if (requestContextNode == null) {
|
||||||
|
throw new InvalidRequestException(Msg.code(2550) + "context cannot be null for a CdsServiceRequest.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
package ca.uhn.hapi.fhir.cdshooks.svc;
|
package ca.uhn.hapi.fhir.cdshooks.svc;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.ConfigurationException;
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
|
||||||
import ca.uhn.fhir.i18n.Msg;
|
import ca.uhn.fhir.i18n.Msg;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.ICdsMethod;
|
import ca.uhn.hapi.fhir.cdshooks.api.ICdsMethod;
|
||||||
|
@ -38,7 +37,6 @@ import ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery.ICrDiscoveryServiceFactory;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc;
|
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import jakarta.annotation.Nonnull;
|
import jakarta.annotation.Nonnull;
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
@ -50,7 +48,7 @@ import java.util.function.Function;
|
||||||
|
|
||||||
public class CdsServiceRegistryImpl implements ICdsServiceRegistry {
|
public class CdsServiceRegistryImpl implements ICdsServiceRegistry {
|
||||||
private static final Logger ourLog = LoggerFactory.getLogger(CdsServiceRegistryImpl.class);
|
private static final Logger ourLog = LoggerFactory.getLogger(CdsServiceRegistryImpl.class);
|
||||||
|
private final CdsServiceRequestJsonDeserializer myCdsServiceRequestJsonDeserializer;
|
||||||
private CdsServiceCache myServiceCache;
|
private CdsServiceCache myServiceCache;
|
||||||
|
|
||||||
private final CdsHooksContextBooter myCdsHooksContextBooter;
|
private final CdsHooksContextBooter myCdsHooksContextBooter;
|
||||||
|
@ -65,19 +63,13 @@ public class CdsServiceRegistryImpl implements ICdsServiceRegistry {
|
||||||
ObjectMapper theObjectMapper,
|
ObjectMapper theObjectMapper,
|
||||||
ICdsCrServiceFactory theCdsCrServiceFactory,
|
ICdsCrServiceFactory theCdsCrServiceFactory,
|
||||||
ICrDiscoveryServiceFactory theCrDiscoveryServiceFactory,
|
ICrDiscoveryServiceFactory theCrDiscoveryServiceFactory,
|
||||||
FhirContext theFhirContext) {
|
CdsServiceRequestJsonDeserializer theCdsServiceRequestJsonDeserializer) {
|
||||||
myCdsHooksContextBooter = theCdsHooksContextBooter;
|
myCdsHooksContextBooter = theCdsHooksContextBooter;
|
||||||
myCdsPrefetchSvc = theCdsPrefetchSvc;
|
myCdsPrefetchSvc = theCdsPrefetchSvc;
|
||||||
myObjectMapper = theObjectMapper;
|
myObjectMapper = theObjectMapper;
|
||||||
// registering this deserializer here instead of
|
|
||||||
// CdsHooksObjectMapperFactory to avoid circular
|
|
||||||
// dependency
|
|
||||||
SimpleModule module = new SimpleModule();
|
|
||||||
module.addDeserializer(
|
|
||||||
CdsServiceRequestJson.class, new CdsServiceRequestJsonDeserializer(this, theFhirContext));
|
|
||||||
myObjectMapper.registerModule(module);
|
|
||||||
myCdsCrServiceFactory = theCdsCrServiceFactory;
|
myCdsCrServiceFactory = theCdsCrServiceFactory;
|
||||||
myCrDiscoveryServiceFactory = theCrDiscoveryServiceFactory;
|
myCrDiscoveryServiceFactory = theCrDiscoveryServiceFactory;
|
||||||
|
myCdsServiceRequestJsonDeserializer = theCdsServiceRequestJsonDeserializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
|
@ -91,10 +83,13 @@ public class CdsServiceRegistryImpl implements ICdsServiceRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CdsServiceResponseJson callService(String theServiceId, CdsServiceRequestJson theCdsServiceRequestJson) {
|
public CdsServiceResponseJson callService(String theServiceId, Object theCdsServiceRequestJson) {
|
||||||
|
final CdsServiceJson cdsServiceJson = getCdsServiceJson(theServiceId);
|
||||||
|
final CdsServiceRequestJson deserializedRequest =
|
||||||
|
myCdsServiceRequestJsonDeserializer.deserialize(cdsServiceJson, theCdsServiceRequestJson);
|
||||||
ICdsServiceMethod serviceMethod = (ICdsServiceMethod) getCdsServiceMethodOrThrowException(theServiceId);
|
ICdsServiceMethod serviceMethod = (ICdsServiceMethod) getCdsServiceMethodOrThrowException(theServiceId);
|
||||||
myCdsPrefetchSvc.augmentRequest(theCdsServiceRequestJson, serviceMethod);
|
myCdsPrefetchSvc.augmentRequest(deserializedRequest, serviceMethod);
|
||||||
Object response = serviceMethod.invoke(myObjectMapper, theCdsServiceRequestJson, theServiceId);
|
Object response = serviceMethod.invoke(myObjectMapper, deserializedRequest, theServiceId);
|
||||||
return encodeServiceResponse(theServiceId, response);
|
return encodeServiceResponse(theServiceId, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import ca.uhn.hapi.fhir.cdshooks.api.ICdsServiceRegistry;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeebackOutcomeEnum;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeebackOutcomeEnum;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeedbackJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeedbackJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
||||||
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestContextJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseCardJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseCardJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
|
||||||
|
@ -118,6 +119,7 @@ public class CdsHooksControllerTest {
|
||||||
request.setHookInstance(TEST_HOOK_INSTANCE);
|
request.setHookInstance(TEST_HOOK_INSTANCE);
|
||||||
request.setHook(HelloWorldService.TEST_HOOK);
|
request.setHook(HelloWorldService.TEST_HOOK);
|
||||||
request.setFhirServer(TEST_FHIR_SERVER);
|
request.setFhirServer(TEST_FHIR_SERVER);
|
||||||
|
request.setContext( withCdsServiceRequestContext());
|
||||||
|
|
||||||
String requestBody = myObjectMapper.writeValueAsString(request);
|
String requestBody = myObjectMapper.writeValueAsString(request);
|
||||||
|
|
||||||
|
@ -142,8 +144,9 @@ public class CdsHooksControllerTest {
|
||||||
CdsServiceRequestJson request = new CdsServiceRequestJson();
|
CdsServiceRequestJson request = new CdsServiceRequestJson();
|
||||||
request.setExtension(requestExtension);
|
request.setExtension(requestExtension);
|
||||||
request.setFhirServer(TEST_FHIR_SERVER);
|
request.setFhirServer(TEST_FHIR_SERVER);
|
||||||
request.setHook(HelloWorldService.TEST_HOOK_UNIVERSE_ID);
|
request.setHook(HelloWorldService.TEST_HOOK);
|
||||||
|
request.setContext(withCdsServiceRequestContext());
|
||||||
|
request.setHookInstance(UUID.randomUUID().toString());
|
||||||
|
|
||||||
String requestBody = myObjectMapper.writeValueAsString(request);
|
String requestBody = myObjectMapper.writeValueAsString(request);
|
||||||
|
|
||||||
|
@ -163,6 +166,7 @@ public class CdsHooksControllerTest {
|
||||||
request.setHookInstance(TEST_HOOK_INSTANCE);
|
request.setHookInstance(TEST_HOOK_INSTANCE);
|
||||||
request.setHook(HelloWorldService.TEST_HOOK);
|
request.setHook(HelloWorldService.TEST_HOOK);
|
||||||
request.setFhirServer(TEST_FHIR_SERVER);
|
request.setFhirServer(TEST_FHIR_SERVER);
|
||||||
|
request.setContext(withCdsServiceRequestContext());
|
||||||
|
|
||||||
String requestBody = myObjectMapper.writeValueAsString(request);
|
String requestBody = myObjectMapper.writeValueAsString(request);
|
||||||
|
|
||||||
|
@ -268,4 +272,11 @@ public class CdsHooksControllerTest {
|
||||||
return JsonUtil.serialize(input, true);
|
return JsonUtil.serialize(input, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private static CdsServiceRequestContextJson withCdsServiceRequestContext() {
|
||||||
|
CdsServiceRequestContextJson cdsServiceRequestContextJson = new CdsServiceRequestContextJson();
|
||||||
|
cdsServiceRequestContextJson.put("patientId", "Patient/123");
|
||||||
|
return cdsServiceRequestContextJson;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,106 +1,152 @@
|
||||||
package ca.uhn.hapi.fhir.cdshooks.serializer;
|
package ca.uhn.hapi.fhir.cdshooks.serializer;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsHooksExtension;
|
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestContextJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestContextJson;
|
||||||
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.custom.extensions.model.ExampleExtension;
|
import ca.uhn.hapi.fhir.cdshooks.custom.extensions.model.ExampleExtension;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.CdsServiceRegistryImpl;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import jakarta.annotation.Nonnull;
|
||||||
import org.hl7.fhir.r4.model.Patient;
|
import org.hl7.fhir.r4.model.Patient;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
|
||||||
import org.mockito.Mock;
|
|
||||||
import org.mockito.junit.jupiter.MockitoExtension;
|
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||||
|
|
||||||
@ExtendWith(MockitoExtension.class)
|
|
||||||
class CdsServiceRequestJsonDeserializerTest {
|
class CdsServiceRequestJsonDeserializerTest {
|
||||||
@Mock
|
private static final String SERVICE_ID = "service-id";
|
||||||
private CdsServiceRegistryImpl myCdsServiceRegistry;
|
private static final String EXAMPLE_PROPERTY_VALUE = "example-value";
|
||||||
|
private static final String EXAMPLE_PROPERTY_KEY = "example-property";
|
||||||
|
private static final String HOOK_ID = "hook-id";
|
||||||
private final FhirContext myFhirContext = FhirContext.forR4();
|
private final FhirContext myFhirContext = FhirContext.forR4();
|
||||||
|
private final ObjectMapper myObjectMapper = new ObjectMapper();
|
||||||
private CdsServiceRequestJsonDeserializer myFixture;
|
private CdsServiceRequestJsonDeserializer myFixture;
|
||||||
|
|
||||||
@BeforeEach()
|
@BeforeEach()
|
||||||
void setup() {
|
void setup() {
|
||||||
myFixture = new CdsServiceRequestJsonDeserializer(myCdsServiceRegistry, myFhirContext);
|
myFixture = new CdsServiceRequestJsonDeserializer(myFhirContext, myObjectMapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void configureObjectMapper() {
|
void deserialize_shouldDeserialize_whenValidCdsServiceRequestWithExtensionReceived() {
|
||||||
// setup
|
// setup
|
||||||
ObjectMapper input = new ObjectMapper();
|
final CdsServiceJson cdsServiceJson = withCdsServiceJsonIncludingExtensionClass();
|
||||||
|
final LinkedHashMap<String, Object> extension = withExtension();
|
||||||
|
final LinkedHashMap<String, Object> request = withRequest(extension);
|
||||||
|
request.put("context", withContext());
|
||||||
// execute
|
// execute
|
||||||
myFixture.configureObjectMapper(input);
|
final CdsServiceRequestJson actual = myFixture.deserialize(cdsServiceJson, request);
|
||||||
// validate
|
// validate
|
||||||
assertThat(input.getRegisteredModuleIds()).hasSize(1);
|
assertThat(actual.getExtension()).isInstanceOf(ExampleExtension.class);
|
||||||
|
final ExampleExtension actualExtension = (ExampleExtension) actual.getExtension();
|
||||||
|
assertThat(actualExtension.getExampleProperty()).isEqualTo(EXAMPLE_PROPERTY_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void deserializeExtensionWhenClassFoundShouldDeserializeExtension() throws JsonProcessingException {
|
void deserialize_shouldIgnoreExtraFieldsInsideExtension_whenExtensionContainsMoreFieldsThanDefinedInClass() {
|
||||||
|
// setup
|
||||||
|
final CdsServiceJson cdsServiceJson = withCdsServiceJsonIncludingExtensionClass();
|
||||||
|
final LinkedHashMap<String, Object> extension = withExtension();
|
||||||
|
extension.put("example-extra-property", "example-extra-value");
|
||||||
|
final LinkedHashMap<String, Object> request = withRequest(extension);
|
||||||
|
request.put("context", withContext());
|
||||||
|
// execute
|
||||||
|
final CdsServiceRequestJson actual = myFixture.deserialize(cdsServiceJson, request);
|
||||||
|
// validate
|
||||||
|
assertThat(actual.getExtension()).isInstanceOf(ExampleExtension.class);
|
||||||
|
final ExampleExtension actualExtension = (ExampleExtension) actual.getExtension();
|
||||||
|
assertThat(actualExtension.getExampleProperty()).isEqualTo(EXAMPLE_PROPERTY_VALUE);
|
||||||
|
assertThat(actual.getContext().get("encounterId")).isEqualTo("Encounter/123");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private static LinkedHashMap<String, Object> withContext() {
|
||||||
|
final LinkedHashMap<String, Object> context = new LinkedHashMap<>();
|
||||||
|
context.put("encounterId", "Encounter/123");
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void deserialize_shouldThrow_whenCdsServiceRequestIncludesInvalidProperty() {
|
||||||
|
// setup
|
||||||
|
final CdsServiceJson cdsServiceJson = withCdsServiceJsonIncludingExtensionClass();
|
||||||
|
final LinkedHashMap<String, Object> extension = withExtension();
|
||||||
|
final LinkedHashMap<String, Object> request = withRequest(extension);
|
||||||
|
request.put("invalid-key", "some-value");
|
||||||
|
request.put("context", withContext());
|
||||||
|
// execute & validate
|
||||||
|
assertThatThrownBy(
|
||||||
|
() -> myFixture.deserialize(cdsServiceJson, request))
|
||||||
|
.isInstanceOf(InvalidRequestException.class)
|
||||||
|
.hasMessageContaining("HAPI-2551:")
|
||||||
|
.hasMessageContaining("Invalid CdsServiceRequest received.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void deserialize_shouldReturnNullExtension_whenNotClassFound() {
|
||||||
// setup
|
// setup
|
||||||
final String serviceId = "service-id";
|
|
||||||
final String extension = """
|
|
||||||
{
|
|
||||||
"example-property": "example-value"
|
|
||||||
}
|
|
||||||
""";
|
|
||||||
final CdsServiceJson cdsServiceJson = new CdsServiceJson();
|
final CdsServiceJson cdsServiceJson = new CdsServiceJson();
|
||||||
cdsServiceJson.setId(serviceId);
|
cdsServiceJson.setId(SERVICE_ID);
|
||||||
cdsServiceJson.setExtensionClass(ExampleExtension.class);
|
final LinkedHashMap<String, Object> extension = withExtension();
|
||||||
doReturn(cdsServiceJson).when(myCdsServiceRegistry).getCdsServiceJson(serviceId);
|
extension.put("example-extra-property", "example-extra-value");
|
||||||
|
final LinkedHashMap<String, Object> request = withRequest(extension);
|
||||||
|
request.put("context", withContext());
|
||||||
// execute
|
// execute
|
||||||
final ExampleExtension actual = (ExampleExtension) myFixture.deserializeExtension(serviceId, extension);
|
final CdsServiceRequestJson actual = myFixture.deserialize(cdsServiceJson, request);
|
||||||
// validate
|
// validate
|
||||||
assertThat(actual.getExampleProperty()).isEqualTo("example-value");
|
assertThat(actual.getExtension()).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void deserializeExtensionWhenClassFoundButExtensionHasExtraPropertiesShouldIgnoreExtraProperties() throws JsonProcessingException {
|
void deserialize_shouldThrow_whenHookNotFoundInRequest() {
|
||||||
// setup
|
// setup
|
||||||
final String serviceId = "service-id";
|
final CdsServiceJson cdsServiceJson = withCdsServiceJsonIncludingExtensionClass();
|
||||||
final String extension = """
|
final LinkedHashMap<String, Object> request = new LinkedHashMap<>();
|
||||||
{
|
request.put("context", withContext());
|
||||||
"example-property": "example-value",
|
request.put("hookInstance", UUID.randomUUID().toString());
|
||||||
"example-extra-property": "example-extra-value"
|
// execute and validate
|
||||||
}
|
assertThatThrownBy(() -> myFixture.deserialize(cdsServiceJson, request))
|
||||||
""";
|
.isInstanceOf(InvalidRequestException.class)
|
||||||
final CdsServiceJson cdsServiceJson = new CdsServiceJson();
|
.hasMessageContaining("HAPI-2549:")
|
||||||
cdsServiceJson.setId(serviceId);
|
.hasMessageContaining("hook cannot be null for a CdsServiceRequest.");
|
||||||
cdsServiceJson.setExtensionClass(ExampleExtension.class);
|
|
||||||
doReturn(cdsServiceJson).when(myCdsServiceRegistry).getCdsServiceJson(serviceId);
|
|
||||||
// execute
|
|
||||||
final ExampleExtension actual = (ExampleExtension) myFixture.deserializeExtension(serviceId, extension);
|
|
||||||
// validate
|
|
||||||
assertThat(actual.getExampleProperty()).isEqualTo("example-value");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void deserializeExtensionWhenNotClassFoundShouldReturnNull() throws JsonProcessingException {
|
void deserialize_shouldThrow_whenContextNotFoundInRequest() {
|
||||||
// setup
|
// setup
|
||||||
final String serviceId = "service-id";
|
final CdsServiceJson cdsServiceJson = withCdsServiceJsonIncludingExtensionClass();
|
||||||
final String extension = """
|
final LinkedHashMap<String, Object> request = new LinkedHashMap<>();
|
||||||
{
|
request.put("hook", HOOK_ID);
|
||||||
"example-property": "example-value"
|
request.put("hookInstance", UUID.randomUUID().toString());
|
||||||
}
|
// execute and validate
|
||||||
""";
|
assertThatThrownBy(() -> myFixture.deserialize(cdsServiceJson, request))
|
||||||
final CdsServiceJson cdsServiceJson = new CdsServiceJson();
|
.isInstanceOf(InvalidRequestException.class)
|
||||||
cdsServiceJson.setId(serviceId);
|
.hasMessageContaining("HAPI-2550:")
|
||||||
doReturn(cdsServiceJson).when(myCdsServiceRegistry).getCdsServiceJson(serviceId);
|
.hasMessageContaining("context cannot be null for a CdsServiceRequest.");
|
||||||
// execute
|
|
||||||
final CdsHooksExtension actual = myFixture.deserializeExtension(serviceId, extension);
|
|
||||||
// validate
|
|
||||||
assertThat(actual).isNull();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void deserializeRequestContextShouldDeserializeValidContext() throws JsonProcessingException {
|
void deserialize_shouldThrow_whenHookInstanceNotFoundInRequest() {
|
||||||
|
// setup
|
||||||
|
final CdsServiceJson cdsServiceJson = withCdsServiceJsonIncludingExtensionClass();
|
||||||
|
final LinkedHashMap<String, Object> request = new LinkedHashMap<>();
|
||||||
|
request.put("context", withContext());
|
||||||
|
request.put("hook", HOOK_ID);
|
||||||
|
// execute and validate
|
||||||
|
assertThatThrownBy(() -> myFixture.deserialize(cdsServiceJson, request))
|
||||||
|
.isInstanceOf(InvalidRequestException.class)
|
||||||
|
.hasMessageContaining("HAPI-2548:")
|
||||||
|
.hasMessageContaining("hookInstance cannot be null for a CdsServiceRequest.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void deserializeRequestContext_shouldDeserialize_whenContextIsValid() throws JsonProcessingException {
|
||||||
// setup
|
// setup
|
||||||
final String encounterId = "123";
|
final String encounterId = "123";
|
||||||
final Patient patientContext = new Patient();
|
final Patient patientContext = new Patient();
|
||||||
|
@ -109,9 +155,34 @@ class CdsServiceRequestJsonDeserializerTest {
|
||||||
input.put("encounterId", encounterId);
|
input.put("encounterId", encounterId);
|
||||||
input.put("patient", patientContext);
|
input.put("patient", patientContext);
|
||||||
// execute
|
// execute
|
||||||
final CdsServiceRequestContextJson actual = myFixture.deserializeRequestContext(input);
|
final CdsServiceRequestContextJson actual = myFixture.deserializeContext(input);
|
||||||
// validate
|
// validate
|
||||||
assertThat(actual.get("encounterId")).isEqualTo(encounterId);
|
assertThat(actual.get("encounterId")).isEqualTo(encounterId);
|
||||||
assertThat(actual.get("patient")).usingRecursiveComparison().isEqualTo(patientContext);
|
assertThat(actual.get("patient")).usingRecursiveComparison().isEqualTo(patientContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private static LinkedHashMap<String, Object> withExtension() {
|
||||||
|
final LinkedHashMap<String, Object> extension = new LinkedHashMap<>();
|
||||||
|
extension.put(EXAMPLE_PROPERTY_KEY, EXAMPLE_PROPERTY_VALUE);
|
||||||
|
return extension;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private static CdsServiceJson withCdsServiceJsonIncludingExtensionClass() {
|
||||||
|
final CdsServiceJson cdsServiceJson = new CdsServiceJson();
|
||||||
|
cdsServiceJson.setId(SERVICE_ID);
|
||||||
|
cdsServiceJson.setExtensionClass(ExampleExtension.class);
|
||||||
|
cdsServiceJson.setHook(HOOK_ID);
|
||||||
|
return cdsServiceJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nonnull
|
||||||
|
private static LinkedHashMap<String, Object> withRequest(@Nonnull LinkedHashMap<String, Object> theExtension) {
|
||||||
|
final LinkedHashMap<String, Object> request = new LinkedHashMap<>();
|
||||||
|
request.put("extension", theExtension);
|
||||||
|
request.put("hookInstance", UUID.randomUUID().toString());
|
||||||
|
request.put("hook", HOOK_ID);
|
||||||
|
return request;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package ca.uhn.hapi.fhir.cdshooks.svc;
|
package ca.uhn.hapi.fhir.cdshooks.svc;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.ConfigurationException;
|
import ca.uhn.fhir.context.ConfigurationException;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeedbackJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceFeedbackJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceJson;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
|
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceResponseJson;
|
||||||
|
import ca.uhn.hapi.fhir.cdshooks.serializer.CdsServiceRequestJsonDeserializer;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.cr.ICdsCrServiceFactory;
|
import ca.uhn.hapi.fhir.cdshooks.svc.cr.ICdsCrServiceFactory;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery.ICrDiscoveryServiceFactory;
|
import ca.uhn.hapi.fhir.cdshooks.svc.cr.discovery.ICrDiscoveryServiceFactory;
|
||||||
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc;
|
import ca.uhn.hapi.fhir.cdshooks.svc.prefetch.CdsPrefetchSvc;
|
||||||
|
@ -33,13 +33,14 @@ class CdsServiceRegistryImplTest {
|
||||||
private ICrDiscoveryServiceFactory myCrDiscoveryServiceFactory;
|
private ICrDiscoveryServiceFactory myCrDiscoveryServiceFactory;
|
||||||
@Mock
|
@Mock
|
||||||
private CdsServiceCache myCdsServiceCache;
|
private CdsServiceCache myCdsServiceCache;
|
||||||
|
@Mock
|
||||||
|
private CdsServiceRequestJsonDeserializer myCdsServiceRequestJsonDeserializer;
|
||||||
private final ObjectMapper myObjectMapper = new ObjectMapper();
|
private final ObjectMapper myObjectMapper = new ObjectMapper();
|
||||||
private final FhirContext myFhirContext = FhirContext.forR4();
|
|
||||||
private CdsServiceRegistryImpl myFixture;
|
private CdsServiceRegistryImpl myFixture;
|
||||||
|
|
||||||
@BeforeEach()
|
@BeforeEach()
|
||||||
void setup() {
|
void setup() {
|
||||||
myFixture = new CdsServiceRegistryImpl(myCdsHooksContextBooter, myCdsPrefetchSvc, myObjectMapper, myCdsCrServiceFactory, myCrDiscoveryServiceFactory, myFhirContext);
|
myFixture = new CdsServiceRegistryImpl(myCdsHooksContextBooter, myCdsPrefetchSvc, myObjectMapper, myCdsCrServiceFactory, myCrDiscoveryServiceFactory, myCdsServiceRequestJsonDeserializer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir-caching-api</artifactId>
|
<artifactId>hapi-fhir-caching-api</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
<artifactId>hapi-fhir-serviceloaders</artifactId>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId>
|
<artifactId>hapi-fhir-spring-boot-sample-client-apache</artifactId>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
<artifactId>hapi-fhir-spring-boot-samples</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir-spring-boot</artifactId>
|
<artifactId>hapi-fhir-spring-boot</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
@ -145,6 +145,20 @@
|
||||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- For test CR config that's exported to downstream modules -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
|
<artifactId>hapi-fhir-jpaserver-base</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<!-- prevent conflict with other version of this dependency sourced from elsewhere -->
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.glassfish</groupId>
|
||||||
|
<artifactId>jakarta.json</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- test -->
|
<!-- test -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.testcontainers</groupId>
|
<groupId>org.testcontainers</groupId>
|
||||||
|
|
|
@ -21,8 +21,10 @@ package ca.uhn.fhir.cr.common;
|
||||||
|
|
||||||
import ca.uhn.fhir.cr.repo.HapiFhirRepository;
|
import ca.uhn.fhir.cr.repo.HapiFhirRepository;
|
||||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||||
|
import com.google.common.annotations.Beta;
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
|
@Beta
|
||||||
public interface IRepositoryFactory {
|
public interface IRepositoryFactory {
|
||||||
HapiFhirRepository create(RequestDetails theRequestDetails);
|
HapiFhirRepository create(RequestDetails theRequestDetails);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
|
@ -20,6 +20,7 @@
|
||||||
package ca.uhn.fhir.cr.config;
|
package ca.uhn.fhir.cr.config;
|
||||||
|
|
||||||
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
||||||
|
import ca.uhn.fhir.cr.common.RepositoryFactoryForRepositoryInterface;
|
||||||
import ca.uhn.fhir.cr.repo.HapiFhirRepository;
|
import ca.uhn.fhir.cr.repo.HapiFhirRepository;
|
||||||
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
||||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||||
|
@ -28,8 +29,15 @@ import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class RepositoryConfig {
|
public class RepositoryConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
IRepositoryFactory repositoryFactory(DaoRegistry theDaoRegistry, RestfulServer theRestfulServer) {
|
IRepositoryFactory repositoryFactory(DaoRegistry theDaoRegistry, RestfulServer theRestfulServer) {
|
||||||
return rd -> new HapiFhirRepository(theDaoRegistry, rd, theRestfulServer);
|
return rd -> new HapiFhirRepository(theDaoRegistry, rd, theRestfulServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
RepositoryFactoryForRepositoryInterface repositoryFactoryForInterface(
|
||||||
|
DaoRegistry theDaoRegistry, RestfulServer theRestfulServer) {
|
||||||
|
return rd -> new HapiFhirRepository(theDaoRegistry, rd, theRestfulServer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ package ca.uhn.fhir.cr.config.r4;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
import ca.uhn.fhir.cr.common.IRepositoryFactory;
|
||||||
|
import ca.uhn.fhir.cr.common.RepositoryFactoryForRepositoryInterface;
|
||||||
import ca.uhn.fhir.cr.config.ProviderLoader;
|
import ca.uhn.fhir.cr.config.ProviderLoader;
|
||||||
import ca.uhn.fhir.cr.config.ProviderSelector;
|
import ca.uhn.fhir.cr.config.ProviderSelector;
|
||||||
import ca.uhn.fhir.cr.config.RepositoryConfig;
|
import ca.uhn.fhir.cr.config.RepositoryConfig;
|
||||||
|
@ -66,7 +67,8 @@ public class CrR4Config {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
IMeasureServiceFactory r4MeasureServiceFactory(
|
IMeasureServiceFactory r4MeasureServiceFactory(
|
||||||
IRepositoryFactory theRepositoryFactory, MeasureEvaluationOptions theEvaluationOptions) {
|
RepositoryFactoryForRepositoryInterface theRepositoryFactory,
|
||||||
|
MeasureEvaluationOptions theEvaluationOptions) {
|
||||||
return rd -> new R4MeasureService(theRepositoryFactory.create(rd), theEvaluationOptions);
|
return rd -> new R4MeasureService(theRepositoryFactory.create(rd), theEvaluationOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,23 @@
|
||||||
package ca.uhn.fhir.cr;
|
/*-
|
||||||
|
* #%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.config.test;
|
||||||
|
|
||||||
import org.cqframework.cql.cql2elm.CqlCompilerException;
|
import org.cqframework.cql.cql2elm.CqlCompilerException;
|
||||||
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
||||||
|
@ -7,7 +26,9 @@ import org.cqframework.cql.cql2elm.LibraryBuilder;
|
||||||
import org.opencds.cqf.fhir.cql.CqlEngineOptions;
|
import org.opencds.cqf.fhir.cql.CqlEngineOptions;
|
||||||
import org.opencds.cqf.fhir.cql.CqlOptions;
|
import org.opencds.cqf.fhir.cql.CqlOptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common CQL properties shared with downstream modules.
|
||||||
|
*/
|
||||||
public class TestCqlProperties {
|
public class TestCqlProperties {
|
||||||
|
|
||||||
//cql settings
|
//cql settings
|
|
@ -1,4 +1,23 @@
|
||||||
package ca.uhn.fhir.cr;
|
/*-
|
||||||
|
* #%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.config.test;
|
||||||
|
|
||||||
import ca.uhn.fhir.batch2.jobs.reindex.ReindexProvider;
|
import ca.uhn.fhir.batch2.jobs.reindex.ReindexProvider;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
|
@ -47,6 +66,9 @@ import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common hapi-fhir clinical reasoning config shared with downstream modules.
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@Import({SubscriptionSubmitterConfig.class, SubscriptionChannelConfig.class})
|
@Import({SubscriptionSubmitterConfig.class, SubscriptionChannelConfig.class})
|
||||||
public class TestCrConfig {
|
public class TestCrConfig {
|
||||||
|
@ -77,7 +99,9 @@ public class TestCrConfig {
|
||||||
}
|
}
|
||||||
@Bean
|
@Bean
|
||||||
public TestCqlProperties testCqlProperties(){
|
public TestCqlProperties testCqlProperties(){
|
||||||
return new TestCqlProperties();}
|
return new TestCqlProperties();
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public JpaStorageSettings storageSettings() {
|
public JpaStorageSettings storageSettings() {
|
||||||
JpaStorageSettings storageSettings = new JpaStorageSettings();
|
JpaStorageSettings storageSettings = new JpaStorageSettings();
|
||||||
|
@ -87,12 +111,6 @@ public class TestCrConfig {
|
||||||
storageSettings.setResourceClientIdStrategy(JpaStorageSettings.ClientIdStrategyEnum.ANY);
|
storageSettings.setResourceClientIdStrategy(JpaStorageSettings.ClientIdStrategyEnum.ANY);
|
||||||
return storageSettings;
|
return storageSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
public PartitionHelper partitionHelper() {
|
|
||||||
return new PartitionHelper();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ModelManager modelManager(Map<ModelIdentifier, Model> theGlobalModelCache) {
|
public ModelManager modelManager(Map<ModelIdentifier, Model> theGlobalModelCache) {
|
||||||
return new ModelManager(theGlobalModelCache);
|
return new ModelManager(theGlobalModelCache);
|
|
@ -1,9 +1,28 @@
|
||||||
package ca.uhn.fhir.cr.r4;
|
/*-
|
||||||
|
* #%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.config.test.r4;
|
||||||
|
|
||||||
import ca.uhn.fhir.cr.TestCqlProperties;
|
|
||||||
import ca.uhn.fhir.cr.TestCrConfig;
|
|
||||||
import ca.uhn.fhir.cr.common.CqlThreadFactory;
|
import ca.uhn.fhir.cr.common.CqlThreadFactory;
|
||||||
import ca.uhn.fhir.cr.config.r4.CrR4Config;
|
import ca.uhn.fhir.cr.config.r4.CrR4Config;
|
||||||
|
import ca.uhn.fhir.cr.config.test.TestCqlProperties;
|
||||||
|
import ca.uhn.fhir.cr.config.test.TestCrConfig;
|
||||||
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
||||||
import org.cqframework.cql.cql2elm.model.CompiledLibrary;
|
import org.cqframework.cql.cql2elm.model.CompiledLibrary;
|
||||||
import org.cqframework.cql.cql2elm.model.Model;
|
import org.cqframework.cql.cql2elm.model.Model;
|
||||||
|
@ -30,6 +49,9 @@ import java.util.Set;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common hapi-fhir clinical reasoning config specifically for R4 shared with downstream modules.
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@Import({TestCrConfig.class, CrR4Config.class})
|
@Import({TestCrConfig.class, CrR4Config.class})
|
||||||
public class TestCrR4Config {
|
public class TestCrR4Config {
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
package ca.uhn.fhir.cr.dstu3;
|
package ca.uhn.fhir.cr.dstu3;
|
||||||
|
|
||||||
import ca.uhn.fhir.cr.TestCqlProperties;
|
import ca.uhn.fhir.cr.TestHapiFhirCrPartitionConfig;
|
||||||
import ca.uhn.fhir.cr.TestCrConfig;
|
import ca.uhn.fhir.cr.config.test.TestCqlProperties;
|
||||||
import ca.uhn.fhir.cr.config.dstu3.CrDstu3Config;
|
import ca.uhn.fhir.cr.config.dstu3.CrDstu3Config;
|
||||||
|
import ca.uhn.fhir.cr.config.test.TestCrConfig;
|
||||||
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
||||||
import org.cqframework.cql.cql2elm.model.CompiledLibrary;
|
import org.cqframework.cql.cql2elm.model.CompiledLibrary;
|
||||||
import org.cqframework.cql.cql2elm.model.Model;
|
import org.cqframework.cql.cql2elm.model.Model;
|
||||||
|
@ -26,6 +27,7 @@ import java.util.Set;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@Import({
|
@Import({
|
||||||
|
TestHapiFhirCrPartitionConfig.class,
|
||||||
TestCrConfig.class,
|
TestCrConfig.class,
|
||||||
CrDstu3Config.class
|
CrDstu3Config.class
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,10 +2,12 @@ package ca.uhn.fhir.cr.r4;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.cr.IResourceLoader;
|
import ca.uhn.fhir.cr.IResourceLoader;
|
||||||
|
import ca.uhn.fhir.cr.TestHapiFhirCrPartitionConfig;
|
||||||
import ca.uhn.fhir.cr.config.r4.ApplyOperationConfig;
|
import ca.uhn.fhir.cr.config.r4.ApplyOperationConfig;
|
||||||
import ca.uhn.fhir.cr.config.r4.ExtractOperationConfig;
|
import ca.uhn.fhir.cr.config.r4.ExtractOperationConfig;
|
||||||
import ca.uhn.fhir.cr.config.r4.PackageOperationConfig;
|
import ca.uhn.fhir.cr.config.r4.PackageOperationConfig;
|
||||||
import ca.uhn.fhir.cr.config.r4.PopulateOperationConfig;
|
import ca.uhn.fhir.cr.config.r4.PopulateOperationConfig;
|
||||||
|
import ca.uhn.fhir.cr.config.test.r4.TestCrR4Config;
|
||||||
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
||||||
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
||||||
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
||||||
|
@ -38,6 +40,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
||||||
@ContextConfiguration(classes = {
|
@ContextConfiguration(classes = {
|
||||||
|
TestHapiFhirCrPartitionConfig.class,
|
||||||
TestCrR4Config.class,
|
TestCrR4Config.class,
|
||||||
ApplyOperationConfig.class,
|
ApplyOperationConfig.class,
|
||||||
ExtractOperationConfig.class,
|
ExtractOperationConfig.class,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -221,6 +221,28 @@ public class RestServerR4Helper extends BaseRestServerHelper implements BeforeEa
|
||||||
myRestServer.setConceptMapResourceProvider(theResourceProvider);
|
myRestServer.setConceptMapResourceProvider(theResourceProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T extends IBaseResource> HashMapResourceProvider<T> getResourceProvider(Class<T> theResourceType) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
HashMapResourceProvider<T> resourceProvider = (HashMapResourceProvider<T>) myRestServer.myResourceProvidersMap.get(theResourceType);
|
||||||
|
assert resourceProvider != null : "No resource provider defined for resource type: '" + theResourceType + "'" ;
|
||||||
|
return resourceProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T extends IBaseResource> void setResourceProvider(HashMapResourceProvider<T> theResourceProvider) {
|
||||||
|
assert theResourceProvider.getResourceType() != null : "resourceProvider doesn't have a resourceType";
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
HashMapResourceProvider<T> resourceProvider = (HashMapResourceProvider<T>) myRestServer.myResourceProvidersMap.get(theResourceProvider.getResourceType());
|
||||||
|
|
||||||
|
if (resourceProvider != null) {
|
||||||
|
resourceProvider.getStoredResources().forEach(theResourceProvider::store);
|
||||||
|
myRestServer.unregisterProvider(resourceProvider);
|
||||||
|
}
|
||||||
|
|
||||||
|
registerProvider(theResourceProvider);
|
||||||
|
myRestServer.myResourceProvidersMap.put(theResourceProvider.getResourceType(), theResourceProvider);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setPagingProvider(IPagingProvider thePagingProvider) {
|
public void setPagingProvider(IPagingProvider thePagingProvider) {
|
||||||
myPagingProvider = thePagingProvider;
|
myPagingProvider = thePagingProvider;
|
||||||
}
|
}
|
||||||
|
@ -295,6 +317,8 @@ public class RestServerR4Helper extends BaseRestServerHelper implements BeforeEa
|
||||||
private HashMapResourceProvider<ConceptMap> myConceptMapResourceProvider;
|
private HashMapResourceProvider<ConceptMap> myConceptMapResourceProvider;
|
||||||
private RestServerDstu3Helper.MyPlainProvider myPlainProvider;
|
private RestServerDstu3Helper.MyPlainProvider myPlainProvider;
|
||||||
|
|
||||||
|
private final Map<Class<?>, HashMapResourceProvider<?>> myResourceProvidersMap = new HashMap<>();
|
||||||
|
|
||||||
private final boolean myInitialTransactionLatchEnabled;
|
private final boolean myInitialTransactionLatchEnabled;
|
||||||
|
|
||||||
private PagingHttpMethodEnum myPagingHttpMethod = PagingHttpMethodEnum.GET;
|
private PagingHttpMethodEnum myPagingHttpMethod = PagingHttpMethodEnum.GET;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-deployable-pom</artifactId>
|
<artifactId>hapi-deployable-pom</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -8,7 +8,7 @@
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>HAPI-FHIR</name>
|
<name>HAPI-FHIR</name>
|
||||||
<description>An open-source implementation of the FHIR specification in Java.</description>
|
<description>An open-source implementation of the FHIR specification in Java.</description>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.5.0-SNAPSHOT</version>
|
<version>7.5.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<relativePath>../../pom.xml</relativePath>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue