<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Extracting dosage and unit of measurement from a string variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/495549#M130796</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you kindly for your time to reply to my question. Much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 23:54:32 GMT</pubDate>
    <dc:creator>Carbon</dc:creator>
    <dc:date>2018-09-13T23:54:32Z</dc:date>
    <item>
      <title>Extracting dosage and unit of measurement from a string variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/494715#M130426</link>
      <description>&lt;P&gt;&amp;nbsp;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create two variables - one with dosage (number) and another with units of measurement (string - &lt;EM&gt;mg, mgs, mL&lt;/EM&gt;&amp;nbsp;or&amp;nbsp;&lt;EM&gt;iu&lt;/EM&gt;) using free text medication records that do not appear to follow any structured pattern and some of them have entries that complicate scanning the digits, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DRUG 357860 25mg TAB&amp;nbsp;-&amp;nbsp;&lt;EM&gt;[problem: two numbers and&amp;nbsp;only one of them is dosage, another is a part of drug name]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Drug_1/Drug_2 1 liquid 50/8mL&amp;nbsp;-&amp;nbsp;&lt;EM&gt;[problem: two numbers for two different drugs separated by /]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Drug 250mgs TAB (250mgs)&amp;nbsp;-&amp;nbsp;&lt;EM&gt;[problem: double entry of the same dosage]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Drug 80 iu text&amp;nbsp;-&amp;nbsp;&lt;EM&gt;[space between dosage and unit]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The predominant format is DRUG NAME&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;123mg TEXT.&amp;nbsp;The&amp;nbsp;observations that have two drugs with two dosage values would create two variables with two separate dosages - Drug 1 and Drug 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use scan and compress, but I don't know how to separate numbers that are part of a drug name&amp;nbsp;from dosage values. Any ideas on&amp;nbsp;how to approach this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any advice. My apologies if I missed similar postings. I tried to search, but couldn't find an exact match.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 04:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/494715#M130426</guid>
      <dc:creator>Carbon</dc:creator>
      <dc:date>2018-09-12T04:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting dosage and unit of measurement from a string variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/494719#M130429</link>
      <description>Do you know all measurement units that can appear in the data? I would start with some regular expressions, like /.*(\d+)mg.*/&lt;BR /&gt;With prxposn the contents of the brackets can be extracted.</description>
      <pubDate>Wed, 12 Sep 2018 05:26:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/494719#M130429</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2018-09-12T05:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting dosage and unit of measurement from a string variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/494736#M130437</link>
      <description>&lt;P&gt;From free text it is going to be very hard to extract anything of use.&amp;nbsp; In circumstances like this it is advisable to get the data coded by a medical professional, as things like the drug, and the &amp;lt;text&amp;gt; part may impact dose, frequency, drug etc.&amp;nbsp; Simple text matching will not work on this.&amp;nbsp; It is one reason why most companies setup databases to collect various data points in their own separate fields.&amp;nbsp; You have given an example of this yourself:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Drug_1/Drug_2 1 liquid 50/8mL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should this be recorded as Drug combination xyz at y dose, or two separate drugs a differing doses.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How will you be encoding this further - i.e. to global standard medical dictionaries?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 07:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/494736#M130437</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-12T07:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting dosage and unit of measurement from a string variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/495175#M130637</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for getting back to me and your feedback. I can now provide&amp;nbsp;a detailed extract of my data (substring of interest is highlighted):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;10MG&lt;/FONT&gt; TAB (INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;10MCG&lt;/FONT&gt;/HRTRANPATCH (INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG&lt;FONT color="#993300"&gt;50MCG&lt;/FONT&gt;TAB (INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;50/8MG&lt;/FONT&gt; TAB (INGREDIENT, INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG&lt;FONT color="#993300"&gt;100&lt;/FONT&gt;/&lt;FONT color="#993300"&gt;25&lt;/FONT&gt;TAB (INGREDIENT; INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG&lt;FONT color="#993300"&gt;13.125G&lt;/FONT&gt;SACH (PWDR) (INGREDIENT 3350; INGREDIENT; INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG SZ &lt;FONT color="#993300"&gt;50MG&lt;/FONT&gt; TAB&lt;/P&gt;&lt;P&gt;DRUG SZ &lt;FONT color="#993300"&gt;500MG&lt;/FONT&gt;CAP&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;5MG&lt;/FONT&gt;/ML MIXT (INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;20MCG&lt;/FONT&gt;/H&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;3.3G&lt;/FONT&gt;/5ML&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;1.25G&lt;/FONT&gt; BLUE (INGREDIENT BLUE 1.25G TAB)&lt;/P&gt;&lt;P&gt;DRUG D &lt;FONT color="#993300"&gt;1000IU&lt;/FONT&gt; CAP&lt;/P&gt;&lt;P&gt;DRUG&lt;FONT color="#993300"&gt;500MG/5ML&lt;/FONT&gt;TEXT (INGREDIENT INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG240 &lt;FONT color="#993300"&gt;240MG&lt;/FONT&gt;/5 EL (INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG SR-CAP &lt;FONT color="#993300"&gt;200MG/25MG&lt;/FONT&gt; (INGREDIENT/INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;5/2.5MG&lt;/FONT&gt; TAB (INGREDIENT;INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG TAB &lt;FONT color="#993300"&gt;310/.35MG&lt;/FONT&gt; (INGREDIENT; INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG MR-TAB &lt;FONT color="#993300"&gt;100MG&lt;/FONT&gt; 100MG MR-TAB (INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG 5/5 &lt;FONT color="#993300"&gt;5MG/5MG&lt;/FONT&gt; TAB (INGREDIENT/INGREDIENT)&lt;/P&gt;&lt;P&gt;DRUG &lt;FONT color="#993300"&gt;600MG/200IU&lt;/FONT&gt; TAB (INGREDIENT &amp;amp; INGREDIENT)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The units of measurements are determined as g, mg, mcg, ml and iu. In terms of issue with two drugs, there is a variable that identifies two generic components of medication (INGREDIENT) using the ATC code. I just need to extract the corresponding dosage values and units.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give me an example of using &lt;STRONG&gt;prxposn&lt;/STRONG&gt; based on my data. I understand that it also involves &lt;STRONG&gt;prxparse &lt;/STRONG&gt;and&lt;STRONG&gt; prxmatch, &lt;/STRONG&gt;but have very&amp;nbsp;sketchy understanding of these commands.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 06:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/495175#M130637</guid>
      <dc:creator>Carbon</dc:creator>
      <dc:date>2018-09-13T06:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting dosage and unit of measurement from a string variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/495191#M130648</link>
      <description>&lt;P&gt;Yes, unfortunately there is no one pattern for programming this.&amp;nbsp; You will need to set out a whole series of possibilities from, is scan(2) a dose, is position of first number a dose etc.&lt;/P&gt;
&lt;P&gt;Then there is as I mentioned previously a judgement call on the data, say you have an aspirin 100mg tab combination, should the dose be the tablet dose, or the aspirin part of the tablet - just an example I made up - this is why i recommend you get medical review on the data.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 08:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/495191#M130648</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-13T08:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting dosage and unit of measurement from a string variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/495549#M130796</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you kindly for your time to reply to my question. Much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 23:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-dosage-and-unit-of-measurement-from-a-string-variable/m-p/495549#M130796</guid>
      <dc:creator>Carbon</dc:creator>
      <dc:date>2018-09-13T23:54:32Z</dc:date>
    </item>
  </channel>
</rss>

