An R package and RShiny app for working with OMOP CDM data in conjunction with geospatial data in a standardized format.
- Ability to register desired geospatial data sources.
- Work with PHI in a local environment.
gaiaCore is an R package created by the OHDSI GIS work group. A Postgres/PostGIS database is used to store and maintain source records.
To set up the backbone schema, you must have a Postgres/PostGIS database
-
See the instructions here for configuring your R environment, including RTools and Java.
-
You can install the development version of gaiaCore from GitHub with:
# install.packages("devtools") devtools::install_github("OHDSI/GIS/packages/gaiaCore")
-
library(gaiaCore)
gaiaDB is a postgres database with PostGIS installed. If you don't have an existing postgres/PostGIS instance, you can create one in a docker container (see below).
If you already have a Postgres/PostGIS database, skip the Docker section.
-
You will need to have Docker and Docker Compose installed. The easiest way to install Docker and Docker Compose is by installing Docker Desktop.
-
Download the
init
directory from this repository. -
From a terminal (Command Prompt or Powershell on Windows), make sure the
init
directory is your working directory. -
Run command
docker-compose up -d
. This will build a docker image, install the database, load the data and variable sources, and expose the database at port 5432.
- Note: to change the port, open the file
docker-compose.yml
and edit line 10 from- "5432:5432"
to- "X:5432"
whereX
is the desired port.
- You can now connect to the database from R using localhost, port 5432 (if not changed), username "postgres", and password "mysecretpassword"
- Note: to change your password, edit line 13 of the
docker-compose.yml
file. If you've already started the container, you will need to shut down the container, remove the volumes and image that were created, and redo step 4 for the password change to take effect.
- The next section will highlight the steps to connect your PostGIS Docker container to R
- Create the
connectionDetails
object
connectionDetails <- DatabaseConnector::createConnectionDetails(
dbms = "postgresql",
server = "", # server info, use localhost/gaiaDB if setting up from Docker
port = 5432,
user="postgres", # username to access server
password = "mysecretpassword")
- Run the
initializeDatabase(connectionDetails)
function
- Developer questions/comments/feedback: OHDSI Forum
- Please use the GitHub issue tracker for all bugs/issues/enhancements
Read here how you can contribute to this package.
GIS is licensed under Apache License 2.0
gaiaCore is being developed in R Studio.
gaiaDB is being developed in Postgres/PostGIS
Under development