Hi SAS folks,
I am working on some reseach project using hospital visit data. I have to identify the subjects who had switched their treatment. the defination of treatment switch is like:
Treatments are grouped by topical, non-biologic systemic, and biologic. A switching event is defined as the withdrawal of a medication that was not dispensed at the time of the last treatment withdrawal. There is a hierarchy, with biologics at the top, then non-bio systemics, then topical.
If a patient is first observed withdrawing a topical, any withdrawal of a treatment after that to a bio, non-bio systemic, or new topical is a switch
If a patient is first observed withdrawing a non-bio systemic, any withdrawal of a treatment after that to a bio or a new non-bio systemic is a switch
A withdrawal of any topical is not a switch
If a patient is first observed withdrawing a bio, a switch can only be made to another bio (which is different from the first)
A withdrawal of any topical or non-bio systemic is not a switch
According to the logic above, once a patient has switched to a higher class of therapy, the lower classes are considered concomitant medication and a withdrawal of a concomitant medication does not indicate a treatment switch.
In nutshell, If a patient moves from lower class of treatment to upper or withing the same class(different ATC code) then it will consider as a Switch.
Treatment hierarchy
Biologics> Non_Bio_Sys>Topical
I am adding sample dataset for the reference, with variable information :
LPNR: unique subjID
EDATUM: prescrition date ( treatment recieved date)
ATC_CODE: codes for each of treament type
'D05AX52' , 'D05AX02' = PSorasis(Topical) 'L01XC02' , 'L04AA24', 'L04AB01', 'L04AB02', 'L04AB04', 'L04AB05', 'L04AB06', 'L04AC03', 'L04AC07' =Non_Bio_systemic 'A11CC03' , 'D05BB02', 'L01BA01', 'L01BB03' , 'L01XX05' , 'L04AA21' , 'L04AD01' , 'L04AX03' =Biologics
TYPE: Treatment type
It would be great , if you can help me with SAS code to indentify the Subjects with Switches .
... View more