Enable the Shiny app to accept URL parameters (e.g., ?codelist=opensafely/anxiety-disorders/6aef605a) to automatically load codelists when the app starts, improving integration with OpenCodelists.org and user experience.
Currently, users must manually copy-paste codelist slugs into the app. Direct linking from http://opencodelists.org/ would imporove the workflow and make the tool more accessible for researchers exploring code usage patterns of codelists.
Proposed Implementation
- URL parameter parsing: Use parseQueryString() to extract codelist parameter from URL
- Automatic text input population: Update codelist_slug text input using updateTextInput()
- Programmatic button trigger: Automatically trigger the "Load codelist" action button
Technical approach
- Parse URL parameters in
server.R using session$clientData$url_search
- Check for codelist parameter on app initialisation
- If present, populate the text input and simulate button click
- Handle error cases gracefully (invalid codelist slugs, network issues)
Future enhancements
- Support multiple parameters (dataset, date_range)
- Validation of codelist compatibility with selected dataset
Acceptance Criteria
Enable the Shiny app to accept URL parameters (e.g.,
?codelist=opensafely/anxiety-disorders/6aef605a) to automatically load codelists when the app starts, improving integration with OpenCodelists.org and user experience.Currently, users must manually copy-paste codelist slugs into the app. Direct linking from http://opencodelists.org/ would imporove the workflow and make the tool more accessible for researchers exploring code usage patterns of codelists.
Proposed Implementation
Technical approach
server.Rusingsession$clientData$url_searchFuture enhancements
Acceptance Criteria
?codelist=URL parameter