clinical_xml_to_table: clinical_xml_to_table

View source: R/clinical_xml_to_table.R

clinical_xml_to_tableR Documentation

clinical_xml_to_table

Description

convert xml to a table

Usage

clinical_xml_to_table(
  xml_data,
  data_items = c("Time/Day", "Time/Hour", "Time/Minute", "Time/Second", "ReadingStatus",
    "ErrorStatus", "Systolic", "Diastolic", "MeanArterialPressure", "HeartRate",
    "PulsePressure", "CoefficientOfVariability", "DiaryEventAnnotation", "Excluded"),
  data_types = c("i", "i", "i", "i", "c", "c", "i", "i", "i", "i", "i", "i", "c", "c"),
  parent_level = "//Measurements/Measurement/"
)

Arguments

xml_data

this is the clinical_data list element produced from the read_rsntl() function

data_items

this is a vector of items that are wanted the default

data_types

this is a vector of data types for items that are wanted

parent_level

this is the common parent level in the xml below which the dataitems are located

Details

This is probably heavily dependent on the version of the data file format and could need regular ammending it. The dataitems and parentlevel parameters are an attempt to make this flexible but possibly will not be sufficient.

Value

A tibble with the columns representing the data items

Examples

xml_data <- read_rsntl(system.file("extdata","2013_B_07-01-2021_13-49-43.RSNTL",package="sentinelreadr"))
tables <- lapply(xml_data$clinical_data,clinical_xml_to_table)


PietaSchofield/sentinelreadr documentation built on Aug. 9, 2024, 11:41 p.m.