LILY-196: add expiry date to cases and be able to sort on it
Fix sorting for priority