Stream: analytics on FHIR
Topic: FHIR-based relational schema
Chris Busch (Mar 11 2021 at 00:17):
Has anyone seen a public domain FHIR-based relational schema?
Vasyl Herman (Mar 11 2021 at 06:43):
Hi. We used pg admin to get the schema
Vasyl Herman (Mar 11 2021 at 06:44):
Also interested in the official one.
Chris Busch (Mar 11 2021 at 14:03):
@Vasyl Herman Can you share details on "using pg admin to get the schema"?
Paul Hellwig (Mar 11 2021 at 14:07):
I am not sure that a generic relational schema is possible. FHIR makes heavy use of the document-like data representation, concretely 'nestedness', optional data points, etc., and resources keep getting updated.
This would be really hard to track in a normalized relational schema. And a schema export from an existing dataset (e.g. with pg admin) is only valid at this point in time. Any resource added might make a re-design necessary.... (whether this is likely depends on the size and variety of the existing dataset, of course)
For our analytics we go with a limited relational schema, i.e. we extract only the key/value pairs we need for our visualizations.
Lloyd McKenzie (Mar 11 2021 at 15:34):
There is no "official" schema - any FHIR-based schema is going to have trade-offs driven by how you plan to use the data.
Vasyl Herman (Mar 11 2021 at 15:42):
@Chris Busch Hello, clone hapi-fhir-jpaserver-starter
My datasource config looks like this:
spring:
datasource:
url: 'jdbc:postgresql://hapi-fhir-pg:5432/hapi'
username: user
password: passwd
driverClassName: org.postgresql.Driver
docker-compose.yml like this:
version: "3.7"
services:
hapi-fhir-jpaserver-start:
depends_on:
- hapi-fhir-mysql
# image: "hapiproject/hapi:latest"
build: .
restart: on-failure
ports:
- "8080:8080"
volumes:
- hapi-data:/data/hapi
- ./configs/application.yaml:/data/hapi/application.yaml
environment:
SPRING_CONFIG_LOCATION: 'file:///data/hapi/application.yaml'
hapi-fhir-pg:
image: postgres:10
restart: always
volumes:
- hapi-fhir-pg:/var/lib/postgresql/data:Z
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
POSTGRES_DB: hapi
http_proxy:
https_proxy:
no_proxy:
ports:
- 5431:5432
pgadmin:
image: dpage/pgadmin4
restart: always
ports:
- 8280:80
environment:
PGADMIN_DEFAULT_EMAIL: yours
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- pgadmin-data:/var/lib/pgadmin
volumes:
hapi-data:
hapi-fhir-pg:
then start docker-compose and finally you can use pg admin to backup the shcema
Vasyl Herman (Mar 11 2021 at 15:44):
@Chris Busch I am wondering why you need this?
Richard Stanley (Mar 11 2021 at 16:04):
I'll toss in here that the firebase folks used binary blobs (jsonb) in postgres for the full resource content, and IIRC only create fields for resource id. The binary blobs can be indexed as one wishes.
Chris Busch (Mar 11 2021 at 18:11):
Vasyl Herman [said](https://chat.fhir.org/#narrow/stream/179219-analytics-on.20FHIR/topic/FHIR-
@Chris Busch I am wondering why you need this?
We are creating a persistent database which will receive and send data in FHIR but the primary use is analytics. Thinking it will make life easier to follow the FHIR organization and naming to the extent possible.
Vasyl Herman (Mar 11 2021 at 20:24):
@Chris Busch
Thanks for answering. I hope it helps you.
Last updated: Apr 12 2022 at 19:14 UTC