Programming specifications

Reply
N/A
Posts: 0

Programming specifications

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.
Esteemed Advisor
Posts: 5,073

Re: Programming specifications

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
SAS Employee
Posts: 156

Re: Programming specifications

Can you give us an example of your data ?
Post a Question
Discussion Stats
  • 2 replies
  • 285 views
  • 0 likes
  • 3 in conversation