Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce fhir-term-graph module #1980

Closed
JohnTimm opened this issue Feb 22, 2021 · 7 comments
Closed

Introduce fhir-term-graph module #1980

JohnTimm opened this issue Feb 22, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request new-module Flag for identifying PRs that introduce a new module (and therefor require manual work for release) showcase Used to Identify End-of-Sprint Demos terminology

Comments

@JohnTimm
Copy link
Collaborator

JohnTimm commented Feb 22, 2021

The fhir-term-graph module will have an implementation of the FHIRTermServiceProvider interface built on top of a graph database (JanusGraph). This will enable the ability to efficiently support code systems with a large number of concepts (e.g. SNOMED-CT).

Current feature branch:
https://github.com/IBM/FHIR/tree/fhir-term-graph

The feature will be configurable.

@JohnTimm JohnTimm added enhancement New feature or request terminology labels Feb 22, 2021
@JohnTimm JohnTimm added this to the Sprint 2021-03 milestone Feb 22, 2021
@JohnTimm JohnTimm self-assigned this Feb 22, 2021
@prb112 prb112 added the new-module Flag for identifying PRs that introduce a new module (and therefor require manual work for release) label Feb 23, 2021
JohnTimm added a commit that referenced this issue Feb 25, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Feb 25, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Feb 26, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Feb 26, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 2, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 2, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 2, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 3, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 3, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 5, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 8, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 8, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 10, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 11, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 11, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 11, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 11, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 11, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 11, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 12, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 12, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 12, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 15, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 23, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 23, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 23, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 23, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 23, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 23, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
prb112 pushed a commit that referenced this issue Mar 24, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
prb112 added a commit that referenced this issue Mar 24, 2021
Issue #1980 - Introduce fhir-term-graph module
JohnTimm added a commit that referenced this issue Mar 25, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 25, 2021
Issue #1980 - changed over validateCode to use normalize
JohnTimm added a commit that referenced this issue Mar 25, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
prb112 added a commit that referenced this issue Mar 25, 2021
Issue #1980 - fixed subsumed by implicit value set URL syntax
JohnTimm added a commit that referenced this issue Mar 25, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 25, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 25, 2021
Issue #1980 - clean up FHIRTermService subsumes logic
JohnTimm added a commit that referenced this issue Mar 28, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 29, 2021
Signed-off-by: John T.E. Timm <johntimm@us.ibm.com>
JohnTimm added a commit that referenced this issue Mar 29, 2021
Issue #2092, Issue #1733, Issue #1980 - miscellaneous updates
@lmsurpre
Copy link
Member

lmsurpre commented Mar 30, 2021

The graph loader definitely needs some better docs.

On my first attempt to load it, I passed the following args:

SNOMED
-base /Users/lmsurpre/SnomedCT_USEditionRF2_PRODUCTION_20210301T120000Z/Full
-concept Terminology/sct2_Concept_Full_US1000124_20210301.txt
-desc Terminology/sct2_Description_Full-en_US1000124_20210301.txt
-relation Terminology/sct2_Relationship_Full_US1000124_20210301.txt
-lang Refset/der2_cRefset_LanguageFull-en_US1000124_20210301.txt
-config src/test/resources/conf/janusgraph-berkeleyje-lucene.properties

It did a bunch of work and then bombed out with this:

An error occurred: java.io.FileNotFoundException: /Users/lmsurpre/SnomedCT_USEditionRF2_PRODUCTION_20210301T120000Z/Full/../Refset/Language/Refset/der2_cRefset_LanguageFull-en_US1000124_20210301.txt (No such file or directory)

Apparently it wants something like this instead:

SNOMED
-base /Users/lmsurpre/SnomedCT_USEditionRF2_PRODUCTION_20210301T120000Z/Full/Terminology
-concept sct2_Concept_Full_US1000124_20210301.txt
-desc sct2_Description_Full-en_US1000124_20210301.txt
-relation sct2_Relationship_Full_US1000124_20210301.txt
-lang der2_cRefset_LanguageFull-en_US1000124_20210301.txt
-config src/test/resources/conf/janusgraph-berkeleyje-lucene.properties

Are there different release formats for SNOMED CT? Could we just point it at /Users/lmsurpre/SnomedCT_USEditionRF2_PRODUCTION_20210301T120000Z/Full and let it figure out the rest?

@lmsurpre
Copy link
Member

lmsurpre commented Mar 30, 2021

What does the terminology system update scenario look like? Is it idempotent (i.e. loading the same source files twice is the same loading it once)?
What happens if we import this version of the SNOMED CT US edition, then import the international version later. They just co-exist or does it meld them together based on the individual concepts?
And I have similar questions for the UMLS loader as well. A new version of UMLS may contain some source systems that changed and others that didn't.

@lmsurpre
Copy link
Member

I opened #2176 for the missing doc

@lmsurpre
Copy link
Member

With fhir-term-graph enabled as described above, I noticed the following output during startup:

[2021-03-30T21:25:17.347+0000] 0000002e SystemErr     R   SLF4J: Class path contains multiple SLF4J bindings.
[2021-03-30T21:25:17.348+0000] 0000002e SystemErr     R   SLF4J: Found binding in [wsjar:file:/Users/lmsurpre/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[2021-03-30T21:25:17.348+0000] 0000002e SystemErr     R   SLF4J: Found binding in [wsjar:file:/Users/lmsurpre/.m2/repository/org/slf4j/slf4j-nop/1.7.30/slf4j-nop-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[2021-03-30T21:25:17.348+0000] 0000002e SystemErr     R   SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[2021-03-30T21:25:17.439+0000] 0000002e SystemErr     R   SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

I'm not positive that its related to the graph stuff, but I went ahead and opened #2177 for it.

@lmsurpre
Copy link
Member

After loading a berkelydb/lucene graph as described above, I moved that to my server and updated my fhir-server-config with this:

        "term": {
            "graphTermServiceProvider": {
                "enabled": true,
                "timeLimit": 30000,
                "configuration": {
                    "storage.backend": "berkeleyje",
                    "storage.directory": "data/graph",
                    "index.search.backend": "lucene",
                    "index.search.directory": "data/searchindex"
                }
            }
        },

Unfortunately, calls to $lookup are now failing with a stacktrace like this:

[2021-03-30T21:33:08.978+0000] 00000020 FHIRResource  E   An error occurred during the CodeSystem lookup operation
                                 com.ibm.fhir.exception.FHIROperationException: An error occurred during the CodeSystem lookup operation  [probeId=7f-0-0-1-a6a2c6c3-d13f-4937-9ea7-79c93c9f4a5c]
	at com.ibm.fhir.operation.term.LookupOperation.doInvoke(LookupOperation.java:52)
	at com.ibm.fhir.server.operation.spi.AbstractOperation.invoke(AbstractOperation.java:56)
	at com.ibm.fhir.server.util.FHIRRestHelper.doInvoke(FHIRRestHelper.java:1119)
	at com.ibm.fhir.server.resources.Operation.invoke(Operation.java:212)
	...
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: ele-1: All FHIR elements must have a @value or children
	at com.ibm.fhir.model.util.ValidationSupport.requireValueOrChildren(ValidationSupport.java:378)
	at com.ibm.fhir.model.type.String.<init>(String.java:30)
	at com.ibm.fhir.model.type.String$Builder.build(String.java:197)
	at com.ibm.fhir.model.type.String.string(String.java:58)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.createConcept(GraphTermServiceProvider.java:558)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.createConcept(GraphTermServiceProvider.java:546)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.getConcept(GraphTermServiceProvider.java:601)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.getConcept(GraphTermServiceProvider.java:122)
	at com.ibm.fhir.term.service.FHIRTermService.lookup(FHIRTermService.java:289)
	at com.ibm.fhir.operation.term.LookupOperation.doInvoke(LookupOperation.java:48)
	... 59 more

I opened #2178 for making loading idempotent (to avoid the partially imported content) and #2179 for being more resilient.

@lmsurpre
Copy link
Member

After recreating the graph db, I was able to successfully load SnomedCT_USEditionRF2_PRODUCTION_20210301T120000Z and exercise the following queries:

@ryadav007
Copy link

after loading successfully snomed ct codes and starting the fhir server it gives this issue
java.lang.Error: java.lang.IllegalArgumentException: Could not find implementation class: org.janusgraph.diskstorage.cql.CQLStoreManager at org.linuxforhealth.fhir.term.graph.impl.FHIRTermGraphImpl.<init>(FHIRTermGraphImpl.java:43) at org.linuxforhealth.fhir.term.graph.factory.FHIRTermGraphFactory.open(FHIRTermGraphFactory.java:51) at org.linuxforhealth.fhir.term.graph.provider.GraphTermServiceProvider.<init>(GraphTermServiceProvider.java:89) at org.linuxforhealth.fhir.server.listener.FHIRServletContextListener.configureTermServiceCapabilities(FHIRServletContextListener.java:432) at org.linuxforhealth.fhir.server.listener.FHIRServletContextListener.contextInitialized(FHIRServletContextListener.java:295) at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2466) at com.ibm.ws.webcontainer31.osgi.webapp.WebApp31.notifyServletContextCreated(WebApp31.java:510) at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1064) at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6704) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:472) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(DynamicVirtualHost.java:467) at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebContainer.java:1188) at com.ibm.ws.webcontainer.osgi.WebContainer.startModule(WebContainer.java:977) at com.ibm.ws.app.manager.module.internal.ModuleHandlerBase.deployModule(ModuleHandlerBase.java:99) at com.ibm.ws.app.manager.module.internal.DeployedModuleInfoImpl.installModule(DeployedModuleInfoImpl.java:49) at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.deployModules(SimpleDeployedAppInfoBase.java:597) at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.installApp(SimpleDeployedAppInfoBase.java:511) at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:349) at com.ibm.ws.app.manager.war.internal.WARApplicationHandlerImpl.install(WARApplicationHandlerImpl.java:65) at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:161) at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1367) at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:910) at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:245) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.IllegalArgumentException: Could not find implementation class: org.janusgraph.diskstorage.cql.CQLStoreManager at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:75) at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:527) at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:491) at org.janusgraph.graphdb.configuration.builder.GraphDatabaseConfigurationBuilder.build(GraphDatabaseConfigurationBuilder.java:64) at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:176) at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:147) at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:127) at org.linuxforhealth.fhir.term.graph.impl.FHIRTermGraphImpl.open(FHIRTermGraphImpl.java:53) at org.linuxforhealth.fhir.term.graph.impl.FHIRTermGraphImpl.<init>(FHIRTermGraphImpl.java:40) ... 25 more Caused by: java.lang.ClassNotFoundException: org.janusgraph.diskstorage.cql.CQLStoreManager at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:734) at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:319) at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:706) at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:578) at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:545) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:315) at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:71) ... 33 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new-module Flag for identifying PRs that introduce a new module (and therefor require manual work for release) showcase Used to Identify End-of-Sprint Demos terminology
Projects
None yet
Development

No branches or pull requests

4 participants