<?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: Creating flags to measure differences in episodes of hospital readmissions in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305825#M8742</link>
    <description>&lt;P&gt;It really helps to provide some data. How do we know what the discharge date of your index variable is? Or the admission date of the Read_flag2? Are they even SAS date values, character or some other numeric that looks vaguely date like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; to&amp;nbsp;create data step code of your All.New_reflag dataset so we can test data against it. But you may still need to tell use how to identify DISD and ADMD.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2016 23:34:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-10-19T23:34:27Z</dc:date>
    <item>
      <title>Creating flags to measure differences in episodes of hospital readmissions</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305718#M8732</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to create a flag to indicate readmission episodes. I started&amp;nbsp;by using SQL to identify all persons in a data set where the difference between their&amp;nbsp;admission (ADMD) and discharge (DISD) dates were between 1 and 30. The resulting data set generated a flag for readmits (Read_Flag) . I then used that information to transpose the Read_Flag by patient:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc transpose data=all.readmits4 out=all.reflag_wide prefix=Read_Flag;&lt;BR /&gt;by uidnum ;&lt;BR /&gt;var Read_Flag;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data all.NEW_reflag;&amp;nbsp;&lt;BR /&gt;merge all.reflag_wide all.readmits4a;&lt;BR /&gt;by uidnum;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=all.NEW_reflag nodups;&amp;nbsp;&lt;BR /&gt;by uidnum;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data all.NEW_reflag2;&lt;BR /&gt;set all.NEW_reflag;&lt;BR /&gt;rename Read_Flag1 = index;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Everything is ok until I get here:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data all.NEW_reflag2;&lt;BR /&gt;if index (DISD) - Read_Flag2 (ADMD) &amp;gt;= 30 then RDMT1 =1;&lt;BR /&gt;else RDMT1=0;&lt;BR /&gt;if if Read_Flag2 (DISD) - Read_Flag3 (ADMD) &amp;gt;= 30 then RDMT2 =1;&lt;BR /&gt;else RDMT2=0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, I would like to create a flag to indicate readmission episodes (Read_Flag 1 through &amp;nbsp;Read_Flag 1894) that are more than 30 days apart (with a RDMT flag). I tired the code above however I get a lot of syntax error issues from SAS, plus I'm not sure if I can subtract&amp;nbsp;that the discharge date from one variable with the admission date of another variable. Please advise on the most efficient&amp;nbsp;way to address this issue, Thanks:&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305718#M8732</guid>
      <dc:creator>melgwy</dc:creator>
      <dc:date>2016-10-19T17:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating flags to measure differences in episodes of hospital readmissions</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305760#M8738</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to search a string with the index function you need both a source string and target string.&lt;/P&gt;
&lt;P&gt;I have no idea what you may be attempting to do here:&lt;/P&gt;
&lt;P&gt;if index (DISD) - Read_Flag2 (ADMD) &amp;gt;= 30 then RDMT1 =1;&lt;/P&gt;
&lt;P&gt;Read_flag1(ADMD) will mean absolutely nothing to SAS.&lt;/P&gt;
&lt;P&gt;If you want to compare the postions of strings you'll need to provide 1) the name of the variable and 2) the value to search for in that variable. It&amp;nbsp; looks like you may want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if index(index,'DISD') - index(Read_flag2,'ADMD') ge 30 then RDMT1=1;&lt;/P&gt;
&lt;P&gt;Assuming you meant to search for the string value 'DISD' inside the variable Index and 'ADMD' inside the variable Read_flag2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to consider:&lt;/P&gt;
&lt;P&gt;data all.NEW_reflag2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set all.NEW_reflag (rename=(Read_Flag1 = index));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 20:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305760#M8738</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-19T20:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating flags to measure differences in episodes of hospital readmissions</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305776#M8740</link>
      <description>I will try this,&lt;BR /&gt;My goal was to subtract the discharge date (DISD) of my index variable fom the admission (ADMD)date of my Read_flag2 variable.&lt;BR /&gt;Does that change your suggestion?</description>
      <pubDate>Wed, 19 Oct 2016 20:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305776#M8740</guid>
      <dc:creator>melgwy</dc:creator>
      <dc:date>2016-10-19T20:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating flags to measure differences in episodes of hospital readmissions</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305825#M8742</link>
      <description>&lt;P&gt;It really helps to provide some data. How do we know what the discharge date of your index variable is? Or the admission date of the Read_flag2? Are they even SAS date values, character or some other numeric that looks vaguely date like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; to&amp;nbsp;create data step code of your All.New_reflag dataset so we can test data against it. But you may still need to tell use how to identify DISD and ADMD.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 23:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Creating-flags-to-measure-differences-in-episodes-of-hospital/m-p/305825#M8742</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-19T23:34:27Z</dc:date>
    </item>
  </channel>
</rss>

