# FHIR Bridge db connection **Category:** [Implementation](https://discourse.openehr.org/c/implem/39) **Created:** 2023-02-23 15:23 UTC **Views:** 478 **Replies:** 10 **URL:** https://discourse.openehr.org/t/fhir-bridge-db-connection/3609 --- ## Post #1 by @ISys Hey everyone, So at this point I am trying to analyze in depth the ehrbase construction regarding the relations. My setup for now is full environment for fhir bridge and the issue is that I am not able to check the relations for postgres/ehrbase user. Although I am creating templates/ehr's, there is always "Did not find any relations.". I am not very into java/spring framework (I am doing as python junior), so I guess there is some spring flavour as the reason, but I can not find anything on that. What is the proper setting for checking relations in fhir bridge (running as docker container)? Thank you --- ## Post #2 by @ian.mcnicoll Can you post a screenshot? I'm not sure I really understand what you are seeing. --- ## Post #3 by @SevKohler Did you add the templates into the resources/opt folder ? Since the bridge is automatically uploading these to ehrbase. Also its autogenerating Ehrs for each unknown patient. --- ## Post #4 by @ISys Severin, yes - I have added the template as well as composition for that. Even though, there are no relations for that (in ehrbase-db container). I am using the 'docker-compose-demo' in FHIR bride: ![Screenshot from 2023-02-24 14-58-45|538x230](upload://zGyBXuAc0gr95UBmgfb6PBhJT8r.png) --- ## Post #5 by @SevKohler So you want to query on the ehrbase database or what is your goal ? --- ## Post #6 by @ISys Yes, that is correct - I want to query on the ehrbase db. --- ## Post #7 by @SevKohler And what is your exact goal ? Understanding the ehrbase db ? Otherwise i would recommend AQL ;) --- ## Post #8 by @ian.mcnicoll I completely support that suggestion. CDRs are supposed to be queried via the domain information model using AQL or equivalent. The db schema will really not help you as it is designed at very low level to be static and unchanging. That might be interesting if you want to build a CDR, but f you just want to consume the data from a CDR you really do not want to go there!! --- ## Post #9 by @ISys Of course I did some queries using AQL and that is very enough, but I am just trying to understand the ehrbase db as for production case. --- ## Post #10 by @ian.mcnicoll Curioisity is fine!! but remember that in production you will never be accessing the postgresDb directly - all of the interactions with ehrBase should be via the API, as for every CDR. --- ## Post #11 by @Seref [quote="ISys, post:9, topic:3609, full:true"] Of course I did some queries using AQL and that is very enough, but I am just trying to understand the ehrbase db as for production case. [/quote] Sure, always great to be able to look under the hood, but you may consider using something that's more efficient and visual for exploratory purposes. https://www.jetbrains.com/datagrip/ is my favorite. 30 days trial free. Postgres had its own free tool (gui) for ages, I'm guessing it's still around. Or anything else that'll show you the schemas and and relations in them. --- **Canonical:** https://discourse.openehr.org/t/fhir-bridge-db-connection/3609 **Original content:** https://discourse.openehr.org/t/fhir-bridge-db-connection/3609