-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e165a9e
commit 8cf481a
Showing
6 changed files
with
261 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#' Check if string is valid length of a HCPCS code | ||
#' @param x string | ||
#' @return boolean | ||
#' @examplesIf interactive() | ||
#' is_valid_length("11646") | ||
#' @noRd | ||
is_valid_length <- function(x, | ||
arg = rlang::caller_arg(x), | ||
call = rlang::caller_env()) { | ||
|
||
if (stringr::str_length(x) != 5L) { | ||
cli::cli_abort(c( | ||
"A {.strong HCPCS} code is {.emph 5} characters.", | ||
"x" = "{.strong {.val {x}}} is {.val {nchar(x)}}."), | ||
call = call)} | ||
x | ||
} | ||
|
||
#' Check if code is HCPCS Level 1 Category I (CPT) | ||
#' @param x string | ||
#' @return boolean | ||
#' @examplesIf interactive() | ||
#' is_category_I("11646") | ||
#' @noRd | ||
is_category_I <- function(x, | ||
arg = rlang::caller_arg(x), | ||
call = rlang::caller_env()) { | ||
is_valid_length(x) | ||
|
||
stringr::str_detect(x, stringr::regex("^\\d{5}$")) | ||
} | ||
|
||
#' Check if code is HCPCS Level 1 Category II | ||
#' | ||
#' Category II: Supplemental tracking codes that can be used for performance | ||
#' measurement. These codes are intended to facilitate data collection about | ||
#' quality of care by coding certain services and/or test results that support | ||
#' performance measures and that have been agreed upon as contributing to | ||
#' good patient care. | ||
#' | ||
#' Some codes in this category may relate to compliance by the health care | ||
#' professional with state or federal law. The use of these codes is optional. | ||
#' The codes are not required for correct coding and may not be used as a | ||
#' substitute for Category I codes. Services/procedures or test results | ||
#' described in this category make use of alpha characters as the 5th | ||
#' character in the string (i.e., 4 digits followed by an alpha character). | ||
#' | ||
#' These digits are not intended to reflect the placement of the code in the | ||
#' regular (Category I) part of the CPT code set. Also, these codes describe | ||
#' components that are typically included in an evaluation and management | ||
#' service or test results that are part of the laboratory test/procedure. | ||
#' | ||
#' Consequently, they do not have a relative value associated with them. | ||
#' | ||
#' @param x string | ||
#' @return boolean | ||
#' @examplesIf interactive() | ||
#' is_category_II("1164F") | ||
#' @noRd | ||
is_category_II <- function(x, | ||
arg = rlang::caller_arg(x), | ||
call = rlang::caller_env()) { | ||
is_valid_length(x) | ||
|
||
stringr::str_detect(x, stringr::regex("^\\d{4}[F]$")) | ||
} | ||
|
||
#' Check if code is HCPCS Level 1 Category III | ||
#' | ||
#' Category III: a temporary set of codes for emerging technologies, | ||
#' services, procedures, and service paradigms. | ||
#' | ||
#' @param x string | ||
#' @return boolean | ||
#' @examplesIf interactive() | ||
#' is_category_III("1164T") | ||
#' @noRd | ||
is_category_III <- function(x, | ||
arg = rlang::caller_arg(x), | ||
call = rlang::caller_env()) { | ||
is_valid_length(x) | ||
|
||
stringr::str_detect(x, stringr::regex("^\\d{4}[T]$")) | ||
} | ||
|
||
#' Check if code is HCPCS Level II | ||
#' | ||
#' HCPCS Level II is a standardized coding system that is used primarily to | ||
#' identify products, supplies, and services not included in the CPT code set | ||
#' jurisdiction, such as ambulance services and durable medical equipment, | ||
#' prosthetics, orthotics, and supplies (DMEPOS) when used outside a | ||
#' physician's office. | ||
#' | ||
#' @param x string | ||
#' @return boolean | ||
#' @examplesIf interactive() | ||
#' is_level_II("E8015") | ||
#' @noRd | ||
is_level_II <- function(x, | ||
arg = rlang::caller_arg(x), | ||
call = rlang::caller_env()) { | ||
is_valid_length(x) | ||
|
||
stringr::str_detect(x, stringr::regex("^[a-vA-V]\\d{4}$")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
6 changes: 3 additions & 3 deletions
6
pins/hcpcs/20240302T201820Z-6043f/data.txt → pins/hcpcs/20240305T203346Z-bf451/data.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
file: hcpcs.qs | ||
file_size: 307901 | ||
pin_hash: 6043f4fb1166151f | ||
file_size: 312720 | ||
pin_hash: bf45183aad9b7e27 | ||
type: qs | ||
title: 2024 HCPCS Level II | ||
description: 2024 Healthcare Common Procedure Coding System (HCPCS) | ||
tags: ~ | ||
urls: ~ | ||
created: 20240302T201820Z | ||
created: 20240305T203346Z | ||
api_version: 1 |
Binary file not shown.