Skip to contents

Translates column_name into English using the Google Translate Cloud API for matching using OHDSI Usagi.

Usage

translate_concepts(concepts)

Arguments

concepts

tibble containing concepts (column name: "source_concept") and the number of occurrences in the database (column name: "count") of those concepts.

Value

tibble containing concepts and their translation

Examples

has_adb_environment()
#> Connecting using PostgreSQL driver
#> Executing SQL took 0.00381 secs
#> [1] TRUE
library(dplyr)
conn <- amstel::connect("amsterdamumcdb")
#> Connecting using PostgreSQL driver
#> Executing SQL took 0.00507 secs
admissions <- tbl(conn, "admissions")
concepts <- admissions %>% group_by(source_concept=origin) %>% summarise(count=n()) %>% collect()
concepts <- translate_concepts(concepts)
#> 2024-05-14 22:18:00.611339 -- Translating text: NA characters - 
concepts
#> # A tibble: 16 × 3
#>    source_concept                                        count source_concept_en
#>    <chr>                                                 <dbl> <chr>            
#>  1 Special/Medium care zelfde ziekenhuis                   193 Special/Medium c…
#>  2 NA                                                    14075 NA               
#>  3 Andere locatie zelfde ziekenhuis, transport per ambu…     5 Different locati…
#>  4 Verpleegafdeling ander ziekenhuis                        91 Nursing departme…
#>  5 Verpleegafdeling zelfde ziekenhuis                     5027 Nursing departme…
#>  6 Operatiekamer vanaf Eerste Hulp afdeling zelfde ziek…     2 Operating room f…
#>  7 Recovery zelfde ziekenhuis (alleen bij niet geplande…   217 Recovery same ho…
#>  8 Special/Medium care ander ziekenhuis                     19 Special/Medium c…
#>  9 CCU/IC ander ziekenhuis                                 239 CCU/IC other hos…
#> 10 Anders                                                   53 Otherwise        
#> 11 Eerste Hulp afdeling ander ziekenhuis                   132 Emergency depart…
#> 12 CCU/IC zelfde ziekenhuis                                296 CCU/IC same hosp…
#> 13 Huis                                                     85 House            
#> 14 Recovery ander ziekenhuis                                 6 Recovery other h…
#> 15 Operatiekamer vanaf verpleegafdeling zelfde ziekenhu…     5 Operating room f…
#> 16 Eerste Hulp afdeling zelfde ziekenhuis                 2661 Emergency depart…