Hello, community.
I am currently developing my master's thesis and working on developing a FHIR Server to sit on top of healthcare instituions' data repositories. The server's goal is to securely access clinical data upon user requests (without users dealing directly with the databases).
I am simulating the data repositories using PostgreSQL and I want to use the Hibernate's
hbm2ddl.auto = true configuration to automatically generate DB tables. By using this, Hibernate would, for instance, create a Patient table based on the Patient Resource model class defined by HAPI FHIR.
My first step was to create a PatientEntity object that extends Patient model class and add it the annotations needed for Hibernate to work: @Entity and @ID.
Then, upon defining such configuration on the
hibernate.cfg.xml file, defining code to create a patient example and running the HAPI FHIR Server (built based on the HAPI FHIR Plain Server - Simple server example
https://github.com/FirelyTeam/fhirstarters/tree/master/java/hapi-fhirstarters-simple-server ), the Server is capable of creating such table on my DB automaticaly, but it only one column on the DB: the id collumn, when it should have the others field values I had defined (the name, for instance).
Currently using:
- Eclipse for editing code
-
Apache Maven version 3.8.6 as build tool
- FHIR Version: 6.0.0
Some relevant Maven dependencies:
- hapi-fhir-structures-r4 module
- PostgreSQL JDBC Driver: 42.5.1
- org.hibernate.orm: 6.1.6 Final
- jakarta.persistence: 3.1.0
Has anyone had this problem or had success when using FHIR with Hibernate to generate the DB schema?
Thanks in advance and I'm available to give the needed informations to solve such problem.