scala - how to find Minimum in a tuple : A = tuples of Medication(patientid,date,medicine)
B = A.groupby(x => x.patientid)
example B would look like below - now I need to find the minimum date, how to do that in scala??
(478009505-01,CompactBuffer(Some(Medication(478009505-01,Fri Jun 12 10:30:00 EDT 2009,glimepiride)), Some(Medication(478009505-01,Fri Jun 12 10:30:00 EDT 2009,glimepiride)), Some(Medication(478009505-01,Fri Jun 12 10:30:00 EDT 2009,glimepiride)))