Hello @novinosrin, Thank you for your reply. You sound very smart based on your questions. 1) Yes every, Id will start from line 1 and will proceed to line 2 only if there is a change in the drug given. The change in the drug should trigger use to identify the course and mark it as a 2nd line and same goes for 3rd line 2) Yes, Each ID can have different number of lines. 3) Correct. The only flag we need is a change for the 1st line to flag as 2nd line and a change from 2nd line to flag as 3rd line and so on. Once we know what line it is we should identify what drugs are given during that line period. 1st line are drugs given during 1st drug startdate +10 days is 1st line drug course. 2nd line are the drugs given when we flat a new drugs not in 1st line and all the drugs given 3 days prior to it and 10 days after it is 2nd line course. 3rd line is the same as 2nd line but should be compared to 2nd line course to flag a change.
... View more