Ranking based off conditional field I am looking to select only 1 row based off the IMMS_ID field. Which row I select is based off this if statement (excuse the syntax) 

if (status group based off IMMS_ID) status='DI' select the DI row
else if ... status='OI' ...
else if ... status='FI' ...
else if ... status='OV' ...
else if ... status='FV' ...


So this means if the group based off the IMMS_ID contains OI, OV and FV I want to select the row that has OI (as it's highest in the if/elseif statement).

Ex. Here is a dataset

ID  IMMS_ID  STATUS
 1      1       FV 
 2      1       OI 
 3      1       FI 
 4      2       DI 
 5      2       OV 

So for this dataset I'd want the following results returned

ID  IMMS_ID  STATUS
 2      1       OI 
 4      2       DI 

Thanks for your time!
You can calculate a RANK/ROW_NUMBER based on this logic:

ROW_NUMBER() 
OVER (PARTITION BY IMMS_ID 
      ORDER BY CASE WHEN status='DI' THEN 1
                    WHEN status='OI' THEN 2
                    WHEN status='FI' THEN 3
                    WHEN status='OV' THEN 4
                    WHEN status='FV' THEN 5
                END)