<?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 calculate hospital stay length across three columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807536#M318402</link>
    <description>yes this is helpful, but sometime, they have two pair of re-start date and re-discharge date, such as 15-03-23 to 15-04-07, 15-04-10 to 15-05-11 in above image. I dont know how to pair them to have the re-start date right before the re-discharge date instead of mixing them up.</description>
    <pubDate>Wed, 13 Apr 2022 02:44:22 GMT</pubDate>
    <dc:creator>alice_s</dc:creator>
    <dc:date>2022-04-13T02:44:22Z</dc:date>
    <item>
      <title>How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807489#M318374</link>
      <description>&lt;P&gt;I need to calculate the total hh stay length for patient. below data example is for one patient's record. It includes start date, restart date, discharge date for each episode in three columns, and I needs to get stay length for all episodes. In this example, there are 3 episodes. 15-02-25 to 15-03-13, 15-03-23 to 15-04-07, 15-04-10 to 15-05-11. I'm confused how to deal with the restart_dt and I am struggled to get the total length for each patients in my dataset. Thanks for help if anyone has any ideas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alice_s_4-1649794131807.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70329i32CB2346BD13118B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alice_s_4-1649794131807.png" alt="alice_s_4-1649794131807.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 20:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807489#M318374</guid>
      <dc:creator>alice_s</dc:creator>
      <dc:date>2022-04-12T20:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807503#M318381</link>
      <description>&lt;P&gt;So do you have SAS date values? Any manipulation works much better with those.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not you have to tell which of those values is the year, which the month and which the day of the month so we can help you create date values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might help us to show exactly what result you are expecting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally you would post data as data step code that we can run pasted into a code box opened on the forum with either the &amp;lt;/&amp;gt; or "running man" icons that appear above the message window. Or at least copied text pasted into one of the boxes. But we can't write code from a picture and very few of us are going to retype stuff from a picture.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you did not include any other information how do we know which values are to be consider for these calculations? With the word you are using like "discharge" one would expect at least a patient identifier so that w have some idea of what is going on. Without that, kind of requires mind-reading skills.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From that picture I have a very hard time getting this connection at all: 15-04-10 to 15-05-11.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 21:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807503#M318381</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-12T21:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807524#M318393</link>
      <description>&lt;P&gt;Please explain the logic you are using to extract the reported results from the sample input data.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 01:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807524#M318393</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-04-13T01:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807530#M318396</link>
      <description>&lt;P&gt;Where there is no re-start, you would just take an interval in days between two date values: intck(‘day’, start, discharge). Where there is a re-start, I suppose that would be their second visit, you would need to know what was their second discharge (“re-discharge”), then sum the two intervals calculated with the intck function: sum( intck(‘day’, start, discharge), intck(‘day’, re-start, re-discharge)).&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 02:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807530#M318396</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-04-13T02:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807531#M318397</link>
      <description>Yes, this is my thinking process to calculate the length. I am good with record without re-start, it is very straightfoward. However, the problem if I need to calculate the interval between re-start and re-discharge, the re-start date is usually not on the same row of re-discharge, so I could not use 'intck' directly. This is the point I am struggling with.</description>
      <pubDate>Wed, 13 Apr 2022 02:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807531#M318397</guid>
      <dc:creator>alice_s</dc:creator>
      <dc:date>2022-04-13T02:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807534#M318400</link>
      <description>The missing discharge dates can be filled with the value of previous non-missing discharge date like this:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Fill-missing-values-with-the-previous-values/td-p/326233" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Fill-missing-values-with-the-previous-values/td-p/326233&lt;/A&gt;</description>
      <pubDate>Wed, 13 Apr 2022 02:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807534#M318400</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-04-13T02:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807536#M318402</link>
      <description>yes this is helpful, but sometime, they have two pair of re-start date and re-discharge date, such as 15-03-23 to 15-04-07, 15-04-10 to 15-05-11 in above image. I dont know how to pair them to have the re-start date right before the re-discharge date instead of mixing them up.</description>
      <pubDate>Wed, 13 Apr 2022 02:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807536#M318402</guid>
      <dc:creator>alice_s</dc:creator>
      <dc:date>2022-04-13T02:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807537#M318403</link>
      <description>&lt;P&gt;The columns would need to be arranged in a better way. First take distinct non-missing values from each column in ascending order into a separate table. Then, for each table, create column Month = month(date). Re-merge columns by month. Finish by filling in missing values with last available value from the SAS post I shared previously. The resulting table will be much easier to work with.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 03:26:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807537#M318403</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-04-13T03:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate hospital stay length across three columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807551#M318407</link>
      <description>&lt;P&gt;Instead of re-Arranging the data, you should go back some steps an investigate how the dataset you have now was created, maybe intercepting in the process at an earlier stage makes it easier to solve the task.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 05:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-hospital-stay-length-across-three-columns/m-p/807551#M318407</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-04-13T05:47:49Z</dc:date>
    </item>
  </channel>
</rss>

