Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added ecg domain + QT charts #90

Merged
merged 4 commits into from
Oct 19, 2021
Merged

added ecg domain + QT charts #90

merged 4 commits into from
Oct 19, 2021

Conversation

xni7
Copy link
Contributor

@xni7 xni7 commented Oct 11, 2021

Address #81

Summary

This is based on the hard coded prototype , formalized into the {safetyCharts} pkg structure

Test Code

# Sample ADEG data
# https://physionet.org/content/ecgcipa/1.0.0/
# https://physionet.org/content/ecgcipa/1.0.0/adeg.csv

adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download") %>%
  mutate(ATPTFCT = forcats::fct_reorder(ATPT, .x = ATPTN, .fun = min)) %>%
  mutate(ANRHI=0, ANRLO=0)


meta_new <- rbind(safetyGraphics::meta, safetyCharts::metaecg)
chartsQT <- makeChartConfig() 


mappings_QT <- read_yaml(text=
"
ecg:
  visit_col: ATPT
  visitn_col: ATPTN
")

safetyGraphicsApp(charts=chartsQT, domainData = list(ecg=adeg), meta = meta_new, mapping = mappings_QT)

@xni7 xni7 requested a review from jwildfire October 11, 2021 15:06
@xni7 xni7 linked an issue Oct 11, 2021 that may be closed by this pull request
@jwildfire
Copy link
Contributor

Looks great, @xni7! Test code above works with no edits on my end.

Going to think a little bit about workflow details for the charts we want to re-use across multiple domains. At the very least, I think we should be able to share the init functions across domains in many cases. Would be nice to avoid the duplication of the chart YAML as well, but will need to think about that (and maybe update safetyGraphics).

@xni7 xni7 requested a review from samussiah October 15, 2021 14:16
@jwildfire
Copy link
Contributor

@xni7 This is working great! I set this up to use the same init functions as the labs domain, and made some minor tweaks to standardize things and clear checks. Going to work on incorporating in to work shop now. Going to go ahead and merge - can tweak further with a different PR if needed.

My test code

adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download") %>%
  mutate(ATPTFCT = forcats::fct_reorder(ATPT, .x = ATPTN, .fun = min)) %>%
  mutate(ANRHI=0, ANRLO=0)

mappingsQT <- list(
  ecg=list(
    'visit_col'='ATPT',
    'visitn_col'='ATPTN'
  )
)

safetyGraphicsApp(
    domainData = list(ecg=adeg), 
    meta = safetyCharts::meta_ecg, 
    mapping = mappingsQT
)

@jwildfire jwildfire merged commit 00731ee into dev Oct 19, 2021
@jwildfire jwildfire deleted the 81-qt-prototype branch March 23, 2022 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QT prototype
2 participants