edonnachie / ICD10gm

R Package: ICD-10-GM Metadata
https://edonnachie.github.io/ICD10gm/
Other
10 stars 2 forks source link

Description of icd_parse() #21

Open DdeSordi opened 2 years ago

DdeSordi commented 2 years ago

Hi I think there is an issue in the description of the icd_parse() function. It is described that there is an output of icd_norm but in the icd_parse() function there is one called icd_spec that is the same as icd_norm. Or am i wrong here.

edonnachie commented 2 years ago

Thank you, the documentation is incorrect here.

To get the normcode or other attributes, you can join with ICD10gm::icd_meta_codes as follows:

ICD10gm::icd_parse(c(
  "Backpain (M54.9) is one of the most common diagnoses in primary care",
  "Codes for chronic pain include R52.1 and F45.4"
  ))%>%
  left_join(
    ICD10gm::icd_meta_codes %>% 
      filter(year == 2021) %>% 
      select(icd_sub, icd_normcode, label),
    by = c("icd_sub"))

I will correct for the next release.

DdeSordi commented 2 years ago

Thank you, the documentation is incorrect here.

To get the normcode or other attributes, you can join with ICD10gm::icd_meta_codes as follows:

ICD10gm::icd_parse(c(
  "Backpain (M54.9) is one of the most common diagnoses in primary care",
  "Codes for chronic pain include R52.1 and F45.4"
  ))%>%
  left_join(
    ICD10gm::icd_meta_codes %>% 
      filter(year == 2021) %>% 
      select(icd_sub, icd_normcode, label),
    by = c("icd_sub"))

I will correct for the next release.

So icd_spec that is an output of icd_parse is not icd_norm? icd_spec==icd_norm ???

edonnachie commented 2 years ago

Yes, icd_spec is the specification (i.e. what was provided to the function).

The icd_parse function originated separately from the rest of the package (I needed to extract ICD codes from a booklet). It was then "hardened" and used as a basis for icd_expand, for which I needed the icd_sub format (i.e. full ICD-10 code without punctuation).

It might be a good idea to include the icd_norm (the ICD-10 normcode) in the output of icd parse too. I'll consider this for the next release.