-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathdata.R
More file actions
435 lines (421 loc) · 22.3 KB
/
Copy pathdata.R
File metadata and controls
435 lines (421 loc) · 22.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
#' Example `QS` Dataset
#'
#' An example `QS` dataset based on the examples from the CDISC ADaM Supplements
#' [Generalized Anxiety Disorder 7-Item Version 2
#' (GAD-7)](https://www.cdisc.org/standards/foundational/qrs/generalized-anxiety-disorder-7-item-version-2-0)
#' and [Geriatric Depression Scale Short Form
#' (GDS-SF)](https://www.cdisc.org/standards/foundational/qrs/geriatric-depression-scale-short-form-0).
#' @keywords datasets
#' @family datasets
#' @source
#' Created by (\url{https://github.com/pharmaverse/admiral/blob/main/data-raw/create_example_qs.R})
"example_qs"
#' Queries Dataset
#' @keywords datasets
#' @family datasets
#' @source
#' An example of standard query dataset to be used in deriving Standardized
#' MedDRA Query variables in ADAE
#'
"queries"
#' Queries MH Dataset
#' @keywords datasets
#' @family datasets
#' @source
#' An example of standard query MH dataset to be used in deriving Standardized
#' MedDRA Query variables in ADMH
#'
"queries_mh"
#' Subject Level Analysis Dataset
#'
#' An example subject level analysis dataset
#' @keywords datasets
#' @family datasets
#' @source
#' Derived from the `dm` and `ds` datasets using `{admiral}` (\url{https://github.com/pharmaverse/admiral/blob/main/inst/templates/ad_adsl.R})
#'
"admiral_adsl"
#' Lab Analysis Dataset
#'
#' An example of lab analysis dataset
#' @keywords datasets
#' @family datasets
#' @source
#' Derived from the `adlb` template, then further filtered
#' due to dataset size by the following USUBJIDs:
#' 01-701-1015, 01-701-1023, 01-701-1028, 01-701-1033,
#' 01-701-1034, 01-701-1047, 01-701-1097, 01-705-1186,
#' 01-705-1292, 01-705-1310, 01-708-1286
#'
"admiral_adlb"
#' Metadata Holding Grading Criteria for NCI-CTCAEv4 using SI unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/ncictcaev4.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `Grade 1`: Criteria defining lab value as Grade 1.
#' - `Grade 2`: Criteria defining lab value as Grade 2.
#' - `Grade 3`: Criteria defining lab value as Grade 3.
#' - `Grade 4`: Criteria defining lab value as Grade 4.
#' - `Grade 5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold SI unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on NCI-CTC website defining the grading criteria.
#' [**Common Terminology Criteria for Adverse Events (CTCAE)v4.0**](https://dctd.cancer.gov/research/ctep-trials/trial-development#ctcae-and-ctep-codes)
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_ctcv4"
#' Metadata Holding Grading Criteria for NCI-CTCAEv4 using USCV unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/ncictcaev4_uscv.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `Grade 1`: Criteria defining lab value as Grade 1.
#' - `Grade 2`: Criteria defining lab value as Grade 2.
#' - `Grade 3`: Criteria defining lab value as Grade 3.
#' - `Grade 4`: Criteria defining lab value as Grade 4.
#' - `Grade 5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold USCV unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on NCI-CTC website defining the grading criteria.
#' [**Common Terminology Criteria for Adverse Events (CTCAE)v4.0**](https://dctd.cancer.gov/research/ctep-trials/trial-development#ctcae-and-ctep-codes)
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_ctcv4_uscv"
#' Metadata Holding Grading Criteria for NCI-CTCAEv5 using SI unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/ncictcaev5.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `Grade 1`: Criteria defining lab value as Grade 1.
#' - `Grade 2`: Criteria defining lab value as Grade 2.
#' - `Grade 3`: Criteria defining lab value as Grade 3.
#' - `Grade 4`: Criteria defining lab value as Grade 4.
#' - `Grade 5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold SI unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on NCI-CTC website defining the grading criteria.
#' [**Common Terminology Criteria for Adverse Events (CTCAE)v5.0**](https://dctd.cancer.gov/research/ctep-trials/for-sites/adverse-events#ctep-ctcae)
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_ctcv5"
#' Metadata Holding Grading Criteria for NCI-CTCAEv5 using USCV unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/ncictcaev5_uscv.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `Grade 1`: Criteria defining lab value as Grade 1.
#' - `Grade 2`: Criteria defining lab value as Grade 2.
#' - `Grade 3`: Criteria defining lab value as Grade 3.
#' - `Grade 4`: Criteria defining lab value as Grade 4.
#' - `Grade 5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold USCV unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on NCI-CTC website defining the grading criteria.
#' [**Common Terminology Criteria for Adverse Events (CTCAE)v5.0**](https://dctd.cancer.gov/research/ctep-trials/for-sites/adverse-events#ctep-ctcae)
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_ctcv5_uscv"
#' Metadata Holding Grading Criteria for NCI-CTCAEv6 using SI unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/ncictcaev6.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `Grade 1`: Criteria defining lab value as Grade 1.
#' - `Grade 2`: Criteria defining lab value as Grade 2.
#' - `Grade 3`: Criteria defining lab value as Grade 3.
#' - `Grade 4`: Criteria defining lab value as Grade 4.
#' - `Grade 5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold SI unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on NCI-CTC website defining the grading criteria.
#' [**Common Terminology Criteria for Adverse Events (CTCAE)v6.0**](https://dctd.cancer.gov/research/ctep-trials/for-sites/adverse-events#ctep-ctcae)
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_ctcv6"
#' Metadata Holding Grading Criteria for NCI-CTCAEv6 using USCV unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/ncictcaev6_uscv.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `GRADE_1`: Criteria defining lab value as Grade 1.
#' - `GRADE_2`: Criteria defining lab value as Grade 2.
#' - `GRADE_3`: Criteria defining lab value as Grade 3.
#' - `GRADE_4`: Criteria defining lab value as Grade 4.
#' - `GRADE_5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold USCV unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on NCI-CTC website defining the grading criteria.
#' [**Common Terminology Criteria for Adverse Events (CTCAE)v6.0**](https://dctd.cancer.gov/research/ctep-trials/for-sites/adverse-events#ctep-ctcae)
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_ctcv6_uscv"
#' Metadata Holding Grading Criteria for DAIDs using SI unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/DAIDS.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `SUBGROUP` : Description of sub-group of subjects were grading will be applied (i.e. >= 18 years)
#' - `Grade 1`: Criteria defining lab value as Grade 1.
#' - `Grade 2`: Criteria defining lab value as Grade 2.
#' - `Grade 3`: Criteria defining lab value as Grade 3.
#' - `Grade 4`: Criteria defining lab value as Grade 4.
#' - `Grade 5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `FILTER` : `admiral` code to apply the filter based on SUBGROUP column.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold SI unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `SUBGROUP`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on DAIDS website defining the grading criteria, (Division of AIDS (DAIDS) Table
#' for Grading the Severity of Adult and Pediatric Adverse Events).
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_daids"
#' Metadata Holding Grading Criteria for DAIDs using USCV unit where applicable
#'
#' @details
#' This metadata has its origin in the ADLB Grading Spec json file `data-raw/adlb_grading/DAIDS_uscv.json`.
#' The variables `GRADE_NA_CODE`, `GRADE_4_CODE`, `GRADE_3_CODE`, `GRADE_2_CODE` and `GRADE_1_CODE` in
#' the json file are combined to create `GRADE_CRITERIA_CODE`, and then dropped from metadata.
#' The dataset contains the following columns:
#' - `SOC`: variable to hold the SOC of the lab test criteria.
#' - `TERM`: variable to hold the term describing the criteria applied to a particular lab test,
#' eg. 'Anemia' or 'INR Increased'. Note: the variable is case insensitive.
#' - `SUBGROUP` : Description of sub-group of subjects were grading will be applied (i.e. >= 18 years)
#' - `Grade 1`: Criteria defining lab value as Grade 1.
#' - `Grade 2`: Criteria defining lab value as Grade 2.
#' - `Grade 3`: Criteria defining lab value as Grade 3.
#' - `Grade 4`: Criteria defining lab value as Grade 4.
#' - `Grade 5`: Criteria defining lab value as Grade 5.
#' - `Definition`: Holds the definition of the lab test abnormality.
#' - `FILTER` : `admiral` code to apply the filter based on SUBGROUP column.
#' - `GRADE_CRITERIA_CODE`: variable to hold code that creates grade based on defined criteria.
#' - `UNIT_CHECK`: variable to hold USCV unit of particular lab test. Used to check against input data
#' if criteria is based on absolute values.
#' - `VAR_CHECK`: List of variables required to implement lab grade criteria. Use to check against
#' input data.
#' - `DIRECTION`: variable to hold the direction of the abnormality of a particular lab test
#' value. 'L' is for LOW values, 'H' is for HIGH values. Note: the variable is case insensitive.
#' - `COMMENT`: Holds any information regarding rationale behind implementation of grading criteria.
#'
#' Note: Variables `SOC`, `TERM`, `SUBGROUP`, `Grade 1`, `Grade 2`,`Grade 3`,`Grade 4`,`Grade 5`, `Definition`
#' are from the source document on DAIDS website defining the grading criteria.
#' [Division of AIDS (DAIDS) Table for Grading the Severity of Adult and Pediatric Adverse Events
#' From these variables only 'TERM' is used in the `{admiral}` code, the rest are for information and
#' traceability only.
#'
#'
#' @keywords metadata
#' @family metadata
"atoxgr_criteria_daids_uscv"
#' Country Code Lookup
#'
#' @description
#' These pre-defined country codes are sourced from
#' [ISO 3166 Standards](https://www.iso.org/iso-3166-country-codes.html).
#' See also [Wikipedia](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3).
#'
#' @details
#'
#' `country_code` is the 3-letter ISO 3166-1 county code commonly found in the
#' ADSL `COUNTRY` variable.
#' `country_name` is the country long name corresponding to to the 3-letter code.
#' `country_number` is the numeric code corresponding to an alphabetic sorting of
#' the 3-letter codes.
#'
#' To see the entire table in the console, run `print(country_code_lookup)`.
#'
#' @seealso [dose_freq_lookup]
#'
#' @keywords metadata
#'
#' @family metadata
#'
#' @examples
#' library(tibble)
#' library(dplyr, warn.conflicts = FALSE)
#'
#' # Create reference dataset for periods
#' adsl <- tribble(
#' ~USUBJID, ~SEX, ~COUNTRY,
#' "ST01-01", "F", "AUT",
#' "ST01-02", "M", "MWI",
#' "ST01-03", "F", "GBR",
#' "ST01-04", "M", "CHE",
#' "ST01-05", "M", "NOR",
#' "ST01-06", "F", "JPN",
#' "ST01-07", "F", "USA"
#' )
#'
#' adsl %>%
#' derive_vars_merged(
#' dataset_add = country_code_lookup,
#' new_vars = exprs(COUNTRYN = country_number, COUNTRYL = country_name),
#' by_vars = exprs(COUNTRY = country_code)
#' )
#'
#' @rdname country_code_lookup
"country_code_lookup"
#' Pre-Defined Dose Frequencies
#'
#' @description
#' These pre-defined dose frequencies are sourced from
#' [CDISC](https://evs.nci.nih.gov/ftp1/CDISC/SDTM/SDTM%20Terminology.pdf). The
#' number of rows to generate using `create_single_dose_dataset()` arguments
#' `start_date` and `end_date` is derived from `DOSE_COUNT`, `DOSE_WINDOW`, and
#' `CONVERSION_FACTOR` with appropriate functions from `lubridate`.
#'
#' @details
#' `NCI_CODE` and `CDISC_VALUE` are included from the CDISC source for
#' traceability.
#'
#' `DOSE_COUNT` represents the number of doses received in one single unit of
#' `DOSE_WINDOW`. For example, for `CDISC_VALUE=="10 DAYS PER MONTH"`,
#' `DOSE_WINDOW=="MONTH"` and `DOSE_COUNT==10`. Similarly, for
#' `CDISC_VALUE=="EVERY 2 WEEKS"`, `DOSE_WINDOW=="WEEK"` and
#' `DOSE_COUNT==0.5` (to yield one dose every two weeks).
#'
#' `CONVERSION_FACTOR` is used to convert `DOSE_WINDOW` units `"WEEK"`,
#' `"MONTH"`, and `"YEAR"` to the unit `"DAY"`.
#'
#' For example, for `CDISC_VALUE=="10 DAYS PER MONTH"`, `CONVERSION_FACTOR`
#' is `0.0329`. One day of a month is assumed to be `1 / 30.4375` of a month (one
#' day is assumed to be `1/365.25` of a year).
#' Given only `start_date` and `end_date` in the aggregate dataset, `CONVERSION_FACTOR`
#' is used to calculate specific dates for`start_date` and `end_date` in the
#' resulting single dose dataset for the doses that occur. In such cases, doses
#' are assumed to occur at evenly spaced increments over the interval.
#'
#' To see the entire table in the console, run `print(dose_freq_lookup)`.
#'
#' @seealso [create_single_dose_dataset()]
#'
#' @keywords metadata
#' @family metadata
#'
#' @rdname dose_freq_lookup
"dose_freq_lookup"