Count the number Red Blood Cell (RBC) Transfusions per encounter
n_rbc_transfusions.Rd
This function calculates the number of appropriate transfusions and total of all transfusions per encounter. The definition of an appropriate transfusion can be found on the sample My Practice Report. A transfusion is defined by procedure in the below codes:
An appropriate transfusion also requires that the patients pre-transfusion hemoglobin levels are below 80 g/L. The Athena definition of a hemoglobin test: 3000963
Red blood cell transfusions with no hemoglobin measurement within 48 hours prior to the transfusion are excluded. These scenarios are rare, typically occurring in approximately 2% of blood transfusions in GEMINI data.
Arguments
- dbcon
(
DBIConnection
)
A database connection to any GEMINI database. OnlyDBI
connection is accepted asodbc
connection may cause connection issues in certain environment.- cohort
(
data.frame
ordata.table
) Cohort table with all relevant encounters of interest where each row corresponds to a single encounter. Must contain the following columns:genc_id
(integer
): GEMINI encounter IDhospital_num
(integer
): Hospital number
- exclude_ed
(
logical
) Whether to exclude transfusions in emergency department. When set toTRUE
, transfusions performed in ED (before admission time) will not be counted. When set toFALSE
, transfusions will not be filtered by time and all RBC transfusions intransfusion
table will be counted. Please be aware that this may include transfusions before triage time, transfusions after discharge time, and transfusions without issuing time.Transfusions in ED are defined as
issue_date_time
earlier thanadmission_date_time
. Transfusions with missingissue_date_time
will be excluded whenexclude_ed
is set toTRUE
.
Value
(data.table
)
Table with three columns: genc_id
, n_app_rbc_transfusion_derived
(number
of appropriate RBC transfusions), and n_rbc_transfusion_derived
(total of
all RBC transfusions). Encounters without any transfusion will get a 0.
Note
Transfusion data from two hospitals with known data quality issues are
automatically removed by this function. Any genc_ids
from those sites are
not included in the returned output. When merging the output of this function
with another table, those genc_ids
should have a value of NA
.
Currently, the function does not take transfusion
or lab
data coverage
into account. For patients without RBC transfusion, the function will return
0
in result columns. User should check transfusion and lab data coverage and
decide whether the imputed 0
s are appropriate or not.