Stream: implementers
Topic: Complex types <> DB
Christian González (Apr 16 2018 at 12:57):
Hello FHIR community.
New here, really appreciate the FHIR evolvong standard.
We are trying to implement a Python/Django based FHIR server (and EMR), and currently are struggling through the FHIR docs. There are some problems we(I don't understand as FHIR in the first place seems to be very easy and straight forward, after a second glance really complex to get through. I often see things where I admire: "whow, they even thought about that cornercase..."
But, there are downsides too: My most challenging question is: how is it supposed to implement Complex data types within the database? As example: the "Quantity" type has value as decimal field. But as has a "implicit" precision, I can't use that in a database as "decimal". How is tat supposed to be saved? As string?
Do you recommend to hold a simple, straight forward data model in the DB, and just use FHIR as REST API, with an adapter upon it? Or do you recommend to save all the FHIR objects directly in the DB as they are?
FYI: we are using a relational DB model. With a NoSQL, this would be easy, just throw the JSON onto a MongoDB etc.
But with *SQL - I am really confused how to implement resources like "Reference" and Complex Types.
Any help welcome, thanks.
Yunwei Wang (Apr 16 2018 at 14:28):
Depends on the purpose of database, there could be different solution. Most of Reference can be treated as foreign key. For example, my Condition table has a foreign key column to Patient table. Though Quantity has implicit precision during transfer, your should be able to decide the precision your database need. There is no conflict.
Igor Sirkovich (Apr 16 2018 at 15:30):
@Christian González stian, have a look at the similar discussion at https://chat.fhir.org/#narrow/stream/social/subject/Implement.20FHIR.20with.20existing.20database
Christian González (Apr 16 2018 at 18:53):
Thanks. Yes, I thought I can't be the first one with this problems. I'll ask there more specific.
If anyone is interested joining an Open Source EMR + FHIR server with Django/Python, feel free: https://gitlab.com/nerdocs/medux/MedUX
Last updated: Apr 12 2022 at 19:14 UTC