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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 836 views
  • 0 likes
  • 3 in conversation