selectCases | R Documentation |
This query function can select the cases matching defined conditions for analyses.
selectCases(
dxDataFile,
idColName,
icdColName,
dateColName,
icdVerColName = NULL,
icd10usingDate = NULL,
groupDataType = CCS,
customGroupingTable,
isDescription = TRUE,
caseCondition,
caseCount = 2,
periodRange = c(30, 365),
caseName = "Selected"
)
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 |
caseCondition |
Certain diseases to be selected. The condition can be specific ICD, CCS category description, etc. String with regular expression is also supported. |
caseCount |
Minimum number of diagnoses time to be selected. If |
caseName |
Value to identify selected or not. The value will be filled in the labeling column called |
PeriodRange |
Determine duration of interest for performing the case selection. By default, it is set from 30 to 365 days (with argument |
User can select cases by diagnostic categories, such as CCS category, ICD codes, etc. The function also provides the options to set the minimum number of diagnoses within a specific duration. The output dataset can be passed to 'groupedDataLongToWide' to create tables in wide format for statistical analytic usage.
A new data.table
based on standard classification dataset with a new column: selectedCase
, in which each cell is labeled as selected or not. If the patient was diagnosed with certain diseases, but the selection condition is not satisfied, then the selectedCase
cell will be labeled with a star (*).
Other data integration functions: splitDataByDate
, getEligiblePeriod
, getConditionEra
# sample file for example
head(sampleDxFile)
#select case with "Diseases of the urinary system" by level 2 of CCS classification
selectCases(dxDataFile = sampleDxFile,
ID, ICD, Date,
icdVerColName = NULL,
groupDataType = ccslvl2,
icd10usingDate = "2015/10/01",
caseCondition = "Diseases of the urinary system",
caseCount = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.