Create a DataTable plugin
Create a DataTable Plugin to display patient measurement data.
Step 1: SQL requests
Utilize the OMOP CDM measurement table to:
- Select data for a specific patient.
- Choose one or multiple variables (e.g.,
measurement_concept_id
3024171 for Respiratory Rate and 3027018 for Heart Rate). - Apply a date range filter using
measurement_datetime
. - Transform data from a long to a wide format, creating 4 equal time intervals.
For instance, with a min_datetime
of 2023-01-03 08:00 and a max_datetime
of 2023-01-05 08:00, divide the range into 4 intervals: from 2023-01-03 08:00 to 20:00, 2023-01-03 20:00 to 2023-01-04 08:00, etc.
Access test data at Physionet's MIMIC-IV demo OMOP dataset. Note: Convert person_id
to integers as the dataset contains negative values.
Step 2: User interface / Front-end
Specs:
- Implement a datetime selector allowing users to choose both the start and end of the time interval.
- Incorporate a toggle switch for users to select between two display formats:
-
Vertical data display: Show data in its native format as per the OMOP measurement table, with separate columns for
concept_id
,value_num
, andmeasurement_datetime
. - Horizontal data display: Arrange data to show time intervals as columns, transforming the dataset into a wide format for a different analytical perspective.
-
Vertical data display: Show data in its native format as per the OMOP measurement table, with separate columns for
- Provide a numeric input field where users can specify the number of time intervals they wish to display.
Using Shiny
Develop a Shiny App in R or Python, starting with the [dev] Template plugin from the InterHop git repository for LinkR.
Refer to this tutorial for guidance on creating a LinkR plugin.
Alternative web app libraries
Consider using Dash, Streamlit, or other web application frameworks.
Step 3: Back-end development
Depending on your choice in Step 2, implement the back-end logic using either Python or R.