Ranking based off conditional field
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)