# Exploring FHIR Model / Database **Category:** [FHIR](https://openhealthhub.org/c/fhir/31) **Created:** 2019-02-03 10:49 UTC **Views:** 3223 **Replies:** 0 **URL:** https://openhealthhub.org/t/exploring-fhir-model-database/1987 --- ## Post #1 by @mayfield.g.kev # CCRI Relationship Diagram and Docker This is a bit lengthy. The instructions setup a basic FHIR server, database admin tool and a modelling tool which allows exploration of the database model. The model resembles the FHIR model, it is not exactly the same and should be familiar to most who have worked on EPR, LIMS or PAS systems. Docker Instructions 1. Install docker 2. In an empty directory create .ENV file and copy content from: https://github.com/nhsconnect/careconnect-reference-implementation/blob/master/.env 3. Create docker-compose.yml file Copy content from this file: https://github.com/nhsconnect/careconnect-reference-implementation/blob/master/docker-compose.min.yml 4. Run docker pose file docker-compose up -d To stop docker-compose stop 5. A small front end should be available on http://localhost:8081/ccri This is a very basic application that allows a developer to explore the FHIR RESTful API to the database. ![|624x341](https://lh6.googleusercontent.com/tzTdNeHthZ1Y_eVTqji2mpCHkbfxGpRM1sDmzSx0W-tDOBAnoVzFtxqEN6voXKfFILkeX_gd2vVBUTJIQYjAMujVncWz0e7YDb6V2nRVkhESa0IqoXVrhTpyQxeVeMRd75diB0gs) 6. Install pgAdmin https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.1/windows/ Add a new server, settings in the diagram below: The password is fhirjpa port number is 5434 ![|504x552](https://lh6.googleusercontent.com/IzVLrEW_Y3AqJhAd4RmKb8k0V_BjnVLXcEpsllmUaMJdjHOFSdHe-1JLwPVEOvGMoJquu4hJVqYHz6HoeKPi_p_ljy1ZyLUld6zwBg_8b2GK1ZviSVnxpChd7JO2VQk5RCt0wthW) Once connected, you will be able to explore the database: ![|624x369](https://lh3.googleusercontent.com/dGhBdFio4pwH_5ibzvayBcyKnlQsAPMnN65F5EOXQ5dXqgELgM9ITXb5LzYwiwVp6XC1EquiBHDVaWpDFyHmUPOkvmUUQ6JTscTTtIaCKMwxcGUHR0wwJyTTgClMbcJkA7-GoL7f) 7. Install visualisation tools. I’ve used https://dbeaver.io/download/ Once installed set up the connection (port 5434, username and password fhirjpa and database careconnect) ![|562x564](https://lh4.googleusercontent.com/MpoPkxNvBOQuYL9Xk-ZjS6Ffxfo3QtClCBUxysZBUhnesPwbPeQBD0icS8rHN5IUeoY2AcPNs8mR4_b-VUHMMtWchFbHMIVOIq8_Vbu6rj0A3Hx78pAvnLib2KdPtlYCDb-shXCJ) Once connected, then select New->Wizard from the menu. Choose ER Diagram from the menu ![|510x494](https://lh4.googleusercontent.com/Bxn3m1Fmr7ghjPMj3_OZWAJ_wPOwbxEdA_vyvOOYYHoGwu_q1VGchS_AKsX8Jl40kqF4WKZ847jr8mwYwC0g5PP8GSEl6gD0yr8zxMRX2uwV8q3ibnVzbhXVou1kzvhzauzhrBVw) Then select the tables: ![|512x685](https://lh6.googleusercontent.com/QVLEmxjtVDpPRXQAWynBtjAlKAkP-dEJp8AgRIDw94D6rYToVdAq5z0iKShv_-cyy4PJ56Qp1wwU8wCY5qzS59LK88sISd3EcErjDlJk_IJ8Azygl0kEcWccHGUvFeInhbATOxQ7) In the diagram above creates a very complicated diagram. In the screenshot below only Patient, Encounter, Observation and Procedure tables have been selected: ![|624x600](https://lh5.googleusercontent.com/nxrUAxddRcTRuODHSDkxaAxrYQReqPZj1ZvH-RpRZffSSiyicMtmkpiBnJg_x6RScbiKH8ykjqwd6D3SqGw-vz0uhtB2WcrlYIiG0luM8ZYKXXi2W6UeFU1gt_XZla51On1BKDty) --- **Canonical:** https://openhealthhub.org/t/exploring-fhir-model-database/1987 **Original content:** https://openhealthhub.org/t/exploring-fhir-model-database/1987