<?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: processing overlapping records in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561464#M157182</link>
    <description>&lt;P&gt;Please edit your question to provide some data in the form of a data step using &lt;FONT face="courier new,courier"&gt;datalines&lt;/FONT&gt;, so that others can work with a representative example of what you have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also please try editing your original question to reformat it so that it is easier to read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2019 16:15:27 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2019-05-24T16:15:27Z</dc:date>
    <item>
      <title>processing overlapping records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561455#M157175</link>
      <description>&lt;P&gt;I have a group of patient records for whom I want to look 6 months pre and post their hospitalization for various types of activity (clinic visits, imaging, etc.).&amp;nbsp; &amp;nbsp;The files I will use to get these activities have a ID field and a date field.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here are a few caveats to setting up my patient records to search for the pre-post activity:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; 1) There will be patients with more than one admit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; 2)&amp;nbsp; We don't want to duplicate count any of the pre-post activity so,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a.&amp;nbsp; &amp;nbsp;If a patient has a 2nd admit within 6 months of the first admit his/her 'Post' activity should only include data NOT included&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; as part of the previous admit.&amp;nbsp; &amp;nbsp;Ex) patient with an admit on Jan 1 will have 'Post' activity from Jan - June.&amp;nbsp; &amp;nbsp; &amp;nbsp;If that same&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;patient was admitted again on Feb 1, his 'Post' activity will only include data from July.&amp;nbsp; &amp;nbsp; &amp;nbsp; If that patient has a third&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; admit on May 1 his 'Post' activity will only include data from Aug-Oct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b. Regarding the 'Pre' activity,&amp;nbsp; If a patient has an initial visit on Jan 1, he will have 'Pre' activity from Aug-Dec of the previous&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; year and 'Post' activity from Jan-June.&amp;nbsp; &amp;nbsp;If that same patient has an admit again on Feb 1 then he would have no 'Pre'&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; activity because if would have been captured in the previous admit's pre/post activity.&amp;nbsp; So,&amp;nbsp; unless there is at least 6 months&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; between a single patient's admits, he will have no 'Pre' activity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Like I said, once I determine the time frame of activity needed for each record, I will then merge with the 'Activity' datasets.&amp;nbsp; By patient ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any insight would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 15:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561455#M157175</guid>
      <dc:creator>uabcms</dc:creator>
      <dc:date>2019-05-24T15:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: processing overlapping records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561464#M157182</link>
      <description>&lt;P&gt;Please edit your question to provide some data in the form of a data step using &lt;FONT face="courier new,courier"&gt;datalines&lt;/FONT&gt;, so that others can work with a representative example of what you have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also please try editing your original question to reformat it so that it is easier to read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 16:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561464#M157182</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2019-05-24T16:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: processing overlapping records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561467#M157184</link>
      <description>What type of insights are you looking for here? If you need help with code you'll need to provide sample data. Please include at least one of each case above and one that doesn't meet your conditions.  &lt;BR /&gt;&lt;BR /&gt;If you just need general guidance, are you comfortable with SQL?</description>
      <pubDate>Fri, 24 May 2019 16:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561467#M157184</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-24T16:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: processing overlapping records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561518#M157212</link>
      <description>&lt;P&gt;Attached a file containing a list of hospital admissions.&amp;nbsp; It is 'Testlist'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also attached a file of locations the patients have been seen in.&amp;nbsp; This is the Pre/Post activity.&amp;nbsp; &amp;nbsp;('Activity')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the disjointed layout of my initial request,&amp;nbsp; it didn't look like that as I was typing it. When I posted it got messy.&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 20:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561518#M157212</guid>
      <dc:creator>uabcms</dc:creator>
      <dc:date>2019-05-24T20:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: processing overlapping records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561534#M157217</link>
      <description>&lt;P&gt;From&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Please edit your question to provide some data in the form of a data step using&amp;nbsp;&lt;FONT face="courier new,courier"&gt;datalines&lt;/FONT&gt;, so that others can work with a representative example of what you have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also please try editing your original question to reformat it so that it is easier to read.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What part of that didn't you understand?&amp;nbsp; Why do you think posting some Excel files helps us help you?&amp;nbsp; Do you expect us to write the code to import your Excel data, just so we can &lt;U&gt;then&lt;/U&gt; address your question?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about you exert a little effort in asking your question?&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 04:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561534#M157217</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-05-25T04:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: processing overlapping records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561999#M157396</link>
      <description>&lt;P&gt;Apologies for the sloppy start.&amp;nbsp; &amp;nbsp;Was try to get something uploaded before leaving in a hurry for the long weekend.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Probably&amp;nbsp;should have waited until today.&amp;nbsp; &amp;nbsp;Appreciate the 'correction'.&lt;/P&gt;
&lt;P&gt;Below is the request as best as I can describe it.&amp;nbsp; I've attached SAS code that creates&amp;nbsp; 2 datasets.&amp;nbsp; One is the&lt;/P&gt;
&lt;P&gt;'master'&amp;nbsp;patient&amp;nbsp; file (Patients) and one is the file I will use to look for Pre and Post activity.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure how to proceed after that.&amp;nbsp; Thus no further code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a group of patient records for whom I want to look 6 months pre and post their hospitalization for various types of activity (clinic visits, imaging, etc.).&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here are a few caveats for counting the pre-post activity visits:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; 1) There will be patients with more than one admit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; 2)&amp;nbsp; We don't want to duplicate count any of the pre-post activity so,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a.&amp;nbsp; &amp;nbsp;If a patient has a 2nd admit within 6 months of the first admit his/her 'Post' activity should only include data&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NOT included&amp;nbsp;&amp;nbsp;as part of the previous admit.&amp;nbsp; &amp;nbsp;Ex) patient with an admit on Jan 1 will have 'Post' activity&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from Jan - June.&amp;nbsp; &amp;nbsp; &amp;nbsp;If that same patient was admitted again on Feb 1, his 'Post' activity will only include data&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from July.&amp;nbsp; &amp;nbsp; &amp;nbsp; If that patient has a third admit on May 1 his 'Post' activity will only include data from Aug-Oct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b. Regarding the 'Pre' activity,&amp;nbsp; If a patient has an initial visit on Jan 1, he will have 'Pre' activity from Aug-Dec&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;of the&amp;nbsp;previous year and 'Post' activity from Jan-June.&amp;nbsp; &amp;nbsp;If that same patient has an admit again on Feb 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;then he would&amp;nbsp;have no 'Pre'&amp;nbsp; activity because if would have been captured in the previous admit's pre/post&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;activity.&amp;nbsp; So, unless&amp;nbsp;there is at least 6 months between a single patient's admits, he will have no 'Pre'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; activity -other than that from the&amp;nbsp;initial admit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output I need is the total number of Pre and Post visits - by clinic location.&amp;nbsp; So,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="443"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="233"&gt;Location&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="105"&gt;# Pre visit&lt;/TD&gt;
&lt;TD width="105"&gt;# Post visits&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;EF OP&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;HK BUILDING&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;PLASTIC SURGERY AND LASER CLINIC&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;KC CARDIOLOGY PROCEDURES&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;KC HEM ONC&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;KC MAMMOGRAM&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Etc.&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully, this is more helpful.&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, when I check the 'Preview' panel the layout of my text looks fine.&amp;nbsp; &amp;nbsp;It changes when it's posted.&amp;nbsp; Any insight on&lt;/P&gt;
&lt;P&gt;that would be appreciated also.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:40:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/processing-overlapping-records/m-p/561999#M157396</guid>
      <dc:creator>uabcms</dc:creator>
      <dc:date>2019-05-28T15:40:36Z</dc:date>
    </item>
  </channel>
</rss>

