FHIR Chat · HAPI FHIR JPA Server shema DDL script · hapi

Stream: hapi

Topic: HAPI FHIR JPA Server shema DDL script


view this post on Zulip Asharaf Kadavath (Sep 26 2019 at 20:17):

I am looking for sql script(oracle) for hapi fhir JPA server( hapi-fhir-jpaserver-starter-4.0.0).

would like to create db objects using a script instead of enabling hibernate auto create.

where can i find ddl script for hapi server ?

Thanks
~ash

view this post on Zulip James Agnew (Sep 26 2019 at 20:32):

If you grab the hapi-fhir-jpaserver-base JAR and unzip it, you'll find a set of *.sql files in there named after the variou platforms we support. You can grab the oracle one from that if you need.

view this post on Zulip Subramanya Kudithipudi (Oct 02 2019 at 22:19):

Hi, I am new to Hapi, I was able to use hapi-fhir-jpaserver-starter code from Github and executed the code without any issues.
I want to change the default H2 database connection to MySQL, I have installed MySQL database server on my machine,
How can I populate the Database tables related to FHIR? Any help would be appreciated....

view this post on Zulip James Agnew (Oct 03 2019 at 00:24):

You can find instructions on how to set up MySQL in the readme file here: https://github.com/hapifhir/hapi-fhir-jpaserver-starter

view this post on Zulip Subramanya Kudithipudi (Oct 03 2019 at 00:41):

Thanks it worked

view this post on Zulip James Agnew (Oct 03 2019 at 00:52):

woohoo!

view this post on Zulip Subramanya Kudithipudi (Oct 03 2019 at 01:03):

Hi James, Do we have any tutorial available to learn more about FHIR. Like I was able to setup jpa server and able to see the tables in Mysql database. I already have a existing database with tables like patient, patient_address, patient_measures_data etc... how do I use FHIR to interact with existing database...

view this post on Zulip James Agnew (Oct 03 2019 at 13:46):

The server docs may be of help here: http://hapifhir.io/doc_rest_server.html

view this post on Zulip Jordi Cabré (Jun 01 2021 at 10:07):

I'm trying to extract DDL using cli migrate-database command using --dry-run. My database is currently empty.
cli command is:

java -cp hapi-fhir-cli.jar:/home/jeusdi/projects/workarea/salut/mpi/ojdbc8.jar ca.uhn.fhir.cli.App migrate-database -d ORACLE_12C -n <user> -p <password> -u <url> --dry-run

I'm getting this exception:

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [alter table TRM_CONCEPT_MAP add constraint FK_TRMCONCEPTMAP_RES foreign key (RES_ID) references HFJ_RESOURCE]; nested exception is java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
    at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:431)
    at ca.uhn.fhir.jpa.migrate.taskdef.AddTableRawSqlTask.lambda$doExecute$2(AddTableRawSqlTask.java:80)
    at ca.uhn.fhir.jpa.migrate.taskdef.AddTableRawSqlTask$$Lambda$139/00000000287E02E0.doInTransaction(Unknown Source)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
    at ca.uhn.fhir.jpa.migrate.taskdef.AddTableRawSqlTask.doExecute(AddTableRawSqlTask.java:76)
    at ca.uhn.fhir.jpa.migrate.taskdef.BaseTask.execute(BaseTask.java:179)
    at ca.uhn.fhir.jpa.migrate.TaskOnlyMigrator.migrate(TaskOnlyMigrator.java:59)
    at ca.uhn.fhir.cli.BaseFlywayMigrateDatabaseCommand.run(BaseFlywayMigrateDatabaseCommand.java:137)
    at ca.uhn.fhir.cli.HapiFlywayMigrateDatabaseCommand.run(HapiFlywayMigrateDatabaseCommand.java:56)
    at ca.uhn.fhir.cli.BaseApp.run(BaseApp.java:269)
    at ca.uhn.fhir.cli.App.main(App.java:43)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:37)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:896)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1737)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1692)
    at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:300)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
    at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:422)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:381)
    ... 11 common frames omitted
Caused by: oracle.jdbc.OracleDatabaseException: ORA-00942: table or view does not exist

    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
    ... 27 common frames omitted

Any ideas about how to get initial DDL?


Last updated: Apr 12 2022 at 19:14 UTC