@Ashwini_uci wrote:
I have a quick question:
In the array above, I want to define range as 25300-25099
('25030'<=dxmslivedis(i)<='25099')
By the very nature of ICD9 code format, the sequence will go like this - 25030,25031,.....,25040,25041,25050....25070...25099. and then the codes for next diagnosis begin from 2501 which I am not interested in.
What will be the best way to define range here if I don't know the upper level code for every diagnosis that wish to code? In this particular case I happen to know the higher/upper level of range will be 25099.
If I use this following sequence, not sure if it will capture all and ONLY the codes between 25030-25099?
('25030'<=dxmslivedis(i)<'2501')
If your comparison is happening in SAS then you can use colon modifier to limit match to shorter string.
('250' <=: dx <=: '253')
Or if you are pushing the query into external database then use facts that spaces are less than digits and letter like Z are larger than digits.
('250 ' <= dx <= '253ZZ')
Of course this really won't help much with ICD9 codes for Diabetes where the fifth digit is used to distinguish between Type I and Type II diagnosis codes.
if '250' =: dx then do;
diabetes=1;
if substr(dx,5,1) in ('1','3') then type1=1
else if substr(dx,5,1) in ('0','2') then type2=1;
end;
... View more