Function find_children
find_children.Rd
The find_children function is used to quickly find all the child codes of a parent code so a user does not need to type all child codes out manually. The TriNetX standardized_terminology table contains all definitions of parent and child code relationships.
Arguments
- database
database name to use
- code_list
user defined table with 3 mandatory columns:
feature
- the feature the exact code will roll up to and name of the column in the output dataframe (letters, numbers, underscores only, no spaces, not case sensitive)code
- parent or child codecode_system
- ICD-10-CM, RxNorm, etccode_system rules:
patient: returns self (use month_year_death as the code value)
ICD-10-CM: returns children from ICD-10-CM and ICD-9-CM
ICD-9-CM: can only be a child, so returns itself
ICD-10-PCS: returns children from ICD-10-PCS and ICD-9-CM
CPT: returns children from CPT
HCPCS: returns children from HCPCS
SNOMEDCT_US: returns children from SNOMED
RxNorm: can only be a child, so returns self
VA: returns RxNorm children
ATC: returns RxNorm children
TNX: returns children of TNX rollups
LOINC: returns itself, parents are not supported (except for TNX labs)
Encounter Type: returns itself
optional columns
qualifier_num
- the find_children function will populate the value within qualifier_num to all the children of that codequalifier_text
- the find_children function will populate the value within qualifier_text to all the children of that code
- only_children
(optional argument)
if TRUE, returns only discovered child codes
if FALSE, returns all codes, including original input
FALSE by default
- added
(optional argument)
if TRUE, the function returns an additional column named 'added' that is 0 if the code was present in the input and 1 if the code was not present in the input after find_children was run
if FALSE, does nothing
FALSE by default
- code_desc
(optional argument)
if TRUE, the function returns an additional column named 'code_description' that populates the code_description value from the standardized_terminology table
if FALSE, does nothing
FALSE by default