getControlSubj {sendigR}R Documentation

Extract a list of control animals for a list of studies

Description

Returns a data table with a list of animals belonging to the groups for negative control in the given list of studies.

Usage

getControlSubj(dbToken, studyList, inclUncertain = FALSE)

Arguments

dbToken

Mandatory.
Token for the open database connection (see initEnvironment).

studyList

Mandatory, data.table.
A table with a list of studies to limit the output to be within this set of studies.
The table must include a column named 'STUDYID'.

inclUncertain

Mandatory, boolean.
Indicates whether animals, which cannot be identified as neither negative nor positive control (i.e. uncertain animals), shall be included or not in the output data table.

Details

The set of animals contains all animals from DM where the SETCD is associated with a TX parameter 'TCNTRL'. Negative control animals are further defined by

Animals are in all cases excluded (i.e. whether inclUncertain=TRUE or inclUncertain=FALSE) from the output set, when they are identified as positive control animals - i.e. they are associated with a TX parameter 'TCNTRL' containing a word from this set of words:

The age in days at reference start date is calculated for each animal based on the age related variables in DM:

  1. If BRTHDTC is populated compute DM.RFSTDTC – DM.BRTHDTC + 1

  2. Else If AGE is populated convert from units specified in AGEU to days.

  3. Else If AGETXT is populated convert the mid-point of the range from units specified in AGEU to days.
    These AGEU units are handled with the described conversion from value to number of days:

    • DAYS

    • WEEKS : value * 7

    • MONTHS : value * 365/12

    • YEARS : value * 365

If input parameter inclUncertain=TRUE, uncertain animals are included in the output set. These uncertain situations are identified and reported (in column UNCERTAIN_MSG):

Value

The function return a data.table with columns:

Examples

## Not run: 
controlAnimals <- getControlSubj(myDbToken, allSTudies)

## End(Not run)

[Package sendigR version 1.0.0 Index]