BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I've encountered a metric spec in one of our incentive program specifications which I've never had to program before. I can't come up with any pragmatic method that will render a solution.

The wording is as follows:
"Number of patients as defined in the eligible population for whom 3 or more professional encounters exist that are at least 7 days apart."

I've tried using lag,lag2,lagn.... functions to do this, but this would require hundreds of lines of code to accomodate patients with a dozen or more encounter dates.

Any help is appreciated. Thank you.
2 REPLIES 2
LinusH
Tourmaline | Level 20
This shouldn't be too difficult, unless if you data is structured in an odd way.
You can use lag or retain to check if the encounter is to be counted, and retain to keep track of the number of qualifying encounter per patient. When reading the last record for each patient, just out the ones that has 3 or more qualifying encounters.

Good luck!

/Linus
Data never sleeps
GertNissen
Barite | Level 11
Can you give us an example of your data ?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 2 replies
  • 848 views
  • 0 likes
  • 3 in conversation