-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
123 lines (69 loc) · 2.3 KB
/
README.Rmd
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
---
title: "ICD9fi"
output:
github_document:
toc: true
df_print: kable
# html_document:
# df_print: paged
# toc: true
---
```{r setup, include=FALSE}
rm(list = ls())
knitr::opts_chunk$set(echo = FALSE)
library(tidyverse)
library(scales)
source("../lib/vocabulary_reporting_fuctions.r")
# Document variables
N_TOPS <- 10
# output status
db_statuses <- tibble()
```
```{r load, message=FALSE, warning=FALSE}
icd9fi_concept <- read_csv("./1_source_vocabulary/CONCEPT_ICD9fi.csv")
icd9fi_mapsto <- read_csv("./2_mapping_to_standard/CONCEPT_RELATIONSHIP_ICD9fi.csv")
icd9fi_freqs <- read_csv("./3_freq_of_source_codes/freq_total.csv")
```
# Intro
TODO: intro icd9fi
# Formating source vocabulary to OMOP
The icd9fi codes have been ...
TODO: i got it from aki now in the gitlab repo
The concept names are a mixed of Latin, Finnish, and English !!. These are not translated to English !!. The English name were append by matching the ICD9fi code to the ICD9 code dowloaded from [Wolfbane.com](http://www.wolfbane.com/icd/) (1.6.2020).
There are 5 tipes of maching :
TODO
# Mapping the source vocabulary to the standard vocabularies
ICD9fi codes ranked by frequency calculated from FinnGen-DF5.
Mapping was carried in USAGI by medical student [\@kalleaseppala](github.com/kalleaseppala).
## Progess in number of codes
```{r}
n_codes <- icd9fi_concept %>% nrow()
n_codes_accepted <- icd9fi_mapsto %>% distinct(concept_id_1) %>% nrow()
```
From `r scales::number(n_codes)` codes `r scales::number(n_codes_accepted)` have been approved.
This makes `r scales::percent(n_codes_accepted/n_codes)` of codes approved.
```{r}
db_statuses <- bind_rows(
tibble(
status = "mapped",
n_codes = n_codes_accepted,
per_codes = percent(n_codes_accepted/!!n_codes),
n_events = as.double(NA),
per_events = as.character(NA),
db_name = "source"
),
tibble(
status = "not_mapped",
n_codes = !!n_codes-n_codes_accepted,
per_codes = percent((!!n_codes-n_codes_accepted)/!!n_codes),
n_events = as.double(NA),
per_events = as.character(NA),
db_name = "source"
)
)
```
# Assessing coverage of databases
```{r results='asis'}
#write_csv(db_statuses, "status_table.csv" )
database_coverage_md("ICD9fi", icd9fi_concept, icd9fi_mapsto, icd9fi_freqs )
```