You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article describes how to create an events SDTM domain using the {sdtm.oak} package. Examples are currently presented and tested in the context of the AE domain.
17
+
This article describes how to create an events SDTM domain using the `{sdtm.oak}` package. Examples are currently presented and tested in the context of the `AE` domain.
18
18
19
-
Before reading this article, it is recommended that users review some of the articles in the package documentation of {sdtm.oak} to understand some of the key concepts:
19
+
Before reading this article, it is recommended that users review some of the articles in the package documentation of `{sdtm.oak}` to understand some of the key concepts:
[Creating an Interventions Domain](https://pharmaverse.github.io/sdtm.oak/articles/interventions_domain.html), which provides a detailed explanation of various concepts in {sdtm.oak}, such as `oak_id_vars`, `condition_add`, etc. It also offers guidance on which mapping algorithms or functions to use for different mappings and provides a more detailed explanation of how these mapping algorithms or functions work.
21
+
[Creating an Interventions Domain](https://pharmaverse.github.io/sdtm.oak/articles/interventions_domain.html), which provides a detailed explanation of various concepts in `{sdtm.oak}`, such as `oak_id_vars`, `condition_add`, etc. It also offers guidance on which mapping algorithms or functions to use for different mappings and provides a more detailed explanation of how these mapping algorithms or functions work.
22
22
23
23
In this article, we will dive directly into programming and provide further explanation only where it is required.
24
24
@@ -48,7 +48,7 @@ library(dplyr)
48
48
ae_raw <- pharmaverseraw::ae_raw
49
49
```
50
50
51
-
Adverse Events Raw dataset.
51
+
Adverse Events Raw dataset
52
52
```{r eval=TRUE, echo=FALSE, purl=FALSE}
53
53
print_df(ae_raw, n = 5)
54
54
```
@@ -93,7 +93,7 @@ print_df(study_ct, n = 10)
93
93
94
94
The topic variable is mapped as a first step in the mapping process. It is the primary variable in the SDTM domain. The rest of the variables add further definition to the topic variable. In this example, the topic variable is `AETERM`. It is mapped from the raw dataset column `IT.AETERM`. The mapping logic is `Map the collected value in the ae_raw dataset IT.AETERM variable to AE.AETERM`.
95
95
96
-
This mapping does not involve any controlled terminology. The `assign_no_ct` function is used for mapping. Once the topic variable is mapped, the Qualifier, Identifier, and Timing variables can be mapped.
96
+
This mapping does not involve any controlled terminology. The `sdtm.oak::assign_no_ct()` function is used for mapping. Once the topic variable is mapped, the Qualifier, Identifier, and Timing variables can be mapped.
97
97
98
98
```{r}
99
99
ae <-
@@ -313,4 +313,4 @@ print_df(ae, n = 10)
313
313
314
314
## Add Labels and Attributes {#attributes}
315
315
316
-
Yet to be developed.
316
+
Yet to be developed. Please refer to `{metatools}` package to investigate options.
Copy file name to clipboardExpand all lines: sdtm/dm.qmd
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "DM"
3
-
order: 2
3
+
order: 1
4
4
---
5
5
6
6
```{r setup script, include=FALSE, purl=FALSE}
@@ -14,9 +14,9 @@ source("functions/print_df.R")
14
14
15
15
# Introduction
16
16
17
-
This article describes how to create a demographics(DM) domain using the {sdtm.oak} package.
17
+
This article describes how to create a demographics (`DM`) domain using the `{sdtm.oak}` package.
18
18
19
-
Before reading this article, it is recommended that users review some of the articles in the package documentation of {sdtm.oak} to understand some of the key concepts:
19
+
Before reading this article, it is recommended that users review some of the articles in the package documentation of `{sdtm.oak}` to understand some of the key concepts:
[Creating an Interventions Domain](https://pharmaverse.github.io/sdtm.oak/articles/interventions_domain.html), which provides a detailed explanation of various concepts in {sdtm.oak}, such as `oak_id_vars`, `condition_add`, etc. It also offers guidance on which mapping algorithms or functions to use for different mappings and provides a more detailed explanation of how these mapping algorithms or functions work.
Create reference date configuration file, a data frame which has the details of the variables to be used for the calculation of reference dates. The data frame should have columns listed below:
121
+
121
122
-**`raw_dataset_name`**: Name of the raw dataset.
122
123
-**`date_var`**: Date variable name from the raw dataset.
123
124
-**`time_var`**: Time variable name from the raw dataset.
124
125
-**`dformat`**: Format of the date collected in raw data.
125
126
-**`tformat`**: Format of the time collected in raw data.
126
-
-**`sdtm_var_name`**: Reference date variable name in DM domain where the raw variable is used.
127
+
-**`sdtm_var_name`**: Reference date variable name in `DM` domain where the raw variable is used.
127
128
128
129
```{r}
129
130
ref_date_conf_df <- tibble::tribble(
@@ -144,7 +145,7 @@ print_df(ref_date_conf_df)
144
145
145
146
## Map Topic Variable {#maptopic}
146
147
147
-
In DM domainSUBJID is the topic variable and it can be mapped from PATNUM using a simple mutate statement.
148
+
In `DM` domain, `SUBJID` is the topic variable and it can be mapped from `PATNUM` using a simple `dplyr::mutate()` statement.
148
149
149
150
```{r}
150
151
dm <- dm_raw %>%
@@ -160,7 +161,7 @@ print_df(dm, n = 10)
160
161
161
162
## Map Rest of the Variables {#maprest}
162
163
163
-
Map rest of the variables in DM domain using either `assign_no_ct` or `assign_ct` depending
164
+
Map rest of the variables in `DM` domain using either `sdtm.oak::assign_no_ct()` or `sdtm.oak::assign_ct()` depending
164
165
on if the variable has controlled terminologies associated.
165
166
166
167
```{r}
@@ -249,11 +250,11 @@ print_df(dm, n = 10)
249
250
250
251
## Map Reference Date Variables {#mapvars}
251
252
252
-
Use `oak_cal_ref_dates` to calculate reference dates variables in ISO8601 format.
253
+
Use `sdtm.oak::oak_cal_ref_dates()` to calculate reference dates variables in ISO 8601 format.
253
254
The function takes the raw variable names from reference date configuration file,
254
255
and calculated the minimum or maximum dates based upon the `min_max` parameter.
255
256
256
-
Variable `RFSTDTC` is the reference Start Date/time for the subject in ISO 8601 character format. Usually equivalent to date/time when subject was first exposed to study treatment. So as specified in the reference date configuration file, we need to calculate the minumum date of the `IT.ECSTDAT` for each subject from the `ec_raw` dataset. Therefore, in `min_max` parameter, "min" is selected for the calculation.
257
+
Variable `RFSTDTC` is the reference Start Date/time for the subject in ISO 8601 character format. Usually equivalent to date/time when subject was first exposed to study treatment. So as specified in the reference date configuration file, we need to calculate the minimum date of the `IT.ECSTDAT` for each subject from the `ec_raw` dataset. Therefore, in `min_max` parameter, "min" is selected for the calculation.
257
258
258
259
```{r eval=TRUE}
259
260
dm <- dm %>%
@@ -395,4 +396,4 @@ print_df(dm, n = 10)
395
396
396
397
## Add Labels and Attributes {#attributes}
397
398
398
-
Yet to be developed.
399
+
Yet to be developed. Please refer to `{metatools}` package to investigate options.
This article describes how to create a Findings SDTM domain using the {sdtm.oak} package. Examples are currently presented and tested in the context of the VS domain.
17
+
This article describes how to create a Findings SDTM domain using the `{sdtm.oak}` package. Examples are currently presented and tested in the context of the `VS` domain.
18
18
19
-
Before reading this article, it is recommended that users review some of the articles in the package documentation of {sdtm.oak} to understand some of the key concepts:
19
+
Before reading this article, it is recommended that users review some of the articles in the package documentation of `{sdtm.oak}` to understand some of the key concepts:
[Creating an Interventions Domain](https://pharmaverse.github.io/sdtm.oak/articles/interventions_domain.html), which provides a detailed explanation of various concepts in {sdtm.oak}, such as `oak_id_vars`, `condition_add`, etc. It also offers guidance on which mapping algorithms or functions to use for different mappings and provides a more detailed explanation of how these mapping algorithms or functions work.
21
+
[Creating an Interventions Domain](https://pharmaverse.github.io/sdtm.oak/articles/interventions_domain.html), which provides a detailed explanation of various concepts in `{sdtm.oak}`, such as `oak_id_vars`, `condition_add`, etc. It also offers guidance on which mapping algorithms or functions to use for different mappings and provides a more detailed explanation of how these mapping algorithms or functions work.
22
22
23
23
In this article, we will dive directly into programming and provide further explanation only where it is required.
24
24
25
25
# Programming workflow
26
26
27
-
In {sdtm.oak} we process one raw dataset at a time. Similar raw datasets (example Vital Signs - Screening (vs_raw), Vital Signs - Treatment (vs_t_raw)) can be stacked together before processing or can be processed separately.
27
+
In `{sdtm.oak}` we process one raw dataset at a time. Similar raw datasets (example Vital Signs - Screening (`vs_raw`), Vital Signs - Treatment (`vs_t_raw`)) can be stacked together before processing or can be processed separately.
SDTM annotated CRF for the vs_raw can be viewed [here](https://github.com/pharmaverse/pharmaverseraw/blob/main/vignettes/articles/aCRFs/VitalSigns_aCRF.pdf):
61
+
SDTM annotated CRF for the `vs_raw` can be viewed [here](https://github.com/pharmaverse/pharmaverseraw/blob/main/vignettes/articles/aCRFs/VitalSigns_aCRF.pdf):
62
62
63
63
## Create oak_id_vars {#oakidvars}
64
64
@@ -84,7 +84,7 @@ print_df(study_ct, n = 10)
84
84
85
85
## Map Topic Variable {#maptopic}
86
86
87
-
This raw dataset has multiple topic variables. Lets start with SYSBP. Map topic variable SYSBP from the raw variable SYS_BP.
87
+
This raw dataset has multiple topic variables. Lets start with `SYSBP`. Map topic variable `SYSBP` from the raw variable `SYS_BP`.
88
88
89
89
```{r}
90
90
# Map topic variable SYSBP
@@ -108,7 +108,7 @@ print_df(vs_sysbp, n = 10)
108
108
109
109
## Map Rest of the Variables {#maprest}
110
110
111
-
Map rest of the variables applicable to the topic variable SYSBP. This can include qualifiers, identifier and timing variables.
111
+
Map rest of the variables applicable to the topic variable `SYSBP`. This can include qualifiers, identifier and timing variables.
112
112
113
113
```{r}
114
114
## Map Rest of the Variables
@@ -157,7 +157,7 @@ print_df(vs_sysbp, n = 10)
157
157
158
158
## Repeat Map Topic and Map Rest {#repeatsteps}
159
159
160
-
This raw data source has other topic variables DIABP, PULSE, HEIGHT, WEIGHT, TEMP and its corresponding qualifiers. Repeat mapping topic and qualifiers for each topic variable.
160
+
This raw data source has other topic variables `DIABP`, `PULSE`, `HEIGHT`, `WEIGHT`, `TEMP` and its corresponding qualifiers. Repeat mapping topic and qualifiers for each topic variable.
161
161
162
162
```{r}
163
163
# Repeat Map Topic and Map Rest
@@ -519,4 +519,4 @@ print_df(vs)
519
519
520
520
## Add Labels and Attributes {#attributes}
521
521
522
-
Yet to be developed.
522
+
Yet to be developed. Please refer to `{metatools}` package to investigate options.
0 commit comments