<?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: Identifying patients with gaps in medication longer than a set length of days in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identifying-patients-with-gaps-in-medication-longer-than-a-set/m-p/810267#M319523</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;I did not know this function it works perfectly!&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2022 19:14:22 GMT</pubDate>
    <dc:creator>Ju_Fr</dc:creator>
    <dc:date>2022-04-27T19:14:22Z</dc:date>
    <item>
      <title>Identifying patients with gaps in medication longer than a set length of days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-patients-with-gaps-in-medication-longer-than-a-set/m-p/810163#M319476</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m a new sas user and I’m stuck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a patient dataset with one line per patient and a dummy variable for each of 12 days. 1 is for when the patient has medication on hand and 0 when they do not.&lt;/P&gt;&lt;P&gt;What I would like is to identify patients who have a medication gap of 4 days or more, along with the starting date of this gap. &amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, patient A has such a gap that starts on day 4. Patient B has a gap of 2 days on days 2-3 but I’m only interested in their longer gap starting on day 8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only code I managed to come up with counted the total number of gap days per ID but that was inappropriate because I need to indentify patients who have a distinct gap &amp;gt;=4 days, and not patients who overall have missed medication more than 4 days over the period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight would be warmly appreciated&amp;nbsp;! Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&amp;nbsp;have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&amp;nbsp;ID $ day1 day2 day3 day4 day5 day6 day7 day8 day9 day10 day11 day12;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a 1 1 1 0 0 0 0 0 0 0 0 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b&amp;nbsp;1 1 0 0 1 1 1 0 0 0 0 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c&amp;nbsp;1 0 1 1 1 1 1 1 0 0 0 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d&amp;nbsp;1 1 1 0 0 1 1 0 0 0 1&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&amp;nbsp;want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&amp;nbsp;ID $ gap gap_date $;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a 1 day4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b&amp;nbsp;1 day8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c&amp;nbsp;1 day9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d&amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 14:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-patients-with-gaps-in-medication-longer-than-a-set/m-p/810163#M319476</guid>
      <dc:creator>Ju_Fr</dc:creator>
      <dc:date>2022-04-27T14:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying patients with gaps in medication longer than a set length of days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-patients-with-gaps-in-medication-longer-than-a-set/m-p/810183#M319487</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
set have;

start = index(cats(of day1-day12), '0000');
drop day1-day12;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/417490"&gt;@Ju_Fr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I’m a new sas user and I’m stuck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a patient dataset with one line per patient and a dummy variable for each of 12 days. 1 is for when the patient has medication on hand and 0 when they do not.&lt;/P&gt;
&lt;P&gt;What I would like is to identify patients who have a medication gap of 4 days or more, along with the starting date of this gap. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, patient A has such a gap that starts on day 4. Patient B has a gap of 2 days on days 2-3 but I’m only interested in their longer gap starting on day 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only code I managed to come up with counted the total number of gap days per ID but that was inappropriate because I need to indentify patients who have a distinct gap &amp;gt;=4 days, and not patients who overall have missed medication more than 4 days over the period.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any insight would be warmly appreciated&amp;nbsp;! Thank you&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&amp;nbsp;have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&amp;nbsp;ID $ day1 day2 day3 day4 day5 day6 day7 day8 day9 day10 day11 day12;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a 1 1 1 0 0 0 0 0 0 0 0 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b&amp;nbsp;1 1 0 0 1 1 1 0 0 0 0 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c&amp;nbsp;1 0 1 1 1 1 1 1 0 0 0 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d&amp;nbsp;1 1 1 0 0 1 1 0 0 0 1&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&amp;nbsp;want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&amp;nbsp;ID $ gap gap_date $;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalines ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a 1 day4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b&amp;nbsp;1 day8&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c&amp;nbsp;1 day9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d&amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 15:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-patients-with-gaps-in-medication-longer-than-a-set/m-p/810183#M319487</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-04-27T15:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying patients with gaps in medication longer than a set length of days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-patients-with-gaps-in-medication-longer-than-a-set/m-p/810267#M319523</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;I did not know this function it works perfectly!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 19:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-patients-with-gaps-in-medication-longer-than-a-set/m-p/810267#M319523</guid>
      <dc:creator>Ju_Fr</dc:creator>
      <dc:date>2022-04-27T19:14:22Z</dc:date>
    </item>
  </channel>
</rss>

