Skip to contents

fix_survey_names() is a convenience function for reformatting MH Survey names as they appear in the Qualtrics UI to something more legible. fix_campus_names() is a similar convenience function that reformats full campus names to their shorthand equivalent.

Usage

fix_survey_names(.data)

fix_campus_names(.data)

Arguments

.data

A tibble. fix_survey_names() requires the column survey_name to be present. fix_campus_names() requires the column campus to be present.

Examples

# list of survey names as they appear in the qualtrics ui
surveys <-
  tibble::tibble(
    survey_name = c("Live - Adult Day Surgery",
                    "Live - Adult Emergency Department",
                    "Live - Adult Inpatient Rehab",
                    "Live - Adult Medical Practice",
                    "Live - Adult Outpatient",
                    "Live - Adult Outpatient - Oncology",
                    "Live - Adult Outpatient - Vaccine",
                    "Live - Adult Outpatient Rehab",
                    "Live - Adult Telemedicine",
                    "Live - Adult Urgent Care",
                    "Live - HCAHPS - Paper",
                    "Live - Home Medical Equipment",
                    "Live - Infusion Pharmacy",
                    "Live - Inpatient",
                    "Live - Pediatric - Emergency Department",
                    "Live - Pediatric Inpatient")
  )

# bad names!
surveys
#> # A tibble: 16 × 1
#>    survey_name                            
#>    <chr>                                  
#>  1 Live - Adult Day Surgery               
#>  2 Live - Adult Emergency Department      
#>  3 Live - Adult Inpatient Rehab           
#>  4 Live - Adult Medical Practice          
#>  5 Live - Adult Outpatient                
#>  6 Live - Adult Outpatient - Oncology     
#>  7 Live - Adult Outpatient - Vaccine      
#>  8 Live - Adult Outpatient Rehab          
#>  9 Live - Adult Telemedicine              
#> 10 Live - Adult Urgent Care               
#> 11 Live - HCAHPS - Paper                  
#> 12 Live - Home Medical Equipment          
#> 13 Live - Infusion Pharmacy               
#> 14 Live - Inpatient                       
#> 15 Live - Pediatric - Emergency Department
#> 16 Live - Pediatric Inpatient             

# better names!
fix_survey_names(surveys)
#> # A tibble: 16 × 1
#>    survey_name           
#>    <chr>                 
#>  1 Day Surgery           
#>  2 Emergency             
#>  3 Inpatient Rehab       
#>  4 Medical Practice      
#>  5 Outpatient            
#>  6 Outpatient Oncology   
#>  7 Outpatient Vaccine    
#>  8 Outpatient Rehab      
#>  9 Telemedicine          
#> 10 Urgent Care           
#> 11 HCAHPS                
#> 12 Home Medical Equipment
#> 13 Infusion Pharmacy     
#> 14 Inpatient             
#> 15 Pedi Emergency        
#> 16 Pedi Inpatient        

# list of campus names as they appear in the qualtrics ui
campuses <-
  tibble::tibble(
    campus = c("Children's Memorial Hermann Hospital",
               "Memorial Hermann - Texas Medical Center",
               "Memorial Hermann / Rockets Orthopedic Hospital",
               "Memorial Hermann Cypress Hospital",
               "Memorial Hermann Greater Heights Hospital",
               "Memorial Hermann Katy Hospital",
               "Memorial Hermann Memorial City Medical Center",
               "Memorial Hermann Northeast Hospital",
               "Memorial Hermann Pearland Hospital",
               "Memorial Hermann Rehabilitation Hospital - Katy",
               "Memorial Hermann Southeast Hospital",
               "Memorial Hermann Southwest Hospital",
               "Memorial Hermann Sugar Land Hospital",
               "Memorial Hermann The Woodlands Medical Center",
               "TIRR Memorial Hermann")
  )

# bad names!
campuses
#> # A tibble: 15 × 1
#>    campus                                         
#>    <chr>                                          
#>  1 Children's Memorial Hermann Hospital           
#>  2 Memorial Hermann - Texas Medical Center        
#>  3 Memorial Hermann / Rockets Orthopedic Hospital 
#>  4 Memorial Hermann Cypress Hospital              
#>  5 Memorial Hermann Greater Heights Hospital      
#>  6 Memorial Hermann Katy Hospital                 
#>  7 Memorial Hermann Memorial City Medical Center  
#>  8 Memorial Hermann Northeast Hospital            
#>  9 Memorial Hermann Pearland Hospital             
#> 10 Memorial Hermann Rehabilitation Hospital - Katy
#> 11 Memorial Hermann Southeast Hospital            
#> 12 Memorial Hermann Southwest Hospital            
#> 13 Memorial Hermann Sugar Land Hospital           
#> 14 Memorial Hermann The Woodlands Medical Center  
#> 15 TIRR Memorial Hermann                          

# better names!
fix_campus_names(campuses)
#> # A tibble: 15 × 1
#>    campus         
#>    <chr>          
#>  1 CMHH           
#>  2 TMC            
#>  3 MHROH          
#>  4 Cypress        
#>  5 Greater Heights
#>  6 Katy           
#>  7 Memorial City  
#>  8 Northeast      
#>  9 Pearland       
#> 10 Katy Rehab     
#> 11 Southeast      
#> 12 Southwest      
#> 13 Sugar Land     
#> 14 Woodlands      
#> 15 TIRR