Giter VIP home page Giter VIP logo

onfhir's Introduction

onFHIR FHIR Repository

Maven Central License: GPL v3

onFHIR is a FHIR compliant secure health data repository that you can use as a central data service for your FHIR compliant healthcare applications. You can use it as a standalone server, or you can extend it with your further custom FHIR Operations to build your own application layer in addition to having standard FHIR repository capabilities. onFHIR.io is using FHIR Infrastructure Resource definitions (CapabilityStatement, StructureDefinition, SearchParameter, etc.) to tailor the FHIR server to your specific FHIR capabilities you required; resource profiles, search parameters, FHIR interactions you wanted to support.

It is implemented with Scala, based on Akka and MongoDB.

Stable versions are released in Maven Central and snapshot versions in Sonatype Snapshot Repository.

TEMPORARY WARNING

On March 6, 2023, we forcefully rearranged the existing onfhir_2.13 branch as master. The old master has been branched has onfhir_2.12.

Basic Configuration

You can copy and update onfhir-core/src/main/resources/application.conf file, which is the entrypoint configuration to configure onFHIR repository based on your needs.

For logger configurations, check onfhir-core/src/main/resources/logback.xml

For configuration of the FHIR API to be provided, you need to provide the followings;

  • A file providing your Conformance statement (FHIR Capability Statement - See http://hl7.org/fhir/capabilitystatement.html) that describes the capabilities of the FHIR server you want to provide
  • A folder including all your Profile definitions (FHIR StructureDefinition - See http://hl7.org/fhir/structuredefinition.html) including resource, data type and extension definitions that will be used in the FHIR server you want to provide
  • A folder including all your Compartment definitions (FHIR CompartmentDefinition - See http://hl7.org/fhir/compartmentdefinition.html) for all compartments that you want to support for search
  • A folder including all your Search parameter definitions (FHIR SearchParameter - See http://hl7.org/fhir/searchparameter.html) for all extra search parameters (apart from what is available from the base FHIR standard) that you define and support for your resources
  • A folder including all your Value sets (FHIR ValueSet - See http://hl7.org/fhir/valueset.html) that you define and refer in your resource profiles
  • A folder including all your Operation definitions (FHIR OperationDefinition - http://hl7.org/fhir/operationdefinition.html) that you define and refer from capability statement in operations part (For your OperationDefinitions write the full class path of your implementation of operation in OperationDefinition.name)

You can also provide the zip file for FHIR base definitions (Validation package - 'validation-min.xml.zip') that you want to support specifically. onFHIR supports all stable and build versions of HL7 FHIR. In this project, we provide modules for the last 3 main versions that are configured automatically with standard definitions and special configurators:

  • R5 >> onfhir-server-r5
  • R4 >> onfhir-server-r4
  • STU3 >> onfhir-server-stu3

Prerequisites

onFHIR requires a MongoDB database up and running. If you do not use the given docker containers, the MongoDB configuration parameters (host, port, dbname etc.) should be passed to onFHIR through either application.conf file or as runtime parameters. The parameter names can be seen in the provided application.conf file.

Build & Run

You need to run the below command to build fhir-repository. This will compile your code, execute unit tests and create a single standalone jar with all the dependencies:

$ mvn package

Unit tests may take some time, so you can add -DskipTests=true command line parameter to the above command to skip the test execution, but it is not recommended:

$ mvn package -DskipTests=true

Executable standalone jars target/onfhir-server-standalone.jar will be created under each onfhir-server for different FHIR version. Executing the following command will run the onRHI server for that version with nearly whole FHIR capabilities.

$ java -jar target/onfhir-server-standalone.jar

You can override in-app configurations by supplying an external application.conf file or JAVA arguments using the following commands:

$ java -Dconfig.file={path-to-application.conf} -jar target/onfhir-server-standalone.jar
$ java -Dserver.port=9999 -Dserver.host=172.17.0.1 -jar target/onfhir-server-standalone.jar

Extensibility

You can develop your own FHIR compliant backend application based on onFHIR. In order to do this you can import the corresponding server module as a dependency to your project and write a scala App (Boot) that initiates onFHIR with a custom configuration. Onfhir.scala is the main entrypoint to the project. The following is the default server Boot configuration for onfhir-server-r4. It initiates a FHIR R4 server with the given configurations.

object Boot extends App {
  //Initialize onfhir for R4
  var onfhir = Onfhir.apply(new FhirR4Configurator())
  //Start it
  onfhir.start
}

You can extend the onFHIR by implementing certain custom mechanisms;

  • Custom Authorizer (Implementing io.onfhir.authz.IAAuthorizer interface): In default(if you configure), onFHIR supports the authorization mechanism defined in SmartOnFhir initiative which is based on OAuth2.0 Bearer Token based authorization. If you need a custom authorization mechanism with different set of scopes (permissions), you can implement a authorizer module and register it to onFHIR.
  • Custom Token Resolver (Implementing io.onfhir.authz.ITokenResolver interface): onFHIR supports two default token resolution methods; Signed JWT tokens and OAuth2.0 Token Introspection. You can use them by configurations or implement a new module.
  • Custom Audit Handler (Implementing io.onfhir.audit.ICustomAuditHandler): In default, you can configure onFHIR to store FHIR AuditEvent records to its own local repository, or a remote FHIR server running as a seperate audit repository. If you want to create audit events/logs in different format and send them to a custom audit repository (ElasticSearch+Kibana, etc), you can extend this interface with your module and register it.
  • Further FHIR Operations: You can implement custom FHIR Operations by extending io.onfhir.api.service.FHIROperationHandlerService and preparing an OperationDefinition file describing the input and output parameters of the operation. You then need to provide a Map[String, String] of the (operation URL -> the class name of the module) that you implemented by extending FHIROperationHandlerService.
  • External Akka Routes: You can also implement non-FHIR REST services for your server and register them to onFHIR.
object Boot extends App {
  //Initialize onfhir for R4
  var onfhir = 
     Onfhir.apply(
        fhirConfigurator = new FhirR4Configurator(),
        fhirOperationImplms = myFhirOperations,
        customAuthorizer = new MyAuthorizer(),
        customAuditHandler = new MyAuditHandler(),
        externalRoutes = ...my non-fhir routes 
     )
  //Start it
  onfhir.start
}

Docker

We also provide a simple docker setup for onFHIR under 'docker' folder. It provides a docker-compose file with two containers; one for MongoDB database and one for onFHIR application. You can run it with our sample onFHIR setup given with 'sample-setup' directory. You can copy the 'onfhir-server-standalone.jar' file to this sample-setup directory and run the sample setup as it is with the following command;

$ cd docker
$ cp ../onfhir-server-r4/target/onfhir-server-standalone.jar ./sample-setup/.
$ docker-compose -f docker-compose.yml -p onfhir up -d

Then you will be able to send requests to this running instance over your docker machine. The following will return the CapabilityStatement

$ curl http://127.0.0.1:8080/fhir/metadata

Tests

fhir-repository uses specs2 for unit testing. To execute tests for each build with the following command:

$ mvn test

onfhir's People

Contributors

dogukan10 avatar mrrio avatar msfyuksel avatar okanmercan99 avatar sinaci avatar suatgonul avatar tnamli avatar yemregurses avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onfhir's Issues

Firely Terminal won't work with onFHIR

Firely Terminal is a FHIR client command line tool.

When trying to use it with onFHIR e.g. to search for FHIR Patients:
fhir search <onfhir-endpoint-url> Patient

I get:
Operation was unsuccessful because of a client error (NotAcceptable). Body has no content.

Hence a HTTP 406 with 0 byte content.

Composite search problem on an element with extension

When you try to define a new composite search parameter on an element where one of the search parameter is on an extension on the same element, search does not work due to bug in identifying actual path with extensions (missing array indicator for the root elements) and removing common path from the path while searching.

Build Error onfhir-path 3.1-SNAPSHOT

[INFO] ------------------------------------------------------------------------ [INFO] Building onfhir-path 3.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ onfhir-path --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 4 resources [INFO] [INFO] --- scala-maven-plugin:4.1.1:add-source (scala-compile-first) @ onfhir-path --- [INFO] Add Source directory: /opt/docker/onFHIR/onfhir/onfhir-path/src/main/scala [INFO] Add Test Source directory: /opt/docker/onFHIR/onfhir/onfhir-path/src/test/scala [INFO] [INFO] --- scala-maven-plugin:4.1.1:compile (scala-compile-first) @ onfhir-path --- [INFO] Using incremental compilation using JavaThenScala compile order [INFO] Compiling 10 Scala sources and 6 Java sources to /opt/docker/onFHIR/onfhir/onfhir-path/target/classes ... [ERROR] ## Exception when compiling 16 sources to /opt/docker/onFHIR/onfhir/onfhir-path/target/classes java.lang.IllegalArgumentException: invalid target release: 11 com.sun.tools.javac.main.OptionHelper$GrumpyHelper.error(OptionHelper.java:103) com.sun.tools.javac.main.Option$12.process(Option.java:216) com.sun.tools.javac.api.JavacTool.processOptions(JavacTool.java:217) com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:156) com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:107) com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:64) sbt.internal.inc.javac.LocalJavaCompiler.run(LocalJava.scala:204) sbt.internal.inc.javac.AnalyzingJavaCompiler.$anonfun$compile$11(AnalyzingJavaCompiler.scala:158) scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) sbt.internal.inc.javac.AnalyzingJavaCompiler.timed(AnalyzingJavaCompiler.scala:236) sbt.internal.inc.javac.AnalyzingJavaCompiler.compile(AnalyzingJavaCompiler.scala:148) sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$5(MixedAnalyzingCompiler.scala:134) scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:186) sbt.internal.inc.MixedAnalyzingCompiler.compileJava$1(MixedAnalyzingCompiler.scala:100) sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:144) sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:343) sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:343) sbt.internal.inc.Incremental$.doCompile(Incremental.scala:120) sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:100) sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:180) sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:98) sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:102) sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:155) sbt.internal.inc.Incremental$.compile(Incremental.scala:92) sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:75) sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:348) sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:301) sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:168) sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:248) sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:74) sbt_inc.SbtIncrementalCompiler.compile(SbtIncrementalCompiler.java:130) scala_maven.ScalaCompilerSupport.incrementalCompile(ScalaCompilerSupport.java:299) scala_maven.ScalaCompilerSupport.compile(ScalaCompilerSupport.java:101) scala_maven.ScalaCompilerSupport.doExecute(ScalaCompilerSupport.java:83) scala_maven.ScalaMojoSupport.execute(ScalaMojoSupport.java:555) org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) org.apache.maven.cli.MavenCli.main(MavenCli.java:199) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

issue: embedded mongodb throws socket exception

Issue report

Expected Behavior

Should have written resources successfully

Steps to Reproduce the Problem

  1. make embedded=true for mongodb in config file
  2. make host = ["localhost:27018"] for mongodb in config file
  3. try to write resources to repository

Logs

[mongod output] : Permission denied
[mongod output] 2020-09-21T11:40:34.228+0300 E STORAGE  [WTCheckpointThread] WiredTiger error (13) [1600677634:227954][16124:140717079221488], file:WiredTiger.wt, WT_SESSION.checkpoint: __wt_turtle_update, 397: WiredTiger.turtle: fatal turtle file update error: Permission denied Raw: [1600677634:227954][16124:140717079221488], file:WiredTiger.wt, WT_SESSION.checkpoint: __wt_turtle_update, 397: WiredTiger.turtle: fatal turtle file update error: Permission denied
[mongod output] 2020-09-21T11:40:34.228+0300 E STORAGE  [WTCheckpointThread] WiredTiger error (-31804) [1600677634:227954][16124:140717079221488], file:WiredTiger.wt, WT_SESSION.checkpoint: __wt_panic, 523: the process must exit and restart: WT_PANIC: WiredTiger library panic Raw: [1600677634:227954][16124:140717079221488], file:WiredTiger.wt, WT_SESSION.checkpoint: __wt_panic, 523: the process must exit and restart: WT_PANIC: WiredTiger library panic
[mongod output] 2020-09-21_11:40:34.227 [onfhir-akka.actor.default-dispatcher-2] DEBUG i.o.a.s.FHIRUpdateService - updating (creating a new version) document in database as it already exists
2020-09-21T11:40:34.228+0300 F -        [WTCheckpointThread] Fatal Assertion 50853 at src\mongo\db\storage\wiredtiger\wiredtiger_util.cpp 401
[mongod output] 2020-09-21T11:40:34.228+0300 F -        [WTCheckpointThread] 
[mongod output] 
[mongod output] ***aborting after fassert() failure
[mongod output] 
[mongod output] 
[mongod output] 2020-09-21T11:40:34.229+0300 F -        [conn5] Fatal Assertion 28559 at src\mongo\db\storage\wiredtiger\wiredtiger_util.cpp 62
[mongod output] 2020-09-21T11:40:34.229+0300 F -        [conn5] 
[mongod output] 
[mongod output] ***aborting after fassert() failure
[mongod output] 
[mongod output] 
[mongod output] 2020-09-21_11:40:34.470 [Thread-14] WARN  o.m.d.connection - Got socket exception on connection [connectionId{localValue:5, serverValue:5}] to localhost:27018. All connections to localhost:27018 will be closed.

2020-09-21_11:41:04.489 [onfhir-akka.actor.default-dispatcher-4] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
com.mongodb.MongoSocketReadException: Exception receiving message
	at com.mongodb.internal.connection.InternalStreamConnection.translateReadException(InternalStreamConnection.java:569)
	at com.mongodb.internal.connection.InternalStreamConnection.access$1200(InternalStreamConnection.java:76)
	at com.mongodb.internal.connection.InternalStreamConnection$5.failed(InternalStreamConnection.java:520)
	at com.mongodb.internal.connection.AsynchronousChannelStream$BasicCompletionHandler.failed(AsynchronousChannelStream.java:235)
	at com.mongodb.internal.connection.AsynchronousChannelStream$BasicCompletionHandler.failed(AsynchronousChannelStream.java:203)
	at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:128)
	at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157)
	at sun.nio.ch.Invoker.invoke(Invoker.java:185)
	at sun.nio.ch.Invoker.invoke(Invoker.java:297)
	at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ReadTask.failed(WindowsAsynchronousSocketChannelImpl.java:600)
	at sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:399)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: The specified network name is no longer available.

	at sun.nio.ch.Iocp.translateErrorToIOException(Iocp.java:309)
	at sun.nio.ch.Iocp.access$700(Iocp.java:46)
	... 5 common frames omitted
2020-09-21_11:41:04.490 [onfhir-akka.actor.default-dispatcher-2] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with af4e036eedce9584ea564f8a75c3cdef...
2020-09-21_11:41:21.864 [MaintenanceTimer-1-thread-1] WARN  o.m.d.connection - Exception thrown during connection pool background maintenance task
com.mongodb.MongoSocketOpenException: Exception opening socket
	at com.mongodb.internal.connection.AsynchronousSocketChannelStream$OpenCompletionHandler.failed(AsynchronousSocketChannelStream.java:117)
	at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:128)
	at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157)
	at sun.nio.ch.Invoker.invoke(Invoker.java:185)
	at sun.nio.ch.Invoker.invoke(Invoker.java:297)
	at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ConnectTask.failed(WindowsAsynchronousSocketChannelImpl.java:302)
	at sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:399)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: The remote computer refused the network connection.

	at sun.nio.ch.Iocp.translateErrorToIOException(Iocp.java:309)
	at sun.nio.ch.Iocp.access$700(Iocp.java:46)
	... 5 common frames omitted
2020-09-21_11:42:04.497 [onfhir-akka.actor.default-dispatcher-4] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.concurrent.TimeoutException: Futures timed out after [60 seconds]
	at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:255)
	at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:259)
	at scala.concurrent.Await$.$anonfun$result$1(package.scala:215)
	at akka.dispatch.MonitorableThreadFactory$AkkaForkJoinWorkerThread$$anon$3.block(ThreadPoolBuilder.scala:172)
	at akka.dispatch.forkjoin.ForkJoinPool.managedBlock(ForkJoinPool.java:3641)
	at akka.dispatch.MonitorableThreadFactory$AkkaForkJoinWorkerThread.blockOn(ThreadPoolBuilder.scala:170)
	at akka.dispatch.BatchingExecutor$BlockableBatch.blockOn(BatchingExecutor.scala:108)
	at scala.concurrent.Await$.result(package.scala:142)
	at io.onfhir.api.service.FHIRBatchTransactionService.executeChildInteraction(FHIRBatchTransactionService.scala:124)
	at io.onfhir.api.service.FHIRBatchTransactionService.$anonfun$performBatchRequest$4(FHIRBatchTransactionService.scala:176)
	at io.onfhir.api.service.FHIRBatchTransactionService.$anonfun$performBatchRequest$4$adapted(FHIRBatchTransactionService.scala:173)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at io.onfhir.api.service.FHIRBatchTransactionService.$anonfun$performBatchRequest$1(FHIRBatchTransactionService.scala:173)
	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:654)
	at scala.util.Success.$anonfun$map$1(Try.scala:251)
	at scala.util.Success.map(Try.scala:209)
	at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
	at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
	at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
	at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:49)
	at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
2020-09-21_11:42:04.499 [onfhir-akka.actor.default-dispatcher-2] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with 81babdda1eab99919b10506d6299a7fd...
2020-09-21_11:42:21.824 [MaintenanceTimer-1-thread-1] WARN  o.m.d.connection - Exception thrown during connection pool background maintenance task
com.mongodb.MongoSocketOpenException: Exception opening socket
	at com.mongodb.internal.connection.AsynchronousSocketChannelStream$OpenCompletionHandler.failed(AsynchronousSocketChannelStream.java:117)
	at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:128)
	at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157)
	at sun.nio.ch.Invoker.invoke(Invoker.java:185)
	at sun.nio.ch.Invoker.invoke(Invoker.java:297)
	at sun.nio.ch.WindowsAsynchronousSocketChannelImpl$ConnectTask.failed(WindowsAsynchronousSocketChannelImpl.java:302)
	at sun.nio.ch.Iocp$EventHandlerTask.run(Iocp.java:399)
	at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: The remote computer refused the network connection.

	at sun.nio.ch.Iocp.translateErrorToIOException(Iocp.java:309)
	at sun.nio.ch.Iocp.access$700(Iocp.java:46)
	... 5 common frames omitted

Extend FHIR Path Patch Operation with dynamic values constructed at runtime by running a given FHIR Path expression on the updated resource

This functionality is not defined in FHIR Path Patch specification (https://www.hl7.org/fhir/fhirpatch.html) but it can be a usefull extension.

In current spec, the "value" parameter either provides the value or value parts (by using part elements) to patch to the given path expressed by a FHIR Path expression.

We can extend this by enabling the provision of the value (or part.value) as FHIR Expression (when valueExpression is given) which then can be evaluated at runtime on the updated resource to get the value to patch for the given path.

e.g. Update the status of a FHIR Goal resource as 'achieved' or 'not-achieved' when a new related observation is created.
PATCH http://onfhir.io/r4/Goal?subject=...&target-measure=... { "resourceType": "Parameters", "parameter": [ { "name": "operation", "part": [ { "name": "type", "valueCode": "replace" }, { "name": "path", "valueString": "Goal.achievementStatus" }, { "name": "value", "valueExpression": { "language": "text/fhirpath", "expression": "Goal.target.detailRange.iff(high > 60, 'achieved', 'not-achieved')" } } ] } ] }_

Batch request may fail because of return=minimal header

Some fhir repositories such as Firely Server does not support return=minimal header for batch requests.

In this case, we get an java.lang.ClassCastException in parseEntryAsResponse function: https://github.com/srdc/onfhir/blob/master/onfhir-common/src/main/scala/io/onfhir/api/client/FHIRBundle.scala#L212
since the response includes an OperationOutcome, indicating that return=minimal header is not supported on interaction the system_batch, which has no response field.

feature: Enable mongodb.host config parameter to read from environment variables

mongodb.host parameter can be a list of mongodb hosts to support multiple mongodb instances (i.e. for sharding). But, it is not possible to pass such a list through environment variables. It would be nice to pass that list as a bare string so that it is also possible to read from an environment variable. If possible, backward compatibility will be good in order not to break older configuration files.

value dataTypeProfiles is not a member of io.onfhir.config.FhirConfig

Just checked the R4 version out and could not compile it with maven package.

[ERROR] [Error] /home/florian/Development/onfhir/onfhir-server-r4/src/main/scala/io/onfhir/r4/config/R4Configurator.scala:102: value dataTypeProfiles is not a member of io.onfhir.config.FhirConfig
[ERROR] [Error] /home/florian/Development/onfhir/onfhir-server-r4/src/main/scala/io/onfhir/r4/validation/OnFhirValidationSupportR4.scala:52: value dataTypeProfiles is not a member of io.onfhir.config.FhirConfig
[ERROR] [Error] /home/florian/Development/onfhir/onfhir-server-r4/src/main/scala/io/onfhir/r4/validation/OnFhirValidationSupportR4.scala:60: value map is not a member of Any

Is it because I use OpenJDK-11?

_include:iterate does not work in _include queries

Example query:

/CarePlan?_include=CarePlan:goal&_include:iterate=Goal:subject

Response:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "transient",
"diagnostics": "empty.reduceLeft",
"expression": []
}
]
}

Parsing bug in XML formatted responses

When a domain resource has text attribute with div and status (Narrative) is requested by a query with Accept: application/fhir+xml header, it gives error response as described below.

If it's a read request as get fhir/ResourceType/id, the response is:

<OperationOutcome xmlns="http://hl7.org/fhir">
    <issue>
        <severity value="error"/>
        <code value="invalid"/>
        <diagnostics value="Problem while converting JSON to XML:Content is not allowed in prolog."/>
    </issue>
</OperationOutcome>

If it's a search requests (fhir/ResourceType?params) that results in a bundle containing that resource, the response is:

<OperationOutcome xmlns="http://hl7.org/fhir">
    <issue>
        <severity value="error"/>
        <code value="invalid"/>
        <diagnostics value="Problem while converting JSON to XML:null"/>
    </issue>
</OperationOutcome>

Support for Java 11

  • Tests fail with the following Exception if the source code is built by JDK 11.
  • /metadata endpoint returns an error with "None.get" message if the JAR file is produced with JDK8 and run with JDK11.

Error log

2020-09-17_15:28:17.742 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRCreateService - Requesting 'Create' for Some(Patient) ...
2020-09-17_15:28:17.771 [io-onfhir-api-endpoint-FHIRHistoryEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$createResource$3(ResourceManager.scala:856)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:17.900 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with example...
2020-09-17_15:28:17.906 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRUpdateService - creating a new document in database as it does not exist
2020-09-17_15:28:17.910 [io-onfhir-api-endpoint-FHIRHistoryEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$createResource$3(ResourceManager.scala:856)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:18.985 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with example...
2020-09-17_15:28:19.000 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRUpdateService - updating (creating a new version) document in database as it already exists
2020-09-17_15:28:19.029 [io-onfhir-api-endpoint-FHIRHistoryEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$updateResource$3(ResourceManager.scala:955)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:19.052 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRHistoryService - Requesting 'history' for Patient with Some(example)
2020-09-17_15:28:19.095 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRHistoryService - returning history of 2 resources...
2020-09-17_15:28:22.159 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with example...
2020-09-17_15:28:22.163 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRUpdateService - updating (creating a new version) document in database as it already exists
2020-09-17_15:28:22.172 [io-onfhir-api-endpoint-FHIRHistoryEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$updateResource$3(ResourceManager.scala:955)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:22.178 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRHistoryService - Requesting 'history' for Patient with None
2020-09-17_15:28:22.199 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRHistoryService - returning history of 0 resources...
2020-09-17_15:28:22.222 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRHistoryService - Requesting 'history' for Patient with Some(11111)
2020-09-17_15:28:22.240 [onfhir-akka.actor.default-dispatcher-3] DEBUG i.o.a.s.FHIRHistoryService - No such resource with type(Patient) and id(Some(11111)), returning 404 NotFound
Tests run: 10, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 17.129 sec <<< FAILURE! - in io.onfhir.api.endpoint.FHIRHistoryEndpointTest
FHIR History Service should::return history of a resource for create, update, and delete interactions(io.onfhir.api.endpoint.FHIRHistoryEndpointTest) Time elapsed: 0.023 sec <<< FAILURE!
org.specs2.reporter.JUnitPrinter$$anon$1: 500 Internal Server Error != 201 Created expected:<[201 Created]> but was:<[500 Internal Server Error]>
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$3(FHIRHistoryEndpointTest.scala:43)
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$2(FHIRHistoryEndpointTest.scala:42)

FHIR History Service should::return history of resource type(io.onfhir.api.endpoint.FHIRHistoryEndpointTest) Time elapsed: 0.01 sec <<< FAILURE!
org.specs2.reporter.JUnitPrinter$$anon$1: 500 Internal Server Error != 201 Created expected:<[201 Created]> but was:<[500 Internal Server Error]>
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$61(FHIRHistoryEndpointTest.scala:100)
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$60(FHIRHistoryEndpointTest.scala:100)

FHIR History Service should::honor since parameter(io.onfhir.api.endpoint.FHIRHistoryEndpointTest) Time elapsed: 0.007 sec <<< FAILURE!
org.specs2.reporter.JUnitPrinter$$anon$1: Some(2) is Some but 2 != 1 expected:<[1]> but was:<[2]>
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$75(FHIRHistoryEndpointTest.scala:120)
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$73(FHIRHistoryEndpointTest.scala:116)

FHIR History Service should::honor at parameter(io.onfhir.api.endpoint.FHIRHistoryEndpointTest) Time elapsed: 0.005 sec <<< FAILURE!
org.specs2.reporter.JUnitPrinter$$anon$1: Some(0) is Some but 0 != 2 expected:<[2]> but was:<[0]>
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$86(FHIRHistoryEndpointTest.scala:137)
at io.onfhir.api.endpoint.FHIRHistoryEndpointTest.$anonfun$new$84(FHIRHistoryEndpointTest.scala:133)

Running io.onfhir.api.endpoint.FHIRReadEndpointTest
2020-09-17_15:28:25.537 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Reading base FHIR foundation resources (base standard) to start configuration of onFhir server ...
2020-09-17_15:28:25.551 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type StructureDefinition from default path 'definitions.json.zip'
2020-09-17_15:28:26.250 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type StructureDefinition from default path 'definitions.json.zip'
2020-09-17_15:28:26.300 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type StructureDefinition from default path 'definitions.json.zip'
2020-09-17_15:28:26.453 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type StructureDefinition from default path 'definitions.json.zip'
2020-09-17_15:28:26.621 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type SearchParameter from default path 'definitions.json.zip'
2020-09-17_15:28:26.755 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type ValueSet,CodeSystem from default path 'definitions.json.zip'
2020-09-17_15:28:26.991 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type ValueSet,CodeSystem from default path 'definitions.json.zip'
2020-09-17_15:28:27.204 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type ValueSet,CodeSystem from default path 'definitions.json.zip'
2020-09-17_15:28:27.421 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type OperationDefinition from default path 'definitions.json.zip'
2020-09-17_15:28:27.670 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources of type CompartmentDefinition from default path 'definitions.json.zip'
2020-09-17_15:28:27.922 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Reading FHIR foundation resources to start configuration of onFhir server ...
2020-09-17_15:28:27.923 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading a CapabilityStatement from default path 'conformance-statement.json'
2020-09-17_15:28:27.927 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources from default folder 'profiles.zip'
2020-09-17_15:28:27.928 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources from default folder 'search-parameters.zip'
2020-09-17_15:28:27.929 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources from default folder 'operation-definitions.zip'
2020-09-17_15:28:27.931 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources from default folder 'compartments.zip'
2020-09-17_15:28:27.931 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources from default folder 'value-sets.zip'
2020-09-17_15:28:27.933 [specs2-5] INFO i.o.a.u.IOUtil$ - Reading resources from default folder 'code-systems.zip'
2020-09-17_15:28:27.933 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring the platform accordingly ...
2020-09-17_15:28:27.933 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Parsing base FHIR foundation resources (base standard) ...
2020-09-17_15:28:29.604 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Validating given FHIR foundation resources for base specification conformance ...
2020-09-17_15:28:29.906 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Parsing given FHIR foundation resources ...
2020-09-17_15:28:30.342 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring supported FHIR resources and profiles ...
2020-09-17_15:28:30.413 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring supported FHIR search parameters for supported resources ...
2020-09-17_15:28:30.630 [specs2-5] WARN i.o.c.SearchParameterConfigurator - Problem while parsing search parameter expression 'Some(Patient.deceased.exists() and Patient.deceased != false)'! Trying xpath expression to resolve possible target paths...
2020-09-17_15:28:30.646 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring supported FHIR operations ...
2020-09-17_15:28:30.658 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring supported FHIR compartments ...
2020-09-17_15:28:30.658 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring supported FHIR system level interaction ...
2020-09-17_15:28:30.658 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring supported FHIR ValueSets ...
2020-09-17_15:28:30.658 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring required database indexes and shard keys ...
2020-09-17_15:28:30.660 [specs2-5] INFO i.o.c.IndexConfigurator$ - Reading DB Index Configuration file path 'db-index-conf.json'
2020-09-17_15:28:30.667 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Configuring other FHIR version specific parameters (mime types, etc)...
2020-09-17_15:28:30.668 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Setting up (or updating) the platform as requested ...
2020-09-17_15:28:30.671 [specs2-5] INFO i.o.d.DBInitializer$ - Preparing database ...
2020-09-17_15:28:30.671 [specs2-5] INFO i.o.d.DBInitializer$ - Creating MongoDB collections for supported resources ...
2020-09-17_15:28:33.341 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'MolecularSequence' ...
2020-09-17_15:28:33.362 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'CompartmentDefinition' ...
2020-09-17_15:28:33.378 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'StructureDefinition' ...
2020-09-17_15:28:33.400 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'Observation' ...
2020-09-17_15:28:33.424 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'RiskAssessment' ...
2020-09-17_15:28:33.466 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'OperationDefinition' ...
2020-09-17_15:28:33.483 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'AuditEvent' ...
2020-09-17_15:28:33.485 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'ActivityDefinition' ...
2020-09-17_15:28:33.505 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'CodeSystem' ...
2020-09-17_15:28:33.552 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'ValueSet' ...
2020-09-17_15:28:33.557 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'Patient' ...
2020-09-17_15:28:33.566 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'CapabilityStatement' ...
2020-09-17_15:28:33.569 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'SearchParameter' ...
2020-09-17_15:28:33.584 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'Practitioner' ...
2020-09-17_15:28:33.592 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB collection created for 'Condition' ...
2020-09-17_15:28:34.474 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB history collection created for 'Practitioner' ...
2020-09-17_15:28:34.493 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB history collection created for 'Observation' ...
2020-09-17_15:28:34.508 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB history collection created for 'Condition' ...
2020-09-17_15:28:34.510 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB history collection created for 'ActivityDefinition' ...
2020-09-17_15:28:34.513 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB history collection created for 'RiskAssessment' ...
2020-09-17_15:28:34.516 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB history collection created for 'MolecularSequence' ...
2020-09-17_15:28:34.526 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.d.DBInitializer$ - MongoDB history collection created for 'Patient' ...
2020-09-17_15:28:34.527 [specs2-5] INFO i.o.d.DBInitializer$ - Creating database indexes from configurations ...
2020-09-17_15:28:34.527 [specs2-5] INFO i.o.d.DBInitializer$ - Creating indexes for MolecularSequence ...
2020-09-17_15:28:34.531 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 0 indexes ensured for the collection MolecularSequence ...
2020-09-17_15:28:34.531 [specs2-5] INFO i.o.d.DBInitializer$ - Creating indexes for Practitioner ...
2020-09-17_15:28:34.532 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 0 indexes ensured for the collection Practitioner ...
2020-09-17_15:28:34.532 [specs2-5] INFO i.o.d.DBInitializer$ - Creating indexes for Condition ...
2020-09-17_15:28:34.631 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 2 indexes ensured for the collection Condition ...
2020-09-17_15:28:34.632 [specs2-5] INFO i.o.d.DBInitializer$ - Creating indexes for Observation ...
2020-09-17_15:28:35.141 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 10 indexes ensured for the collection Observation ...
2020-09-17_15:28:35.141 [specs2-5] INFO i.o.d.DBInitializer$ - Creating indexes for ActivityDefinition ...
2020-09-17_15:28:35.142 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 0 indexes ensured for the collection ActivityDefinition ...
2020-09-17_15:28:35.142 [specs2-5] INFO i.o.d.DBInitializer$ - Creating indexes for Patient ...
2020-09-17_15:28:35.142 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 0 indexes ensured for the collection Patient ...
2020-09-17_15:28:35.142 [specs2-5] INFO i.o.d.DBInitializer$ - Creating indexes for RiskAssessment ...
2020-09-17_15:28:35.188 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 1 indexes ensured for the collection RiskAssessment ...
2020-09-17_15:28:35.189 [specs2-5] INFO i.o.r.c.FhirR4Configurator - Storing infrastructure resources to database ...
2020-09-17_15:28:35.192 [specs2-5] DEBUG i.o.d.DBInitializer$ - Storing CapabilityStatement resources ...
2020-09-17_15:28:35.331 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 1 resources stored for CapabilityStatement ...
2020-09-17_15:28:35.331 [onfhir-akka.actor.default-dispatcher-7] INFO i.o.d.DBInitializer$ - 0 resources updated for CapabilityStatement ...
2020-09-17_15:28:35.331 [specs2-5] INFO i.o.d.DBInitializer$ - No resources for StructureDefinition, skipping storage...
2020-09-17_15:28:35.331 [specs2-5] INFO i.o.d.DBInitializer$ - No resources for SearchParameter, skipping storage...
2020-09-17_15:28:35.331 [specs2-5] INFO i.o.d.DBInitializer$ - No resources for CompartmentDefinition, skipping storage...
2020-09-17_15:28:35.331 [specs2-5] DEBUG i.o.d.DBInitializer$ - Storing ValueSet resources ...
2020-09-17_15:28:35.343 [onfhir-akka.actor.default-dispatcher-6] INFO i.o.d.DBInitializer$ - 1 resources stored for ValueSet ...
2020-09-17_15:28:35.343 [onfhir-akka.actor.default-dispatcher-6] INFO i.o.d.DBInitializer$ - 0 resources updated for ValueSet ...
2020-09-17_15:28:35.343 [specs2-5] INFO i.o.d.DBInitializer$ - No resources for OperationDefinition, skipping storage...
2020-09-17_15:28:35.343 [specs2-5] INFO i.o.d.DBInitializer$ - No resources for CodeSystem, skipping storage...
2020-09-17_15:28:35.345 [specs2-5] INFO i.o.c.FhirConfigurationManager$ - ** Initialization completed ...
2020-09-17_15:28:35.346 [specs2-5] INFO i.o.c.FhirConfigurationManager$ - ** Used Memory: 305 MB
2020-09-17_15:28:35.346 [specs2-5] INFO i.o.c.FhirConfigurationManager$ - ** Free Memory: 374 MB
2020-09-17_15:28:35.346 [specs2-5] INFO i.o.c.FhirConfigurationManager$ - ** Total Memory: 680 MB
2020-09-17_15:28:35.346 [specs2-5] INFO i.o.c.FhirConfigurationManager$ - ** Max Memory: 8164 MB
2020-09-17_15:28:35.346 [specs2-5] INFO i.o.c.FhirConfigurationManager$ - ** Available Processors:8
2020-09-17_15:28:35.867 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRReadService - requesting 'read' for Patient with id example ...
2020-09-17_15:28:35.873 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRReadService - resource not found, return 404 NotFound...
2020-09-17_15:28:35.953 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with example...
2020-09-17_15:28:35.956 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRUpdateService - creating a new document in database as it does not exist
2020-09-17_15:28:35.972 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$createResource$3(ResourceManager.scala:856)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:36.034 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with example...
2020-09-17_15:28:36.042 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRUpdateService - updating (creating a new version) document in database as it already exists
2020-09-17_15:28:36.069 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$updateResource$3(ResourceManager.scala:955)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:36.075 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRReadService - requesting 'vread' for Patient with id example ...
2020-09-17_15:28:36.083 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.api.util.FHIRUtil$.extractLastUpdatedFromResource(FHIRUtil.scala:501)
at io.onfhir.api.util.FHIRUtil$.extractBaseMetaFields(FHIRUtil.scala:472)
at io.onfhir.api.service.FHIRReadService.$anonfun$getResource$2(FHIRReadService.scala:100)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:49)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
2020-09-17_15:28:36.105 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRReadService - requesting 'read' for Patient with id example ...
2020-09-17_15:28:36.113 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.api.util.FHIRUtil$.extractLastUpdatedFromResource(FHIRUtil.scala:501)
at io.onfhir.api.util.FHIRUtil$.extractBaseMetaFields(FHIRUtil.scala:472)
at io.onfhir.api.service.FHIRReadService.$anonfun$getResource$2(FHIRReadService.scala:100)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:49)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
2020-09-17_15:28:36.137 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRReadService - requesting 'read' for Patient with id example ...
2020-09-17_15:28:36.141 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.api.util.FHIRUtil$.extractLastUpdatedFromResource(FHIRUtil.scala:501)
at io.onfhir.api.util.FHIRUtil$.extractBaseMetaFields(FHIRUtil.scala:472)
at io.onfhir.api.service.FHIRReadService.$anonfun$getResource$2(FHIRReadService.scala:100)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:49)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
2020-09-17_15:28:36.161 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRReadService - requesting 'read' for Patient with id example ...
2020-09-17_15:28:36.166 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.api.util.FHIRUtil$.extractLastUpdatedFromResource(FHIRUtil.scala:501)
at io.onfhir.api.util.FHIRUtil$.extractBaseMetaFields(FHIRUtil.scala:472)
at io.onfhir.api.service.FHIRReadService.$anonfun$getResource$2(FHIRReadService.scala:100)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:49)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
2020-09-17_15:28:36.191 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRDeleteService - requesting a 'delete' on Patient with id example...
2020-09-17_15:28:36.194 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRDeleteService - insert a new and empty document indicating that current document is deleted...
2020-09-17_15:28:36.206 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$deleteResource$2(ResourceManager.scala:1015)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:36.211 [onfhir-akka.actor.default-dispatcher-6] DEBUG i.o.a.s.FHIRReadService - requesting 'read' for Patient with id example ...
2020-09-17_15:28:36.214 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.api.util.FHIRUtil$.extractLastUpdatedFromResource(FHIRUtil.scala:501)
at io.onfhir.api.util.FHIRUtil$.extractBaseMetaFields(FHIRUtil.scala:472)
at io.onfhir.api.service.FHIRReadService.$anonfun$getResource$2(FHIRReadService.scala:100)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:49)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
2020-09-17_15:28:36.271 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.a.s.FHIRUpdateService - requesting 'update' for Patient with example...
2020-09-17_15:28:36.275 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.a.s.FHIRUpdateService - updating (creating a new version) document in database as it already exists
2020-09-17_15:28:36.283 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.util.DateTimeUtil$.instantToDateTime(DateTimeUtil.scala:190)
at io.onfhir.db.ResourceManager$.$anonfun$updateResource$3(ResourceManager.scala:955)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
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:834)
2020-09-17_15:28:36.288 [onfhir-akka.actor.default-dispatcher-7] DEBUG i.o.a.s.FHIRReadService - requesting 'read' for Patient with id example ...
2020-09-17_15:28:36.295 [io-onfhir-api-endpoint-FHIRReadEndpointTest-akka.actor.default-dispatcher-2] ERROR i.o.s.ErrorHandler$ - Unexpected exception!
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:349)
at scala.None$.get(Option.scala:347)
at io.onfhir.api.util.FHIRUtil$.extractLastUpdatedFromResource(FHIRUtil.scala:501)
at io.onfhir.api.util.FHIRUtil$.extractBaseMetaFields(FHIRUtil.scala:472)
at io.onfhir.api.service.FHIRReadService.$anonfun$getResource$2(FHIRReadService.scala:100)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:288)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:49)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Problem in _include=* wildcard query

The wildcard include query is misinterpreted. A query like this:

/CarePlan?_id=ba717c6f-120b-478d-ac42-7c0e9f543ae0&_include=*

is interpreted into this internally:

/CarePlan?_id=ba717c6f-120b-478d-ac42-7c0e9f543ae0&_include=(CarePlan,CarePlan.goal):(CarePlan,CarePlan.care-team):(CarePlan,CarePlan.condition):(CarePlan,CarePlan.performer):(CarePlan,CarePlan.activity-reference):(CarePlan,CarePlan.part-of):(CarePlan,CarePlan.instantiates-canonical):(CarePlan,CarePlan.encounter):(CarePlan,CarePlan.based-on):(CarePlan,CarePlan.subject):(CarePlan,CarePlan.patient):(CarePlan,CarePlan.replaces)&_page=1

Support :not modifier for uri search types

Not part of the specification but would be good add-on to support :not modifier for uri search parameters. It is needed for _source search param to be more specific.

Provide a sample project for a onFHIR based custom FHIR server and documentation

  • Provide an example how to define and implement a custom FHIR operation

  • Provide an example how to provide custom profile chain with extensions and configure onFHIR accordingly

  • Provide an example how to define new search parameters and configure onFHIR accordingly

  • Provide an example custom authorization module that implements a specific authorization policy

  • Provide an example database indexing configuration

Build Tests onfhir-server-r4 fails, if no mongo-DB is running

You may modify the test or the build howto to avoid this issue.

2020-10-08_08:51:53.745 [specs2-1] INFO  i.o.c.IndexConfigurator$ - Reading DB Index Configuration file path 'db-index-conf.json'
2020-10-08_08:51:53.761 [specs2-1] INFO  i.o.r.c.FhirR4Configurator - Configuring other FHIR version specific parameters (mime types, etc)...
2020-10-08_08:51:53.762 [specs2-1] INFO  i.o.r.c.FhirR4Configurator - Setting up (or updating) the platform as requested ...
2020-10-08_08:51:53.772 [specs2-1] INFO  i.o.d.DBInitializer$ - Preparing database ...
2020-10-08_08:51:53.772 [specs2-1] INFO  i.o.d.DBInitializer$ - Creating MongoDB collections for supported resources ...
2020-10-08_08:51:54.112 [MaintenanceTimer-1-thread-1] WARN  o.m.d.connection - Exception thrown during connection pool background maintenance task
com.mongodb.MongoSocketOpenException: Exception opening socket
        at com.mongodb.internal.connection.AsynchronousSocketChannelStream$OpenCompletionHandler.failed(AsynchronousSocketChannelStream.java:117)
        at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:128)
        at sun.nio.ch.Invoker$2.run(Invoker.java:218)
        at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:252)
        at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198)
        at sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213)
        at sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:293)
        ... 1 common frames omitted

feature: Group by and having statement in FHIR Path

Feature Request

Describe the Feature Request
I would like to have a list of patients having more than two chronic conditions. I am able to retrieve conditions from repository through FHIR query. What I need more is to group conditions by their subject and keep the ones having at least two condition resources.

Is your feature request related to a problem? Please describe
No.

Update of foundation resources during setup of platform does not trigger

Although there are logs like below, the actual update of resources does not take place as expected:

2022-10-26_15:51:42.601 [onfhir-akka.actor.default-dispatcher-12] INFO i.o.d.DBInitializer$ - 0 resources stored for SearchParameter ...
2022-10-26_15:51:42.601 [onfhir-akka.actor.default-dispatcher-12] INFO i.o.d.DBInitializer$ - 20 resources updated for SearchParameter ...
2022-10-26_15:51:42.601 [main] DEBUG i.o.d.DBInitializer$ - Storing CompartmentDefinition resources ...
2022-10-26_15:51:42.606 [onfhir-akka.actor.default-dispatcher-12] INFO i.o.d.DBInitializer$ - 0 resources stored for CompartmentDefinition ...
2022-10-26_15:51:42.606 [onfhir-akka.actor.default-dispatcher-12] INFO i.o.d.DBInitializer$ - 1 resources updated for CompartmentDefinition ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.