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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

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