/
datadocs.R
544 lines (495 loc) · 18.4 KB
/
datadocs.R
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
#' ICD-9 chapters
#'
#' \code{icd9_chapters}, \code{icd9_chapters_sub} and \code{icd9_majors} contain
#' mappings from the higher level descriptions of ICD-9 codes to the ranges of
#' ICD-9 codes they describe. Helpful in summarizing codes or grouping for
#' human-readable output. These can easily be converted to a co-morbidity
#' mapping, as shown in the vignette.
#'
#' \itemize{ \item 001-139 Infectious And Parasitic Diseases \item 140-239
#' Neoplasms \item 240-279 Endocrine, Nutritional And Metabolic Diseases, And
#' Immunity Disorders \item 280-289 Diseases Of The Blood And Blood-Forming
#' Organs \item 290-319 Mental Disorders \item 320-389 Diseases Of The Nervous
#' System And Sense Organs \item 390-459 Diseases Of The Circulatory System
#' \item 460-519 Diseases Of The Respiratory System \item 520-579 Diseases Of
#' The Digestive System \item 580-629 Diseases Of The Genitourinary System \item
#' 630-679 Complications Of Pregnancy, Childbirth, And The Puerperium \item
#' 680-709 Diseases Of The Skin And Subcutaneous Tissue \item 710-739 Diseases
#' Of The Musculoskeletal System And Connective Tissue \item 740-759 Congenital
#' Anomalies \item 760-779 Certain Conditions Originating In The Perinatal
#' Period \item 780-799 Symptoms, Signs, And Ill-Defined Conditions \item
#' 800-999 Injury And Poisoning \item V01-V91 Supplementary Classification Of
#' Factors Influencing Health Status And Contact With Health Services \item
#' E000-E999 Supplementary Classification Of External Causes Of Injury And
#' Poisoning }
#' @keywords datasets list category
#' @docType data
#' @source
# nolint start
#' \url{http://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html}
# nolint end
#'
#' @details Format: list with chapter/sub-chapter or major names stored in list
#' names, each with two element named character vector with start and end
#' codes.
#' @name icd9_chapters
#' @aliases icd9_majors
NULL
#' ICD-9 sub-chapters
#' @name icd9_sub_chapters
#' @seealso \code{\link{icd9_chapters}}
NULL
#' ICD-10 chapters
#'
#' The WHO ICD-10 scheme chapters. The chapter level is the highest in the
#' hierarchy, each chapter containing sets of codes which span multiple
#' three-digit 'major' codes, and in some cases also span codes across two
#' alphabetic initial characters. E.g. Chapter I spans A00 to B99.
#'
#' 2017 ICD-10-CM does not have any U codes (codes for special purposes).
#' U00-U49 - Provisional assignment of new diseases of uncertain etiology or
#' emergency use U82-U85 - Resistance to antimicrobial and anti-neoplastic drugs
#' @source http://apps.who.int/classifications/icd10/browse/2016/en
#' @details Format: list with chapter names stored in list names, each with two
#' element named character vector with start and end codes.
#' @name icd10_chapters
#' @aliases icd10_chapters_fr
#' @seealso \code{\link{icd10_sub_chapters}}
#' @docType data
#' @keywords datasets
NULL
#' ICD-10 sub-chapters
#'
#' The WHO ICD-10 scheme sub-chapters. N.b. there may be WHO vs CM differences:
#' please file bug if noted. In the \code{XML} definition of ICD-10-CM there are
#' some intermediate hierarchical levels, e.g. for neoplasms. Sub-chapter here
#' is defined as the lowest-level grouping of three-digit codes, e.g. C00-C14
#' "Malignant neoplasms of lip, oral cavity and pharynx", not C00-C96 "Malignant
#' neoplasms" which itself is a subset of the chapter C00-D49 "Neoplasms"
#' @source http://apps.who.int/classifications/icd10/browse/2016/en
#' @details Format: list with sub-chapter or major names stored in list names,
#' each with two element named character vector with start and end codes.
#' @seealso \code{\link{icd10_chapters}}
#' @name icd10_sub_chapters
#' @aliases icd10_sub_chapters_fr
NULL
#' ICD-9-CM diagnosis codes including leaf nodes and branch names up to the
#' three-digit codes.
#'
#' Unlike \code{\link{get_icd9cm2014_leaf}} and friends, these data frames
#' contain the full structure of the ICD-9-CM scheme up to the three-digit
#' codes. Unlike the equivalent ICD-10-CM data frames (e.g.,
#' \code{\link{icd10cm2019}}), they do not have columns indicating billable/leaf
#' status, or chapter designations.
#'
#' \code{icd9cm_hierarchy} is the deprecated name, which currently points to the
#' final ICD-9-CM 2014 release. 2011 -- 2014 are in fact identical. These are
#' generated dynamically by parsing an awkward RTF file, and only the 2011 --
#' 2014 data has been tested and used thoroughly.
#' @docType data
#' @keywords datasets
#' @details Format: data frame
#' @source
#' \url{http://wonder.cdc.gov/wonder/sci_data/codes/icd9/type_txt/icd9cm.asp}
#' @source Rich text descriptions here:
#' \url{http://www.cdc.gov/nchs/icd/icd9cm.htm}
# nolint start
#' \url{http://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html}
# nolint end
#' This page has versions 23 to 32 (2005 to 2014). At present, only the 2014
#' data is included in this package.
#' @source
#' \url{http://wonder.cdc.gov/wonder/sci_data/codes/icd9/type_txt/icd9abb.asp}
#' @source
#' \url{http://wonder.cdc.gov/wonder/sci_data/codes/icd9/type_txt/icd9cm.asp}
#' @source
#' \url{http://wonder.cdc.gov/wonder/sci_data/codes/icd9/type_txt/icdcm.asp}
#' @source
#' \url{http://wonder.cdc.gov/wonder/sci_data/codes/icd9/type_txt/icd9abb.asp}
#' @name icd9cm_hierarchy
NULL
#' United States and Belgium ICD-10-CM
#'
#' The public domain modified ICD-10 classification as published in the public
#' domain by the US CDC. Currently this has a slightly different structure to
#' \code{icd9cm_hierarchy} because the published data helpfully has a
#' \emph{leaf} flag indicating whether a code is a \emph{billable} leaf node, or
#' a code higher in the hierarchy which nevertheless will have a description.
#' @section Editions: There are annual revisions to this data in the US.
#' @seealso \code{\link{get_icd10cm2014}} \code{\link{get_icd10cm2015}}
#' \code{\link{get_icd10cm2017}} \code{\link{get_icd10cm2018}}
#' @source \url{http://www.cdc.gov/nchs/icd/icd10cm.htm}
#' @docType data
#' @keywords datasets
#' @details Format: data frame, with columns for code, leaf status (0 or 1),
#' short and long descriptions.
#' @references \url{https://www.cms.gov/Medicare/Coding/ICD10/}
# nolint start
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2018-ICD-10-PCS-Tables-And-Index.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2018-ICD-10-PCS-Order-File.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2017-PCS-Code-Tables.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2017-PCS-Long-Abbrev-Titles.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2016-Code-Descriptions-in-Tabular-Order.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2015-code-descriptions.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2015-tables-index.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2015-Code_Tables-and-Index.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2015-PCS-long-and-abbreviated-titles.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2014-ICD10-Code-Descriptions.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2014-ICD10-Code-Tables-and-Index.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2014-Code-Tables-and-Index.zip}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/Downloads/2014-PCS-long-and-abbreviated-titles.zip}
# nolint end
#' @name icd10cm2019
NULL
#' @name get_icd10cm2014
#' @title ICD-10-CM 2014
#' @seealso \code{\link{icd10cm2019}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @name get_icd10cm2015
#' @title ICD-10-CM 2015
#' @seealso \code{\link{icd10cm2019}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @name get_icd10cm2016
#' @title ICD-10-CM 2016
#' @seealso \code{\link{icd10cm2019}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @name get_icd10cm2017
#' @title ICD-10-CM 2017
#' @seealso \code{\link{icd10cm2019}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @name get_icd10cm2018
#' @title ICD-10-CM 2018
#' @seealso \code{\link{icd10cm2019}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @name get_icd10cm2019
#' @title ICD-10-CM 2019
#' @seealso \code{\link{icd10cm2019}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' 2016 WHO ICD-10 data
#'
#' This data must be downloaded on a per-user basis. A prompt is given when the
#' data is first attempted to be accessed.
#' @name get_icd10who2016
#' @source \url{http://www.who.int}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' 2008 WHO ICD-10 data in French
#'
#' This data must be downloaded on a per-user basis. A prompt is given when the
#' data is first attempted to be accessed.
#' @name get_icd10who2008fr
#' @source \url{http://www.who.int}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' French ICD-10-FR modification of WHO ICD-10 used in France
#'
#' La Classification internationale statistique des maladies (CIM), version 10,
#' edition française (The International Classification of Diseases (ICD),
#' version 10, French edition.) Comme la version américaine, l'édition française
#' a beaucoup de changéements par rapport à l'édition de l'OMS. Juste l'année
#' 2018 est présentée pour le moment.
# "
#' The short descriptions are capitalized, and, as is correct in French, do not
#' require accents. These were not converted to lower or sentence case to avoid
#' introducing spelling errors.
#' Définitions CIM-10-FR de l'OMS (WHO ICD-10 definitions)
#' @source \url{https://www.atih.sante.fr/cim-10-fr-2018-usage-pmsi}
#' @references
# nolint start
#' \href{https://www.atih.sante.fr/nomenclatures-de-recueil-de-linformation/cim}{ATIH
#' CIM-10-FR}
# nolint end
#' @docType data
#' @keywords datasets
#' @name get_icd10fr2019
#' @export
NULL
#' Belgian ICD-10-BE
#'
#' This is based heavily on ICD-10-CM. 2014 is identical, with translations for
#' most of the codes into Dutch and French. 2017 has about a hundred additional
#' code definitions over ICD-10-CM 2017. The 2014 data also has the interesting
#' fields for gender specificity of a given code, and whether it is permissible
#' as Present-on-Arrival (POA).
#' @source
#' \url{https://www.health.belgium.be/en/node/30433}
# nolint start
#' \url{https://www.health.belgium.be/sites/default/files/uploads/fields/fpshealth_theme_file/fy2017_reflist_icd-10-be.xlsx_last_updatet_28-07-2017_1.xlsx}
#' \url{https://www.health.belgium.be/fr/sante/organisation-des-soins-de-sante/hopitaux/systemes-denregistrement/icd-10-be}
# nolint end
#' \url{https://www.health.belgium.be/fr/fy2014reflisticd-10-bexlsx}
#' @name get_icd10be2014
#' @seealso \code{\link{get_icd10be2017}} \code{\link{get_icd10be2014_pc}}
#' \code{\link{get_icd10be2017_pc}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @title ICD-10-BE 2017
#' @name get_icd10be2017
#' @seealso \code{\link{get_icd10be2014}} \code{\link{get_icd10be2014_pc}}
#' \code{\link{get_icd10be2017_pc}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @title ICD-10-BE 2017 procedure codes
#' @name get_icd10be2017_pc
#' @seealso \code{\link{get_icd10be2014}} \code{\link{get_icd10be2014_pc}}
#' \code{\link{get_icd10be2017}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' @title ICD-10-BE 2014 procedure codes
#' @name get_icd10be2014_pc
#' @seealso \code{\link{get_icd10be2014}} \code{\link{get_icd10be2017}}
#' \code{\link{get_icd10be2017_pc}}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' ICD-10-CM Procedure Codes
#'
#' ICD-10-PCS is the annually-updated set of procedure codes designed by 3M for
#' the US CMS. There is no directory of WHO ICD procedure codes.
#' @format A named list of data frames. The elements of the list are named by
#' the year, e.g., \code{"2018"}. Each data frame contains two character
#' columns, the first, named \code{code} is the procedure code; the second,
#' named \code{desc}, has the description.
#' @name get_icd10cm2019_pc
#' @seealso \code{get_icd10cm2014_pc} \code{get_icd10cm2015_pc}
#' \code{get_icd10cm2016_pc} \code{get_icd10cm2017_pc}
#' \code{get_icd10cm2018_pc}
#' \url{https://www.cms.gov/Medicare/Coding/ICD10/downloads/pcs_refman.pdf}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' ICD-10-CM Procedure codes for 2014
#' @name get_icd10cm2014_pc
#' @seealso \code{get_icd10cm2015_pc} \code{get_icd10cm2016_pc}
#' \code{get_icd10cm2017_pc} \code{get_icd10cm2018_pc}
#' \code{get_icd10cm2019_pc}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' ICD-10-CM Procedure codes for 2015
#' @name get_icd10cm2015_pc
#' @seealso \code{get_icd10cm2014_pc} \code{get_icd10cm2016_pc}
#' \code{get_icd10cm2017_pc} \code{get_icd10cm2018_pc}
#' \code{get_icd10cm2019_pc}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' ICD-10-CM Procedure codes for 2016
#' @name get_icd10cm2016_pc
#' @seealso \code{get_icd10cm2014_pc} \code{get_icd10cm2015_pc}
#' \code{get_icd10cm2017_pc} \code{get_icd10cm2018_pc}
#' \code{get_icd10cm2019_pc}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' ICD-10-CM Procedure codes for 2017
#' @name get_icd10cm2017_pc
#' @seealso \code{get_icd10cm2014_pc} \code{get_icd10cm2015_pc}
#' \code{get_icd10cm2016_pc} \code{get_icd10cm2018_pc}
#' \code{get_icd10cm2019_pc}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' ICD-10-CM Procedure codes for 2018
#' @name get_icd10cm2018_pc
#' @seealso \code{get_icd10cm2014_pc} \code{get_icd10cm2015_pc}
#' \code{get_icd10cm2016_pc} \code{get_icd10cm2017_pc}
#' \code{get_icd10cm2019_pc}
#' @docType data
#' @keywords datasets
#' @export
NULL
#' ICD-9-CM, just billable/leaf codes
#'
#' @details These are derived from the final CMS published version 32 for 2014,
#' which was unchanged since 2011. The short descriptions are in ASCII with no
#' special characters, whereas the long descriptions contain accented
#' characters which are stored as Unicode, \code{latin-1} or \code{cp1252}.
#'
#' This all done during package creation, but can be repeated by package
#' users, including pulling the data from the web pages directly. Despite my
#' best efforts, current locale can give different results, but this packaged
#' data is correct, with some \code{UTF-8} encoded strings.
#' \code{icd9cm_billable} has been removed, and is replaced by
#' \code{icd9cm2014_leaf} now includes only the latest version (32).
#' @docType data
#' @keywords datasets
#' @format data frames with columns \code{code}, \code{short_desc}, and
#' \code{long_desc}.
#' @source
# nolint start
#' \url{http://www.cms.gov/Medicare/Coding/ICD9ProviderDiagnosticCodes/codes.html}
# nolint end
#' @name get_icd9cm2014_leaf
#' @aliases get_cd9cm2005_leaf get_icd9cm2006_leaf get_icd9cm2007_leaf
#' get_icd9cm2008_leaf get_icd9cm2009_leaf get_icd9cm2010_leaf
#' get_icd9cm2011_leaf get_icd9cm2012_leaf get_icd9cm2013_leaf
#' get_icd9cm2014_leaf
#' @export
NULL
#' The final ICD-9-CM list of leaf (\sQuote{billable}) codes
#'
#' Other years are available from \code{\link{get_icd9cm2013_leaf}}, etc..
#' @name icd9cm2014_leaf
#' @docType data
#' @keywords datasets
NULL
#' @name get_icd9cm2005
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2006
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2007
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2008
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2009
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2010
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2011
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2012
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2013
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2014
#' @rdname icd9cm_hierarchy
#' @export
NULL
#' @name get_icd9cm2005_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2006_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2007_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2008_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2009_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2010_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2011_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2012_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' @name get_icd9cm2013_leaf
#' @rdname get_icd9cm2014_leaf
#' @export
NULL
#' The latest available version of ICD-10-CM in this package
#' @details This is an active binding, so is exported explicitly
#' @docType data
#' @keywords datasets
#' @export
get_icd10cm_latest <- function() {
get_icd10cm2019()
}
#' Hospital discharge data from Vermont
#'
#' Anonymous data from public Vermont source for 2013
#'
#' Conditions of Release Release of public use data is subject to the following
#' conditions, which the requestor agrees to upon accepting copies of the data:
#'
#' 1. The data may not be used in any manner that attempts to or does identify,
#' directly or indirectly, any individual patient or physician.
#'
#' 2. The requestor agrees to incorporate the following, or a substantially
#' similar, disclaimer in all reports or publications that include public use
#' data: \dQuote{Hospital discharge data for use in this study were supplied by
#' the Vermont Association of Hospitals and Health Systems-Network Services
#' Organization (VAHHS-NSO) and the Vermont Department of Banking, Insurance,
#' Securities and Health Care Administration (BISHCA). All analyses,
#' interpretations or conclusions based on these data are solely that of [the
#' requestor]. VAHHS-NSO and BISHCA disclaim responsibility for any such
#' analyses, interpretations or conclusions. In addition, as the data have been
#' edited and processed by VAHHS-NSO, BISHCA assumes no responsibility for
#' errors in the data due to coding or processing}
#' @source
# nolint start
#' \url{http://www.healthvermont.gov/health-statistics-vital-records/health-care-systems-reporting/hospital-discharge-data}
# nolint end
#' @details Format: CSV original, minimally processed into R data frame.
#' @keywords datasets
#' @author Vermont Division of Health Care Administration
#' @docType data
#' @name vermont_dx
#' @noMd
NULL
#' United States Transuranium & Uranium Registries
#'
#' This is an ICD-10 data set (not ICD-10-CM) with mortality from the United
#' States Transuranium & Uranium Registries, published in the public domain.
#' @name uranium_pathology
#' @source \url{https://ustur.wsu.edu/about-us/}
#' @docType data
#' @keywords datasets
NULL