item2d <- c("h_rate", "bp_m_a", "bp_sys_a", "lactate_abg", "bilirubin",
            "fluid_balance_h", "pao2_abg")

new.config <- function(items) {
    conf <- list()
    for (i in items) conf[[stname2code(i)]] <- list()
    conf
}

cctb <- create.cctable(ccd, conf=new.config(item2d), freq=1)$torigin

suppressWarnings(library(pander))
panderOptions("digits", 2) 
panderOptions("table.split.table", Inf)
demg <- sql.demographic.table(ccd)

Data Summary

dp <- total.data.point(ccd)
np <- max(ccd@infotb$pid, na.rm=TRUE)

This database contains r ccd@nepisodes episode data from r length(s[s!="NA"]) sites. Based on the NHS numbers and PAS numbers, we can identify r np unique patients, among which the earliest admission is r min(ccd@infotb$t_admission, na.rm=TRUE) and the latest discharge time is r max(ccd@infotb$t_discharge, na.rm=TRUE). There are r dp total data points found in the current database, which makes in average r round(dp/np) per unique patient.

Site reference

pander(as.data.frame(site.info()[, 1:3], style="rmarkdown"))

The original XML files and parse information

fs <- file.summary(ccd)
pander(as.data.frame(fs[, c("File", "Number of Episode", "Sites"), with=FALSE]))
xml.file.duration.plot(ccd)
xml.site.duration.plot(ccd)

\newpage

table1(demg, c("SEX", "ETHNIC", "LOCA", "DIS", "HDIS"))

Completeness

Demographic data completeness

demographic.data.completeness(demg)

Sample period of time-wise data

This is the section to show the completeness of some key time-wise data, e.g. physiological data. The completeness of data is measured by sample period. The sample period $P$ is defined as the ratio of the total admission hour $T$ to the number of valid hours $D$ where data can be found. $$P = \frac{T}{D}$$

samplerate2d(cctb)

\newpage

Data Distribution

Demographic

demg.distribution(demg, c("HCM", "apache_score"))

Physiological & Drugs

physio.distribution(cctb, item2d)


ropensci/cleanEHR documentation built on Aug. 28, 2022, 8:31 p.m.