Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Match unlinked data based on datetimes

Match unlinked data based on datetimes

Match unlinked data based on datetimes

I am trying to track the time between when a patient is discharged from a hospital to when they receive a follow-up telephone call. There is no direct link in the database (Teradata) between the hospital admission encounter and the folow-up telephone call so I would like to match the discharge date from the hospital admission to the most recent follow-up call after the discharge. However, a patient may have multiple admissions during a timeframe and multiple follow-up calls. If a follow-up call is matched with one previous discharge it cannot be matched with another discharge. The data looks similar to this:

1 Smith, Bob 9/1/2012 18:28 9/17/2012 13:34 22746
2 Smith, Bob 9/1/2012 18:28 9/21/2012 9:40 28272
3 Smith, Bob 9/1/2012 18:28 9/25/2012 14:24 34316
4 Smith, Bob 9/13/2012 17:37 9/17/2012 13:34 5517
5 Smith, Bob 9/13/2012 17:37 9/21/2012 9:40 11043
6 Smith, Bob 9/13/2012 17:37 9/25/2012 14:24 17087
7 Smith, Bob 9/20/2012 13:35 9/21/2012 9:40 1205
8 Smith, Bob 9/20/2012 13:35 9/25/2012 14:24 7249

In the case above, the records I need to return are lines 1,5, and 8. This matches the discharge with the most recent follow-up call that does not already have a match. The follow-up time can also be null in the cases where a patient did not receive a follow-up call so this scenario needs to be accounted for as well.

Any suggestions for how to do this would be appreciated. Please let me know if something is unclear or if you need more information.


RE: Match unlinked data based on datetimes

Why do you require separate fu-calls for different discharge dates? I mean, Bob Smith was discharged twice before he got his first fu-call, why does this call only count for the first discharged date? (If it doesn't count for both days, don't store that fu_call for both discharged days.)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close