<?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 Exclude all claim entries from a specific enrolid-year combination of dx codes appear after index da in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exclude-all-claim-entries-from-a-specific-enrolid-year/m-p/424073#M104365</link>
    <description>&lt;P&gt;I have a list of&amp;nbsp;inpatient claims ("compiled_ip_index_1") where all enrolids&amp;nbsp;are confirmed to&amp;nbsp;be continuously eligible.&amp;nbsp;Dataset also includes the following vars:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;enrolid&lt;/U&gt;:&amp;nbsp;identifies a patient&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;year&lt;/U&gt;: year&amp;nbsp;the data is from (2010 - 2014)&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;index_dt&lt;/U&gt;: date when the first diagnosis of a specified disease happens, given to each unique enrolid-year combination&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;dx1&lt;/U&gt;: primary diagnosis for which the claim was submitted for&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;dtstart&lt;/U&gt;: start date of claim&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;How do I exclude all claim entries from a specific enrolid-year combination&amp;nbsp;&lt;/STRONG&gt;if a series of exclusionary codes happen to that enrolid-year after index date?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm thinking&amp;nbsp;of something like the following. Haven't tested it out --&amp;nbsp;&lt;STRONG&gt;is there any way to make this more elegant? Is the below syntax OK?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let excl_code = '123', '12345', '4567', '1859', '9084'

data excluded_enrolid_year;
	set compiled_ip;
	keep enrolid year;
	where dx1 in &amp;amp;excl_code and dtstart &amp;gt;= index_dt;
run;

data final_compiled_ip;
	set compiled_ip_index_1;
	drop select distinct enrolid, year from excluded_enrolid_year;&lt;BR /&gt;def2=1
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you so much! (the last part def2=1 I just want to flag that these entries qualify under "def 2")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Dec 2017 20:09:38 GMT</pubDate>
    <dc:creator>cdubs</dc:creator>
    <dc:date>2017-12-29T20:09:38Z</dc:date>
    <item>
      <title>Exclude all claim entries from a specific enrolid-year combination of dx codes appear after index da</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-all-claim-entries-from-a-specific-enrolid-year/m-p/424073#M104365</link>
      <description>&lt;P&gt;I have a list of&amp;nbsp;inpatient claims ("compiled_ip_index_1") where all enrolids&amp;nbsp;are confirmed to&amp;nbsp;be continuously eligible.&amp;nbsp;Dataset also includes the following vars:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;U&gt;enrolid&lt;/U&gt;:&amp;nbsp;identifies a patient&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;year&lt;/U&gt;: year&amp;nbsp;the data is from (2010 - 2014)&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;index_dt&lt;/U&gt;: date when the first diagnosis of a specified disease happens, given to each unique enrolid-year combination&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;dx1&lt;/U&gt;: primary diagnosis for which the claim was submitted for&lt;/LI&gt;&lt;LI&gt;&lt;U&gt;dtstart&lt;/U&gt;: start date of claim&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;How do I exclude all claim entries from a specific enrolid-year combination&amp;nbsp;&lt;/STRONG&gt;if a series of exclusionary codes happen to that enrolid-year after index date?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm thinking&amp;nbsp;of something like the following. Haven't tested it out --&amp;nbsp;&lt;STRONG&gt;is there any way to make this more elegant? Is the below syntax OK?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let excl_code = '123', '12345', '4567', '1859', '9084'

data excluded_enrolid_year;
	set compiled_ip;
	keep enrolid year;
	where dx1 in &amp;amp;excl_code and dtstart &amp;gt;= index_dt;
run;

data final_compiled_ip;
	set compiled_ip_index_1;
	drop select distinct enrolid, year from excluded_enrolid_year;&lt;BR /&gt;def2=1
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you so much! (the last part def2=1 I just want to flag that these entries qualify under "def 2")&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 20:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-all-claim-entries-from-a-specific-enrolid-year/m-p/424073#M104365</guid>
      <dc:creator>cdubs</dc:creator>
      <dc:date>2017-12-29T20:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude all claim entries from a specific enrolid-year combination of dx codes appear after inde</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-all-claim-entries-from-a-specific-enrolid-year/m-p/424085#M104373</link>
      <description>&lt;P&gt;Why haven't you tried your code? That would be the logical thing to do before posting to this forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From my partial understanding of your requirements, your code should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let excl_code = ('123' '12345' '4567' '1859' '9084');

data excluded_enrolid_year;
	set compiled_ip;
	keep enrolid year;
	where dx1 in &amp;amp;excl_code. and dtstart &amp;gt;= index_dt;
run;

proc sql;
create table final_compiled_ip as
select * 
from compiled_ip_index_1 as a
where not exists (select * from excluded_enrolid_year where enrolId=a.enrolId and year=a.year);
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could also be done with a merge operation in a data step, I guess.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 23:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-all-claim-entries-from-a-specific-enrolid-year/m-p/424085#M104373</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-12-29T23:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude all claim entries from a specific enrolid-year combination of dx codes appear after inde</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-all-claim-entries-from-a-specific-enrolid-year/m-p/424088#M104376</link>
      <description>My system is down and I’ve been trying to work around that! But thank you! I’ll try this ASAP&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Dec 2017 23:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-all-claim-entries-from-a-specific-enrolid-year/m-p/424088#M104376</guid>
      <dc:creator>cdubs</dc:creator>
      <dc:date>2017-12-29T23:47:04Z</dc:date>
    </item>
  </channel>
</rss>

