Code Monkey home page Code Monkey logo

linkr-content's Introduction

InterHop

InterHop is a French non-profit association. It promotes, develops and provides free and open-source software for health.

InterHop unites activists advocating for open source software and the self-managed utilization of health data at the local level.

We are a collective comprised of engineers, lawyers, health professionals and patients.

Here's the open-source content we share for the LinkR application.

Studies

No studies available.

Plugins - Patient-level data

Notes
R console

1) Description

This plugin allows you to execute code in the R console and save your code as scripts.

2) Usage

Click here to show / hide content

a) Scripts management

Go to the "Scripts management" tab to add, delete, or rename scripts.

A script is a text file containing code.

Once a script is created, you can edit it in the "Script" tab and execute the code.

b) R code

Write R code and execute it: the result returned by the console will appear below the text editor.

To know the data model used by the application, click on the help button (question mark at the top right of the page) when you are on the "Data / Access Data" page.

Example code (get the min, max, and average heart rate of our patients):

d$measurement %>%
    dplyr::filter(measurement_concept_id == 3027018) %>%
    dplyr::group_by(person_id) %>%
    dplyr::summarize(min_weight = min(value_as_number), max_weight = max(value_as_number), avg_weight = mean(value_as_number)) %>%
    dplyr::ungroup()



c) RMarkdown

You can also write code in Rmarkdown.

This is Markdown to which you can add R code.

For more information on RMarkdown, visit their site.

Example code (the same example as above, in RMarkdown - a backslash has been added to prevent code execution):

# Script on heart rate

\```{r}
d$measurement %>%
    dplyr::filter(measurement_concept_id == 3027018) %>%
    dplyr::group_by(person_id) %>%
    dplyr::summarize(min_weight = min(value_as_number), max_weight = max(value_as_number), avg_weight = mean(value_as_number)) %>%
    dplyr::ungroup()
\```




d) Figure

You can create figures, for example with the ggplot2 library.

Here's an example of code:

# A list containing the data for the plot
data <- list()

# Filter data
data$x <- d$measurement %>% dplyr::filter(measurement_concept_id == 3027018)

# Create ggplot2 plot
data$x %>%
    ggplot2::ggplot(ggplot2::aes(x = value_as_number)) +
    ggplot2::geom_histogram(bins = 50, fill = "#377EB8", color = "#FFFFFF") +
    ggplot2::theme_minimal() +
    ggplot2::labs(x = "Heart rate (bpm)", y = "")


Séries temporelles {dygraphs}
Séries temporelles {vistime}
Tableau {DT}

Plugins - Aggregated data

Plot (ggplot2)

1) Description

This plugin uses the R library ggplot2, allowing the creation of plots from data.

2) Usage

Click here to show / hide content

a) Manage scripts

In order to save multiple plots to a single widget, you can create scripts from the "Scripts management" tab.

You can also rename and delete scripts from this tab.

A script includes:

  • The parameters saved on a plot, from the "Plot" tab.
  • The code corresponding to that plot, from the "Code" tab.

Once a script is created, select it from the "Plot" or "Code" tab.

Save this script after making changes.




b) Configure a plot

Go to the "Plot" tab.

Choose the variable to display on each axis in the "Variables" tab.

Some plots will have a variable on only one axis (geom_histogram), while others will only display if variables are specified on both axes (geom_point).

For each plot, choose:

  • The theme of the plot.
  • The text for the x axis.
  • The text for the y axis (whether a variable is assigned to it or not).

In the "Variables" tab, it's possible to group data, by patient or by time. Then choose the function to apply to group the data.

For example:

  • Group data by patient by selecting the "maximum" function: the maximum value of the parameter, across all stays, will be chosen for each patient.
  • Group data every 4 hours by selecting the "average" function: the maximum value will be chosen for each 4-hour interval, for each patient (thus, multiple data points per patient).

By checking "Show plot at script launch", the plot will be displayed upon the script's loading.




c) Display the code

By clicking on "Generate Code" from the "Plot" tab, the code corresponding to the plot will be generated in the text editor, in the "Code" tab.

You can edit this code and save your changes.

If you click on Generate Code again, your code will be deleted and replaced by the default code corresponding to the plot configured in the "Plot" tab.

Click on "Run code" to display the plot corresponding to the code.

By checking "Run code at script launch", the code will be executed upon the script's loading.


3) Available plots

Click here to show / hide content

a) Histogram (geom_histogram)

Allows visualization of the distribution of a single continuous variable by dividing the x-axis into intervals and counting the number of observations in each interval.

You can choose the size of the bars in two ways:

  • Either by the size of the bars, depending on the x-axis (a size of 50 means a bar will take up 50 of the unit specified on the x-axis).
  • Or by the number of total bars displayed.



b) Scatter plot (geom_point)

Allows visualization of the distribution of two continuous variables, one on the x-axis and the other on the y-axis.

By default, only points having a value at a given moment both for the x variable and for the y variable will be displayed.

For instance, if I choose systolic blood pressure for x and mean arterial pressure for y (as in the example), and I have an x value on a certain day at 18:37:10 and a y value on the same day at 18:37:11, since the moments aren't exactly the same, there won't be a corresponding point on the graph.

To counter this, it is possible to group data, by patient or by time (see Usage section).

R console

1) Description

This plugin allows you to execute code in the R console and save your code as scripts.

2) Usage

Click here to show / hide content

a) Scripts management

Go to the "Scripts management" tab to add, delete, or rename scripts.

A script is a text file containing code.

Once a script is created, you can edit it in the "Script" tab and execute the code.

b) R code

Write R code and execute it: the result returned by the console will appear below the text editor.

To know the data model used by the application, click on the help button (question mark at the top right of the page) when you are on the "Data / Access Data" page.

Example code (get the min, max, and average heart rate of our patients):

d$measurement %>%
    dplyr::filter(measurement_concept_id == 3027018) %>%
    dplyr::group_by(person_id) %>%
    dplyr::summarize(min_weight = min(value_as_number), max_weight = max(value_as_number), avg_weight = mean(value_as_number)) %>%
    dplyr::ungroup()



c) RMarkdown

You can also write code in Rmarkdown.

This is Markdown to which you can add R code.

For more information on RMarkdown, visit their site.

Example code (the same example as above, in RMarkdown - a backslash has been added to prevent code execution):

# Script on heart rate

\```{r}
d$measurement %>%
    dplyr::filter(measurement_concept_id == 3027018) %>%
    dplyr::group_by(person_id) %>%
    dplyr::summarize(min_weight = min(value_as_number), max_weight = max(value_as_number), avg_weight = mean(value_as_number)) %>%
    dplyr::ungroup()
\```




d) Figure

You can create figures, for example with the ggplot2 library.

Here's an example of code:

# A list containing the data for the plot
data <- list()

# Filter data
data$x <- d$measurement %>% dplyr::filter(measurement_concept_id == 3027018)

# Create ggplot2 plot
data$x %>%
    ggplot2::ggplot(ggplot2::aes(x = value_as_number)) +
    ggplot2::geom_histogram(bins = 50, fill = "#377EB8", color = "#FFFFFF") +
    ggplot2::theme_minimal() +
    ggplot2::labs(x = "Heart rate (bpm)", y = "")


Scripts

No scripts available.

Datasets

MIMIC-III
MIMIC-IV demo

Vocabularies

MIMIC-III
MIMIC-IV demo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.