HOWTO Build a health database and FHIR API Server in 15 mins using open source

(Kev Mayfield) #21

If you have maven and java installed, it should run using mvn spring-boot:run

(Matthew Vita (Healthcare Software Engineer)) #22

This is awesome. Thanks @mayfield.g.kev. I will test and report back.

(Matthew Vita (Healthcare Software Engineer)) #23

Hi @mayfield.g.kev, I have successfully spun up the Spring Boot version, but I’m noticing that the “viewer” isn’t there. Is there anyway to integrate this?

(Kev Mayfield) #24

I couldn’t get the the overlay to work with springboot (not sure of the exact reason)

I used a separate webapp as a work around ( which is not ideal.

(Kev Mayfield) #25


To create a FHIR Server, see the HAPI JPA Server notes here:
(please use these instructions in place of those above)

Update on the CareConnect links posted previously:

API Documentation:
Demo server (of API): (currently at release 2 which covers Individuals and Entities plus Observations)

This also uses libraries from the HAPI FHIR open source project but is an example of how an existing PAS, EPR, EDMS, SQL Server, etc, system can be exposed as a FHIR server (The database is SQL and the db model is based on actual systems). Source code can be found here

(Justin Ho) #26

@mayfield.g.kev Thanks for the tutorial. Really helpful esp for someone what is not that fluent in Java. By following your example and the comments I am able to get over connection error to mysql

However, I’m having a bit of a problem with the actual sql statements. I’m getting the following:

jetty_1  | 2018-05-18 03:26:41.570 [scheduledExecutorService-1] WARN  o.h.e.jdbc.spi.SqlExceptionHelper [] SQL Error: 1064, SQLState: 42000
jetty_1  | 2018-05-18 03:26:41.571 [scheduledExecutorService-1] ERROR o.h.e.jdbc.spi.SqlExceptionHelper [] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch first 1001 rows only' at line 1
jetty_1  | 2018-05-18 03:26:41.575 [scheduledExecutorService-1] ERROR o.s.s.s.TaskUtils$LoggingErrorHandler [] Unexpected error occurred in scheduled task.
jetty_1  | org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
jetty_1  | 	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(
jetty_1  | 	at ca.uhn.fhir.jpa.config.HapiFhirHibernateJpaDialect.convertHibernateAccessException(
jetty_1  | 	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(
jetty_1  | 	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(
jetty_1  | 	at
jetty_1  | Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
jetty_1  | 	at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(
jetty_1  | 	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(
jetty_1  | 	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(
jetty_1  | Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fetch first 1000 rows only' at line 1
jetty_1  | 	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(
jetty_1  | 	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(

Could it be because

  • I don’t have a mysql schema in place?
  • I’m not using the right driver?
  • I’m not using the right mysql version?

I’m not sure where to look. Can anyone point me to the right direction?

Thanks in advance,


(Kev Mayfield) #27

The schema is created automatically by the server.

Which repository/instructions did you use? I’m presuming the one from the

I suspect it’s the datasource dialect that is wrong, for MySQL 5.7 I’ve used

(Justin Ho) #28

Thanks Kev! That was it. Got this up and running now