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
Copy file name to clipboardExpand all lines: README.Rmd
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ knitr::opts_chunk$set(
16
16
# codigo: Interface to the International Classification of Diseases (ICD) API <imgsrc="man/figures/logo.png"width="200"align="right" />
17
17
18
18
<!-- badges: start -->
19
-
[](https://www.repostatus.org/#wip)
19
+
[](https://www.repostatus.org/#active)
@@ -28,16 +28,16 @@ The [International Classification of Diseases (ICD)](https://www.who.int/standar
28
28
29
29
## What does `codigo` do?
30
30
31
-
Please note that `codigo` is still highly experimental and is undergoing a lot of development. Hence, any functionalities described below and in the rest of the package documentation have a high likelihood of changing interface or approach as we aim for a stable working version.
31
+
Please note that `codigo` is still experimental but is nearing a stable release. It is possible that some functionalities described below and in the rest of the package documentation may change interface or approach but these changes will likely be minor.
32
32
33
33
Currently, the package provides functions for:
34
34
35
-
* Authenticating with the ICD API;
36
-
* Performing a search of ICD-11 foundation component;
37
-
* Performing autocoding of causes of death using the ICD-11 foundation; and,
38
-
* Getting information on various ICD-11 foundation entities.
39
-
40
-
From here, the plan is to continue developing functions that wrap the various available [API endpoints](https://id.who.int/swagger/index.html).
35
+
* Authenticating with the ICD API (*stable*);
36
+
* Performing a search of ICD-11 foundation and linearization components (*stable*);
37
+
* Performing autocoding of causes of death using the ICD-11 foundation and linearization components (*stable*);
38
+
* Getting information on various ICD-11 foundation and linearization entities (*experimental*);
39
+
* Converting ICD-10 codes to ICD-11 codes and vice versa (*stable*); and,
40
+
* Determining the underlying cause of death based on reported information on a death certificate (*experimental*).
This OAuth2 client can now be used to the various functions in the package that require an OAuth2 client for authentication for making requests to the ICD API.
89
89
90
90
### Performing a basic search
91
91
92
-
The main feature of the ICD API is the ability to search ICD 11 Foundation and ICD 11 Linearization for information regarding an illness/disease. This feature is captured by the `icd_search_foundation()` function. For example, if *colorectal cancer* is the disease of interest and information available from ICD 11 is needed, the following call can be made:
92
+
The main feature of the ICD API is the ability to search ICD 11 Foundation and ICD 11 Linearization for information regarding an illness/disease. This feature is captured by the `icd_search` functions. For example, if *colorectal cancer* is the disease of interest and information available from ICD 11 is needed, the following call can be made:
Copy file name to clipboardExpand all lines: vignettes/codigo.Rmd
+60-6Lines changed: 60 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -19,27 +19,81 @@ knitr::opts_chunk$set(
19
19
library(codigo)
20
20
```
21
21
22
-
This article takes a quick tour of the main features of `codigo`.
22
+
This article takes a quick tour of the main features of `codigo`.
23
+
24
+
## Authenticating with the ICD API
25
+
26
+
The ICD API uses [OAuth2](https://httr2.r-lib.org/articles/oauth.html) for authentication. The package has a set of utility functions that support the ICD API authentication specifications leading to the generation of an OAuth2 token. The `icd_oauth_client()` function is the downstream and user-facing function that creates an ICD OAuth2 client that can be used for token retrieval by future functions that wrap ICD API for entity and linearization information retrieval.
27
+
28
+
An ICD OAuth2 client can be generated as follows:
29
+
30
+
```R
31
+
icd_oauth_client()
32
+
```
33
+
34
+
This function uses a built in OAuth2 client created for light use and for purposes of package development and testing.
35
+
36
+
It is recommended that those intending to use this package for programmatically performing high volume of calls to the ICD API to create their own **access keys** (`client id` and `client secret`) using [these instructions](https://icd.who.int/docs/icd-api/API-Authentication/).
37
+
38
+
Then, with your access keys, perform the following commands:
This OAuth2 client can now be used to the various functions in the package that require an OAuth2 client for authentication for making requests to the ICD API.
23
51
24
52
## Performing a basic search
25
53
26
-
A feature of the ICD API is the ability to search ICD 11 Foundation and ICD 11 Linearization for information regarding an illness/disease. This feature is captured by the `icd_search_foundation()` function. For example, if *colorectal cancer* is the disease of interest and information available from ICD 11 is needed, the following call can be made:
54
+
A feature of the ICD API is the ability to search ICD 11 Foundation and ICD 11 Linearization for information regarding an illness/disease. This feature is captured by the `icd_search` functions. For example, if *colorectal cancer* is the disease of interest and information available from ICD 11 is needed, the following call can be made:
The output is a tibble created from parsed JSON body text of the HTTP response from the ICD API.
66
+
The output is a tibble created from parsed JSON body text of the HTTP response from the ICD API. If you prefer the output to remain as the parsed JSON body text of the HTTP response from the ICD API, set the argument `tabular = FALSE`
Autocoding is a focused search that returns a single result based on the closest match from ICD-11. Autocoding using the ICD Foundation API endpoint produces
80
+
Autocoding is a focused search that returns results based on the closest match from ICD-11. Autocoding using the ICD Linearization component API endpoint can be done as follows:
## Converting ICD-10 codes to ICD-11 and vice versa
43
93
94
+
If you are working with data that used ICD-10 codes and need these codes to be converted to ICD-11 codes, the `icd_map()` function assists in performing this. The following code will provide information on what the *A00* ICD0-10 code including its ICD-11 counterpart.
0 commit comments