08-26-2016 10:56 AM
The data I am working on are pharmacy claims and unfortunately, for some of the more complicated dosages like: Acetaminophen w/ Codeine Soln 120-12 MG/5ML, there is no dosage unit information. I am looking to extract the 12 MG/5ML portion so I can calculate the MG/ML amount for further calculations. I've tried using SCAN, but it's not feasible to specificy the exact string since some of the names have shorter or longer number of strings. Is there another method I can use or is there an available list somewhere that generates the dosage per ML I don't know about?
08-26-2016 11:55 AM
data have; infile cards truncover; input x $100.; cards; Acetaminophen w/ Codeine Soln 120-12 MG/5ML, there is no dosage unit information ; run; data want; set have; pid=prxparse('/\d+\s*MG\/\d+ML/i'); s=1; e=length(x); call prxnext(pid,s,e,x,p,l); do while(p>0); found=substr(x,p,l); output; call prxnext(pid,s,e,x,p,l); end; keep found; run;
08-26-2016 12:50 PM
Is there a consistent pattern to your data such as the - character between the drug description and the dosage information?
If so then SCAN would work if that is the only hyphen:
doseInfo = scan(variable,'-',2);
I have worked with just enough drug information to sympathize with likely to be poorly structured data.
08-26-2016 01:20 PM
Yes, exactly. I ended up finding a calculator developped by Prescription Drug Monitoring Program Training and Technical Assistance Center (PDMP TTAC) that has a spreadsheet within the tool with the dosage strength information for patches, solutions, etc for opioids.
I think all of the drug name info. are formated like that, yes. So although I did find a shortcut with the tool, I will try the scan method which might help for all drug classes, not just opioids. Thank you.