Write a SQL query to find the latest lab result for each patient in a study, partitioned by patient ID and ordered by visit date.