<?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: regular expression ICD-10-CM in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579407#M164469</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279461"&gt;@xinyao2019&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;how to write regular expression to identify cases coded using ICD-10-CM?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there are 9 diagnosis codes, as long as one diagnosis code meets the definition, then disease=1&lt;/P&gt;
&lt;P&gt;((T3[679]9|T414|T427|T4[3579]9)[1-4].|(?!(T3[679]9|T414|T427|T4[3579]9))(T3[6-9]|T4[0-9]|T50)..[1-4])(A|$|\b)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I know just enough about ICD-10 codes to be dangerous.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the recurring issues on this forum regarding ICD-10 and ICD-9 coding is that different organizations implement the coding slightly differently for the values with some using periods, other using _ instead of periods and I believe that we have at least one organization that uses custom informat / format pairs to create numeric ICD variables so some specific sort orders are used.&lt;/P&gt;
&lt;P&gt;So you should likely show some of the entire values that you are searching for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach that has been used is custom format for specific disease which allows such thing as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If put(icdvar,$customformatname.) = '1' then ...&lt;/P&gt;
&lt;P&gt;moving the logic out to proc format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If by any chance you actually have all of the codes in a data set it is very easy to create a CNTLIN data set for Proc format to create the needed format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the concerns I have with Regex and ICD-10 is there are so many levels for some of the code groups and interpreting some of those expressions, as you are finding, may not be particularly easy to catch all of the cases involved.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2019 15:00:45 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-08-06T15:00:45Z</dc:date>
    <item>
      <title>regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579252#M164408</link>
      <description>&lt;P&gt;how to write regular expression to identify cases coded using ICD-10-CM?&amp;nbsp;&lt;/P&gt;&lt;P&gt;there are 9 diagnosis codes, as long as one diagnosis code meets the definition, then disease=1&lt;/P&gt;&lt;P&gt;((T3[679]9|T414|T427|T4[3579]9)[1-4].|(?!(T3[679]9|T414|T427|T4[3579]9))(T3[6-9]|T4[0-9]|T50)..[1-4])(A|$|\b)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 00:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579252#M164408</guid>
      <dc:creator>xinyao2019</dc:creator>
      <dc:date>2019-08-06T00:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579271#M164417</link>
      <description>&lt;P&gt;It is highly unlikely that many posters on the Community know anything about&amp;nbsp;ICD-10-CM. I don't. If you could explain what the 9 diagnosis codes are, and some more example data with expected outcomes then you will have a better chance of getting suitable answers.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 05:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579271#M164417</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-08-06T05:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579275#M164418</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp; already said it is hard to build a regex if you don't know what it is exactly you are looking for (what are the boundaries of the codes and the general structure).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But even better then answering try to build it by yourself. Developing the pattern with this site is super intuitive:&amp;nbsp;&lt;A href="https://regexr.com/38ed7" target="_blank"&gt;https://regexr.com/38ed7&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are not familiar with the basic concepts of regex I recommend this blog post:&amp;nbsp;&lt;A href="https://www.janmeppe.com/blog/regex-for-noobs/" target="_blank"&gt;https://www.janmeppe.com/blog/regex-for-noobs/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS the function you would want to use is the prxmatch function(&lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0bj9p4401w3n9n1gmv6tf**bleep**9m.htm&amp;amp;docsetVersion=3.1&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0bj9p4401w3n9n1gmv6tf**bleep**9m.htm&amp;amp;docsetVersion=3.1&amp;amp;locale=en&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also a great resource about RegEx in SAS is the regex tip sheet by the SAS Support Team:&amp;nbsp;&lt;A href="https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf" target="_blank"&gt;https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps you!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 05:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579275#M164418</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-08-06T05:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579302#M164429</link>
      <description>&lt;P&gt;If the expression you want to use is the one you gave, just write:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT size="2"&gt;DISEASE=prxmatch('/((T3[679]9|T414|T427|T4[3579]9)[1-4].|(?!(T3[679]9|T414|T427|T4[3579]9))(T3[6-9]|T4[0-9]|T50)..[1-4])(A|$|\b)/',DIAGNOSIS_CODE);&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT size="2"&gt;DISEASE=prxmatch('/((T3[679]9|T414|T427|T4[3579]9)[1-4].|(?!(T3[679]9|T414|T427|T4[3579]9))(T3[6-9]|T4[0-9]|T50)..[1-4])(A|$|\b)/',DIAGNOSIS_CODE)&amp;gt;0;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 10:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579302#M164429</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-08-06T10:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579407#M164469</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279461"&gt;@xinyao2019&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;how to write regular expression to identify cases coded using ICD-10-CM?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there are 9 diagnosis codes, as long as one diagnosis code meets the definition, then disease=1&lt;/P&gt;
&lt;P&gt;((T3[679]9|T414|T427|T4[3579]9)[1-4].|(?!(T3[679]9|T414|T427|T4[3579]9))(T3[6-9]|T4[0-9]|T50)..[1-4])(A|$|\b)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I know just enough about ICD-10 codes to be dangerous.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the recurring issues on this forum regarding ICD-10 and ICD-9 coding is that different organizations implement the coding slightly differently for the values with some using periods, other using _ instead of periods and I believe that we have at least one organization that uses custom informat / format pairs to create numeric ICD variables so some specific sort orders are used.&lt;/P&gt;
&lt;P&gt;So you should likely show some of the entire values that you are searching for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another approach that has been used is custom format for specific disease which allows such thing as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If put(icdvar,$customformatname.) = '1' then ...&lt;/P&gt;
&lt;P&gt;moving the logic out to proc format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If by any chance you actually have all of the codes in a data set it is very easy to create a CNTLIN data set for Proc format to create the needed format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the concerns I have with Regex and ICD-10 is there are so many levels for some of the code groups and interpreting some of those expressions, as you are finding, may not be particularly easy to catch all of the cases involved.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579407#M164469</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-06T15:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579417#M164476</link>
      <description>&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;data contain&lt;/P&gt;&lt;P&gt;ID diagnosis1&amp;nbsp;diagnosis2 diagnosis3 diagnosis4 diagnosis5 diagnosis6 diagnosis7 diagnosis8 diagnosis9&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;T12340&amp;nbsp; &amp;nbsp; T1235&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;S12400&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; S12340&amp;nbsp; &amp;nbsp; &amp;nbsp; T123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T1256&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; S12345&amp;nbsp; &amp;nbsp; &amp;nbsp; S13456&amp;nbsp; &amp;nbsp; &amp;nbsp; T567&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The definition for disease is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;((T3[679]9|T414|T427|T4[3579]9)[1-4].|(?!(T3[679]9|T414|T427|T4[3579]9))(T3[6-9]|T4[0-9]|T50)..[1-4])(A|$|\b)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;as long as one of the diagnosis meets the definition, the case is disease=1&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579417#M164476</guid>
      <dc:creator>xinyao2019</dc:creator>
      <dc:date>2019-08-06T15:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579418#M164477</link>
      <description>&lt;P&gt;thanks for the resources. very helpful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579418#M164477</guid>
      <dc:creator>xinyao2019</dc:creator>
      <dc:date>2019-08-06T15:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579420#M164478</link>
      <description>&lt;P&gt;thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the codes in case someone else needs it.&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set datahave;&lt;/P&gt;&lt;P&gt;array injurydx[9] $7 DIAG1-DIAG9;/*diagnosis 1-9 variables*/&lt;BR /&gt;do i = 1 to 9;&lt;BR /&gt;DISEASE=prxmatch('/((T3[679]9|T414|T427|T4[3579]9)[1-4].|(?!(T3[679]9|T414|T427|T4[3579]9))(T3[6-9]|T4[0-9]|T50)..[1-4])(A|$|\b)/',injurydx[i] );&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 15:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579420#M164478</guid>
      <dc:creator>xinyao2019</dc:creator>
      <dc:date>2019-08-06T15:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: regular expression ICD-10-CM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579486#M164491</link>
      <description>&lt;P&gt;i did not know that different organizations implement&amp;nbsp; ICD-10-CM slightly different.&amp;nbsp;&lt;/P&gt;&lt;P&gt;we have the ICD-10-CM in our dataset as Character&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is how it looks:&lt;/P&gt;&lt;P&gt;Obs DIAG1&lt;/P&gt;&lt;P&gt;1 I130&lt;/P&gt;&lt;P&gt;2 J189&lt;/P&gt;&lt;P&gt;3 S42201A&lt;/P&gt;&lt;P&gt;4 A047&lt;/P&gt;&lt;P&gt;5 J440&lt;/P&gt;&lt;P&gt;6 K5720&lt;/P&gt;&lt;P&gt;7 J189&lt;/P&gt;&lt;P&gt;8 O701&lt;/P&gt;&lt;P&gt;9 Z3800&lt;/P&gt;&lt;P&gt;10 Z3800&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 19:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regular-expression-ICD-10-CM/m-p/579486#M164491</guid>
      <dc:creator>xinyao2019</dc:creator>
      <dc:date>2019-08-06T19:45:30Z</dc:date>
    </item>
  </channel>
</rss>

