Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/OHDSI/GIS
Browse files Browse the repository at this point in the history
  • Loading branch information
kzollove committed Feb 7, 2024
2 parents ea8bc66 + d3ce92e commit 9f0bf6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/dbUtils.R
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ getGeomIdMap <- function(connectionDetails, geomIndexId){
#'
getLocationAddresses <- function(connectionDetails, cdmDatabaseSchema){
addressQuery <- paste0("SELECT l.location_id
, CONCAT(l.address_1, ' ', l.address_2, ' ', l.city, ' ', l.state, ' ', LEFT(l.zip, 5)) AS address
, CONCAT(COALESCE(l.address_1, ''), ' ', COALESCE(l.address_2, ''), ' ', COALESCE(l.city, ''), ' ', COALESCE(l.state, ''), ' ', LEFT(COALESCE(l.zip, ''), 5)) AS address
, latitude
, longitude
FROM ", cdmDatabaseSchema, ".location l")
Expand All @@ -688,7 +688,7 @@ getLocationAddresses <- function(connectionDetails, cdmDatabaseSchema){
if(stringr::str_detect(conditionMessage(err), "longitude|latitude")) {
message('\nLatitude/Longitude columns skipped.')
addressQuery <- paste0("SELECT l.location_id
, CONCAT(l.address_1, ' ', l.address_2, ' ', l.city, ' ', l.state, ' ', LEFT(l.zip, 5)) AS address
, CONCAT(COALESCE(l.address_1, ''), ' ', COALESCE(l.address_2, ''), ' ', COALESCE(l.city, ''), ' ', COALESCE(l.state, ''), ' ', LEFT(COALESCE(l.zip, ''), 5)) AS address
FROM ", cdmDatabaseSchema, ".location l")
DatabaseConnector::querySql(connection = conn, sql = addressQuery)
} else {
Expand Down

0 comments on commit 9f0bf6e

Please sign in to comment.