extract_rxclass_graph.Rd
Extract RxClass Graph
extract_rxclass_graph( class_types = c("MESHPA", "EPC", "MOA", "PE", "PK", "TC", "VA", "DISEASE", "CHEM", "SCHEDULE", "STRUCT", "DISPOS"), prior_version = NULL, prior_api_version = "3.1.174" )
For each class_type
, the following csvs are returned to the installation dir:
RxClass API /
RxClass Version /
extracted /
graph /
raw /
node.csv
edge.csv
processed /
CONCEPT_ANCESTOR.csv
The CONCEPT_ANCESTOR.csv is processed to include levels of separation with the source edge.csv fields classId1 and classId2 translated to child and parent, respectively.
Some class types such as DISEASE follow a cyclical hierarchical pattern that can recurse into infinity if a limit is imposed when writing the Concept Ancestor csv file. Concept Ancestor processing is completed when a subsequent level of parent and children is a dataframe that is a duplicate of a previous level's.
Other class types such as SCHEDULE do not have multiple levels.
The response from the RxNav RxClass API is a set of nodes and edges for a given
class_type
. Both are saved as csvs to the 'raw' folder.
The edge.csv is then processed into a Concept Ancestor format as 'CONCEPT_ANCESTOR.csv' under the 'processed' folder.