The beta program for the RapidMiner 9.7 release is now available. Lots of amazing new improvements including true version control!


Find medication names in text

DocMusherDocMusher Member Posts: 316   Unicorn
edited November 2018 in Help
Somebody a fast answer or experience using this webservice to find drug names https://rxnav.nlm.nih.gov/index.html?


  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 570   Unicorn
    I can't even get that page to load in my browser with or without VPN. 
    Do you have a link to the API documentation?
  • DocMusherDocMusher Member Posts: 316   Unicorn
  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,408  RM Data Scientist

    i think this is the link for Get Page: https://rxnav.nlm.nih.gov/REST/drugs?name=cymbalta

    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
  • DocMusherDocMusher Member Posts: 316   Unicorn
    Thanks Martin,
    Somebody with a working example process?
  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 570   Unicorn
    Sure, it's a really simple example. 

    Note, the default return request for the data is XML, but I have chosen JSON because it means I don't need to configure XPath to convert it into an exampleSet.  Clever use of SelectAttributes, filters, loops, transpose & regular expressions should enable you to the abuse the returned dataset in any way you please.
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="7.0.001">
      <operator activated="true" class="process" compatibility="7.0.001" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="set_macro" compatibility="7.0.001" expanded="true" height="68" name="Put Drug Name Here" width="90" x="45" y="34">
            <parameter key="macro" value="drugName"/>
            <parameter key="value" value="aspirin"/>
          <operator activated="true" class="web:get_webpage" compatibility="7.0.000" expanded="true" height="68" name="Get Page" width="90" x="246" y="34">
            <parameter key="url" value="https://rxnav.nlm.nih.gov/REST/drugs"/>
            <list key="query_parameters">
              <parameter key="name" value="%{drugName}"/>
            <list key="request_properties">
              <parameter key="Content-Type" value="application/json"/>
              <parameter key="Accept" value="application/json"/>
            <description align="center" color="transparent" colored="false" width="126">Making sure I ask for JSON data in response rather than default XML as it's easier to handle with JSON to Data operator.</description>
          <operator activated="true" class="text:json_to_data" compatibility="7.0.000" expanded="true" height="82" name="JSON To Data" width="90" x="380" y="34"/>
          <connect from_op="Get Page" from_port="output" to_op="JSON To Data" to_port="documents 1"/>
          <connect from_op="JSON To Data" from_port="example set" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
Sign In or Register to comment.