The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

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, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 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.