<?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 Unique Denied Claims within 14 days window. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471928#M285773</link>
    <description>&lt;P&gt;It is strange, it works for some patients but not for other.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 21:08:31 GMT</pubDate>
    <dc:creator>ssitharath0420</dc:creator>
    <dc:date>2018-06-20T21:08:31Z</dc:date>
    <item>
      <title>Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471723#M285762</link>
      <description>&lt;P&gt;I am trying to identify unique all denied claims within a 14 days window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Patient_id&lt;/TD&gt;&lt;TD&gt;Denied_date&lt;/TD&gt;&lt;TD&gt;Brand_name&lt;/TD&gt;&lt;TD&gt;Gen_name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5/16/2017&lt;/TD&gt;&lt;TD&gt;XIFAXAN&lt;/TD&gt;&lt;TD&gt;RIFAXIMIN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5/16/2017&lt;/TD&gt;&lt;TD&gt;XIFAXAN&lt;/TD&gt;&lt;TD&gt;RIFAXIMIN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5/16/2017&lt;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;&lt;TD&gt;11/28/2017&lt;/TD&gt;&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I used is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data denied_reassign1;&lt;BR /&gt;set denied_reassign;&lt;BR /&gt;enddate=denied_adj_dte+14;&lt;BR /&gt;format enddate date9.;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=denied_reassign1;&lt;BR /&gt;&amp;nbsp;by denied_patid denied_genname denied_adj_dte;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;data denied_reassign2;&lt;BR /&gt;set denied_reassign1;&lt;BR /&gt;patient_id2=lag1(denied_patid);&lt;BR /&gt;GenName2=lag1(Denied_Genname);&lt;BR /&gt;o_reject_cd2=lag1(o_reject_cd);&lt;BR /&gt;internal_resp_cd2=lag1(internal_resp_cd1);&lt;BR /&gt;denied_adj_dte_2=lag1(Denied_Adj_Dte);&lt;BR /&gt;format denied_adj_dte_2 date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=denied_reassign2;&lt;BR /&gt;&amp;nbsp;by denied_patid denied_genname denied_adj_dte;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data denied_reassign3;&lt;BR /&gt;set denied_reassign2;&lt;BR /&gt;Diff=denied_adj_dte-denied_adj_dte_2;&lt;BR /&gt;D_Adj_Dte=denied_adj_dte;&lt;BR /&gt;format D_Adj_Dte date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sort data=denied_reassign3;&lt;BR /&gt;&amp;nbsp;by denied_patid denied_genname denied_adj_dte;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data Rolling14Day_assgn;&lt;BR /&gt;set denied_reassign3;&lt;BR /&gt;if patient_id2=denied_patid and GenName2=Denied_Genname&amp;nbsp;&lt;BR /&gt;and Diff&amp;lt;=14 then do;&lt;BR /&gt;denied_adj_dte=end2;&lt;BR /&gt;end2=max(enddate,end2);&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;seg+1;&lt;BR /&gt;end2=enddate;&lt;BR /&gt;end;&lt;BR /&gt;format end2 date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=Rolling14Day_assgn;&lt;BR /&gt;&amp;nbsp;by denied_patid denied_genname seg;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;data Retain_Last_Clms;&lt;BR /&gt;set Rolling14Day_assgn;&lt;BR /&gt;by denied_patid denied_genname seg;&lt;BR /&gt;if last.seg then Keep=1;&lt;BR /&gt;else if Keep^=1 then delete;&lt;BR /&gt;drop denied_adj_dte;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some patients outputs were return correctly but other did not like the example I provided.&amp;nbsp; Please help!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 15:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471723#M285762</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2018-06-20T15:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471728#M285763</link>
      <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
    by patient_id brand_name gen_name denied_date;
run;
data want;
    retain last_day_of_14_day_period;
    set have;
    by  patient_id brand_name gen_name;
    if first.gen_name then last_day_of_14_day_period=denied_date+13;
    if denied_date&amp;lt;=last_day_of_14_day_period and not first.gen_name then delete;
    else if not first.gen_name then last_day_of_14_day_period=denied_date+13;
run;
    &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jun 2018 15:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471728#M285763</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-20T15:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471736#M285764</link>
      <description>&lt;P&gt;Hi Page,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the code but it only provide the first gen_name and it omitted all the other denied drugs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 15:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471736#M285764</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2018-06-20T15:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471738#M285765</link>
      <description>&lt;P&gt;I just modified the code, try it again.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 15:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471738#M285765</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-20T15:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471766#M285766</link>
      <description>&lt;P&gt;That didn't work either. It just gave me all the denied claims with denied_adj_dt+13.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to tell it once the first denied drug is completed to move to the next denied drug.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471766#M285766</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2018-06-20T16:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471778#M285767</link>
      <description>&lt;P&gt;Okay, we're not making progress&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so a couple of things will help us make progress&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to provide your data in the form of SAS code, so the rest of us can use it and try out our program on it&lt;/P&gt;
&lt;P&gt;&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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also need to SHOW US the resulting data set so we can see what you are seeing. A screen capture is fine.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471778#M285767</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-20T16:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471784#M285768</link>
      <description>&lt;P&gt;This is the result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Patient_id&lt;/TD&gt;&lt;TD&gt;Denied_date&lt;/TD&gt;&lt;TD&gt;Brand_name&lt;/TD&gt;&lt;TD&gt;Gen_name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5/16/2017&lt;/TD&gt;&lt;TD&gt;XIFAXAN&lt;/TD&gt;&lt;TD&gt;RIFAXIMIN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5/18/2017&lt;/TD&gt;&lt;TD&gt;FLUCONAZOLE&lt;/TD&gt;&lt;TD&gt;FLUCONAZOLE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;8/31/2017&lt;/TD&gt;&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;9/25/2017&lt;/TD&gt;&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;9/29/2017&lt;/TD&gt;&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;10/20/2017&lt;/TD&gt;&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;11/28/2017&lt;/TD&gt;&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471784#M285768</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2018-06-20T16:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471789#M285769</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/125428"&gt;@ssitharath0420&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That didn't work either. It just gave me all the denied claims with denied_adj_dt+13.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to tell it once the first denied drug is completed to move to the next denied drug.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does "completed" mean? I do not see any requirement or comment about "completed" or "first denied drug" in the initial question.&lt;/P&gt;
&lt;P&gt;I am also not sure how you are defining "14 day window". You might have some internal definition that we do not know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't even be sure that your "denied_date" is an actual SAS date valued variable or not.&lt;/P&gt;
&lt;P&gt;Where you show&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;9/25/2017&lt;/TD&gt;
&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;
&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I am not sure why that is included in the desired output but&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;9/22/2017&lt;/TD&gt;
&lt;TD&gt;PRALUENT PEN&lt;/TD&gt;
&lt;TD&gt;ALIROCUMAB&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;isn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471789#M285769</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-06-20T16:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471791#M285770</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/125428"&gt;@ssitharath0420&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This is the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you mean this is the result of running my code?????? It's not clear. Or is this the result you want???? Please clarify.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is the result of running my code, this is exactly what you asked for in your original message.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471791#M285770</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-20T16:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471800#M285771</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Patient_id 	Denied_date :mmddyy10.	Brand_name	&amp;amp; $20. Gen_name :$20.;
format Denied_date mmddyy10.;
cards;
1	5/16/2017	XIFAXAN	 RIFAXIMIN
1	5/16/2017	XIFAXAN	 RIFAXIMIN
1	5/16/2017	XIFAXAN	 RIFAXIMIN
1	5/16/2017	FLUCONAZOLE	  FLUCONAZOLE
1	5/16/2017	FLUCONAZOLE	  FLUCONAZOLE
1	5/17/2017	FLUCONAZOLE	  FLUCONAZOLE
1	5/18/2017	FLUCONAZOLE	  FLUCONAZOLE
1	8/18/2017	PRALUENT PEN	ALIROCUMAB
1	8/31/2017	PRALUENT PEN	ALIROCUMAB
1	9/13/2017	PRALUENT PEN	ALIROCUMAB
1	9/15/2017	PRALUENT PEN	ALIROCUMAB
1	9/18/2017	PRALUENT PEN	ALIROCUMAB
1	9/21/2017	PRALUENT PEN	ALIROCUMAB
1	9/22/2017	PRALUENT PEN	ALIROCUMAB
1	9/25/2017	PRALUENT PEN	ALIROCUMAB
1	9/29/2017	PRALUENT PEN	ALIROCUMAB
1	10/20/2017	PRALUENT PEN	ALIROCUMAB
1	11/28/2017	PRALUENT PEN	ALIROCUMAB
;

data temp;
set have;
by Patient_id;
retain _k;
if first.Patient_id then do;call missing(_k);_k=intnx('day',Denied_date,14); group=1;end;
else if not _f and Denied_date&amp;gt;_k then do; group+1;_f=1;_k=intnx('day',Denied_date,14);end;
format _k mmddyy10.;
drop _:;
run;

proc sql;
create table want(drop=group) as
select distinct *
from temp
group by patient_id, group, brand_name,gen_name
having Denied_date=max(Denied_date)
order by patient_id,Denied_date;
quit;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 17:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471800#M285771</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-20T17:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471801#M285772</link>
      <description>&lt;P&gt;Hi Good afternoon&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/125428"&gt;@ssitharath0420&lt;/a&gt;&amp;nbsp; Although I had fun playing around with your data. I would like to opine that your data needs &lt;STRONG&gt;solid&lt;/STRONG&gt; and&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;neat pre processing&lt;/STRONG&gt; with a full stack filled time series with continuous dates so that the process becomes a whole lot easier and easy to maintain.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are looking to implement a well automated code to run in production server, blimey!! that's not the data I would be happy to work with. --&amp;gt; My 2 cents&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 17:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471801#M285772</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-20T17:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471928#M285773</link>
      <description>&lt;P&gt;It is strange, it works for some patients but not for other.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 21:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471928#M285773</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2018-06-20T21:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471930#M285774</link>
      <description>&lt;P&gt;I can only test with the sample you post. May be you could try tweaking to work for your real data&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 21:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/471930#M285774</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-20T21:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying Unique Denied Claims within 14 days window.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/472102#M285775</link>
      <description>&lt;P&gt;This is the result I want.&amp;nbsp; Your code works great but it only take the first drug of that patient. I need it to look all the patient I have in my data set with their corresponding drug.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 14:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-Unique-Denied-Claims-within-14-days-window/m-p/472102#M285775</guid>
      <dc:creator>ssitharath0420</dc:creator>
      <dc:date>2018-06-21T14:14:38Z</dc:date>
    </item>
  </channel>
</rss>

