Hey,
Have:
PatientID HMO_01 HMO_02 HMO_03 HMO_04....HMO_12 PartA_01 PartA_02 PartA_03......PartA_12 Death_Date
123 A A A C 3 A A 03Apr2018
456 3 A C . . . C A A 27Mar2018
I've wide format patient HMO and PartA enrollment type for each month (1-12) and their death date.
I want to flag patients that have either 3 or A enrollment in HMO and A or C in PartA months that falls within 30days period, if 30 days cut across 2 different months then I would want to condition on both months. (i.e for patient 123, I would be conditioned for flag on the month of April and March month as 30 days cuts in both months).
Appreciate your help.
Thanks
It would help if you would post your sample data as a working SAS data step creating a SAS table. This sample data covers ideally all potential cases (so more than 2 rows). Then show us the desired result.
Doing above really helps to avoid misunderstandings and will likely give you faster the answer you need.
I don't understand how you are going to test your 30 day issue? Do you have some type of start/stop date variables?
So is the logic. (1) check that start to end is at least 30 days. (2) check that each month from start to end has appropriate values in your array.
How do you map from the start date to an index into the array? Does the entry one indicate the month of the start date? Or is it from some fixed date (like January 1, 2019)? Anyway to convert from a date to month index use the INTCK() function.
index=intck('month',base_date,current_date) + 1;
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.