Comments (1)
Hi Hans,
I have also had this issue, but believe I have found the cause for some of the errors thrown.
Given the icd package is currently not available on the CRAN respository, I downloaded the most recent version of icd (4.0.9) available from the CRAN archive and installed from source. When running download_all_icd_data(), I encountered the same errors as yourself.
Upon debugging, it appears the error in accessing WHO 2016 is due to a line in the who.R file (which Jack has already fixed here: 450126c)
json_data <- httr::content(http_response, simplifyDataFrame=TRUE)
To the best of my understanding, json_data was not a valid JSON object for manipulation in the next call, resulting in the error 'Error : Argument 'txt' must be a JSON string, URL or file.'.
The following code which Jack has written, however, does provide a fix:
# encoding not specified by WHO resource (as of 2020-06-06). Be explicit
# about assumption.
json_data <- httr::content(http_response, type = "text", encoding = "UTF-8")
The method I used to edit is as follows:
- Call
options(error=recover)
. This call assists with stepping through the function causing the problem. - Call
get_icd10who2016()
. - Select option 9 (i.e. .dl_icd10who_json(year, lang, resource)).
- Call
trace(.dl_icd10who_json, edit = TRUE)
. - In the popup, find the error line from above and replace it with
json_data <- httr::content(http_response, type = "text", encoding = "UTF-8")
and save. - Press Esc.
- Exit recover mode by calling
options(error=NULL)
.
It appears that this has fixed my problem.
For anyone reading this -- if this method of amending a package that I have used above is not the best way to do so, I would appreciate if you could tell me a better way! I'm relatively new to R, and working with packages is very new to me.
Kind regards,
N
from icd.
Related Issues (20)
- dependency on curl executable should be more obvious HOT 1
- short_code argument to expand_range doesn't work for ICD10 HOT 1
- Extending to ICD-O?
- expand_range errors out on ICD-10 decimal codes
- travis build failing due to qpdf HOT 2
- Add `[.icd9cm_pc` and `[.icd10cm_pc` methods
- cannot install in R 3.6.3 or 3.6.1 HOT 1
- package pulled from CRAN HOT 1
- package no longer available on cran HOT 2
- Confusion over undefined ICD codes HOT 2
- Workaround from icd 10 - global burden of disease
- Charlson score accounting twice for the same diagnosis
- Package is down on CRAN HOT 11
- update ICD-10 AHRQ comorbidities
- unable to keep track of which ICD codes are explainable and which are unexplained
- E-Valued ICD10 Codes Return Incorrect Desc or Character Length 0 within `explain_code()`
- How to download the package to a local file HOT 1
- expand_range doesn't work for certain chapters HOT 1
- Not able to install ICD package HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icd.