Skip to content

Commit

Permalink
Merge pull request #2813 from IBM/issue-2806
Browse files Browse the repository at this point in the history
Split out the Term Graph Loaders #2806
  • Loading branch information
prb112 authored Sep 27, 2021
2 parents 1117982 + 15ebdad commit 0f07c83
Show file tree
Hide file tree
Showing 125 changed files with 888 additions and 35 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ The IBM FHIR Server is modular and extensible. The following tables provide an o
|------|-----------|----------|
|fhir-model|An object model generated from the FHIR R4 specification and corresponding parsers and generators for XML and JSON|true|
|fhir-registry|A resource registry, registry provider interfaces, and pre-registered resources shipped with the FHIR specification|false|
|fhir-term|A terminology service provider interface with a default implementation that implements terminology services from fully-defined CodeSystems in the registry|false|
|fhir-term-graph|A terminology service provider that implements terminology services using JanusGraph|false|
|fhir-term-remote|A terminology service provider that connects to an external service using a REST client to access code system content|false|
|term/fhir-term|A terminology service provider interface with a default implementation that implements terminology services from fully-defined CodeSystems in the registry|false|
|term/fhir-term-graph|A terminology service provider that implements terminology services using JanusGraph|false|
|term/fhir-term-graph-loader|Populates the terminology service backend when using JanusGraph|false|
|term/fhir-term-remote|A terminology service provider that connects to an external service using a REST client to access code system content|false|
|fhir-profile|Helper methods for validating ValueSet membership and Profile conformance|false|
|fhir-path|An implementation of version 2.0.0 of the FHIRPath specification assumed by FHIR R4|false|
|fhir-validation|Validation utility for validating resource instances against the base specification and/or configured profiles|false|
Expand Down
4 changes: 2 additions & 2 deletions build/audit/kafka/pre-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ config(){
USERLIB="${DIST}/userlib"
mkdir -p $USERLIB
find ${WORKSPACE}/conformance -iname 'fhir-ig*.jar' -not -iname 'fhir*-tests.jar' -not -iname 'fhir*-test-*.jar' -exec cp -f {} ${USERLIB} \;
cp -pr ${WORKSPACE}/operation/fhir-operation-test/target/fhir-operation-*-tests.jar ${USERLIB}
cp -pr ${WORKSPACE}/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}
cp -pr ${WORKSPACE}/fhir-operation-test/target/fhir-operation-*-tests.jar ${USERLIB}
cp -pr ${WORKSPACE}/term/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}
echo "Finished copying fhir-server dependencies..."

# Move over the test configurations
Expand Down
2 changes: 1 addition & 1 deletion build/docker/copy-test-operations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ mkdir -p $USERLIB
echo "Copying test artifacts to install location..."
find ${WORKSPACE}/conformance -iname 'fhir-ig*.jar' -not -iname 'fhir*-tests.jar' -not -iname 'fhir*-test-*.jar' -exec cp -f {} ${USERLIB} \;
cp -pr ${WORKSPACE}/operation/fhir-operation-test/target/fhir-operation-*-tests.jar ${USERLIB}
cp -pr ${WORKSPACE}/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}
cp -pr ${WORKSPACE}/term/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}

echo "Finished copying test operations."
4 changes: 4 additions & 0 deletions build/migration/db2/2_compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ config(){
then
find ${WORKSPACE}/prev/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi
if [ -d ${WORKSPACE}/prev/term/operation/fhir-operation-term-cache/target ]
then
find ${WORKSPACE}/prev/term/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi

echo "Copying over the overrides for the datasource"
mkdir -p ${DIST}/overrides
Expand Down
4 changes: 4 additions & 0 deletions build/migration/db2/5_current-pre-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ config(){
then
find ${WORKSPACE}/fhir/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi
if [ -d ${WORKSPACE}/fhir/term/operation/fhir-operation-term-cache/target ]
then
find ${WORKSPACE}/fhir/term/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi

echo "Remove the old overrides, and copy the current overrides for the datasource"
rm -rf ${DIST}/overrides
Expand Down
4 changes: 4 additions & 0 deletions build/migration/postgres/2_compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ config(){
then
find ${WORKSPACE}/prev/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi
if [ -d ${WORKSPACE}/prev/term/operation/fhir-operation-term-cache/target ]
then
find ${WORKSPACE}/prev/term/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi
# Move over the test configurations
echo "Copying over the fhir-server-config.json and updating publishing"
cp -f ${DIST}/config/default/fhir-server-config-postgresql.json ${DIST}/config/default/fhir-server-config.json
Expand Down
6 changes: 6 additions & 0 deletions build/migration/postgres/5_current-pre-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ config(){
mkdir -p "${USERLIB}"
find ${WORKSPACE}/fhir/conformance -iname 'fhir-ig*.jar' -not -iname 'fhir*-tests.jar' -not -iname 'fhir*-test-*.jar' -exec cp -f {} ${USERLIB} \;
find ${WORKSPACE}/fhir/operation/fhir-operation-test/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
find ${WORKSPACE}/fhir/operation/fhir-operation-test/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;

echo "Copying over the overrides for the datasource"
mkdir -p ${DIST}/overrides
Expand All @@ -43,6 +44,11 @@ config(){
then
find ${WORKSPACE}/fhir/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi

if [ -d ${WORKSPACE}/fhir/term/operation/fhir-operation-term-cache/target ]
then
find ${WORKSPACE}/fhir/term/operation/fhir-operation-term-cache/target -iname '*.jar' -exec cp -f {} ${USERLIB} \;
fi
# Move over the test configurations
echo "Copying over the fhir-server-config.json and updating publishing"
cp -f ${DIST}/config/default/fhir-server-config-postgresql.json ${DIST}/config/default/fhir-server-config.json
Expand Down
2 changes: 1 addition & 1 deletion build/notifications/kafka/pre-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config(){
mkdir -p $USERLIB
find ${WORKSPACE}/conformance -iname 'fhir-ig*.jar' -not -iname 'fhir*-tests.jar' -not -iname 'fhir*-test-*.jar' -exec cp -f {} ${USERLIB} \;
cp -pr ${WORKSPACE}/operation/fhir-operation-test/target/fhir-operation-*-tests.jar ${USERLIB}
cp -pr ${WORKSPACE}/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}
cp -pr ${WORKSPACE}/term/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}
echo "Finished copying fhir-server dependencies..."

# Move over the test configurations
Expand Down
2 changes: 1 addition & 1 deletion build/persistence/postgres/pre-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ copy_server_config(){
echo "Copying test artifacts to install location..."
find ${WORKSPACE}/conformance -iname 'fhir-ig*.jar' -not -iname 'fhir*-tests.jar' -not -iname 'fhir*-test-*.jar' -exec cp -f {} ${USERLIB} \;
cp -pr ${WORKSPACE}/operation/fhir-operation-test/target/fhir-operation-*-tests.jar ${USERLIB}
cp -pr ${WORKSPACE}/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}
cp -pr ${WORKSPACE}/term/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}
echo "Finished copying fhir-server dependencies..."
}

Expand Down
2 changes: 1 addition & 1 deletion build/pre-integration-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ If (!(Test-Path -Path $USERLIB_DIR) ) {
}
Copy-Item $CP_ITEM -Destination $USERLIB_DST

$CP_ITEM=[string]$DIR_WORKSPACE + '\operation\fhir-operation-term-cache\target\fhir-operation-term-cache-*.jar'
$CP_ITEM=[string]$DIR_WORKSPACE + '\term\operation\fhir-operation-term-cache\target\fhir-operation-term-cache-*.jar'
Copy-Item $CP_ITEM -Destination $USERLIB_DST

# Start up the fhir server
Expand Down
2 changes: 1 addition & 1 deletion build/pre-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ echo "Copying test artifacts to install location..."
USERLIB=${SIT}/wlp/usr/servers/fhir-server/userlib
rm -rf ${USERLIB}/fhir-operation-*-tests.jar
cp -pr ${WORKSPACE}/operation/fhir-operation-test/target/fhir-operation-*-tests.jar ${USERLIB}/
cp -pr ${WORKSPACE}/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}/
cp -pr ${WORKSPACE}/term/operation/fhir-operation-term-cache/target/fhir-operation-*.jar ${USERLIB}/
find ${WORKSPACE}/conformance -iname 'fhir-ig*.jar' -not -iname 'fhir*-tests.jar' -not -iname 'fhir*-test-*.jar' -exec cp -f {} ${USERLIB} \;

# Start up the fhir server
Expand Down
12 changes: 6 additions & 6 deletions docs/src/pages/guides/FHIRTerminologyGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ date: "2021-04-23"

## Overview

The IBM FHIR Server Terminology module ([fhir-term](https://github.com/IBM/FHIR/tree/main/fhir-term)) provides a FHIR terminology service provider interface (SPI) and a default implementation that implements terminology services using `CodeSystem`, `ValueSet`, and `ConceptMap` resources that have been made available through the FHIR registry module ([fhir-registry](https://github.com/IBM/FHIR/tree/main/fhir-registry)).
The IBM FHIR Server Terminology module ([fhir-term](https://github.com/IBM/FHIR/tree/main/term/fhir-term)) provides a FHIR terminology service provider interface (SPI) and a default implementation that implements terminology services using `CodeSystem`, `ValueSet`, and `ConceptMap` resources that have been made available through the FHIR registry module ([fhir-registry](https://github.com/IBM/FHIR/tree/main/fhir-registry)).

## FHIR Terminology Service Diagram

Expand Down Expand Up @@ -36,11 +36,11 @@ NOTE: `closure(CodeSystem, Set)`, `getConcepts(CodeSystem, Function)`, `getConce

## Registry Terminology Service Provider Implementation

The default implementation of `FHIRTermServiceProvider` ([RegistryTermServiceProvider](https://github.com/IBM/FHIR/blob/main/fhir-term/src/main/java/com/ibm/fhir/term/service/provider/RegistryTermServiceProvider.java)) leverages terminology resources (`CodeSystem`, `ValueSet`, and `ConceptMap`) that have been made available through the FHIR registry module ([fhir-registry](https://github.com/IBM/FHIR/tree/main/fhir-registry)). It supports `CodeSystem` resources with *complete* content (`CodeSystem.content = 'complete'`) and `ValueSet` resources that reference `CodeSystem` resources that have complete content.
The default implementation of `FHIRTermServiceProvider` ([RegistryTermServiceProvider](https://github.com/IBM/FHIR/blob/main/term/fhir-term/src/main/java/com/ibm/fhir/term/service/provider/RegistryTermServiceProvider.java)) leverages terminology resources (`CodeSystem`, `ValueSet`, and `ConceptMap`) that have been made available through the FHIR registry module ([fhir-registry](https://github.com/IBM/FHIR/tree/main/fhir-registry)). It supports `CodeSystem` resources with *complete* content (`CodeSystem.content = 'complete'`) and `ValueSet` resources that reference `CodeSystem` resources that have complete content.

## FHIR Terminology Service Singleton Facade

The FHIR Terminology Service Singleton facade ([FHIRTermService](https://github.com/IBM/FHIR/blob/main/fhir-term/src/main/java/com/ibm/fhir/term/service/FHIRTermService.java)) loads a list of `FHIRTermServiceProvider` instances from the ServiceLoader and includes an instance of the `RegistryTermServiceProvider`. Client code (Java) that requires terminology capabilities should access them via the `FHIRTermService` singleton facade. Here is an example:
The FHIR Terminology Service Singleton facade ([FHIRTermService](https://github.com/IBM/FHIR/blob/main/term/fhir-term/src/main/java/com/ibm/fhir/term/service/FHIRTermService.java)) loads a list of `FHIRTermServiceProvider` instances from the ServiceLoader and includes an instance of the `RegistryTermServiceProvider`. Client code (Java) that requires terminology capabilities should access them via the `FHIRTermService` singleton facade. Here is an example:

```java
ValueSet valueSet = ValueSetSupport.getValueSet("http://ibm.com/fhir/ValueSet/vs1");
Expand Down Expand Up @@ -73,7 +73,7 @@ NOTE: The current implementation of `FHIRTermService` does not support optional

## FHIR Server Terminology Extended Operations

The FHIR terminology operations module ([fhir-operation-term](https://github.com/IBM/FHIR/tree/main/operation/fhir-operation-term)) connects the FHIR Server REST layer to the FHIR terminology module via the operations framework. This module implements the terminology operations as defined in the FHIR terminology service specification [http://hl7.org/fhir/terminology-service.html](http://hl7.org/fhir/terminology-service.html). One exception is the `$closure` operation. The `$closure` operation is experimental and does not support versioning or replay. This means that the `$closure` operation will always return the set of closure table entries for the given input concepts and does not store client state.
The FHIR terminology operations module ([fhir-operation-term](https://github.com/IBM/FHIR/tree/main/term/operation/fhir-operation-term)) connects the FHIR Server REST layer to the FHIR terminology module via the operations framework. This module implements the terminology operations as defined in the FHIR terminology service specification [http://hl7.org/fhir/terminology-service.html](http://hl7.org/fhir/terminology-service.html). One exception is the `$closure` operation. The `$closure` operation is experimental and does not support versioning or replay. This means that the `$closure` operation will always return the set of closure table entries for the given input concepts and does not store client state.

## FHIRPath Terminology Functions

Expand Down Expand Up @@ -107,7 +107,7 @@ Additionally, the FHIRPath functions `subsumedBy` and `subsumes` have been imple

## Graph Terminology Service Provider Implementation (experimental)

The FHIR term graph module [fhir-term-graph](https://github.com/IBM/FHIR/tree/main/fhir-term-graph) provides an implementation of `FHIRTermServiceProvider` that is backed by a graph database ([JanusGraph](https://janusgraph.org)). The module also contains term graph loaders for SNOMED-CT Release Format 2 (RF2) files (SnomedTermGraphLoader), UMLS Rich Release Format (RRF) files (UMLSTermGraphLoader), and FHIR CodeSystem resources (CodeSystemTermGraphLoader). Graph term service providers may be enabled / configured through the `fhir-server-config.json` file per the configuration properties specified in the [FHIR Server User's Guide](https://ibm.github.io/FHIR/guides/FHIRServerUsersGuide#51-configuration-properties-reference).
The FHIR term graph module [fhir-term-graph](https://github.com/IBM/FHIR/tree/main/term/fhir-term-graph) provides an implementation of `FHIRTermServiceProvider` that is backed by a graph database ([JanusGraph](https://janusgraph.org)). The module also contains term graph loaders for SNOMED-CT Release Format 2 (RF2) files (SnomedTermGraphLoader), UMLS Rich Release Format (RRF) files (UMLSTermGraphLoader), and FHIR CodeSystem resources (CodeSystemTermGraphLoader). Graph term service providers may be enabled / configured through the `fhir-server-config.json` file per the configuration properties specified in the [FHIR Server User's Guide](https://ibm.github.io/FHIR/guides/FHIRServerUsersGuide#51-configuration-properties-reference).

Example configurations:

Expand Down Expand Up @@ -144,7 +144,7 @@ Example configurations:

## Remote Terminology Service Provider Implementation (experimental)

The FHIR term remote module [fhir-term-remote](https://github.com/IBM/FHIR/tree/main/fhir-term-remote) provides an implementation of `FHIRTermServiceProvider` that connects to an external service using a REST client to access code system content. The external service must implement the FHIR REST terminology APIs documented [here](http://hl7.org/fhir/terminology-service.html). Remote term service providers may be enabled / configured through the `fhir-server-config.json` file per the configuration properties specified in the [FHIR Server User's Guide](https://ibm.github.io/FHIR/guides/FHIRServerUsersGuide#51-configuration-properties-reference).
The FHIR term remote module [fhir-term-remote](https://github.com/IBM/FHIR/tree/main/term/fhir-term-remote) provides an implementation of `FHIRTermServiceProvider` that connects to an external service using a REST client to access code system content. The external service must implement the FHIR REST terminology APIs documented [here](http://hl7.org/fhir/terminology-service.html). Remote term service providers may be enabled / configured through the `fhir-server-config.json` file per the configuration properties specified in the [FHIR Server User's Guide](https://ibm.github.io/FHIR/guides/FHIRServerUsersGuide#51-configuration-properties-reference).

Example configurations:

Expand Down
6 changes: 1 addition & 5 deletions fhir-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@
<module>../fhir-model</module>
<module>../fhir-audit</module>
<module>../fhir-registry</module>
<module>../fhir-term</module>
<module>../fhir-term-graph</module>
<module>../fhir-term-remote</module>
<module>../term</module>
<module>../fhir-path</module>
<module>../fhir-profile</module>
<module>../fhir-validation</module>
Expand All @@ -105,8 +103,6 @@
<module>../operation/fhir-operation-document</module>
<module>../operation/fhir-operation-healthcheck</module>
<module>../operation/fhir-operation-convert</module>
<module>../operation/fhir-operation-term</module>
<module>../operation/fhir-operation-term-cache</module>
<module>../operation/fhir-operation-reindex</module>
<module>../operation/fhir-operation-bulkdata</module>
<module>../operation/fhir-operation-everything</module>
Expand Down
Loading

0 comments on commit 0f07c83

Please sign in to comment.