BookmarkSubscribeRSS Feed
cbatzi01
Calcite | Level 5

Hi, 


I have pharmacy claims data, specific to patients with RA.  There are 4 drugs I am interested (MTX, HCQ, SSZ, LEF).  These drugs can be used as mono therapy, dual therapy, or triple therapy, (dual and triple always include MTX).  

 

Regimens

  1. MTX
  2. HCQ
  3. SSZ
  4. LEF
  5. MTX+HCQ
  6. MTX+SSZ
  7. MTX+LEF
  8. MTX+HCQ+SSZ
  9. MTX+HCQ+LEF
  10. MTX+SSZ+LEF

The data look like this:

PATID INDEX_DT DRUGName StartDate DaysSupply

 

How do I figure which regimen the patients are on?  I don't really care about switching.  I just need the intial regimen.  

 

Thanks!
Chris

 

2 REPLIES 2
ballardw
Super User

If you claims data has information with patient id and one drug per record then the technique in this post: https://communities.sas.com/t5/Base-SAS-Programming/Summarize-overlapping-medications/m-p/304122#M64...

is basically similar to what you are doing.

 

If your data goes over a long enough period where you have multiple similar claims then you may need to reduce to the above needed form with something like:

 

Proc sql;

   Create table temp as

   select distinct patient_id, drug

   from claims data;

run;

 

If the data has multiple drugs per patient record then you will need to transform to the one drug per patient form. The method for that likely depends on your current data structure.

 

A further thing to keep in mind could be time. How would you tell if someone had been on a single treatment regimen for period of time and then shifted to the two or three drug regimen? And how do you want to report that? So the claim or service date may come into play but you'll need to determine the rule(s) involved.

PGStats
Opal | Level 21

Assuming that multiple-drug treatments are represented as many drugs starting on the same day, for tha same patient, you could do this:

 

proc sort data=theData; by patId startDate drugName; run;

data want0;
length drugs $12;
do until(last.startDate);
	set theData; by patId startDate;
	drugs = catx("+", drugs, drugName);
	end;
run;

data want1;
set want0; by patId;
if first.patId;
drop drugName daysSupply;
run;
PG

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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