<?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: How to select patients with continuous insurance enrollment prior to an index date? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787411#M251595</link>
    <description>&lt;PRE&gt;&lt;CODE class=""&gt;data enrolled;
input patid fst_dt :YYMMDD10. eligeff :YYMMDD10. eligend :YYMMDD10.;
format fst_dt YYMMDD10. eligeff YYMMDD10. eligend YYMMDD10.;

cards;
123 2017-12-13 2017-07-01 2019-05-31
123 2019-02-06 2017-07-01 2019-05-31
212 2018-07-17 2017-10-01 2019-12-31
212 2018-10-01 2017-10-01 2019-12-31
212 2019-02-15 2017-10-01 2019-12-31
212 2019-06-10 2017-10-01 2019-12-31
212 2019-09-11 2017-10-01 2019-12-31
540 2019-05-21 2017-12-01 2019-12-31


;
proc print;
run;

*need to create an indicator variable "eligible" if, a record (each observation line) has continuous enrollment 365 days prior 
to index. so (fst_date)-365 =all those date should be included between eligeff and eligend

obs#3 would Not be eligible,
obs#4 would be eligible;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 26 Dec 2021 14:39:56 GMT</pubDate>
    <dc:creator>Student77</dc:creator>
    <dc:date>2021-12-26T14:39:56Z</dc:date>
    <item>
      <title>How to select patients with continuous insurance enrollment prior to an index date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787403#M251591</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw a previous post that suggested to do this with proc sql, and for the past couple hours I try, and I end up with freezing, and restarting SAS. UGH.&lt;/P&gt;&lt;P&gt;In another post, I read that when using proc sql join for larger data, it can take much longer than just data/proc steps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am trying to figure out how to pull patient IDs (&lt;STRONG&gt;patid&lt;/STRONG&gt;) for those patients who had continuous insurance enrollment for the full 365 days prior (no breaks), to an index date (&lt;STRONG&gt;fst_dt&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where I am having difficulty is that a patid may have multiple records, with multiple insurance start/end dates (&lt;STRONG&gt;eligeff&lt;/STRONG&gt; and &lt;STRONG&gt;eligend&lt;/STRONG&gt;, respectively, and these may have breaks in them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(all dates&amp;nbsp;YYMMDD10.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See snip of data below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Student77_0-1640494491940.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66964i0F241E25EA0D3130/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Student77_0-1640494491940.png" alt="Student77_0-1640494491940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;for ex. row 26-31 are for the same patid.&lt;/P&gt;&lt;P&gt;#26&amp;nbsp; the index date is 7-17-2018 , and insurance started 10-1-17 and ended 12-31-2019.&lt;/P&gt;&lt;P&gt;so if the indicator for a person having enrollment 365 days prior is called "eligible", here it would be 0. because insurance started in october the previous year instead of july. So this one doesn't count.&lt;/P&gt;&lt;P&gt;#27 however, does qualify because the insurance start date (10-01-2017) was 365 days before the index, (fst_dt=10-01-2018).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you look at lines #3 and #4 though, it's not as clear cut--there's a gap between insurance start/end dates between observations for the same patient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this makes sense. I appreciate any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 05:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787403#M251591</guid>
      <dc:creator>Student77</dc:creator>
      <dc:date>2021-12-26T05:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to select patients with continuous insurance enrollment prior to an index date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787406#M251592</link>
      <description>&lt;P&gt;Please post your data in usable form. Pictures are&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; usable.&lt;/P&gt;
&lt;P&gt;Post a working data step with datalines that recreates your data into a code box opened with the "little running man" button.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 10:24:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787406#M251592</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-26T10:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to select patients with continuous insurance enrollment prior to an index date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787407#M251593</link>
      <description>&lt;P&gt;You were asked in your &lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-select-consecutive-days-of-prescription-drug-use-between/m-p/785854" target="_self"&gt;previous thread&lt;/A&gt; to provide data in a usable form. Please don't make us ask every time you have a question. We're trying to help you, but you have to help us as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions: &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 11:07:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787407#M251593</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-26T11:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to select patients with continuous insurance enrollment prior to an index date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787411#M251595</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;data enrolled;
input patid fst_dt :YYMMDD10. eligeff :YYMMDD10. eligend :YYMMDD10.;
format fst_dt YYMMDD10. eligeff YYMMDD10. eligend YYMMDD10.;

cards;
123 2017-12-13 2017-07-01 2019-05-31
123 2019-02-06 2017-07-01 2019-05-31
212 2018-07-17 2017-10-01 2019-12-31
212 2018-10-01 2017-10-01 2019-12-31
212 2019-02-15 2017-10-01 2019-12-31
212 2019-06-10 2017-10-01 2019-12-31
212 2019-09-11 2017-10-01 2019-12-31
540 2019-05-21 2017-12-01 2019-12-31


;
proc print;
run;

*need to create an indicator variable "eligible" if, a record (each observation line) has continuous enrollment 365 days prior 
to index. so (fst_date)-365 =all those date should be included between eligeff and eligend

obs#3 would Not be eligible,
obs#4 would be eligible;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Dec 2021 14:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787411#M251595</guid>
      <dc:creator>Student77</dc:creator>
      <dc:date>2021-12-26T14:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to select patients with continuous insurance enrollment prior to an index date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787413#M251596</link>
      <description>&lt;P&gt;If I am understanding the requirements properly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set enrolled;
    if eligeff&amp;lt;=fst_dt-365 and eligend&amp;gt;=fst_dt then flag=1;
    else flag=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Dec 2021 15:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787413#M251596</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-26T15:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to select patients with continuous insurance enrollment prior to an index date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787414#M251597</link>
      <description>&lt;P&gt;whoa, that's it?! I was trying to do a do loop with an indicator for each month prior and proc sql -_-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 18:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787414#M251597</guid>
      <dc:creator>Student77</dc:creator>
      <dc:date>2021-12-26T18:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to select patients with continuous insurance enrollment prior to an index date?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787444#M251608</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332727"&gt;@Student77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;whoa, that's it?! I was trying to do a do loop with an indicator for each month prior and proc sql -_-&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Isn't that the logic? Compare the effective date to 365 days before fst_dt and the eligibility end date to fst_dt?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Dec 2021 12:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-patients-with-continuous-insurance-enrollment/m-p/787444#M251608</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-27T12:02:07Z</dc:date>
    </item>
  </channel>
</rss>

