View source: R/getConditionEra.R
getConditionEra | R Documentation |
Conditions era is used to integrate distributed data of clinical records into a single progression record.
getConditionEra(
dxDataFile,
idColName,
icdColName,
dateColName,
icdVerColName = NULL,
icd10usingDate = NULL,
groupDataType = ccs,
customGroupingTable,
isDescription = TRUE,
gapDate = 30,
selectedCaseFile = NULL
)
dxDataFile |
A data frame object of clinical diagnostic data with at least 3 columns: ID, ICD, and Date. As for date column, the data format should be YYYY/MM/DD or YYYY-MM-DD. |
idColName |
Column name of ID column in dxDataFile. Data type of this argumant should be string without quotation marks. |
icdColName |
Column name of ICD column in dxDataFile. Data type of this argumant should be string without quotation marks. |
dateColName |
Column name of date column in dxDataFile, and the type of date column should be a date format in R or a string format with date information in YYYY/MM/DD or YYYY-MM-DD. Data type of this argumant should be string without quotation marks. |
icdVerColName |
(Optional) Column name if there is a columns to record ICD-9/10 version used in dxDataFile. In this column, data format should be numeric 9L or 10L to indicate which ICD version is used for each cell. See examples below to get more information. |
icd10usingDate |
The date that ICD-10 was started to be used in dxDataFile dataset. The data format should be YYYY/MM/DD or YYYY-MM-DD. Necessary if icdVerColName is null. |
groupDataType |
Five Stratified methods can be chosen: CCS ( |
customGroupingTable |
Used-defined grouping categories. |
isDescription |
Binary. If true, category description of classification methods will be used in the group column. If false, category name will be used. By default, it is set to be |
gapDate |
Length of condition gap with numeric data type, By default, it set to 30 days |
selectedCaseFile |
A data frame with the label of case selected or not. Can be generated by |
This function calculates condition era by grouped categories of each patient.
A new data.table
based on classifying dxDataFile
and calculated condition era by groupDataType
for each patient.
Other data integration functions: selectCases
, splitDataByDate
, getEligiblePeriod
# sample file for example
head(sampleDxFile)
# Select case with "Diseases of the urinary system" by level 2 of CCS classification
selectedCaseFile <- selectCases(sampleDxFile, ID, ICD, Date,
icdVerColName = NULL,
icd10usingDate = "2015/10/01",
groupDataType = ccslvl2,
caseCondition = "Diseases of the urinary system",
caseCount = 1)
# Condition era calculation with case selection
Era1 <- getConditionEra(sampleDxFile, ID, ICD, Date, icdVerColName = NULL, "2015-10-01",
groupDataType = CCSlvl3,
selectedCaseFile = selectedCaseFile)
head(Era1)
# Define the grouping categories
grepTable <- data.frame(Group = "Chronic kidney disease",
grepIcd = "^58|^N18",
stringsAsFactors = FALSE)
# Condition era calculation with grouping custom method of code standardization
Era2 <- getConditionEra(sampleDxFile, ID, ICD, Date, icdVerColName = NULL, "2015-10-01",
groupDataType = customGrepIcdGroup,
customGroupingTable = grepTable)
head(Era2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.