RxMix Tutorial

A Batch Example

In this example, the batch processing function of RxMix will be illustrated. In addition, the workflow configuration will be saved and loaded.

The application developed in this example will process a file of National Drug Codes (NDCs) and determine what conditions are treated by the drugs using the NDF-RT "may_treat" role. Specifically, the following functions are needed to accomplish this task:
Creating the Workflow
To create the application, enter the RxMix web page. The figure below shows the initial RxMix page.



To define the workflow, click on the arrow at the right side of the box under Select Function and select findRxcuiById.

The Optional Parameters labeled id_string and allSourcesFlag will appear. In the selection box for id_string, select NDC. The display should look like the image below.



Click the Add to Workflow button to enter this function into the workflow.

Next, select function getRelatedbyType. The optional parameter labeled term_type will be displayed.

Select IN from the term_type menu.



Click the Add to Workflow button.

Next, select function findConceptsByName under the NDF-RT section on the menu. The optional parameter labeled kind will appear.

Select DRUG_KIND from the kind menu.



Click the Add to Workflow button to enter this function into the workflow.

To finish the workflow, select function getRelatedConceptsByRole from the menu. The optional parameters labeled role_type and transitive will be displayed.

Select may_treat from the role_type menu.



Click the Add to Workflow button to enter this function into the workflow.

Saving and Loading the Workflow
Click the Save button in the Execute section to save the workflow configuration. A popup menu will prompt you to save the file.

To test loading the workflow configuration, click the Clear button to delete the workflow from the RxMix page.

In the Load section, click the from my workflows button and select the workflow configuration that was just saved. The workflow should look like the figure below.



Note: The parameters for each function can be viewed by moving the cursor over the function name in the workflow graph.

Create an Input File
In a text editor, create an input file with the following NDC values (one per line):

00591377510
00781318273
00093577001

Save the file with a .txt extension. This will be used as input to the workflow.

Creating a Batch Job
To create a batch run in RxMix, click on the Batch tab in the Input section. The Batch Form will be displayed.



Enter your email address and the file name of the input file previously created.

Selecting Output Options
RxMix allows filtering of the output variables produced by the last function of the workflow. RxMix also lets the user choose which format to display the batch output - XML, JSON, or TEXT.

Uncheck the kind box in the Output Filter section.

Select the TEXT item under the Output Format section.



Click on the Submit Batch button to start the batch processing. An email message will be sent to you with a link to the results of the run.

The text results should look like this:

F0|findRxcuiById|I0|00591377510|F1|getRelatedByType|I1|617310|F2|findConceptsByName|I2|atorvastatin|F3|
getRelatedConceptsByRole|I3|N0000022046|name|Arteriosclerosis|NUI|N0000000473
F0|findRxcuiById|I0|00591377510|F1|getRelatedByType|I1|617310|F2|findConceptsByName|I2|atorvastatin|F3|
getRelatedConceptsByRole|I3|N0000022046|name|Coronary Artery Disease|NUI|N0000000856
F0|findRxcuiById|I0|00591377510|F1|getRelatedByType|I1|617310|F2|findConceptsByName|I2|atorvastatin|F3|
getRelatedConceptsByRole|I3|N0000022046|name|Hypercholesterolemia|NUI|N0000001580
F0|findRxcuiById|I0|00591377510|F1|getRelatedByType|I1|617310|F2|findConceptsByName|I2|atorvastatin|F3|
getRelatedConceptsByRole|I3|N0000022046|name|Hyperlipidemias|NUI|N0000001592
F0|findRxcuiById|I0|00591377510|F1|getRelatedByType|I1|617310|F2|findConceptsByName|I2|atorvastatin|F3|
getRelatedConceptsByRole|I3|N0000022046|name|Hyperlipoproteinemias|NUI|N0000001594
F0|findRxcuiById|I0|00591377510|F1|getRelatedByType|I1|617310|F2|findConceptsByName|I2|atorvastatin|F3|
getRelatedConceptsByRole|I3|N0000022046|name|Hypertriglyceridemia|NUI|N0000003210
F0|findRxcuiById|I0|00781318273|F1|getRelatedByType|I1|310414|F2|findConceptsByName|I2|fomepizole|F3|
getRelatedConceptsByRole|I3|N0000148539|name|Drug Toxicity|NUI|N0000001000
F0|findRxcuiById|I0|00093577001|F1|getRelatedByType|I1|314154|F2|findConceptsByName|I2|olanzapine|F3|
getRelatedConceptsByRole|I3|N0000148465|name|Bipolar Disorder|NUI|N0000000553
F0|findRxcuiById|I0|00093577001|F1|getRelatedByType|I1|314154|F2|findConceptsByName|I2|olanzapine|F3|
getRelatedConceptsByRole|I3|N0000148465|name|Psychotic Disorders|NUI|N0000002532
F0|findRxcuiById|I0|00093577001|F1|getRelatedByType|I1|314154|F2|findConceptsByName|I2|olanzapine|F3|
getRelatedConceptsByRole|I3|N0000148465|name|Schizophrenia|NUI|N0000002690