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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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