How connect HAPI-FHIR with Oracle database.

566 views
Skip to first unread message

Felipe Henríquez

unread,
Aug 29, 2018, 10:11:12 AM8/29/18
to HAPI FHIR
Dear I've installed HAPI-FHIR in CentOS 7.5.1804. I have HAPI-FHIR JPA up and running with Apache Tomcat latest, builded with Maven latest, but I want to use my own database, Oracle 12c.

I've readed the documentation and says that the file FhirServerConfig.java need to be modified, but exist two of these files:

Locate command show the following
/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfig.java
/src/main/java/ca/uhn/fhir/jpa/demo/elasticsearch/FhirServerConfig.java

Is necessary modify both files?

And my other doubt is how can I configure the following section for Oracle 12c

public DataSource dataSource() {
                  BasicDataSource retVal = new BasicDataSource();
                  retVal.setDriver(new org.apache.derby.jdbc.EmbeddedDriver());
                  retVal.setUrl("jdbc:derby:directory:target/jpaserver_derby_files;create=true");
                  retVal.setUsername("");
                  retVal.setPassword("");
                  return retVal;
          }

And in what part I must to import the Oracle driver?

Thanks in advance!.

Felipe Henríquez

unread,
Sep 13, 2018, 2:13:59 PM9/13/18
to HAPI FHIR
Anyone knows how to do this?, thanks.

Patrick Werner

unread,
Sep 14, 2018, 6:13:06 AM9/14/18
to HAPI FHIR
Am Mittwoch, 29. August 2018 16:11:12 UTC+2 schrieb Felipe Henríquez:
Locate command show the following
/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfig.java
/src/main/java/ca/uhn/fhir/jpa/demo/elasticsearch/FhirServerConfig.java
If you want the example server with Oracle and default Lucene Index you only have to modify FhirServerConfig.java (everything under elasticsearch isn't loaded on startup by default, have a look at the web.xml

Is necessary modify both files?

And my other doubt is how can I configure the following section for Oracle 12c

public DataSource dataSource() {
                  BasicDataSource retVal = new BasicDataSource();
                  retVal.setDriver(new org.apache.derby.jdbc.EmbeddedDriver());
                  retVal.setUrl("jdbc:derby:directory:target/jpaserver_derby_files;create=true");
                  retVal.setUsername("");
                  retVal.setPassword("");
                  return retVal;
          }

And in what part I must to import the Oracle driver?

Oracle JDBC driver should be imported via maven, and you have to config the hibernate properties, some guidance on that is contained here:

Felipe Henríquez

unread,
Nov 7, 2018, 8:43:04 AM11/7/18
to HAPI FHIR
Thanks for your help I have some doubts still, ¿how do you load the structure of database in Oracle database?, there aren't any init script for HAPI-FHIR oracle database.

James Agnew

unread,
Nov 7, 2018, 3:56:54 PM11/7/18
to Felipe Henríquez, HAPI FHIR
Hapi fhir will initialize the DB on startup in it's default configuration. You don't need to run any init scripts.

Cheers,
James

sent from my phone.

On Wed, Nov 7, 2018, 08:43 Felipe Henríquez <fahenr...@gmail.com wrote:
Thanks for your help I have some doubts still, ¿how do you load the structure of database in Oracle database?, there aren't any init script for HAPI-FHIR oracle database.

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/65ce8976-d025-4d0a-8204-1f74d3f96efe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages