<?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: Previous Visits Volumes on Single Record? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134901#M36539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The group by determines the group for which statistics like the count(*) function gets applied. So yes, you need it or the counts will be wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Nov 2013 20:50:04 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2013-11-20T20:50:04Z</dc:date>
    <item>
      <title>Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134896#M36534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using SAS 9.3.&amp;nbsp; My database is where one line of data is one inpatient separation or ED visit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to calculate something called the LACE score for each of my inpatient visits.&amp;nbsp; For all the criteria from within the current visit I'm fine (like LOS, certain diagnoses, etc.) BUT LACE also includes a value for "volumes of ED visits within the last 6 months".&amp;nbsp; This 6 months timeframe will be different depending on the admit date of the inpatient visit so I'm not clear on how I would calculate this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone give me something to start me off?&amp;nbsp; Thanks so very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 18:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134896#M36534</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2013-11-07T18:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134897#M36535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some sample data could help...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 22:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134897#M36535</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-11-07T22:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134898#M36536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay the data below is a single patient as determined by the chart number.&amp;nbsp;&amp;nbsp; The data elements are chart number, regno which is unique to the visit, type which is identifying visit type whether ED visit or inpatient, admit date and discharge date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To restate my desired results, I want to have each inpatient visit identifying volumes of ED visits in the last 6 months compared to that inpatient visit.&amp;nbsp; Therefore, the data would look like this with the last column being the sum of ED visits within the last 6 months of the admission date for the inpatient visit:&lt;/P&gt;&lt;P&gt;A1234 005 IP 2012-07-04 2012-07-14&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;A1234 006 IP 2012-09-01 2012-09-07&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;A1234 007 IP 2012-12-24 2012-12-31&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test_grp;&lt;/P&gt;&lt;P&gt;input @1 chart $5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; @6 regno&amp;nbsp; $3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; @9 Type $2. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; @11 AdmDate yymmdd8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; @19 DisDate yymmdd8.&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;format admdate yymmdd10. disdate yymmdd10.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A1234001ED2012032920120329&lt;/P&gt;&lt;P&gt;A1234002ED2012042920120429&lt;/P&gt;&lt;P&gt;A1234003ED2012052920120529&lt;/P&gt;&lt;P&gt;A1234004ED2012062920120629&lt;/P&gt;&lt;P&gt;A1234005IP2012070420120714&lt;/P&gt;&lt;P&gt;A1234006IP2012090120120907&lt;/P&gt;&lt;P&gt;A1234007IP2012122420121231&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All assistance greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 20:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134898#M36536</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2013-11-19T20:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134899#M36537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.*,count(*) as visit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from test_grp a left join test_grp b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.chart=b.chart &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and b.AdmDate &amp;lt; a.AdmDate &amp;lt; intnx('month',b.AdmDate,6,'s')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where a.type='IP' and b.type='ED'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by 1,2,3,4,5&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 22:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134899#M36537</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-11-19T22:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134900#M36538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Patrick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For learning purposes, what is the group by doing i.e. do I need it?&amp;nbsp; I expect to have many, many inpatient visits so I'm not sure if I have to expand that group thus the query. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 16:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134900#M36538</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2013-11-20T16:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134901#M36539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The group by determines the group for which statistics like the count(*) function gets applied. So yes, you need it or the counts will be wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 20:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134901#M36539</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-11-20T20:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134902#M36540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay thanks...but does it remain as 1, 2, 3 ,4, 5 no matter how many records I have in my database (the sample only had 1)?&amp;nbsp; I'm asking what it's based on, is it the number of variables in the sample?&amp;nbsp; So if I have more variables then I must add to this?&amp;nbsp; Sorry, just not understanding how to extrapolate beyond the one case in my sample data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 23:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134902#M36540</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2013-11-27T23:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134903#M36541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the 1,2,3,4,5 stands for the variables and as I've used the select * it's the order in which they are stored in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also write out the variable names in the group by statement which actually would be cleaner coding if using a select * (sorry, was just a bit lazy).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think of the variables in the group by as what you would use in any by statement (eg. in a proc means). If you're having additional variables in your data source then it's up to you if this adds an additional aggregation level or not - and depending on this you need to add the variable to the group by statement or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Nov 2013 00:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/134903#M36541</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-11-28T00:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Visits Volumes on Single Record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/336255#M62983</link>
      <description>&lt;P&gt;Hi Patrik,&lt;/P&gt;&lt;P&gt;I have similar question posted today. will you please guide me.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 16:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Previous-Visits-Volumes-on-Single-Record/m-p/336255#M62983</guid>
      <dc:creator>chuie</dc:creator>
      <dc:date>2017-02-27T16:30:56Z</dc:date>
    </item>
  </channel>
</rss>

