Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

Find medication names in text

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

Answers

  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 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: 333 Unicorn
  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,529 RM Data Scientist
    Sven,

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

    ~Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • DocMusherDocMusher Member Posts: 333 Unicorn
    Thanks Martin,
    Somebody with a working example process?
    Thanks
  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 578 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">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <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>
          <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>
            <list key="request_properties">
              <parameter key="Content-Type" value="application/json"/>
              <parameter key="Accept" value="application/json"/>
            </list>
            <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>
          <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"/>
        </process>
      </operator>
    </process>
Sign In or Register to comment.